From f860c2f35b2f94e379d2ff7d5c13f54cd4a3132a Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:06:42 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835119 13f79535-47bb-0310-9956-ffa450edef68 --- .../modules/assembly-java-dsl/DISCLAIMER | 8 - .../modules/assembly-java-dsl/LICENSE | 205 --- .../sca-java-0.90/modules/assembly-java-dsl/NOTICE | 6 - .../modules/assembly-java-dsl/pom.xml | 38 - .../tuscany/sca/assembly/dsl/AssemblyBuilder.java | 37 - .../tuscany/sca/assembly/dsl/ComponentBuilder.java | 34 - .../sca/assembly/dsl/ComponentPropertyBuilder.java | 28 - .../assembly/dsl/ComponentReferenceBuilder.java | 36 - .../sca/assembly/dsl/ComponentServiceBuilder.java | 32 - .../tuscany/sca/assembly/dsl/CompositeBuilder.java | 29 - .../sca/assembly/dsl/impl/AssemblyBuilderImpl.java | 70 - .../assembly/dsl/impl/ComponentBuilderImpl.java | 74 -- .../dsl/impl/ComponentPropertyBuilderImpl.java | 40 - .../dsl/impl/ComponentReferenceBuilderImpl.java | 77 -- .../dsl/impl/ComponentServiceBuilderImpl.java | 62 - .../assembly/dsl/impl/CompositeBuilderImpl.java | 62 - .../sca/assembly/dsl/AccountDataService.java | 24 - .../sca/assembly/dsl/AccountDataServiceImpl.java | 24 - .../tuscany/sca/assembly/dsl/AccountService.java | 24 - .../sca/assembly/dsl/AccountServiceImpl.java | 24 - .../tuscany/sca/assembly/dsl/BigBankBuilder.java | 59 - .../sca/assembly/dsl/BigBankBuilderTestCase.java | 38 - .../sca/assembly/dsl/StockQuoteService.java | 24 - .../sca-java-0.90/modules/assembly-xml/.checkstyle | 24 - branches/sca-java-0.90/modules/assembly-xml/.pmd | 20 - .../sca-java-0.90/modules/assembly-xml/.ruleset | 190 --- .../sca-java-0.90/modules/assembly-xml/DISCLAIMER | 8 - .../sca-java-0.90/modules/assembly-xml/LICENSE | 205 --- branches/sca-java-0.90/modules/assembly-xml/NOTICE | 6 - .../sca-java-0.90/modules/assembly-xml/pom.xml | 58 - .../sca/assembly/xml/BaseArtifactProcessor.java | 686 ---------- .../xml/ComponentTypeDocumentProcessor.java | 94 -- .../sca/assembly/xml/ComponentTypeProcessor.java | 271 ---- .../assembly/xml/CompositeDocumentProcessor.java | 93 -- .../sca/assembly/xml/CompositeProcessor.java | 503 -------- .../apache/tuscany/sca/assembly/xml/Constants.java | 74 -- .../xml/ConstrainingTypeDocumentProcessor.java | 93 -- .../assembly/xml/ConstrainingTypeProcessor.java | 205 --- .../org/apache/tuscany/sca/assembly/xml/XAttr.java | 122 -- .../tuscany/sca/assembly/xml/ReadAllTestCase.java | 159 --- .../sca/assembly/xml/ReadDocumentTestCase.java | 113 -- .../tuscany/sca/assembly/xml/ReadTestCase.java | 104 -- .../tuscany/sca/assembly/xml/ResolveTestCase.java | 117 -- .../tuscany/sca/assembly/xml/StAXPerfTest.java | 105 -- .../sca/assembly/xml/TestModelResolver.java | 63 - .../tuscany/sca/assembly/xml/WireTestCase.java | 126 -- .../tuscany/sca/assembly/xml/WriteAllTestCase.java | 115 -- .../tuscany/sca/assembly/xml/Calculator.composite | 53 - .../xml/CalculatorComponent.constrainingType | 34 - .../sca/assembly/xml/CalculatorImpl.componentType | 31 - .../sca/assembly/xml/TestAllCalculator.composite | 119 -- .../sca/assembly/xml/TestAllDivide.composite | 56 - .../sca-java-0.90/modules/assembly/.checkstyle | 24 - branches/sca-java-0.90/modules/assembly/.pmd | 21 - branches/sca-java-0.90/modules/assembly/.ruleset | 190 --- branches/sca-java-0.90/modules/assembly/DISCLAIMER | 8 - branches/sca-java-0.90/modules/assembly/LICENSE | 205 --- branches/sca-java-0.90/modules/assembly/NOTICE | 6 - branches/sca-java-0.90/modules/assembly/pom.xml | 44 - .../tuscany/sca/assembly/AbstractContract.java | 62 - .../tuscany/sca/assembly/AbstractProperty.java | 122 -- .../tuscany/sca/assembly/AbstractReference.java | 43 - .../tuscany/sca/assembly/AbstractService.java | 28 - .../tuscany/sca/assembly/AssemblyFactory.java | 156 --- .../java/org/apache/tuscany/sca/assembly/Base.java | 51 - .../org/apache/tuscany/sca/assembly/Binding.java | 58 - .../org/apache/tuscany/sca/assembly/Callback.java | 40 - .../org/apache/tuscany/sca/assembly/Component.java | 133 -- .../tuscany/sca/assembly/ComponentProperty.java | 80 -- .../tuscany/sca/assembly/ComponentReference.java | 64 - .../tuscany/sca/assembly/ComponentService.java | 49 - .../apache/tuscany/sca/assembly/ComponentType.java | 80 -- .../org/apache/tuscany/sca/assembly/Composite.java | 108 -- .../tuscany/sca/assembly/CompositeReference.java | 37 - .../tuscany/sca/assembly/CompositeService.java | 42 - .../tuscany/sca/assembly/ConstrainingType.java | 72 -- .../org/apache/tuscany/sca/assembly/Contract.java | 63 - .../sca/assembly/DefaultAssemblyFactory.java | 31 - .../sca/assembly/DefaultSCABindingFactory.java | 31 - .../tuscany/sca/assembly/Implementation.java | 28 - .../apache/tuscany/sca/assembly/Multiplicity.java | 49 - .../org/apache/tuscany/sca/assembly/Property.java | 41 - .../org/apache/tuscany/sca/assembly/Reference.java | 64 - .../apache/tuscany/sca/assembly/SCABinding.java | 32 - .../tuscany/sca/assembly/SCABindingFactory.java | 36 - .../org/apache/tuscany/sca/assembly/Service.java | 37 - .../org/apache/tuscany/sca/assembly/Visitable.java | 37 - .../org/apache/tuscany/sca/assembly/Visitor.java | 36 - .../java/org/apache/tuscany/sca/assembly/Wire.java | 67 - .../sca/assembly/builder/CompositeBuilder.java | 40 - .../builder/CompositeBuilderException.java | 45 - .../assembly/builder/CompositeBuilderMonitor.java | 36 - .../tuscany/sca/assembly/builder/Problem.java | 45 - .../builder/impl/CompositeBuilderImpl.java | 1340 -------------------- .../sca/assembly/builder/impl/ProblemImpl.java | 98 -- .../sca/assembly/builder/impl/PropertyUtil.java | 189 --- .../sca/assembly/builder/impl/ReferenceUtil.java | 94 -- .../sca/assembly/impl/AbstractPropertyImpl.java | 102 -- .../sca/assembly/impl/AbstractReferenceImpl.java | 46 - .../sca/assembly/impl/AbstractServiceImpl.java | 36 - .../sca/assembly/impl/AssemblyFactoryImpl.java | 121 -- .../apache/tuscany/sca/assembly/impl/BaseImpl.java | 58 - .../tuscany/sca/assembly/impl/CallbackImpl.java | 62 - .../tuscany/sca/assembly/impl/ComponentImpl.java | 157 --- .../sca/assembly/impl/ComponentPropertyImpl.java | 78 -- .../sca/assembly/impl/ComponentReferenceImpl.java | 72 -- .../sca/assembly/impl/ComponentServiceImpl.java | 60 - .../sca/assembly/impl/ComponentTypeImpl.java | 151 --- .../tuscany/sca/assembly/impl/CompositeImpl.java | 136 -- .../sca/assembly/impl/CompositeReferenceImpl.java | 51 - .../sca/assembly/impl/CompositeServiceImpl.java | 51 - .../sca/assembly/impl/ConstrainingTypeImpl.java | 116 -- .../tuscany/sca/assembly/impl/ContractImpl.java | 59 - .../tuscany/sca/assembly/impl/PropertyImpl.java | 51 - .../tuscany/sca/assembly/impl/ReferenceImpl.java | 95 -- .../sca/assembly/impl/SCABindingFactoryImpl.java | 36 - .../tuscany/sca/assembly/impl/SCABindingImpl.java | 91 -- .../tuscany/sca/assembly/impl/ServiceImpl.java | 79 -- .../apache/tuscany/sca/assembly/impl/WireImpl.java | 76 -- .../tuscany/sca/assembly/util/PrintUtil.java | 172 --- .../sca/assembly/AssemblyFactoryTestCase.java | 212 ---- .../apache/tuscany/sca/assembly/TestBinding.java | 69 - .../tuscany/sca/assembly/TestImplementation.java | 62 - .../apache/tuscany/sca/assembly/TestInterface.java | 42 - .../sca/assembly/TestInterfaceContract.java | 41 - .../apache/tuscany/sca/assembly/TestOperation.java | 31 - .../builder/impl/CompositeBuilderTestCase.java | 135 -- .../modules/binding-jsonrpc/DISCLAIMER | 8 - .../sca-java-0.90/modules/binding-jsonrpc/LICENSE | 205 --- .../sca-java-0.90/modules/binding-jsonrpc/NOTICE | 6 - .../sca-java-0.90/modules/binding-jsonrpc/pom.xml | 133 -- .../jsonrpc/DefaultJSONRPCBindingFactory.java | 35 - .../sca/binding/jsonrpc/JSONRPCBinding.java | 30 - .../sca/binding/jsonrpc/JSONRPCBindingFactory.java | 35 - .../binding/jsonrpc/impl/JSONRPCBindingImpl.java | 79 -- .../jsonrpc/impl/JSONRPCBindingProcessor.java | 75 -- .../jsonrpc/module/JSONRPCModuleActivator.java | 62 - .../jsonrpc/provider/JSONRPCBindingInvoker.java | 50 - .../provider/JSONRPCBindingProviderFactory.java | 57 - .../provider/JSONRPCReferenceBindingProvider.java | 64 - .../provider/JSONRPCServiceBindingProvider.java | 106 -- .../jsonrpc/server/JSONRPCEntryPointServlet.java | 150 --- .../jsonrpc/server/JSONRPCScriptServlet.java | 52 - .../sca/binding/jsonrpc/util/JavaToSmd.java | 49 - .../src/main/resources/JSONRPCBinding.composite | 34 - .../org.apache.tuscany.sca.core.ModuleActivator | 18 - .../tuscany/sca/binding/jsonrpc/server/jsonrpc.js | 484 ------- .../apache/tuscany/sca/binding/jsonrpc/Echo.java | 29 - .../sca/binding/jsonrpc/EchoComponentImpl.java | 34 - .../binding/jsonrpc/JSONRPCServiceTestCase.java | 63 - .../sca-java-0.90/modules/binding-rmi/.ruleset | 190 --- .../sca-java-0.90/modules/binding-rmi/DISCLAIMER | 8 - branches/sca-java-0.90/modules/binding-rmi/LICENSE | 205 --- branches/sca-java-0.90/modules/binding-rmi/NOTICE | 6 - branches/sca-java-0.90/modules/binding-rmi/pom.xml | 82 -- .../sca/binding/rmi/DefaultRMIBindingFactory.java | 36 - .../sca/binding/rmi/NoRemoteMethodException.java | 40 - .../sca/binding/rmi/NoRemoteServiceException.java | 38 - .../apache/tuscany/sca/binding/rmi/RMIBinding.java | 55 - .../sca/binding/rmi/RMIBindingConstants.java | 36 - .../tuscany/sca/binding/rmi/RMIBindingFactory.java | 33 - .../tuscany/sca/binding/rmi/RMIBindingImpl.java | 129 -- .../tuscany/sca/binding/rmi/RMIBindingInvoker.java | 83 -- .../sca/binding/rmi/RMIBindingProvider.java | 244 ---- .../sca/binding/rmi/RMIBindingProviderFactory.java | 57 - .../sca/binding/rmi/RMIModuleActivator.java | 60 - .../sca/binding/rmi/RMIRuntimeException.java | 37 - .../sca/binding/rmi/xml/RMIBindingProcessor.java | 169 --- .../org.apache.tuscany.sca.core.ModuleActivator | 18 - .../src/test/java/helloworld/HelloWorldImpl.java | 37 - .../test/java/helloworld/HelloWorldRmiImpl.java | 48 - .../test/java/helloworld/HelloWorldRmiService.java | 29 - .../test/java/helloworld/HelloWorldService.java | 29 - .../tuscany/sca/binding/rmi/BindingTestCase.java | 59 - .../rmi/NoRemoteMethodExceptionTestCase.java | 47 - .../rmi/NoRemoteServiceExceptionTestCase.java | 47 - .../test/resources/HelloWorldImpl.componentType | 23 - .../test/resources/HelloWorldRmiImpl.componentType | 27 - .../src/test/resources/META-INF/LICENSE.txt | 202 --- .../binding-rmi/src/test/resources/META-INF/NOTICE | 14 - .../src/test/resources/RMIBindingTest.composite | 44 - .../modules/binding-ws-axis2/DISCLAIMER | 8 - .../sca-java-0.90/modules/binding-ws-axis2/LICENSE | 205 --- .../sca-java-0.90/modules/binding-ws-axis2/NOTICE | 6 - .../sca-java-0.90/modules/binding-ws-axis2/pom.xml | 181 --- .../binding-ws-axis2/src/main/assembly/axis2.xml | 306 ----- .../binding/axis2/Axis2AsyncBindingInvoker.java | 74 -- .../sca/binding/axis2/Axis2BindingInvoker.java | 146 --- .../binding/axis2/Axis2BindingProviderFactory.java | 58 - .../axis2/Axis2CallbackInvocationHandler.java | 53 - .../sca/binding/axis2/Axis2ModuleActivator.java | 70 - .../binding/axis2/Axis2OneWayBindingInvoker.java | 58 - .../axis2/Axis2ReferenceBindingProvider.java | 267 ---- .../sca/binding/axis2/Axis2ReferenceCallback.java | 54 - .../axis2/Axis2ReferenceCallbackTargetInvoker.java | 108 -- .../binding/axis2/Axis2ServiceBindingProvider.java | 418 ------ .../axis2/Axis2ServiceCallbackTargetInvoker.java | 105 -- .../axis2/Axis2ServiceInMessageReceiver.java | 65 - .../Axis2ServiceInOutAsyncMessageReceiver.java | 128 -- .../Axis2ServiceInOutSyncMessageReceiver.java | 75 -- .../sca/binding/axis2/Axis2ServiceServlet.java | 300 ----- .../sca/binding/axis2/TuscanyAxisConfigurator.java | 44 - .../sca/binding/axis2/TuscanyDispatcher.java | 101 -- .../sca/binding/axis2/TuscanyListingAgent.java | 334 ----- .../org.apache.tuscany.sca.core.ModuleActivator | 18 - .../sca/binding/axis2/engine/config/axis2.xml | 306 ----- .../sca/binding/axis2/Axis2ReferenceTestCase.java | 83 -- .../sca/binding/axis2/Axis2ServiceTestCase.java | 104 -- .../apache/tuscany/sca/binding/axis2/Greeter.java | 31 - .../sca/binding/axis2/GreetingCallback.java | 24 - .../sca/binding/axis2/itests/HelloWorld.java | 29 - .../binding/axis2/itests/HelloWorldComponent.java | 33 - .../axis2/itests/HelloWorldMultiService.java | 51 - .../sca/binding/axis2/itests/HelloWorldOM.java | 30 - .../sca/binding/axis2/itests/HelloWorldOM2.java | 30 - .../axis2/itests/HelloWorldOMComponent.java | 34 - .../binding/axis2/itests/HelloWorldOMService.java | 40 - .../binding/axis2/itests/HelloWorldOMTestCase.java | 56 - .../binding/axis2/itests/HelloWorldService.java | 28 - .../axis2/itests/HelloWorldTestCaseFIXME.java | 44 - .../itests/QuestionMarkWSDLTestCaseFIXME.java | 100 -- .../endpoints/AbstractHelloWorldOMTestCase.java | 62 - .../endpoints/DefaultMultiServiceTestCase.java | 24 - .../endpoints/DefaultSingleServiceTestCase.java | 24 - .../itests/endpoints/WSDLExplicitURITestCase.java | 24 - .../itests/endpoints/WSDLRelativeURITestCase.java | 24 - .../sca/binding/axis2/itests/HelloWorld.composite | 45 - .../itests/endpoints/DefaultMultiService.composite | 50 - .../endpoints/DefaultSingleService.composite | 50 - .../itests/endpoints/WSDLExplicitURI.composite | 49 - .../itests/endpoints/WSDLRelativeURI.composite | 49 - .../endpoints/helloworld-om-relative-uri.wsdl | 78 -- .../binding/axis2/itests/helloworld-om-uri.wsdl | 78 -- .../binding/axis2/itests/helloworld-om.composite | 45 - .../sca/binding/axis2/itests/helloworld-om.wsdl | 78 -- .../sca/binding/axis2/itests/helloworld.wsdl | 80 -- .../axis2/itests/questionmark-wsdl.composite | 38 - .../modules/binding-ws-xml/.checkstyle | 24 - branches/sca-java-0.90/modules/binding-ws-xml/.pmd | 20 - .../sca-java-0.90/modules/binding-ws-xml/.ruleset | 190 --- .../modules/binding-ws-xml/DISCLAIMER | 8 - .../sca-java-0.90/modules/binding-ws-xml/LICENSE | 205 --- .../sca-java-0.90/modules/binding-ws-xml/NOTICE | 6 - .../sca-java-0.90/modules/binding-ws-xml/pom.xml | 61 - .../binding/ws/xml/WebServiceBindingProcessor.java | 334 ----- .../sca/binding/ws/xml/WebServiceConstants.java | 35 - .../tuscany/sca/binding/ws/xml/ReadTestCase.java | 121 -- .../tuscany/sca/binding/ws/xml/WriteTestCase.java | 112 -- .../sca/binding/ws/xml/Calculator.composite | 58 - .../binding/ws/xml/CalculatorImpl.componentType | 40 - .../apache/tuscany/sca/binding/ws/xml/example.wsdl | 26 - .../sca/binding/ws/xml/invalid-stockquote.wsdl | 58 - .../org/apache/tuscany/sca/binding/ws/xml/ipo.xsd | 136 -- .../tuscany/sca/binding/ws/xml/stockquote.wsdl | 58 - .../apache/tuscany/sca/binding/ws/xml/test1.wsdl | 45 - .../apache/tuscany/sca/binding/ws/xml/test1.xsd | 33 - .../apache/tuscany/sca/binding/ws/xml/test2.wsdl | 63 - .../sca/binding/ws/xml/unwrapped-stockquote.wsdl | 76 -- .../sca-java-0.90/modules/binding-ws/.checkstyle | 24 - branches/sca-java-0.90/modules/binding-ws/.pmd | 20 - branches/sca-java-0.90/modules/binding-ws/.ruleset | 190 --- .../sca-java-0.90/modules/binding-ws/DISCLAIMER | 8 - branches/sca-java-0.90/modules/binding-ws/LICENSE | 205 --- branches/sca-java-0.90/modules/binding-ws/NOTICE | 6 - branches/sca-java-0.90/modules/binding-ws/pom.xml | 66 - .../ws/DefaultWebServiceBindingFactory.java | 30 - .../tuscany/sca/binding/ws/WebServiceBinding.java | 194 --- .../sca/binding/ws/WebServiceBindingFactory.java | 35 - .../ws/impl/WebServiceBindingFactoryImpl.java | 35 - .../sca/binding/ws/impl/WebServiceBindingImpl.java | 242 ---- .../sca-java-0.90/modules/commonj-api/DISCLAIMER | 8 - branches/sca-java-0.90/modules/commonj-api/LICENSE | 205 --- branches/sca-java-0.90/modules/commonj-api/NOTICE | 6 - branches/sca-java-0.90/modules/commonj-api/pom.xml | 46 - .../java/commonj/timers/CancelTimerListener.java | 38 - .../java/commonj/timers/StopTimerListener.java | 38 - .../src/main/java/commonj/timers/Timer.java | 41 - .../main/java/commonj/timers/TimerListener.java | 38 - .../src/main/java/commonj/timers/TimerManager.java | 79 -- .../src/main/java/commonj/work/RemoteWorkItem.java | 39 - .../src/main/java/commonj/work/Work.java | 39 - .../java/commonj/work/WorkCompletedException.java | 73 -- .../src/main/java/commonj/work/WorkEvent.java | 45 - .../src/main/java/commonj/work/WorkException.java | 50 - .../src/main/java/commonj/work/WorkItem.java | 39 - .../src/main/java/commonj/work/WorkListener.java | 44 - .../src/main/java/commonj/work/WorkManager.java | 51 - .../java/commonj/work/WorkRejectedException.java | 50 - .../modules/contribution-impl/.checkstyle | 25 - .../sca-java-0.90/modules/contribution-impl/.pmd | 20 - .../modules/contribution-impl/.ruleset | 190 --- .../modules/contribution-impl/DISCLAIMER | 8 - .../modules/contribution-impl/LICENSE | 205 --- .../sca-java-0.90/modules/contribution-impl/NOTICE | 6 - .../modules/contribution-impl/pom.xml | 45 - .../sca/contribution/impl/ArtifactImpl.java | 52 - .../contribution/impl/ContributionExportImpl.java | 52 - .../contribution/impl/ContributionFactoryImpl.java | 51 - .../sca/contribution/impl/ContributionImpl.java | 74 -- .../contribution/impl/ContributionImportImpl.java | 61 - .../contribution/impl/DeployedArtifactImpl.java | 43 - .../impl/FolderContributionProcessor.java | 112 -- .../impl/InvalidFolderContributionException.java | 41 - .../InvalidFolderContributionURIException.java | 41 - .../processor/impl/JarContributionProcessor.java | 97 -- .../resolver/impl/ModelResolverImpl.java | 87 -- .../service/impl/ArtifactTypeDescriberImpl.java | 106 -- .../impl/ContributionMetadataLoaderImpl.java | 132 -- .../service/impl/ContributionRepositoryImpl.java | 266 ---- .../service/impl/ContributionServiceImpl.java | 332 ----- .../impl/InvalidContributionMetadataException.java | 57 - .../impl/InvalidContributionURIException.java | 57 - .../service/impl/InvalidValueException.java | 46 - .../service/impl/PackageTypeDescriberImpl.java | 98 -- .../sca/contribution/service/util/FileHelper.java | 704 ---------- .../sca/contribution/service/util/IOHelper.java | 182 --- ...FolderContributionPackageProcessorTestCase.java | 45 - .../JarContributionPackageProcessorTestCase.java | 52 - .../resolver/ArtifactResolverTestCase.java | 88 -- .../services/ContentTypeDescriberImplTestCase.java | 53 - .../ContributionMetadataLoaderTestCase.java | 96 -- .../services/ContributionRepositoryTestCase.java | 79 -- .../services/PackageTypeDescriberImplTestCase.java | 52 - .../resources/deployables/sample-calculator.jar | Bin 26901 -> 0 bytes .../resources/repository/sample-calculator.jar | Bin 29164 -> 0 bytes .../src/test/resources/test.composite | 22 - .../contribution-impl/src/test/resources/test.ext | 0 .../sca-java-0.90/modules/contribution/.checkstyle | 24 - branches/sca-java-0.90/modules/contribution/.pmd | 20 - .../sca-java-0.90/modules/contribution/.ruleset | 190 --- .../sca-java-0.90/modules/contribution/DISCLAIMER | 8 - .../sca-java-0.90/modules/contribution/LICENSE | 205 --- branches/sca-java-0.90/modules/contribution/NOTICE | 6 - .../sca-java-0.90/modules/contribution/pom.xml | 44 - .../apache/tuscany/sca/contribution/Artifact.java | 57 - .../tuscany/sca/contribution/ContentType.java | 56 - .../tuscany/sca/contribution/Contribution.java | 91 -- .../sca/contribution/ContributionExport.java | 61 - .../sca/contribution/ContributionFactory.java | 55 - .../sca/contribution/ContributionImport.java | 75 -- .../tuscany/sca/contribution/DeployedArtifact.java | 43 - .../contribution/processor/ArtifactProcessor.java | 48 - .../processor/ArtifactProcessorExtensionPoint.java | 58 - .../processor/ContributionPostProcessor.java | 37 - .../ContributionPostProcessorExtensionPoint.java | 42 - .../DefaultArtifactProcessorExtensionPoint.java | 66 - .../DefaultPackageProcessorExtensionPoint.java | 51 - ...DefaultStAXArtifactProcessorExtensionPoint.java | 46 - .../DefaultURLArtifactProcessorExtensionPoint.java | 46 - .../processor/ExtensiblePackageProcessor.java | 76 -- .../processor/ExtensibleStAXArtifactProcessor.java | 178 --- .../processor/ExtensibleURLArtifactProcessor.java | 98 -- .../contribution/processor/PackageProcessor.java | 67 - .../processor/PackageProcessorExtensionPoint.java | 50 - .../processor/StAXArtifactProcessor.java | 63 - .../StAXArtifactProcessorExtensionPoint.java | 29 - .../processor/URLArtifactProcessor.java | 52 - .../URLArtifactProcessorExtensionPoint.java | 29 - .../sca/contribution/resolver/ClassReference.java | 103 -- .../sca/contribution/resolver/ModelResolver.java | 66 - .../service/AbstractContributionException.java | 124 -- .../service/ContributionException.java | 55 - .../service/ContributionMetadataLoader.java | 42 - .../ContributionMetadataLoaderException.java | 54 - .../service/ContributionReadException.java | 94 -- .../service/ContributionRepository.java | 93 -- .../service/ContributionResolveException.java | 41 - .../service/ContributionRuntimeException.java | 44 - .../contribution/service/ContributionService.java | 104 -- .../service/ContributionWireException.java | 42 - .../service/ContributionWriteException.java | 61 - .../service/InvalidConfigurationException.java | 33 - .../sca/contribution/service/TypeDescriber.java | 38 - .../service/UnrecognizedElementException.java | 48 - .../service/UnsupportedContentTypeException.java | 49 - .../modules/core-databinding/.checkstyle | 25 - .../sca-java-0.90/modules/core-databinding/.pmd | 20 - .../modules/core-databinding/.ruleset | 190 --- .../modules/core-databinding/DISCLAIMER | 8 - .../sca-java-0.90/modules/core-databinding/LICENSE | 205 --- .../sca-java-0.90/modules/core-databinding/NOTICE | 6 - .../sca-java-0.90/modules/core-databinding/pom.xml | 82 -- .../module/DataBindingModuleActivator.java | 151 --- .../DataBindingJavaInterfaceProcessor.java | 135 -- .../Exception2ExceptionTransformer.java | 126 -- .../transformers/Input2InputTransformer.java | 203 --- .../transformers/Output2OutputTransformer.java | 185 --- .../wire/DataBindingRuntimeWireProcessor.java | 150 --- .../wire/DataTransformationInteceptor.java | 224 ---- .../org.apache.tuscany.sca.core.ModuleActivator | 18 - .../DataBindingJavaInterfaceProcessorTestCase.java | 83 -- .../transformers/IDLTransformerTestCase.java.fixme | 229 ---- .../sca-java-0.90/modules/core-spi/.checkstyle | 24 - branches/sca-java-0.90/modules/core-spi/.pmd | 20 - branches/sca-java-0.90/modules/core-spi/.ruleset | 190 --- branches/sca-java-0.90/modules/core-spi/DISCLAIMER | 8 - branches/sca-java-0.90/modules/core-spi/LICENSE | 205 --- branches/sca-java-0.90/modules/core-spi/NOTICE | 6 - branches/sca-java-0.90/modules/core-spi/pom.xml | 111 -- .../modules/core-spi/src/doc/Context Model.emx | 673 ---------- .../sca/core/DefaultExtensionPointRegistry.java | 69 - .../core/DefaultModelFactoryExtensionPoint.java | 67 - .../tuscany/sca/core/ExtensionPointRegistry.java | 50 - .../sca/core/ModelFactoryExtensionPoint.java | 54 - .../apache/tuscany/sca/core/ModuleActivator.java | 68 - .../java/org/apache/tuscany/sca/event/Event.java | 33 - .../org/apache/tuscany/sca/event/EventFilter.java | 35 - .../apache/tuscany/sca/event/EventPublisher.java | 55 - .../tuscany/sca/event/RuntimeEventListener.java | 35 - .../org/apache/tuscany/sca/event/TrueFilter.java | 37 - .../apache/tuscany/sca/invocation/Interceptor.java | 40 - .../tuscany/sca/invocation/InvocationChain.java | 83 -- .../org/apache/tuscany/sca/invocation/Invoker.java | 36 - .../org/apache/tuscany/sca/invocation/Message.java | 132 -- .../tuscany/sca/invocation/MessageFactory.java | 36 - .../tuscany/sca/management/ManagementService.java | 39 - .../sca/provider/BindingProviderFactory.java | 60 - .../DefaultProviderFactoryExtensionPoint.java | 76 -- .../sca/provider/ImplementationProvider.java | 68 - .../provider/ImplementationProviderFactory.java | 42 - .../tuscany/sca/provider/ProviderFactory.java | 36 - .../provider/ProviderFactoryExtensionPoint.java | 55 - .../sca/provider/ReferenceBindingProvider.java | 68 - .../sca/provider/ServiceBindingProvider.java | 52 - .../DefaultWireProcessorExtensionPoint.java | 63 - .../tuscany/sca/runtime/EndpointReference.java | 64 - .../tuscany/sca/runtime/RuntimeComponent.java | 45 - .../sca/runtime/RuntimeComponentReference.java | 80 -- .../sca/runtime/RuntimeComponentService.java | 92 -- .../apache/tuscany/sca/runtime/RuntimeWire.java | 66 - .../tuscany/sca/runtime/RuntimeWireProcessor.java | 35 - .../RuntimeWireProcessorExtensionPoint.java | 53 - .../sca/store/DuplicateRecordException.java | 45 - .../apache/tuscany/sca/store/RecoveryListener.java | 46 - .../java/org/apache/tuscany/sca/store/Store.java | 96 -- .../apache/tuscany/sca/store/StoreException.java | 46 - .../tuscany/sca/store/StoreExpirationEvent.java | 71 -- .../org/apache/tuscany/sca/store/StoreMonitor.java | 71 -- .../tuscany/sca/store/StoreReadException.java | 45 - .../tuscany/sca/store/StoreWriteException.java | 45 - .../tuscany/sca/work/NotificationListener.java | 66 - .../org/apache/tuscany/sca/work/WorkScheduler.java | 52 - .../tuscany/sca/work/WorkSchedulerException.java | 47 - .../apache/tuscany/spi/util/stax/test.composite | 34 - .../sca-java-0.90/modules/core-spring/DISCLAIMER | 8 - branches/sca-java-0.90/modules/core-spring/LICENSE | 205 --- branches/sca-java-0.90/modules/core-spring/NOTICE | 6 - branches/sca-java-0.90/modules/core-spring/pom.xml | 94 -- .../spring/assembly/impl/BeanAssemblyFactory.java | 135 -- .../spring/assembly/impl/BeanComponentImpl.java | 211 --- .../spring/assembly/impl/BeanReferenceImpl.java | 65 - .../sca/core/spring/context/ModelResolverImpl.java | 88 -- .../sca/core/spring/context/SCADomainContext.java | 195 --- .../java/impl/BeanBaseJavaImplementationImpl.java | 182 --- .../java/impl/BeanJavaImplementationFactory.java | 43 - .../java/impl/BeanJavaImplementationImpl.java | 164 --- .../java/impl/BeanJavaInterfaceContractImpl.java | 34 - .../java/impl/BeanJavaInterfaceFactory.java | 44 - .../java/impl/BeanJavaInterfaceImpl.java | 118 -- .../src/test/java/calculator/AddService.java | 25 - .../src/test/java/calculator/AddServiceImpl.java | 35 - .../src/test/java/calculator/CalculatorClient.java | 41 - .../test/java/calculator/CalculatorService.java | 34 - .../java/calculator/CalculatorServiceImpl.java | 71 -- .../src/test/java/calculator/DivideService.java | 25 - .../test/java/calculator/DivideServiceImpl.java | 33 - .../src/test/java/calculator/MultiplyService.java | 25 - .../test/java/calculator/MultiplyServiceImpl.java | 33 - .../java/calculator/NestedCalculatorClient.java | 44 - .../src/test/java/calculator/SubtractService.java | 25 - .../test/java/calculator/SubtractServiceImpl.java | 33 - .../sca/core/spring/CalculatorTestCase.java | 54 - .../sca/core/spring/NestedCalculatorTestCase.java | 57 - .../tuscany/sca/core/spring/Calculator.composite | 52 - .../sca/core/spring/InnerCalculator.composite | 42 - .../sca/core/spring/InnerOperations.composite | 57 - .../sca/core/spring/OuterCalculator.composite | 41 - branches/sca-java-0.90/modules/core/.checkstyle | 24 - branches/sca-java-0.90/modules/core/.pmd | 20 - branches/sca-java-0.90/modules/core/.ruleset | 190 --- branches/sca-java-0.90/modules/core/DISCLAIMER | 8 - branches/sca-java-0.90/modules/core/LICENSE | 205 --- branches/sca-java-0.90/modules/core/NOTICE | 6 - branches/sca-java-0.90/modules/core/pom.xml | 64 - .../sca/core/component/CallableReferenceImpl.java | 59 - .../sca/core/component/CallbackReferenceImpl.java | 33 - .../sca/core/component/ComponentContextImpl.java | 93 -- .../core/component/ComponentContextProvider.java | 44 - .../sca/core/component/RequestContextImpl.java | 54 - .../sca/core/component/ServiceReferenceImpl.java | 51 - .../tuscany/sca/core/event/BaseEventPublisher.java | 89 -- .../tuscany/sca/core/event/ComponentStart.java | 54 - .../tuscany/sca/core/event/ComponentStop.java | 53 - .../tuscany/sca/core/event/ConversationEnd.java | 53 - .../tuscany/sca/core/event/ConversationStart.java | 52 - .../tuscany/sca/core/event/HttpSessionEnd.java | 53 - .../tuscany/sca/core/event/HttpSessionStart.java | 52 - .../apache/tuscany/sca/core/event/RequestEnd.java | 45 - .../tuscany/sca/core/event/RequestStart.java | 45 - .../core/invocation/AbstractInvocationHandler.java | 104 -- .../invocation/CallbackInterfaceInterceptor.java | 57 - .../core/invocation/CallbackWireObjectFactory.java | 47 - .../core/invocation/ExtensibleWireProcessor.java | 44 - .../sca/core/invocation/InvocationChainImpl.java | 126 -- .../invocation/JDKCallbackInvocationHandler.java | 95 -- .../sca/core/invocation/JDKInvocationHandler.java | 112 -- .../sca/core/invocation/JDKProxyService.java | 78 -- .../sca/core/invocation/MessageFactoryImpl.java | 36 - .../tuscany/sca/core/invocation/MessageImpl.java | 117 -- .../invocation/NoMethodForOperationException.java | 43 - .../core/invocation/NonBlockingInterceptor.java | 174 --- .../core/invocation/ProxyCreationException.java | 48 - .../tuscany/sca/core/invocation/ProxyFactory.java | 61 - .../sca/core/invocation/ThreadMessageContext.java | 68 - .../sca/core/invocation/WireObjectFactory.java | 55 - .../sca/core/runtime/ActivationException.java | 37 - .../sca/core/runtime/CompositeActivator.java | 55 - .../sca/core/runtime/CompositeActivatorImpl.java | 597 --------- .../sca/core/runtime/EndpointReferenceImpl.java | 128 -- .../sca/core/runtime/RuntimeAssemblyFactory.java | 61 - .../sca/core/runtime/RuntimeComponentImpl.java | 128 -- .../runtime/RuntimeComponentReferenceImpl.java | 86 -- .../core/runtime/RuntimeComponentServiceImpl.java | 109 -- .../core/runtime/RuntimeSCABindingProvider.java | 55 - .../runtime/RuntimeSCABindingProviderFactory.java | 51 - .../tuscany/sca/core/runtime/RuntimeWireImpl.java | 66 - .../sca/core/scope/AbstractScopeContainer.java | 146 --- .../sca/core/scope/CompositeScopeContainer.java | 70 - .../core/scope/CompositeScopeContainerFactory.java | 40 - .../core/scope/ConversationalScopeContainer.java | 182 --- .../scope/ConversationalScopeContainerFactory.java | 47 - .../sca/core/scope/HttpSessionScopeContainer.java | 81 -- .../scope/HttpSessionScopeContainerFactory.java | 44 - .../sca/core/scope/RequestScopeContainer.java | 85 -- .../core/scope/RequestScopeContainerFactory.java | 40 - .../tuscany/sca/core/scope/ScopeRegistryImpl.java | 68 - .../sca/core/scope/StatelessScopeContainer.java | 54 - .../core/scope/StatelessScopeContainerFactory.java | 40 - .../apache/tuscany/sca/core/store/MemoryStore.java | 195 --- .../org/apache/tuscany/sca/core/util/IOHelper.java | 182 --- .../apache/tuscany/sca/core/work/Jsr237Work.java | 63 - .../tuscany/sca/core/work/Jsr237WorkScheduler.java | 167 --- .../sca/core/work/ThreadPoolWorkManager.java | 220 ---- .../tuscany/sca/core/work/WorkEventImpl.java | 74 -- .../apache/tuscany/sca/core/work/WorkItemImpl.java | 166 --- .../sca/factory/ObjectCreationException.java | 47 - .../apache/tuscany/sca/factory/ObjectFactory.java | 35 - .../sca/factory/SingletonObjectFactory.java | 38 - .../tuscany/sca/scope/AbstractLifecycle.java | 77 -- .../tuscany/sca/scope/CoreRuntimeException.java | 45 - .../apache/tuscany/sca/scope/InstanceWrapper.java | 45 - .../org/apache/tuscany/sca/scope/Lifecycle.java | 69 - .../tuscany/sca/scope/PersistenceException.java | 43 - .../java/org/apache/tuscany/sca/scope/Scope.java | 63 - .../apache/tuscany/sca/scope/ScopeContainer.java | 93 -- .../tuscany/sca/scope/ScopeContainerFactory.java | 32 - .../apache/tuscany/sca/scope/ScopeIdentifier.java | 35 - .../tuscany/sca/scope/ScopeNotFoundException.java | 31 - .../apache/tuscany/sca/scope/ScopeRegistry.java | 43 - .../sca/scope/ScopedImplementationProvider.java | 64 - .../tuscany/sca/scope/ScopedRuntimeComponent.java | 40 - .../sca/scope/TargetDestructionException.java | 44 - .../sca/scope/TargetInitializationException.java | 44 - .../sca/scope/TargetInvocationException.java | 45 - .../sca/scope/TargetInvokerCreationException.java | 44 - .../tuscany/sca/scope/TargetNotFoundException.java | 44 - .../sca/scope/TargetResolutionException.java | 44 - .../DefaultExtensionPointRegistryTestCase.java | 51 - .../sca/core/event/BaseEventPublisherTestCase.java | 98 -- .../tuscany/sca/core/event/EventTestCase.java | 69 - .../sca/core/mock/component/AsyncTarget.java | 31 - .../sca/core/mock/component/BadContextPojo.java | 28 - .../sca/core/mock/component/BadNamePojo.java | 26 - .../sca/core/mock/component/BasicInterface.java | 30 - .../core/mock/component/BasicInterfaceImpl.java | 66 - .../mock/component/CompositeScopeComponent.java | 31 - .../component/CompositeScopeComponentImpl.java | 40 - .../CompositeScopeDestroyOnlyComponent.java | 36 - .../CompositeScopeInitDestroyComponent.java | 39 - .../component/CompositeScopeInitOnlyComponent.java | 42 - .../component/ConversationalScopeComponent.java | 29 - .../ConversationalScopeComponentImpl.java | 29 - .../ConversationalScopeDestroyOnlyComponent.java | 37 - .../ConversationalScopeInitDestroyComponent.java | 38 - .../ConversationalScopeInitOnlyComponent.java | 38 - .../sca/core/mock/component/OrderException.java | 40 - .../core/mock/component/OrderedDependentPojo.java | 29 - .../mock/component/OrderedDependentPojoImpl.java | 36 - .../core/mock/component/OrderedEagerInitPojo.java | 60 - .../sca/core/mock/component/OrderedInitPojo.java | 28 - .../core/mock/component/OrderedInitPojoImpl.java | 61 - .../sca/core/mock/component/OtherTarget.java | 31 - .../sca/core/mock/component/OtherTargetImpl.java | 39 - .../core/mock/component/RequestScopeComponent.java | 30 - .../RequestScopeDestroyOnlyComponent.java | 38 - .../RequestScopeInitDestroyComponent.java | 38 - .../component/RequestScopeInitOnlyComponent.java | 39 - .../core/mock/component/SessionScopeComponent.java | 30 - .../mock/component/SessionScopeComponentImpl.java | 30 - .../SessionScopeInitDestroyComponent.java | 36 - .../component/SessionScopeInitOnlyComponent.java | 37 - .../sca/core/mock/component/SimpleTarget.java | 30 - .../sca/core/mock/component/SimpleTargetImpl.java | 41 - .../tuscany/sca/core/mock/component/Source.java | 37 - .../sca/core/mock/component/SourceImpl.java | 63 - .../core/mock/component/StatelessComponent.java | 30 - .../mock/component/StatelessComponentImpl.java | 27 - .../tuscany/sca/core/mock/component/Target.java | 32 - .../sca/core/mock/component/TargetImpl.java | 38 - .../core/scope/AbstractScopeContainerTestCase.java | 70 - .../sca/core/store/MemoryStoreTestCase.java | 165 --- .../wire/CallbackInterfaceInterceptorTestCase.java | 55 - .../sca/core/wire/InvocationChainImplTestCase.java | 66 - .../core/wire/NonBlockingInterceptorTestCase.java | 72 -- .../tuscany/sca/factory/AssertionTestCase.java | 38 - .../factory/SingletonObjectFactoryTestCase.java | 33 - .../apache/tuscany/sca/scope/ScopeTestCase.java | 61 - .../modules/databinding-axiom/.ruleset | 191 --- .../modules/databinding-axiom/DISCLAIMER | 8 - .../modules/databinding-axiom/LICENSE | 205 --- .../sca-java-0.90/modules/databinding-axiom/NOTICE | 6 - .../modules/databinding-axiom/pom.xml | 91 -- .../sca/databinding/axiom/AxiomDataBinding.java | 64 - .../databinding/axiom/AxiomExceptionHandler.java | 61 - .../tuscany/sca/databinding/axiom/AxiomHelper.java | 64 - .../sca/databinding/axiom/OMElement2Object.java | 37 - .../sca/databinding/axiom/OMElement2String.java | 59 - .../axiom/OMElement2XMLStreamReader.java | 47 - .../databinding/axiom/OMElementWrapperHandler.java | 70 - .../sca/databinding/axiom/Object2OMElement.java | 52 - .../sca/databinding/axiom/String2OMElement.java | 57 - .../axiom/XMLStreamReader2OMElement.java | 60 - .../module/AxiomDataBindingModuleActivator.java | 61 - .../org.apache.tuscany.sca.core.ModuleActivator | 18 - .../axiom/AxiomExceptionHandlerTestCase.java | 108 -- .../sca/databinding/axiom/OMElementTestCase.java | 103 -- .../databinding-axiom/src/test/resources/ipo.xml | 51 - .../databinding-axiom/src/test/resources/ipo.xsd | 137 -- .../src/test/resources/order.wsdl | 76 -- .../modules/databinding-jaxb/.ruleset | 191 --- .../modules/databinding-jaxb/DISCLAIMER | 8 - .../sca-java-0.90/modules/databinding-jaxb/LICENSE | 205 --- .../sca-java-0.90/modules/databinding-jaxb/NOTICE | 6 - .../sca-java-0.90/modules/databinding-jaxb/pom.xml | 147 --- .../tuscany/sca/databinding/jaxb/JAXB2Node.java | 69 - .../sca/databinding/jaxb/JAXBContextHelper.java | 176 --- .../sca/databinding/jaxb/JAXBDataBinding.java | 114 -- .../sca/databinding/jaxb/JAXBExceptionHandler.java | 107 -- .../sca/databinding/jaxb/JAXBWrapperHandler.java | 123 -- .../jaxb/JAXWSJavaInterfaceProcessor.java | 101 -- .../tuscany/sca/databinding/jaxb/Node2JAXB.java | 66 - .../tuscany/sca/databinding/jaxb/Reader2JAXB.java | 67 - .../sca/databinding/jaxb/XMLStreamReader2JAXB.java | 67 - .../module/JAXBDataBindingModuleActivator.java | 63 - .../org.apache.tuscany.sca.core.ModuleActivator | 18 - .../databinding/jaxb/JAXBDataBindingTestCase.java | 128 -- .../jaxb/JAXBExceptionHandlerTestCase.java | 80 -- .../tuscany/databinding/jaxb/JAXBTestCase.java | 160 --- .../jaxb/JAXBWrapperHandlerTestCase.java | 71 -- .../databinding/jaxb/fault/InvalidSymbolFault.java | 78 -- .../jaxb/fault/InvalidSymbolFault_Exception.java | 63 - .../databinding-jaxb/src/test/resources/ipo.xsd | 136 -- .../modules/databinding-sdo-axiom/.checkstyle | 25 - .../modules/databinding-sdo-axiom/.ruleset | 191 --- .../modules/databinding-sdo-axiom/DISCLAIMER | 8 - .../modules/databinding-sdo-axiom/LICENSE | 205 --- .../modules/databinding-sdo-axiom/NOTICE | 6 - .../modules/databinding-sdo-axiom/pom.xml | 131 -- .../databinding/sdo2om/DataObject2OMElement.java | 88 -- .../databinding/sdo2om/DataObjectSerializer.java | 427 ------- .../sca/databinding/sdo2om/SDODataSource.java | 85 -- .../databinding/sdo2om/XMLDocument2OMElement.java | 61 - .../sdo2om/module/SDOAxiomModuleActivator.java | 48 - .../org.apache.tuscany.sca.core.ModuleActivator | 18 - .../sdo2om/DataObject2OMElementTestCase.java | 57 - .../sdo2om/SDOTransformerTestCaseBase.java | 79 -- .../sdo2om/XMLDocument2OMElementTestCase.java | 62 - .../src/test/resources/ipo.xsd | 136 -- .../src/test/resources/stock.xsd | 33 - .../modules/databinding-sdo/.checkstyle | 25 - .../sca-java-0.90/modules/databinding-sdo/.ruleset | 191 --- .../modules/databinding-sdo/DISCLAIMER | 8 - .../sca-java-0.90/modules/databinding-sdo/LICENSE | 205 --- .../sca-java-0.90/modules/databinding-sdo/NOTICE | 6 - .../sca-java-0.90/modules/databinding-sdo/pom.xml | 114 -- .../sca/databinding/sdo/DataObject2String.java | 58 - .../sdo/DataObject2XMLStreamReader.java | 67 - .../sdo/DuplicateHelperContextException.java | 37 - .../databinding/sdo/HelperContextProcessor.java | 110 -- .../sca/databinding/sdo/HelperContextRegistry.java | 52 - .../databinding/sdo/HelperContextRegistryImpl.java | 49 - .../tuscany/sca/databinding/sdo/ImportSDO.java | 78 -- .../sca/databinding/sdo/ImportSDOProcessor.java | 192 --- .../sca/databinding/sdo/SDOContextHelper.java | 106 -- .../sca/databinding/sdo/SDODataBinding.java | 122 -- .../sca/databinding/sdo/SDOExceptionHandler.java | 124 -- .../sca/databinding/sdo/SDOSimpleTypeMapper.java | 66 - .../sca/databinding/sdo/SDOWrapperHandler.java | 99 -- .../sca/databinding/sdo/String2DataObject.java | 55 - .../sca/databinding/sdo/XMLDocument2String.java | 59 - .../sdo/XMLDocument2XMLStreamReader.java | 63 - .../sdo/XMLStreamReader2DataObject.java | 64 - .../sdo/XMLStreamReader2XMLDocument.java | 58 - .../sca/databinding/sdo/api/HelperContext.java | 37 - .../sdo/module/SDODataBindingModuleActivator.java | 80 -- .../org.apache.tuscany.sca.core.ModuleActivator | 18 - .../sdo/fault/InvalidSymbolFault_Exception.java | 67 - .../databinding/sdo/DataObject2StringTestCase.java | 64 - .../sdo/DataObject2XMLStreamReaderTestCase.java | 58 - .../sdo/HelperContextProcessorTestCase.java | 83 -- .../sdo/ImportSDOProcessorTestCase.java | 85 -- .../databinding/sdo/SDODataBindingTestCase.java | 110 -- .../sdo/SDOExceptionHandlerTestCase.java | 82 -- .../sdo/SDOTransformerTestCaseBase.java | 79 -- .../databinding/sdo/SDOWrapperHandlerTestCase.java | 60 - .../sca/databinding/sdo/TestModelResolver.java | 63 - .../sdo/XMLDocument2XMLStreamReaderTestCase.java | 61 - .../databinding-sdo/src/test/resources/ipo.xsd | 136 -- .../src/test/resources/model/sca-core.xsd | 233 ---- .../resources/model/sca-implementation-mock.xsd | 43 - .../databinding-sdo/src/test/resources/stock.xsd | 33 - .../databinding-sdo/src/test/resources/wrapper.xml | 27 - .../databinding-sdo/src/test/resources/wrapper.xsd | 38 - .../sca-java-0.90/modules/databinding/.checkstyle | 25 - branches/sca-java-0.90/modules/databinding/.pmd | 20 - .../sca-java-0.90/modules/databinding/.ruleset | 190 --- .../sca-java-0.90/modules/databinding/DISCLAIMER | 8 - branches/sca-java-0.90/modules/databinding/LICENSE | 205 --- branches/sca-java-0.90/modules/databinding/NOTICE | 6 - branches/sca-java-0.90/modules/databinding/pom.xml | 51 - .../tuscany/sca/databinding/DataBinding.java | 99 -- .../sca/databinding/DataBindingExtensionPoint.java | 71 -- .../apache/tuscany/sca/databinding/DataPipe.java | 44 - .../DefaultDataBindingExtensionPoint.java | 116 -- .../DefaultTransformerExtensionPoint.java | 90 -- .../tuscany/sca/databinding/ExceptionHandler.java | 57 - .../apache/tuscany/sca/databinding/Mediator.java | 67 - .../tuscany/sca/databinding/PullTransformer.java | 36 - .../tuscany/sca/databinding/PushTransformer.java | 34 - .../tuscany/sca/databinding/SimpleTypeMapper.java | 44 - .../sca/databinding/TransformationContext.java | 79 -- .../sca/databinding/TransformationException.java | 63 - .../tuscany/sca/databinding/Transformer.java | 49 - .../sca/databinding/TransformerExtensionPoint.java | 76 -- .../tuscany/sca/databinding/WrapperHandler.java | 55 - .../sca/databinding/annotation/DataBinding.java | 44 - .../sca/databinding/impl/BaseDataBinding.java | 149 --- .../sca/databinding/impl/BaseTransformer.java | 62 - .../tuscany/sca/databinding/impl/DOMHelper.java | 69 - .../sca/databinding/impl/DirectedGraph.java | 357 ------ .../databinding/impl/Group2GroupTransformer.java | 91 -- .../sca/databinding/impl/GroupDataBinding.java | 96 -- .../impl/Java2SimpleTypeTransformer.java | 60 - .../tuscany/sca/databinding/impl/MediatorImpl.java | 167 --- .../sca/databinding/impl/PipedTransformer.java | 66 - .../impl/SimpleType2JavaTransformer.java | 63 - .../sca/databinding/impl/SimpleTypeMapperImpl.java | 392 ------ .../impl/TransformationContextImpl.java | 112 -- .../sca/databinding/impl/XSDDataTypeConverter.java | 941 -------------- .../javabeans/DOMNode2JavaBeanTransformer.java | 75 -- .../javabeans/Java2XMLMapperException.java | 67 - .../javabeans/JavaBean2DOMNodeTransformer.java | 67 - .../javabeans/JavaBean2XMLStreamReader.java | 53 - .../javabeans/JavaBean2XMLTransformer.java | 226 ---- .../javabeans/JavaBeansDataBinding.java | 104 -- .../javabeans/XML2JavaBeanTransformer.java | 295 ----- .../javabeans/XML2JavaMapperException.java | 74 -- .../tuscany/sca/databinding/xml/BeanUtil.java | 196 --- .../sca/databinding/xml/DOMDataBinding.java | 51 - .../sca/databinding/xml/DOMWrapperHandler.java | 78 -- .../sca/databinding/xml/DOMXMLStreamReader.java | 129 -- .../xml/DelegatingNamespaceContext.java | 310 ----- .../sca/databinding/xml/InputSource2Node.java | 62 - .../sca/databinding/xml/InputSource2SAX.java | 60 - .../sca/databinding/xml/InputStream2Node.java | 64 - .../sca/databinding/xml/InputStream2SAX.java | 59 - .../xml/NameValueArrayStreamReader.java | 403 ------ .../databinding/xml/NameValuePairStreamReader.java | 347 ----- .../tuscany/sca/databinding/xml/NamedProperty.java | 59 - .../databinding/xml/NilElementStreamReader.java | 279 ---- .../sca/databinding/xml/Node2OutputStream.java | 63 - .../tuscany/sca/databinding/xml/Node2String.java | 57 - .../tuscany/sca/databinding/xml/Node2Writer.java | 62 - .../sca/databinding/xml/Node2XMLStreamReader.java | 56 - .../tuscany/sca/databinding/xml/Reader2Node.java | 62 - .../tuscany/sca/databinding/xml/Reader2SAX.java | 55 - .../tuscany/sca/databinding/xml/SAX2DOM.java | 244 ---- .../tuscany/sca/databinding/xml/SAX2DOMPipe.java | 64 - .../databinding/xml/Source2ResultTransformer.java | 58 - .../sca/databinding/xml/StAX2SAXAdapter.java | 256 ---- .../sca/databinding/xml/StAXDataBinding.java | 52 - .../tuscany/sca/databinding/xml/StAXHelper.java | 86 -- .../sca/databinding/xml/StreamDataPipe.java | 54 - .../tuscany/sca/databinding/xml/String2Node.java | 57 - .../tuscany/sca/databinding/xml/String2SAX.java | 56 - .../databinding/xml/String2XMLStreamReader.java | 52 - .../databinding/xml/WrappingXMLStreamReader.java | 230 ---- .../sca/databinding/xml/Writer2ReaderDataPipe.java | 53 - .../databinding/xml/XMLDocumentStreamReader.java | 451 ------- .../databinding/xml/XMLFragmentStreamReader.java | 53 - .../xml/XMLFragmentStreamReaderImpl.java | 857 ------------- .../sca/databinding/xml/XMLGroupDataBinding.java | 58 - .../sca/databinding/xml/XMLStreamReader2Node.java | 59 - .../sca/databinding/xml/XMLStreamReader2SAX.java | 70 - .../databinding/xml/XMLStreamReader2String.java | 52 - .../sca/databinding/xml/XMLStreamSerializer.java | 285 ----- .../tuscany/sca/databinding/xml/XMLStreamable.java | 37 - .../sca/databinding/xml/XMLStringDataBinding.java | 51 - .../databinding/extension/DOMHelperTestCase.java | 56 - .../extension/DataBindingExtensionTestCase.java | 86 -- .../SimpleTypeMapperExtensionTestCase.java | 115 -- .../extension/TransformerExtensionTestCase.java | 75 -- .../extension/XSDDataTypeConverterTestCase.java | 62 - .../impl/DataBindingRegistryImplTestCase.java | 100 -- .../sca/databinding/impl/DataBindingTestCase.java | 45 - .../databinding/impl/DirectedGraphTestCase.java | 89 -- .../sca/databinding/impl/MediatorImplTestCase.java | 119 -- .../impl/TransformerRegistryImplTestCase.java | 107 -- .../sca/databinding/xml/DOM2StAXTestCase.java | 89 -- .../sca/databinding/xml/DataPipeTestCase.java | 89 -- .../xml/JavaBean2XMLStreamReaderTestCase.java | 133 -- .../sca/databinding/xml/Node2StringTestCase.java | 35 - .../xml/PushTransformationTestCase.java | 81 -- .../sca/databinding/xml/StAXHelperTestCase.java | 47 - .../databinding/xml/TraxTransformerTestCase.java | 99 -- .../apache/tuscany/sca/databinding/impl/ipo.xsd | 136 -- .../apache/tuscany/sca/databinding/impl/order.wsdl | 76 -- .../org/apache/tuscany/sca/databinding/xml/foo.xml | 22 - .../modules/host-embedded/.checkstyle | 24 - branches/sca-java-0.90/modules/host-embedded/.pmd | 21 - .../sca-java-0.90/modules/host-embedded/.ruleset | 190 --- .../sca-java-0.90/modules/host-embedded/DISCLAIMER | 8 - .../sca-java-0.90/modules/host-embedded/LICENSE | 205 --- .../sca-java-0.90/modules/host-embedded/NOTICE | 6 - .../sca-java-0.90/modules/host-embedded/pom.xml | 72 -- .../tuscany/sca/host/embedded/SCADomain.java | 267 ---- .../tuscany/sca/host/embedded/SCADomainBean.java | 111 -- .../sca/host/embedded/SCATestCaseRunner.java | 213 ---- .../sca/host/embedded/impl/DefaultSCADomain.java | 348 ----- .../sca/host/embedded/impl/EmbeddedSCADomain.java | 243 ---- .../sca/host/embedded/impl/ReallySmallRuntime.java | 173 --- .../embedded/impl/ReallySmallRuntimeBuilder.java | 282 ---- .../host-embedded/src/test/java/crud/CRUD.java | 56 - .../src/test/java/crud/CRUDImplementation.java | 51 - .../test/java/crud/CRUDImplementationFactory.java | 36 - .../crud/DefaultCRUDImplementationFactory.java | 51 - .../test/java/crud/backend/ResourceManager.java | 111 -- .../java/crud/impl/CRUDImplementationImpl.java | 138 -- .../crud/impl/CRUDImplementationProcessor.java | 97 -- .../test/java/crud/module/CRUDModuleActivator.java | 78 -- .../crud/provider/CRUDImplementationProvider.java | 73 -- .../CRUDImplementationProviderFactory.java | 48 - .../src/test/java/crud/provider/CRUDInvoker.java | 79 -- .../sca/host/embedded/SCADomainBeanTestCase.java | 62 - .../sca/host/embedded/SCADomainTestCase.java | 61 - .../embedded/impl/DefaultSCADomainTestCase.java | 51 - .../embedded/impl/EmbeddedSCADomainTestCase.java | 112 -- .../sca/host/embedded/impl/TestModelResolver.java | 104 -- .../org.apache.tuscany.sca.core.ModuleActivator | 18 - .../src/test/resources/crud.composite | 30 - .../host-embedded/src/test/resources/test.txt | 16 - .../sca-java-0.90/modules/host-http/DISCLAIMER | 8 - branches/sca-java-0.90/modules/host-http/LICENSE | 205 --- branches/sca-java-0.90/modules/host-http/NOTICE | 6 - branches/sca-java-0.90/modules/host-http/pom.xml | 46 - .../sca/http/DefaultServletHostExtensionPoint.java | 45 - .../tuscany/sca/http/ExtensibleServletHost.java | 53 - .../org/apache/tuscany/sca/http/ServletHost.java | 53 - .../sca/http/ServletHostExtensionPoint.java | 51 - .../tuscany/sca/http/ServletMappingException.java | 44 - .../http/module/HTTPRuntimeModuleActivator.java | 46 - .../org.apache.tuscany.sca.core.ModuleActivator | 18 - branches/sca-java-0.90/modules/host-rmi/DISCLAIMER | 8 - branches/sca-java-0.90/modules/host-rmi/LICENSE | 205 --- branches/sca-java-0.90/modules/host-rmi/NOTICE | 6 - branches/sca-java-0.90/modules/host-rmi/pom.xml | 38 - .../org/apache/tuscany/sca/rmi/DefaultRMIHost.java | 129 -- .../java/org/apache/tuscany/sca/rmi/RMIHost.java | 88 -- .../apache/tuscany/sca/rmi/RMIHostException.java | 45 - .../tuscany/sca/rmi/RMIHostRuntimeException.java | 45 - .../sca/rmi/module/RMIRuntimeModuleActivator.java | 43 - .../org.apache.tuscany.sca.core.ModuleActivator | 18 - .../tuscany/sca/rmi/RMIHostImplTestCase.java | 73 -- .../sca-java-0.90/modules/host-webapp/DISCLAIMER | 8 - branches/sca-java-0.90/modules/host-webapp/LICENSE | 205 --- branches/sca-java-0.90/modules/host-webapp/NOTICE | 6 - branches/sca-java-0.90/modules/host-webapp/pom.xml | 53 - .../apache/tuscany/sca/webapp/SCADomainHelper.java | 68 - .../tuscany/sca/webapp/TuscanyContextListener.java | 51 - .../apache/tuscany/sca/webapp/TuscanyServlet.java | 63 - .../tuscany/sca/webapp/WebAppModuleActivator.java | 46 - .../tuscany/sca/webapp/WebAppServletHost.java | 88 -- .../org.apache.tuscany.sca.core.ModuleActivator | 18 - branches/sca-java-0.90/modules/http-jetty/.ruleset | 190 --- .../sca-java-0.90/modules/http-jetty/DISCLAIMER | 8 - branches/sca-java-0.90/modules/http-jetty/LICENSE | 205 --- branches/sca-java-0.90/modules/http-jetty/NOTICE | 6 - branches/sca-java-0.90/modules/http-jetty/pom.xml | 57 - .../apache/tuscany/sca/http/jetty/JettyLogger.java | 87 -- .../apache/tuscany/sca/http/jetty/JettyServer.java | 278 ---- .../jetty/module/JettyRuntimeModuleActivator.java | 54 - .../org.apache.tuscany.sca.core.ModuleActivator | 18 - .../sca/http/jetty/JettyServerTestCase.java | 170 --- .../sca-java-0.90/modules/http-tomcat/.ruleset | 190 --- .../sca-java-0.90/modules/http-tomcat/DISCLAIMER | 8 - branches/sca-java-0.90/modules/http-tomcat/LICENSE | 205 --- branches/sca-java-0.90/modules/http-tomcat/NOTICE | 6 - branches/sca-java-0.90/modules/http-tomcat/pom.xml | 83 -- .../tuscany/sca/http/tomcat/ServletWrapper.java | 47 - .../tuscany/sca/http/tomcat/TomcatServer.java | 220 ---- .../module/TomcatRuntimeModuleActivator.java | 54 - .../org.apache.tuscany.sca.core.ModuleActivator | 18 - .../sca/http/tomcat/TomcatServerTestCase.java | 170 --- .../implementation-java-runtime/.checkstyle | 24 - .../modules/implementation-java-runtime/.pmd | 20 - .../modules/implementation-java-runtime/.ruleset | 190 --- .../modules/implementation-java-runtime/DISCLAIMER | 8 - .../modules/implementation-java-runtime/LICENSE | 205 --- .../modules/implementation-java-runtime/NOTICE | 6 - .../modules/implementation-java-runtime/pom.xml | 68 - .../java/context/InstanceFactory.java | 43 - .../java/context/InstanceFactoryProvider.java | 49 - .../context/JavaPropertyValueObjectFactory.java | 204 --- .../java/context/ReflectiveInstanceFactory.java | 86 -- .../java/context/ReflectiveInstanceWrapper.java | 56 - .../context/TargetMethodNotFoundException.java | 45 - .../injection/ArrayMultiplicityObjectFactory.java | 54 - .../java/injection/ContextInjector.java | 32 - .../injection/ConversationIDObjectFactory.java | 32 - .../java/injection/EventInvoker.java | 34 - .../java/injection/FieldInjector.java | 57 - .../java/injection/InjectionRuntimeException.java | 45 - .../implementation/java/injection/Injector.java | 35 - .../java/injection/InvalidAccessorException.java | 42 - .../injection/InvalidResourceTypeException.java | 46 - .../java/injection/JNDIObjectFactory.java | 50 - .../injection/ListMultiplicityObjectFactory.java | 50 - .../java/injection/MethodEventInvoker.java | 55 - .../java/injection/MethodInjector.java | 55 - .../java/injection/NoAccessorException.java | 39 - .../injection/NoMultiplicityTypeException.java | 42 - .../java/injection/ObjectCallbackException.java | 44 - .../java/injection/PojoObjectFactory.java | 120 -- .../injection/RequestContextObjectFactory.java | 40 - .../java/injection/ResourceHost.java | 46 - .../java/injection/ResourceNotFoundException.java | 46 - .../java/injection/ResourceObjectFactory.java | 87 -- .../injection/ResourceResolutionException.java | 43 - .../java/injection/SingletonObjectFactory.java | 39 - .../InvalidConversationSequenceException.java | 45 - .../java/invocation/JavaComponentInfo.java | 414 ------ .../invocation/JavaImplementationProvider.java | 174 --- .../JavaImplementationProviderFactory.java | 56 - .../java/invocation/JavaTargetInvoker.java | 159 --- .../NoConversationalContractException.java | 34 - .../java/invocation/PassByValueInvoker.java | 117 -- .../invocation/PojoComponentContextFactory.java | 40 - .../java/invocation/PojoConfiguration.java | 218 ---- .../java/invocation/TargetInvoker.java | 69 - .../java/invocation/TargetInvokerInvoker.java | 49 - .../java/module/JavaRuntimeModuleActivator.java | 136 -- .../java/monitor/ExceptionFormatter.java | 34 - .../java/monitor/ExceptionFormatterImpl.java | 43 - .../java/monitor/FormatterRegistry.java | 42 - .../java/monitor/InvalidLevelException.java | 64 - .../java/monitor/JavaLoggingMonitorFactory.java | 118 -- .../java/monitor/MonitorFactory.java | 51 - .../java/monitor/MonitorFactoryUtil.java | 77 -- .../java/monitor/NullMonitorFactory.java | 66 - .../java/monitor/ProxyMonitorFactory.java | 231 ---- .../org.apache.tuscany.sca.core.ModuleActivator | 18 - .../implementation/java/context/ModelHelper.java | 99 -- .../java/context/MultiplicityTestCase.java | 34 - .../context/ReflectiveInstanceWrapperTestCase.java | 83 -- .../CallbackWireObjectFactoryTestCase.java | 54 - .../java/injection/FieldInjectorTestCase.java | 48 - .../java/injection/JNDIObjectFactoryTestCase.java | 61 - .../java/injection/MethodEventInvokerTestCase.java | 72 -- .../java/injection/MethodInjectorTestCase.java | 79 -- .../java/injection/PojoObjectFactoryTestCase.java | 76 -- .../RequestContextObjectFactoryTestCase.java | 33 - .../injection/ResourceObjectFactoryTestCase.java | 89 -- .../injection/SingletonObjectFactoryTestCase.java | 33 - .../integration/AbstractConversationTestCase.java | 51 - .../ConversationIdleExpireTestCase.java.FIXME | 149 --- .../ConversationMaxAgeExpireTestCase.java.FIXME | 153 --- .../ConversationStartStopEndTestCase.java.FIXME | 147 --- .../ReferenceInjectionTestCase.java.FIXME | 79 -- .../sca/implementation/java/mock/AsyncTarget.java | 31 - .../implementation/java/mock/BadContextPojo.java | 28 - .../sca/implementation/java/mock/BadNamePojo.java | 26 - .../implementation/java/mock/BasicInterface.java | 30 - .../java/mock/BasicInterfaceImpl.java | 66 - .../java/mock/CompositeScopeComponent.java | 31 - .../java/mock/CompositeScopeComponentImpl.java | 40 - .../mock/CompositeScopeDestroyOnlyComponent.java | 36 - .../mock/CompositeScopeInitDestroyComponent.java | 39 - .../java/mock/CompositeScopeInitOnlyComponent.java | 42 - .../java/mock/ConversationalScopeComponent.java | 29 - .../mock/ConversationalScopeComponentImpl.java | 29 - .../ConversationalScopeDestroyOnlyComponent.java | 37 - .../ConversationalScopeInitDestroyComponent.java | 38 - .../mock/ConversationalScopeInitOnlyComponent.java | 38 - .../java/mock/MockFactory.java.FIXME | 214 ---- .../java/mock/MockStaticInvoker.java | 94 -- .../java/mock/MockSyncInterceptor.java | 52 - .../implementation/java/mock/OrderException.java | 40 - .../java/mock/OrderedDependentPojo.java | 29 - .../java/mock/OrderedDependentPojoImpl.java | 36 - .../java/mock/OrderedEagerInitPojo.java | 60 - .../implementation/java/mock/OrderedInitPojo.java | 28 - .../java/mock/OrderedInitPojoImpl.java | 61 - .../sca/implementation/java/mock/OtherTarget.java | 31 - .../implementation/java/mock/OtherTargetImpl.java | 39 - .../java/mock/RequestScopeComponent.java | 30 - .../mock/RequestScopeDestroyOnlyComponent.java | 38 - .../mock/RequestScopeInitDestroyComponent.java | 38 - .../java/mock/RequestScopeInitOnlyComponent.java | 39 - .../java/mock/SessionScopeComponent.java | 30 - .../java/mock/SessionScopeComponentImpl.java | 30 - .../mock/SessionScopeInitDestroyComponent.java | 36 - .../java/mock/SessionScopeInitOnlyComponent.java | 37 - .../sca/implementation/java/mock/SimpleTarget.java | 30 - .../implementation/java/mock/SimpleTargetImpl.java | 41 - .../sca/implementation/java/mock/Source.java | 37 - .../sca/implementation/java/mock/SourceImpl.java | 63 - .../java/mock/StatelessComponent.java | 30 - .../java/mock/StatelessComponentImpl.java | 27 - .../sca/implementation/java/mock/Target.java | 32 - .../sca/implementation/java/mock/TargetImpl.java | 38 - .../java/monitor/ExceptionFormatterTestCase.java | 57 - .../java/monitor/JavaLoggingTestCase.java | 152 --- .../sca/implementation/java/util/Bean1.java | 45 - .../sca/implementation/java/util/Bean2.java | 47 - .../java/util/JavaIntrospectionHelperTestCase.java | 182 --- .../sca/implementation/java/util/SuperBean.java | 48 - .../modules/implementation-java-xml/.checkstyle | 24 - .../modules/implementation-java-xml/.pmd | 20 - .../modules/implementation-java-xml/.ruleset | 190 --- .../modules/implementation-java-xml/DISCLAIMER | 8 - .../modules/implementation-java-xml/LICENSE | 205 --- .../modules/implementation-java-xml/NOTICE | 6 - .../modules/implementation-java-xml/pom.xml | 57 - .../apache/tuscany/api/annotation/LogLevel.java | 41 - .../org/apache/tuscany/api/annotation/Monitor.java | 34 - .../apache/tuscany/api/annotation/Resource.java | 49 - ...DefaultJavaClassIntrospectorExtensionPoint.java | 48 - .../introspect/DuplicatePropertyException.java | 32 - .../ExtensibleJavaClassIntrospector.java | 126 -- .../java/introspect/IllegalPropertyException.java | 38 - .../java/introspect/IntrospectionException.java | 60 - .../java/introspect/JavaClassIntrospector.java | 42 - .../JavaClassIntrospectorExtensionPoint.java | 49 - .../java/introspect/JavaClassVisitor.java | 125 -- .../introspect/impl/AbstractPropertyProcessor.java | 167 --- .../impl/AllowsPassByReferenceProcessor.java | 50 - .../impl/AmbiguousConstructorException.java | 40 - .../java/introspect/impl/BaseJavaClassVisitor.java | 64 - .../java/introspect/impl/ConstructorProcessor.java | 81 -- .../java/introspect/impl/ContextProcessor.java | 80 -- .../introspect/impl/ConversationProcessor.java | 136 -- .../java/introspect/impl/DestroyProcessor.java | 57 - .../impl/DuplicateConstructorException.java | 41 - .../impl/DuplicateDestructorException.java | 35 - .../introspect/impl/DuplicateInitException.java | 35 - .../impl/DuplicateReferenceException.java | 35 - .../impl/DuplicateResourceException.java | 36 - .../java/introspect/impl/EagerInitProcessor.java | 56 - .../introspect/impl/HeuristicPojoProcessor.java | 658 ---------- .../impl/IllegalCallbackReferenceException.java | 40 - .../introspect/impl/IllegalContextException.java | 40 - .../impl/IllegalDestructorException.java | 40 - .../java/introspect/impl/IllegalInitException.java | 40 - .../introspect/impl/IllegalReferenceException.java | 40 - .../introspect/impl/IllegalResourceException.java | 40 - .../impl/IllegalServiceDefinitionException.java | 35 - .../java/introspect/impl/InitProcessor.java | 57 - .../impl/InvalidConstructorException.java | 36 - .../impl/InvalidConversationalImplementation.java | 39 - .../introspect/impl/InvalidPropertyException.java | 35 - .../introspect/impl/InvalidReferenceException.java | 42 - .../introspect/impl/InvalidResourceException.java | 40 - .../java/introspect/impl/InvalidServiceType.java | 48 - .../introspect/impl/JavaIntrospectionHelper.java | 448 ------- .../introspect/impl/NoConstructorException.java | 37 - .../java/introspect/impl/PolicyProcessor.java | 164 --- .../java/introspect/impl/PropertyProcessor.java | 44 - .../java/introspect/impl/ReferenceProcessor.java | 171 --- .../java/introspect/impl/ResourceProcessor.java | 134 -- .../java/introspect/impl/ScopeProcessor.java | 60 - .../java/introspect/impl/ServiceProcessor.java | 159 --- .../impl/ServiceTypeNotFoundException.java | 35 - .../impl/UnknownContextTypeException.java | 33 - .../java/xml/JavaImplementationConstants.java | 31 - .../java/xml/JavaImplementationProcessor.java | 188 --- .../src/test/java/calculator/AddService.java | 25 - .../src/test/java/calculator/AddServiceImpl.java | 35 - .../test/java/calculator/CalculatorService.java | 34 - .../java/calculator/CalculatorServiceImpl.java | 71 -- .../src/test/java/calculator/DivideService.java | 25 - .../test/java/calculator/DivideServiceImpl.java | 33 - .../src/test/java/calculator/MultiplyService.java | 25 - .../test/java/calculator/MultiplyServiceImpl.java | 33 - .../src/test/java/calculator/SubtractService.java | 25 - .../test/java/calculator/SubtractServiceImpl.java | 33 - .../DefaultJavaClassIntrospectorTestCase.java | 95 -- .../introspect/impl/AbstractProcessorTest.java | 80 -- .../impl/AbstractPropertyProcessorTestCase.java | 168 --- .../AllowsPassByReferenceProcessorTestCase.java | 70 - .../impl/ConstructorProcessorTestCase.java | 197 --- .../impl/ConstructorPropertyTestCase.java | 158 --- .../impl/ConstructorReferenceTestCase.java | 166 --- .../impl/ConstructorResourceTestCase.java | 153 --- .../introspect/impl/ContextProcessorTestCase.java | 188 --- .../impl/ConversationProcessorTestCase.java | 144 --- .../introspect/impl/ConvertTimeMillisTestCase.java | 116 -- .../introspect/impl/DestroyProcessorTestCase.java | 99 -- .../impl/EagerInitProcessorTestCase.java | 59 - .../impl/HeuristicAndPropertyTestCase.java | 75 -- .../impl/HeuristicConstructorTestCase.java | 315 ----- .../impl/HeuristicPojoProcessorTestCase.java | 411 ------ .../HeutisticExtensibleConstructorTestCase.java | 153 --- .../introspect/impl/InitProcessorTestCase.java | 99 -- .../java/introspect/impl/ModelHelper.java | 99 -- .../introspect/impl/PolicyProcessorTestCase.java | 406 ------ .../introspect/impl/PropertyProcessorTestCase.java | 213 ---- .../impl/ReferenceProcessorTestCase.java | 224 ---- .../introspect/impl/ResourceProcessorTestCase.java | 118 -- .../introspect/impl/ScopeProcessorTestCase.java | 116 -- .../introspect/impl/ServiceCallbackTestCase.java | 169 --- .../introspect/impl/ServiceProcessorTestCase.java | 152 --- .../sca/implementation/java/xml/ReadTestCase.java | 120 -- .../implementation/java/xml/TestModelResolver.java | 88 -- .../sca/implementation/java/xml/WriteTestCase.java | 97 -- .../implementation/java/xml/Calculator.composite | 53 - .../modules/implementation-java/.checkstyle | 24 - .../sca-java-0.90/modules/implementation-java/.pmd | 21 - .../modules/implementation-java/.ruleset | 190 --- .../modules/implementation-java/DISCLAIMER | 8 - .../modules/implementation-java/LICENSE | 205 --- .../modules/implementation-java/NOTICE | 6 - .../modules/implementation-java/pom.xml | 38 - .../java/BaseJavaImplementation.java | 58 - .../java/DefaultJavaImplementationFactory.java | 31 - .../implementation/java/JavaImplementation.java | 186 --- .../java/JavaImplementationFactory.java | 35 - .../java/impl/BaseJavaImplementationImpl.java | 84 -- .../java/impl/JavaConstructorImpl.java | 53 - .../implementation/java/impl/JavaElementImpl.java | 223 ---- .../java/impl/JavaImplementationFactoryImpl.java | 34 - .../java/impl/JavaImplementationImpl.java | 156 --- .../java/impl/JavaParameterImpl.java | 35 - .../implementation/java/impl/JavaResourceImpl.java | 85 -- .../implementation/java/impl/JavaScopeImpl.java | 63 - .../modules/implementation-script/DISCLAIMER | 8 - .../modules/implementation-script/LICENSE | 251 ---- .../modules/implementation-script/NOTICE | 17 - .../modules/implementation-script/pom.xml | 131 -- .../implementation/spi/AbstractImplementation.java | 101 -- .../spi/AbstractStAXArtifactProcessor.java | 78 -- .../spi/PropertyValueObjectFactory.java | 226 ---- .../tuscany/implementation/spi/ResourceHelper.java | 72 -- .../script/ScriptArtifactProcessor.java | 95 -- .../script/ScriptImplementation.java | 55 - .../script/ScriptImplementationProvider.java | 119 -- .../ScriptImplementationProviderFactory.java | 44 - .../sca/implementation/script/ScriptInvoker.java | 67 - .../script/ScriptModuleActivator.java | 62 - .../script/engines/TuscanyJRubyScriptEngine.java | 445 ------- .../org.apache.tuscany.sca.core.ModuleActivator | 18 - .../script/itests/AbstractSCATestCase.java | 48 - .../helloworld/AbstractHelloWorldTestCase.java | 34 - .../helloworld/GroovyHelloWorldTestCase.java | 25 - .../script/itests/helloworld/HelloWorld.java | 26 - .../script/itests/helloworld/HelloWorldProxy.java | 33 - .../itests/helloworld/JRubyHelloWorldTestCase.java | 25 - .../helloworld/JavaScriptHelloWorldTestCase.java | 25 - .../helloworld/JythonHelloWorldTestCase.java | 25 - .../properties/AbstractHelloWorldTestCase.java | 34 - .../properties/GroovyHelloWorldTestCase.java | 25 - .../script/itests/properties/HelloWorld.java | 26 - .../script/itests/properties/HelloWorldProxy.java | 33 - .../itests/properties/JRubyHelloWorldTestCase.java | 24 - .../properties/JavaScriptHelloWorldTestCase.java | 25 - .../properties/JythonHelloWorldTestCase.java | 25 - .../itests/references/GroovyReferenceTestCase.java | 25 - .../script/itests/references/HelloWorldTarget.java | 30 - .../itests/references/JRubyReferenceTestCase.java | 25 - .../references/JavaScriptReferenceTestCase.java | 25 - .../itests/references/JythonReferenceTestCase.java | 25 - .../itests/helloworld/GroovyHelloWorld.composite | 32 - .../itests/helloworld/JRubyHelloWorld.composite | 32 - .../helloworld/JavaScriptHelloWorld.composite | 32 - .../itests/helloworld/JythonHelloWorld.composite | 32 - .../itests/helloworld/helloworld.componentType | 30 - .../script/itests/helloworld/helloworld.groovy | 22 - .../script/itests/helloworld/helloworld.js | 23 - .../script/itests/helloworld/helloworld.py | 20 - .../script/itests/helloworld/helloworld.rb | 21 - .../itests/properties/GroovyHelloWorld.composite | 32 - .../itests/properties/JRubyHelloWorld.composite | 32 - .../properties/JavaScriptHelloWorld.composite | 32 - .../itests/properties/JythonHelloWorld.composite | 32 - .../itests/properties/helloworld.componentType | 32 - .../script/itests/properties/helloworld.groovy | 22 - .../script/itests/properties/helloworld.js | 23 - .../script/itests/properties/helloworld.py | 20 - .../script/itests/properties/helloworld.rb | 21 - .../itests/references/GroovyReference.composite | 37 - .../itests/references/JRubyReference.composite | 37 - .../references/JavaScriptReference.composite | 37 - .../itests/references/JythonReference.composite | 37 - .../itests/references/reference.componentType | 31 - .../script/itests/references/reference.groovy | 22 - .../script/itests/references/reference.js | 22 - .../script/itests/references/reference.py | 20 - .../script/itests/references/reference.rb | 21 - .../modules/interface-java-runtime/DISCLAIMER | 8 - .../modules/interface-java-runtime/LICENSE | 205 --- .../modules/interface-java-runtime/NOTICE | 6 - .../modules/interface-java-runtime/pom.xml | 43 - .../JavaInterfaceRuntimeModuleActivator.java | 63 - .../org.apache.tuscany.sca.core.ModuleActivator | 18 - .../modules/interface-java-xml/.checkstyle | 24 - .../sca-java-0.90/modules/interface-java-xml/.pmd | 20 - .../modules/interface-java-xml/.ruleset | 190 --- .../modules/interface-java-xml/DISCLAIMER | 8 - .../modules/interface-java-xml/LICENSE | 205 --- .../modules/interface-java-xml/NOTICE | 6 - .../modules/interface-java-xml/pom.xml | 56 - ...ultJavaInterfaceIntrospectorExtensionPoint.java | 47 - .../ExtensibleJavaInterfaceIntrospector.java | 147 --- .../java/introspect/JavaInterfaceIntrospector.java | 39 - .../JavaInterfaceIntrospectorExtensionPoint.java | 50 - .../java/introspect/JavaInterfaceVisitor.java | 39 - .../sca/interfacedef/java/xml/JavaConstants.java | 32 - .../java/xml/JavaInterfaceProcessor.java | 157 --- .../impl/ConversationalIntrospectionTestCase.java | 103 -- ...JavaInterfaceProcessorRegistryImplTestCase.java | 102 -- .../sca/interfacedef/java/xml/ReadTestCase.java | 126 -- .../sca/interfacedef/java/xml/WriteTestCase.java | 117 -- .../sca/interfacedef/java/xml/Calculator.composite | 53 - .../java/xml/CalculatorComponent.constrainingType | 34 - .../java/xml/CalculatorImpl.componentType | 31 - .../modules/interface-java/.checkstyle | 24 - branches/sca-java-0.90/modules/interface-java/.pmd | 20 - .../sca-java-0.90/modules/interface-java/.ruleset | 190 --- .../modules/interface-java/DISCLAIMER | 8 - .../sca-java-0.90/modules/interface-java/LICENSE | 205 --- .../sca-java-0.90/modules/interface-java/NOTICE | 6 - .../sca-java-0.90/modules/interface-java/pom.xml | 39 - .../java/DefaultJavaInterfaceFactory.java | 31 - .../sca/interfacedef/java/JavaInterface.java | 71 -- .../interfacedef/java/JavaInterfaceContract.java | 32 - .../interfacedef/java/JavaInterfaceFactory.java | 42 - .../java/impl/JavaInterfaceContractImpl.java | 34 - .../java/impl/JavaInterfaceFactoryImpl.java | 38 - .../interfacedef/java/impl/JavaInterfaceImpl.java | 94 -- .../interfacedef/java/impl/JavaInterfaceUtil.java | 129 -- .../java/impl/JavaInterfaceUtilTestCase.java | 114 -- .../modules/interface-wsdl-runtime/DISCLAIMER | 8 - .../modules/interface-wsdl-runtime/LICENSE | 205 --- .../modules/interface-wsdl-runtime/NOTICE | 6 - .../modules/interface-wsdl-runtime/pom.xml | 43 - .../WSDLInterfaceRuntimeModuleActivator.java | 59 - .../org.apache.tuscany.sca.core.ModuleActivator | 18 - .../modules/interface-wsdl-xml/.checkstyle | 24 - .../sca-java-0.90/modules/interface-wsdl-xml/.pmd | 20 - .../modules/interface-wsdl-xml/.ruleset | 190 --- .../modules/interface-wsdl-xml/DISCLAIMER | 8 - .../modules/interface-wsdl-xml/LICENSE | 205 --- .../modules/interface-wsdl-xml/NOTICE | 6 - .../modules/interface-wsdl-xml/pom.xml | 50 - .../DefaultWSDLInterfaceIntrospector.java | 66 - .../wsdl/introspect/InvalidWSDLException.java | 35 - .../wsdl/introspect/WSDLInterfaceIntrospector.java | 43 - .../wsdl/introspect/WSDLOperation.java | 556 -------- .../sca/interfacedef/wsdl/xml/WSDLConstants.java | 35 - .../wsdl/xml/WSDLDocumentProcessor.java | 190 --- .../wsdl/xml/WSDLInterfaceProcessor.java | 195 --- .../wsdl/xml/XSDDocumentProcessor.java | 103 -- .../DefaultWSDLInterfaceIntrospectorTestCase.java | 85 -- .../wsdl/introspect/TestModelResolver.java | 63 - .../wsdl/introspect/WSDLOperationTestCase.java | 124 -- .../introspect/WrapperStyleOperationTestCase.java | 81 -- .../sca/interfacedef/wsdl/xml/ReadTestCase.java | 118 -- .../sca/interfacedef/wsdl/xml/WSDLTestCase.java | 67 - .../sca/interfacedef/wsdl/xml/WriteTestCase.java | 108 -- .../sca/interfacedef/wsdl/xml/Calculator.composite | 55 - .../wsdl/xml/CalculatorComponent.constrainingType | 36 - .../wsdl/xml/CalculatorImpl.componentType | 33 - .../tuscany/sca/interfacedef/wsdl/xml/example.wsdl | 26 - .../interfacedef/wsdl/xml/invalid-stockquote.wsdl | 58 - .../tuscany/sca/interfacedef/wsdl/xml/ipo.xsd | 136 -- .../sca/interfacedef/wsdl/xml/stockquote.wsdl | 58 - .../tuscany/sca/interfacedef/wsdl/xml/test1.wsdl | 45 - .../tuscany/sca/interfacedef/wsdl/xml/test1.xsd | 33 - .../tuscany/sca/interfacedef/wsdl/xml/test2.wsdl | 63 - .../wsdl/xml/unwrapped-stockquote.wsdl | 76 -- .../modules/interface-wsdl/.checkstyle | 24 - branches/sca-java-0.90/modules/interface-wsdl/.pmd | 20 - .../sca-java-0.90/modules/interface-wsdl/.ruleset | 190 --- .../modules/interface-wsdl/DISCLAIMER | 8 - .../sca-java-0.90/modules/interface-wsdl/LICENSE | 205 --- .../sca-java-0.90/modules/interface-wsdl/NOTICE | 6 - .../sca-java-0.90/modules/interface-wsdl/pom.xml | 66 - .../sca/interfacedef/wsdl/DefaultWSDLFactory.java | 30 - .../sca/interfacedef/wsdl/WSDLDefinition.java | 78 -- .../tuscany/sca/interfacedef/wsdl/WSDLFactory.java | 56 - .../sca/interfacedef/wsdl/WSDLInterface.java | 66 - .../interfacedef/wsdl/WSDLInterfaceContract.java | 43 - .../sca/interfacedef/wsdl/XSDefinition.java | 69 - .../interfacedef/wsdl/impl/WSDLDefinitionImpl.java | 99 -- .../interfacedef/wsdl/impl/WSDLFactoryImpl.java | 50 - .../wsdl/impl/WSDLInterfaceContractImpl.java | 42 - .../interfacedef/wsdl/impl/WSDLInterfaceImpl.java | 93 -- .../interfacedef/wsdl/impl/XSDefinitionImpl.java | 92 -- .../sca-java-0.90/modules/interface/.checkstyle | 24 - branches/sca-java-0.90/modules/interface/.pmd | 20 - branches/sca-java-0.90/modules/interface/.ruleset | 190 --- .../sca-java-0.90/modules/interface/DISCLAIMER | 8 - branches/sca-java-0.90/modules/interface/LICENSE | 205 --- branches/sca-java-0.90/modules/interface/NOTICE | 6 - branches/sca-java-0.90/modules/interface/pom.xml | 31 - .../sca/interfacedef/ConversationSequence.java | 24 - .../apache/tuscany/sca/interfacedef/DataType.java | 89 -- .../IncompatibleInterfaceContractException.java | 69 - .../apache/tuscany/sca/interfacedef/Interface.java | 86 -- .../sca/interfacedef/InterfaceContract.java | 66 - .../sca/interfacedef/InterfaceContractMapper.java | 115 -- .../sca/interfacedef/InvalidCallbackException.java | 34 - .../interfacedef/InvalidInterfaceException.java | 40 - .../interfacedef/InvalidOperationException.java | 42 - .../apache/tuscany/sca/interfacedef/Operation.java | 160 --- .../interfacedef/OverloadedOperationException.java | 42 - .../sca/interfacedef/impl/DataTypeImpl.java | 188 --- .../interfacedef/impl/InterfaceContractImpl.java | 51 - .../impl/InterfaceContractMapperImpl.java | 264 ---- .../sca/interfacedef/impl/InterfaceImpl.java | 160 --- .../sca/interfacedef/impl/OperationImpl.java | 285 ----- .../tuscany/sca/interfacedef/util/ElementInfo.java | 60 - .../sca/interfacedef/util/FaultException.java | 82 -- .../sca/interfacedef/util/JavaXMLMapper.java | 115 -- .../tuscany/sca/interfacedef/util/TypeInfo.java | 72 -- .../tuscany/sca/interfacedef/util/WrapperInfo.java | 140 -- .../tuscany/sca/interfacedef/util/XMLType.java | 124 -- .../impl/ContractCompatibilityTestCase.java | 366 ------ .../sca-java-0.90/modules/java2wsdl/DISCLAIMER | 8 - branches/sca-java-0.90/modules/java2wsdl/LICENSE | 205 --- branches/sca-java-0.90/modules/java2wsdl/NOTICE | 6 - branches/sca-java-0.90/modules/java2wsdl/pom.xml | 198 --- .../java2wsdl/generate/GenerationParameters.java | 435 ------- .../tools/java2wsdl/generate/Java2WSDL.java | 81 -- .../java2wsdl/generate/Java2WSDLGenerator.java | 46 - .../generate/Java2WSDLGeneratorFactory.java | 89 -- .../java2wsdl/generate/Java2WSDLGeneratorImpl.java | 235 ---- .../tools/java2wsdl/generate/SchemaBuilder.java | 524 -------- .../java2wsdl/generate/TuscanyJava2OMBuilder.java | 521 -------- .../generate/TuscanyJava2WSDLBuilder.java | 81 -- .../generate/TuscanyJava2WSDLConstants.java | 51 - .../generate/TuscanyJava2WSDLOptionsValidator.java | 74 -- .../java2wsdl/generate/TuscanySchemaGenerator.java | 410 ------ .../tools/java2wsdl/generate/TuscanyTypeTable.java | 225 ---- .../generate/TuscanyWSDLTypesGenerator.java | 373 ------ .../tools/java2wsdl/generate/WSDLGenEvent.java | 38 - .../tools/java2wsdl/generate/WSDLGenListener.java | 39 - .../tuscany/tools/java2wsdl/util/XMLNameUtil.java | 143 --- .../src/main/resources/META-INF/LICENSE.txt | 202 --- .../java2wsdl/src/main/resources/META-INF/NOTICE | 14 - .../src/main/resources/META-INF/README.txt | 35 - .../main/resources/RemotableInterfaceTemplate.xsl | 116 -- .../tools/java2wsdl/generate/CustomerValue.java | 43 - .../java2wsdl/generate/CustomerWithAccount.java | 49 - .../generate/TuscanyJava2WSDLTestCase.java | 108 -- .../tools/java2wsdl/generate/account/Account.java | 53 - .../java2wsdl/generate/customer/Customer.java | 30 - .../java2wsdl/generate/extra/GoldCustomer.java | 36 - .../java/org/soapinterop/CreditScoreDocLit.java | 25 - .../src/test/resources/AccountService.wsdl | 242 ---- .../src/test/resources/CreditScoreDocLit.wsdl | 76 -- .../java2wsdl/src/test/resources/helloworld.wsdl | 121 -- .../java2wsdl/src/test/resources/interopdoc.wsdl | 180 --- .../java2wsdl/src/test/resources/sequences.xsd | 100 -- .../modules/maven-java2wsdl/DISCLAIMER | 8 - .../sca-java-0.90/modules/maven-java2wsdl/LICENSE | 205 --- .../sca-java-0.90/modules/maven-java2wsdl/NOTICE | 6 - .../sca-java-0.90/modules/maven-java2wsdl/pom.xml | 45 - .../java2wsdl/plugin/Java2WSDLGeneratorMojo.java | 153 --- .../modules/maven-wsdl2java/DISCLAIMER | 8 - .../sca-java-0.90/modules/maven-wsdl2java/LICENSE | 205 --- .../sca-java-0.90/modules/maven-wsdl2java/NOTICE | 6 - .../sca-java-0.90/modules/maven-wsdl2java/pom.xml | 45 - .../wsdl2java/plugin/WSDL2JavaGeneratorMojo.java | 152 --- .../tools/wsdl2java/plugin/WSDLFileOption.java | 92 -- branches/sca-java-0.90/modules/policy/DISCLAIMER | 8 - branches/sca-java-0.90/modules/policy/LICENSE | 205 --- branches/sca-java-0.90/modules/policy/NOTICE | 6 - branches/sca-java-0.90/modules/policy/pom.xml | 38 - .../tuscany/sca/policy/DefaultPolicyFactory.java | 30 - .../java/org/apache/tuscany/sca/policy/Intent.java | 104 -- .../tuscany/sca/policy/IntentAttachPoint.java | 37 - .../org/apache/tuscany/sca/policy/IntentMap.java | 87 -- .../apache/tuscany/sca/policy/PolicyFactory.java | 47 - .../org/apache/tuscany/sca/policy/PolicySet.java | 100 -- .../tuscany/sca/policy/PolicySetAttachPoint.java | 37 - .../apache/tuscany/sca/policy/impl/IntentImpl.java | 86 -- .../tuscany/sca/policy/impl/IntentMapImpl.java | 73 -- .../tuscany/sca/policy/impl/PolicyFactoryImpl.java | 45 - .../tuscany/sca/policy/impl/PolicySetImpl.java | 83 -- .../tuscany/sca/policy/PolicyFactoryTestCase.java | 53 - branches/sca-java-0.90/modules/pom.xml | 103 -- branches/sca-java-0.90/modules/sca-api/DISCLAIMER | 8 - branches/sca-java-0.90/modules/sca-api/LICENSE | 205 --- branches/sca-java-0.90/modules/sca-api/NOTICE | 6 - branches/sca-java-0.90/modules/sca-api/pom.xml | 59 - .../main/java/org/osoa/sca/CallableReference.java | 65 - .../main/java/org/osoa/sca/ComponentContext.java | 109 -- .../src/main/java/org/osoa/sca/Constants.java | 34 - .../src/main/java/org/osoa/sca/Conversation.java | 41 - .../org/osoa/sca/ConversationEndedException.java | 67 - .../osoa/sca/NoRegisteredCallbackException.java | 68 - .../src/main/java/org/osoa/sca/RequestContext.java | 66 - .../main/java/org/osoa/sca/ServiceReference.java | 65 - .../java/org/osoa/sca/ServiceRuntimeException.java | 69 - .../org/osoa/sca/ServiceUnavailableException.java | 65 - .../sca/annotations/AllowsPassByReference.java | 39 - .../org/osoa/sca/annotations/Authentication.java | 69 - .../java/org/osoa/sca/annotations/Callback.java | 50 - .../org/osoa/sca/annotations/ComponentName.java | 36 - .../org/osoa/sca/annotations/Confidentiality.java | 69 - .../java/org/osoa/sca/annotations/Constructor.java | 36 - .../java/org/osoa/sca/annotations/Context.java | 39 - .../sca/annotations/ConversationAttributes.java | 57 - .../org/osoa/sca/annotations/ConversationID.java | 36 - .../org/osoa/sca/annotations/Conversational.java | 38 - .../java/org/osoa/sca/annotations/Destroy.java | 36 - .../java/org/osoa/sca/annotations/EagerInit.java | 36 - .../org/osoa/sca/annotations/EndsConversation.java | 35 - .../main/java/org/osoa/sca/annotations/Init.java | 37 - .../java/org/osoa/sca/annotations/Integrity.java | 69 - .../main/java/org/osoa/sca/annotations/Intent.java | 59 - .../main/java/org/osoa/sca/annotations/OneWay.java | 36 - .../java/org/osoa/sca/annotations/PolicySets.java | 46 - .../java/org/osoa/sca/annotations/Property.java | 52 - .../java/org/osoa/sca/annotations/Qualifier.java | 36 - .../java/org/osoa/sca/annotations/Reference.java | 51 - .../java/org/osoa/sca/annotations/Remotable.java | 37 - .../java/org/osoa/sca/annotations/Requires.java | 57 - .../main/java/org/osoa/sca/annotations/Scope.java | 49 - .../java/org/osoa/sca/annotations/Service.java | 48 - .../sca-java-0.90/modules/wsdl2java/DISCLAIMER | 8 - branches/sca-java-0.90/modules/wsdl2java/LICENSE | 205 --- branches/sca-java-0.90/modules/wsdl2java/NOTICE | 6 - branches/sca-java-0.90/modules/wsdl2java/pom.xml | 198 --- .../wsdl2java/generate/JavaInterfaceEmitter.java | 224 ---- .../wsdl2java/generate/JavaInterfaceGenerator.java | 235 ---- .../generate/RemotableInterfaceWritter.java | 53 - .../generate/SDODataBindingCodegenExtension.java | 62 - .../generate/SDODataBindingTypeMappingEntry.java | 51 - .../wsdl2java/generate/WSDL2JavaGenerator.java | 349 ----- .../tuscany/tools/wsdl2java/util/XMLNameUtil.java | 143 --- .../src/main/resources/META-INF/LICENSE.txt | 202 --- .../wsdl2java/src/main/resources/META-INF/NOTICE | 14 - .../src/main/resources/META-INF/README.txt | 35 - .../main/resources/RemotableInterfaceTemplate.xsl | 116 -- .../generate/WSDL2JavaGeneratorTestCase.java | 44 - .../java/org/soapinterop/CreditScoreDocLit.java | 25 - .../src/test/resources/AccountService.wsdl | 242 ---- .../src/test/resources/CreditScoreDocLit.wsdl | 76 -- .../wsdl2java/src/test/resources/helloworld.wsdl | 121 -- .../wsdl2java/src/test/resources/interopdoc.wsdl | 180 --- .../wsdl2java/src/test/resources/sequences.xsd | 100 -- 1472 files changed, 122423 deletions(-) delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/LICENSE delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/NOTICE delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/pom.xml delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/AssemblyBuilder.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentBuilder.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentPropertyBuilder.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentReferenceBuilder.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentServiceBuilder.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/CompositeBuilder.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/AssemblyBuilderImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentBuilderImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentPropertyBuilderImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentReferenceBuilderImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentServiceBuilderImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/CompositeBuilderImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountDataService.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountDataServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountService.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/BigBankBuilder.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/BigBankBuilderTestCase.java delete mode 100644 branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/StockQuoteService.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/.pmd delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/.ruleset delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/LICENSE delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/NOTICE delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/pom.xml delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseArtifactProcessor.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeDocumentProcessor.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeProcessor.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeDocumentProcessor.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeProcessor.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/XAttr.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadAllTestCase.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadDocumentTestCase.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadTestCase.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolveTestCase.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/StAXPerfTest.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestModelResolver.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WireTestCase.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WriteAllTestCase.java delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Calculator.composite delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/CalculatorComponent.constrainingType delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/CalculatorImpl.componentType delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllCalculator.composite delete mode 100644 branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllDivide.composite delete mode 100644 branches/sca-java-0.90/modules/assembly/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/assembly/.pmd delete mode 100644 branches/sca-java-0.90/modules/assembly/.ruleset delete mode 100644 branches/sca-java-0.90/modules/assembly/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/assembly/LICENSE delete mode 100644 branches/sca-java-0.90/modules/assembly/NOTICE delete mode 100644 branches/sca-java-0.90/modules/assembly/pom.xml delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractContract.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractProperty.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractReference.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractService.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Base.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Binding.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Component.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentProperty.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentService.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentType.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeReference.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeService.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ConstrainingType.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultAssemblyFactory.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultSCABindingFactory.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Implementation.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Multiplicity.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Property.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Visitable.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Visitor.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilder.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderException.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderMonitor.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/Problem.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ProblemImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyUtil.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ReferenceUtil.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractPropertyImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractReferenceImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BaseImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentPropertyImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentTypeImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeReferenceImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConstrainingTypeImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ContractImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/PropertyImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingFactoryImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/util/PrintUtil.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/AssemblyFactoryTestCase.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestBinding.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestImplementation.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestInterface.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestInterfaceContract.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestOperation.java delete mode 100644 branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderTestCase.java delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/LICENSE delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/NOTICE delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/pom.xml delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/DefaultJSONRPCBindingFactory.java delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCBinding.java delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCBindingFactory.java delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/impl/JSONRPCBindingImpl.java delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/impl/JSONRPCBindingProcessor.java delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/module/JSONRPCModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingInvoker.java delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingProviderFactory.java delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCReferenceBindingProvider.java delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceBindingProvider.java delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/server/JSONRPCEntryPointServlet.java delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/server/JSONRPCScriptServlet.java delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/util/JavaToSmd.java delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/main/resources/JSONRPCBinding.composite delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/main/resources/org/apache/tuscany/sca/binding/jsonrpc/server/jsonrpc.js delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/Echo.java delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/EchoComponentImpl.java delete mode 100644 branches/sca-java-0.90/modules/binding-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/.ruleset delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/LICENSE delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/NOTICE delete mode 100755 branches/sca-java-0.90/modules/binding-rmi/pom.xml delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/DefaultRMIBindingFactory.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/NoRemoteMethodException.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/NoRemoteServiceException.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingConstants.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingFactory.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingImpl.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingInvoker.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingProvider.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingProviderFactory.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIRuntimeException.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/xml/RMIBindingProcessor.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldImpl.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiImpl.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiService.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldService.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/NoRemoteMethodExceptionTestCase.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/NoRemoteServiceExceptionTestCase.java delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/test/resources/HelloWorldImpl.componentType delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/test/resources/HelloWorldRmiImpl.componentType delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/test/resources/META-INF/LICENSE.txt delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/test/resources/META-INF/NOTICE delete mode 100644 branches/sca-java-0.90/modules/binding-rmi/src/test/resources/RMIBindingTest.composite delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/LICENSE delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/NOTICE delete mode 100755 branches/sca-java-0.90/modules/binding-ws-axis2/pom.xml delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/assembly/axis2.xml delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2AsyncBindingInvoker.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2BindingInvoker.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2BindingProviderFactory.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2CallbackInvocationHandler.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2OneWayBindingInvoker.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceBindingProvider.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceCallback.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceCallbackTargetInvoker.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceBindingProvider.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceCallbackTargetInvoker.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceInMessageReceiver.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceInOutAsyncMessageReceiver.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceInOutSyncMessageReceiver.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceServlet.java delete mode 100755 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/TuscanyAxisConfigurator.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/TuscanyDispatcher.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/TuscanyListingAgent.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100755 branches/sca-java-0.90/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/axis2/engine/config/axis2.xml delete mode 100755 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceTestCase.java delete mode 100755 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceTestCase.java delete mode 100755 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Greeter.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/GreetingCallback.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorld.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldComponent.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldMultiService.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOM.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOM2.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMComponent.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMService.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMTestCase.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldService.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldTestCaseFIXME.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/QuestionMarkWSDLTestCaseFIXME.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultMultiServiceTestCase.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultSingleServiceTestCase.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLExplicitURITestCase.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLRelativeURITestCase.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/HelloWorld.composite delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultMultiService.composite delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultSingleService.composite delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLExplicitURI.composite delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLRelativeURI.composite delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/helloworld-om-relative-uri.wsdl delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/helloworld-om-uri.wsdl delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/helloworld-om.composite delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/helloworld-om.wsdl delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/helloworld.wsdl delete mode 100644 branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/questionmark-wsdl.composite delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/.pmd delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/.ruleset delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/LICENSE delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/NOTICE delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/pom.xml delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceConstants.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/ReadTestCase.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/WriteTestCase.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator.composite delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/CalculatorImpl.componentType delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/example.wsdl delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/invalid-stockquote.wsdl delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/ipo.xsd delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/stockquote.wsdl delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.wsdl delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.xsd delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test2.wsdl delete mode 100644 branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/unwrapped-stockquote.wsdl delete mode 100644 branches/sca-java-0.90/modules/binding-ws/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/binding-ws/.pmd delete mode 100644 branches/sca-java-0.90/modules/binding-ws/.ruleset delete mode 100644 branches/sca-java-0.90/modules/binding-ws/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/binding-ws/LICENSE delete mode 100644 branches/sca-java-0.90/modules/binding-ws/NOTICE delete mode 100644 branches/sca-java-0.90/modules/binding-ws/pom.xml delete mode 100644 branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/DefaultWebServiceBindingFactory.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBinding.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBindingFactory.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingFactoryImpl.java delete mode 100644 branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.java delete mode 100644 branches/sca-java-0.90/modules/commonj-api/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/commonj-api/LICENSE delete mode 100644 branches/sca-java-0.90/modules/commonj-api/NOTICE delete mode 100644 branches/sca-java-0.90/modules/commonj-api/pom.xml delete mode 100644 branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/CancelTimerListener.java delete mode 100644 branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/StopTimerListener.java delete mode 100644 branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/Timer.java delete mode 100644 branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/TimerListener.java delete mode 100644 branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/TimerManager.java delete mode 100644 branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/RemoteWorkItem.java delete mode 100644 branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/Work.java delete mode 100644 branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkCompletedException.java delete mode 100644 branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkEvent.java delete mode 100644 branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkException.java delete mode 100644 branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkItem.java delete mode 100644 branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkListener.java delete mode 100644 branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkManager.java delete mode 100644 branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkRejectedException.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/.pmd delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/.ruleset delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/LICENSE delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/NOTICE delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/pom.xml delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionExportImpl.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImportImpl.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/DeployedArtifactImpl.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/FolderContributionProcessor.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/InvalidFolderContributionException.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/InvalidFolderContributionURIException.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/JarContributionProcessor.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/resolver/impl/ModelResolverImpl.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ArtifactTypeDescriberImpl.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionMetadataLoaderImpl.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionRepositoryImpl.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/InvalidContributionMetadataException.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/InvalidContributionURIException.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/InvalidValueException.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/PackageTypeDescriberImpl.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/util/FileHelper.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/util/IOHelper.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/processor/FolderContributionPackageProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/processor/JarContributionPackageProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/resolver/ArtifactResolverTestCase.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/ContentTypeDescriberImplTestCase.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/ContributionMetadataLoaderTestCase.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/ContributionRepositoryTestCase.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/PackageTypeDescriberImplTestCase.java delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/test/resources/deployables/sample-calculator.jar delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/test/resources/repository/sample-calculator.jar delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/test/resources/test.composite delete mode 100644 branches/sca-java-0.90/modules/contribution-impl/src/test/resources/test.ext delete mode 100644 branches/sca-java-0.90/modules/contribution/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/contribution/.pmd delete mode 100644 branches/sca-java-0.90/modules/contribution/.ruleset delete mode 100644 branches/sca-java-0.90/modules/contribution/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/contribution/LICENSE delete mode 100644 branches/sca-java-0.90/modules/contribution/NOTICE delete mode 100644 branches/sca-java-0.90/modules/contribution/pom.xml delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Artifact.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContentType.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Contribution.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionExport.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionFactory.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionImport.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DeployedArtifact.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessor.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessorExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionPostProcessor.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionPostProcessorExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultArtifactProcessorExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultPackageProcessorExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensiblePackageProcessor.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXArtifactProcessor.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/PackageProcessor.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/PackageProcessorExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessor.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessorExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessor.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessorExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ModelResolver.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/AbstractContributionException.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionException.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionMetadataLoader.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionMetadataLoaderException.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionReadException.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionRepository.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionResolveException.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionRuntimeException.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionService.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionWireException.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionWriteException.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/InvalidConfigurationException.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/TypeDescriber.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/UnrecognizedElementException.java delete mode 100644 branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/UnsupportedContentTypeException.java delete mode 100644 branches/sca-java-0.90/modules/core-databinding/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/core-databinding/.pmd delete mode 100644 branches/sca-java-0.90/modules/core-databinding/.ruleset delete mode 100644 branches/sca-java-0.90/modules/core-databinding/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/core-databinding/LICENSE delete mode 100644 branches/sca-java-0.90/modules/core-databinding/NOTICE delete mode 100644 branches/sca-java-0.90/modules/core-databinding/pom.xml delete mode 100644 branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/module/DataBindingModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/processor/DataBindingJavaInterfaceProcessor.java delete mode 100644 branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/transformers/Exception2ExceptionTransformer.java delete mode 100644 branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/transformers/Input2InputTransformer.java delete mode 100644 branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/transformers/Output2OutputTransformer.java delete mode 100644 branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/wire/DataBindingRuntimeWireProcessor.java delete mode 100644 branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/wire/DataTransformationInteceptor.java delete mode 100644 branches/sca-java-0.90/modules/core-databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/core-databinding/src/test/java/org/apache/tuscany/core/databinding/processor/DataBindingJavaInterfaceProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/core-databinding/src/test/java/org/apache/tuscany/core/databinding/transformers/IDLTransformerTestCase.java.fixme delete mode 100644 branches/sca-java-0.90/modules/core-spi/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/core-spi/.pmd delete mode 100644 branches/sca-java-0.90/modules/core-spi/.ruleset delete mode 100644 branches/sca-java-0.90/modules/core-spi/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/core-spi/LICENSE delete mode 100644 branches/sca-java-0.90/modules/core-spi/NOTICE delete mode 100644 branches/sca-java-0.90/modules/core-spi/pom.xml delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/doc/Context Model.emx delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistry.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/DefaultModelFactoryExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ExtensionPointRegistry.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModelFactoryExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/Event.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/EventFilter.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/EventPublisher.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/RuntimeEventListener.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/TrueFilter.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Interceptor.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvocationChain.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Invoker.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Message.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/MessageFactory.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/management/ManagementService.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProvider.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProviderFactory.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactory.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactoryExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProvider.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProvider.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultWireProcessorExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReference.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponent.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessorExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/DuplicateRecordException.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/RecoveryListener.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/Store.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreException.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreExpirationEvent.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreMonitor.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreReadException.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreWriteException.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/NotificationListener.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkScheduler.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkSchedulerException.java delete mode 100644 branches/sca-java-0.90/modules/core-spi/src/test/resources/org/apache/tuscany/spi/util/stax/test.composite delete mode 100644 branches/sca-java-0.90/modules/core-spring/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/core-spring/LICENSE delete mode 100644 branches/sca-java-0.90/modules/core-spring/NOTICE delete mode 100644 branches/sca-java-0.90/modules/core-spring/pom.xml delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanAssemblyFactory.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanComponentImpl.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanReferenceImpl.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/context/ModelResolverImpl.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/context/SCADomainContext.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanBaseJavaImplementationImpl.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaImplementationFactory.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaImplementationImpl.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceContractImpl.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceFactory.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceImpl.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/AddService.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/AddServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/CalculatorClient.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/CalculatorService.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/CalculatorServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/DivideService.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/DivideServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/MultiplyService.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/MultiplyServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/NestedCalculatorClient.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/SubtractService.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/SubtractServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/java/org/apache/tuscany/sca/core/spring/CalculatorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/java/org/apache/tuscany/sca/core/spring/NestedCalculatorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/Calculator.composite delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/InnerCalculator.composite delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/InnerOperations.composite delete mode 100644 branches/sca-java-0.90/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/OuterCalculator.composite delete mode 100644 branches/sca-java-0.90/modules/core/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/core/.pmd delete mode 100644 branches/sca-java-0.90/modules/core/.ruleset delete mode 100644 branches/sca-java-0.90/modules/core/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/core/LICENSE delete mode 100644 branches/sca-java-0.90/modules/core/NOTICE delete mode 100644 branches/sca-java-0.90/modules/core/pom.xml delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/CallableReferenceImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/CallbackReferenceImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/ComponentContextImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/ComponentContextProvider.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/RequestContextImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/ServiceReferenceImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/BaseEventPublisher.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/ComponentStart.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/ComponentStop.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/ConversationEnd.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/ConversationStart.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/HttpSessionEnd.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/HttpSessionStart.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/RequestEnd.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/RequestStart.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AbstractInvocationHandler.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackInterfaceInterceptor.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackWireObjectFactory.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleWireProcessor.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/InvocationChainImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKCallbackInvocationHandler.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKProxyService.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/MessageFactoryImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/MessageImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NoMethodForOperationException.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyCreationException.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyFactory.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/WireObjectFactory.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/ActivationException.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/CompositeActivator.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/CompositeActivatorImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/EndpointReferenceImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeAssemblyFactory.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentReferenceImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeSCABindingProvider.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeSCABindingProviderFactory.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeWireImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainer.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/CompositeScopeContainer.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/CompositeScopeContainerFactory.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainer.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainerFactory.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/HttpSessionScopeContainer.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/HttpSessionScopeContainerFactory.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/RequestScopeContainer.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/RequestScopeContainerFactory.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeRegistryImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/StatelessScopeContainer.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/StatelessScopeContainerFactory.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/store/MemoryStore.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/util/IOHelper.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237Work.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManager.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEventImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/factory/ObjectCreationException.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/factory/ObjectFactory.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/factory/SingletonObjectFactory.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/AbstractLifecycle.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/CoreRuntimeException.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/InstanceWrapper.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/Lifecycle.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/PersistenceException.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/Scope.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeContainer.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeContainerFactory.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeIdentifier.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeNotFoundException.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeRegistry.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopedImplementationProvider.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopedRuntimeComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetDestructionException.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetInitializationException.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetInvocationException.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetInvokerCreationException.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetNotFoundException.java delete mode 100644 branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetResolutionException.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistryTestCase.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/event/BaseEventPublisherTestCase.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/event/EventTestCase.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/AsyncTarget.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BadContextPojo.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BadNamePojo.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BasicInterface.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BasicInterfaceImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeComponentImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeDestroyOnlyComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeInitDestroyComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeInitOnlyComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeComponentImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeDestroyOnlyComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeInitDestroyComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeInitOnlyComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderException.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedDependentPojo.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedDependentPojoImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedEagerInitPojo.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedInitPojo.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedInitPojoImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OtherTarget.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OtherTargetImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeDestroyOnlyComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeInitDestroyComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeInitOnlyComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeComponentImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeInitDestroyComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeInitOnlyComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SimpleTarget.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SimpleTargetImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/Source.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SourceImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/StatelessComponent.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/StatelessComponentImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/Target.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/TargetImpl.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainerTestCase.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/store/MemoryStoreTestCase.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/CallbackInterfaceInterceptorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/InvocationChainImplTestCase.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/NonBlockingInterceptorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/factory/AssertionTestCase.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/factory/SingletonObjectFactoryTestCase.java delete mode 100644 branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding-axiom/.ruleset delete mode 100644 branches/sca-java-0.90/modules/databinding-axiom/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/databinding-axiom/LICENSE delete mode 100644 branches/sca-java-0.90/modules/databinding-axiom/NOTICE delete mode 100755 branches/sca-java-0.90/modules/databinding-axiom/pom.xml delete mode 100644 branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java delete mode 100644 branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomExceptionHandler.java delete mode 100644 branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java delete mode 100644 branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Object.java delete mode 100755 branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2String.java delete mode 100755 branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2XMLStreamReader.java delete mode 100644 branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java delete mode 100644 branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Object2OMElement.java delete mode 100755 branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/String2OMElement.java delete mode 100755 branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/XMLStreamReader2OMElement.java delete mode 100644 branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/module/AxiomDataBindingModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/databinding-axiom/src/test/java/org/apache/tuscany/sca/databinding/axiom/AxiomExceptionHandlerTestCase.java delete mode 100755 branches/sca-java-0.90/modules/databinding-axiom/src/test/java/org/apache/tuscany/sca/databinding/axiom/OMElementTestCase.java delete mode 100755 branches/sca-java-0.90/modules/databinding-axiom/src/test/resources/ipo.xml delete mode 100755 branches/sca-java-0.90/modules/databinding-axiom/src/test/resources/ipo.xsd delete mode 100644 branches/sca-java-0.90/modules/databinding-axiom/src/test/resources/order.wsdl delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/.ruleset delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/LICENSE delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/NOTICE delete mode 100755 branches/sca-java-0.90/modules/databinding-jaxb/pom.xml delete mode 100755 branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2Node.java delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBinding.java delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBExceptionHandler.java delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandler.java delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXWSJavaInterfaceProcessor.java delete mode 100755 branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Reader2JAXB.java delete mode 100755 branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLStreamReader2JAXB.java delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/module/JAXBDataBindingModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBDataBindingTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBExceptionHandlerTestCase.java delete mode 100755 branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBWrapperHandlerTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault.java delete mode 100644 branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault_Exception.java delete mode 100755 branches/sca-java-0.90/modules/databinding-jaxb/src/test/resources/ipo.xsd delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/.ruleset delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/LICENSE delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/NOTICE delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/pom.xml delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/DataObject2OMElement.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/DataObjectSerializer.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/SDODataSource.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/XMLDocument2OMElement.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/module/SDOAxiomModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/DataObject2OMElementTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/SDOTransformerTestCaseBase.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/XMLDocument2OMElementTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/resources/ipo.xsd delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/resources/stock.xsd delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/.ruleset delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/LICENSE delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/NOTICE delete mode 100755 branches/sca-java-0.90/modules/databinding-sdo/pom.xml delete mode 100755 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2String.java delete mode 100755 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReader.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DuplicateHelperContextException.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextProcessor.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextRegistry.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextRegistryImpl.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDO.java delete mode 100755 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessor.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOExceptionHandler.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOSimpleTypeMapper.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandler.java delete mode 100755 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/String2DataObject.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2String.java delete mode 100755 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReader.java delete mode 100755 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2DataObject.java delete mode 100755 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2XMLDocument.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/api/HelperContext.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/module/SDODataBindingModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/test/java/com/example/stock/sdo/fault/InvalidSymbolFault_Exception.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2StringTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReaderTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/HelperContextProcessorTestCase.java delete mode 100755 branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDODataBindingTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOExceptionHandlerTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOTransformerTestCaseBase.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandlerTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/TestModelResolver.java delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReaderTestCase.java delete mode 100755 branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/ipo.xsd delete mode 100755 branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/model/sca-core.xsd delete mode 100755 branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/model/sca-implementation-mock.xsd delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/stock.xsd delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/wrapper.xml delete mode 100644 branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/wrapper.xsd delete mode 100644 branches/sca-java-0.90/modules/databinding/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/databinding/.pmd delete mode 100644 branches/sca-java-0.90/modules/databinding/.ruleset delete mode 100644 branches/sca-java-0.90/modules/databinding/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/databinding/LICENSE delete mode 100644 branches/sca-java-0.90/modules/databinding/NOTICE delete mode 100644 branches/sca-java-0.90/modules/databinding/pom.xml delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataBinding.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataBindingExtensionPoint.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataPipe.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultDataBindingExtensionPoint.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultTransformerExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/ExceptionHandler.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/Mediator.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/PullTransformer.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/PushTransformer.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/SimpleTypeMapper.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformationContext.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformationException.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/Transformer.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformerExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/WrapperHandler.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/annotation/DataBinding.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/BaseDataBinding.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/BaseTransformer.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/DOMHelper.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/DirectedGraph.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/Group2GroupTransformer.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/GroupDataBinding.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/Java2SimpleTypeTransformer.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/MediatorImpl.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/PipedTransformer.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/SimpleType2JavaTransformer.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/SimpleTypeMapperImpl.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/TransformationContextImpl.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/XSDDataTypeConverter.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/DOMNode2JavaBeanTransformer.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/Java2XMLMapperException.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2DOMNodeTransformer.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLStreamReader.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLTransformer.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaBeanTransformer.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaMapperException.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/BeanUtil.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMDataBinding.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMWrapperHandler.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMXMLStreamReader.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DelegatingNamespaceContext.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputSource2Node.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputSource2SAX.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputStream2Node.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputStream2SAX.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NameValueArrayStreamReader.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NameValuePairStreamReader.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NamedProperty.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NilElementStreamReader.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2OutputStream.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2String.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2Writer.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2XMLStreamReader.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Reader2Node.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Reader2SAX.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SAX2DOM.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SAX2DOMPipe.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Source2ResultTransformer.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAX2SAXAdapter.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAXDataBinding.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAXHelper.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StreamDataPipe.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2Node.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2SAX.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/String2XMLStreamReader.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/WrappingXMLStreamReader.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Writer2ReaderDataPipe.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLDocumentStreamReader.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLFragmentStreamReader.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLFragmentStreamReaderImpl.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLGroupDataBinding.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamReader2Node.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamReader2SAX.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamReader2String.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamSerializer.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStreamable.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/XMLStringDataBinding.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DOMHelperTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/DataBindingExtensionTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/SimpleTypeMapperExtensionTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/TransformerExtensionTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/extension/XSDDataTypeConverterTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DataBindingRegistryImplTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DataBindingTestCase.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/DirectedGraphTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/MediatorImplTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/impl/TransformerRegistryImplTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DOM2StAXTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/DataPipeTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/JavaBean2XMLStreamReaderTestCase.java delete mode 100755 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/Node2StringTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/PushTransformationTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/StAXHelperTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/java/org/apache/tuscany/sca/databinding/xml/TraxTransformerTestCase.java delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/impl/ipo.xsd delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/impl/order.wsdl delete mode 100644 branches/sca-java-0.90/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/xml/foo.xml delete mode 100644 branches/sca-java-0.90/modules/host-embedded/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/host-embedded/.pmd delete mode 100644 branches/sca-java-0.90/modules/host-embedded/.ruleset delete mode 100644 branches/sca-java-0.90/modules/host-embedded/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/host-embedded/LICENSE delete mode 100644 branches/sca-java-0.90/modules/host-embedded/NOTICE delete mode 100644 branches/sca-java-0.90/modules/host-embedded/pom.xml delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/SCADomain.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/SCADomainBean.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/SCATestCaseRunner.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/DefaultSCADomain.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/EmbeddedSCADomain.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntime.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/impl/ReallySmallRuntimeBuilder.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/java/crud/CRUD.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/java/crud/CRUDImplementation.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/java/crud/CRUDImplementationFactory.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/java/crud/DefaultCRUDImplementationFactory.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/java/crud/backend/ResourceManager.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/java/crud/impl/CRUDImplementationImpl.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/java/crud/impl/CRUDImplementationProcessor.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/java/crud/module/CRUDModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/java/crud/provider/CRUDImplementationProvider.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/java/crud/provider/CRUDImplementationProviderFactory.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/java/crud/provider/CRUDInvoker.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/java/org/apache/tuscany/sca/host/embedded/SCADomainBeanTestCase.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/java/org/apache/tuscany/sca/host/embedded/SCADomainTestCase.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/java/org/apache/tuscany/sca/host/embedded/impl/DefaultSCADomainTestCase.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/java/org/apache/tuscany/sca/host/embedded/impl/EmbeddedSCADomainTestCase.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/java/org/apache/tuscany/sca/host/embedded/impl/TestModelResolver.java delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/resources/crud.composite delete mode 100644 branches/sca-java-0.90/modules/host-embedded/src/test/resources/test.txt delete mode 100644 branches/sca-java-0.90/modules/host-http/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/host-http/LICENSE delete mode 100644 branches/sca-java-0.90/modules/host-http/NOTICE delete mode 100644 branches/sca-java-0.90/modules/host-http/pom.xml delete mode 100644 branches/sca-java-0.90/modules/host-http/src/main/java/org/apache/tuscany/sca/http/DefaultServletHostExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/host-http/src/main/java/org/apache/tuscany/sca/http/ExtensibleServletHost.java delete mode 100644 branches/sca-java-0.90/modules/host-http/src/main/java/org/apache/tuscany/sca/http/ServletHost.java delete mode 100644 branches/sca-java-0.90/modules/host-http/src/main/java/org/apache/tuscany/sca/http/ServletHostExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/host-http/src/main/java/org/apache/tuscany/sca/http/ServletMappingException.java delete mode 100644 branches/sca-java-0.90/modules/host-http/src/main/java/org/apache/tuscany/sca/http/module/HTTPRuntimeModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/host-http/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/host-rmi/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/host-rmi/LICENSE delete mode 100644 branches/sca-java-0.90/modules/host-rmi/NOTICE delete mode 100644 branches/sca-java-0.90/modules/host-rmi/pom.xml delete mode 100644 branches/sca-java-0.90/modules/host-rmi/src/main/java/org/apache/tuscany/sca/rmi/DefaultRMIHost.java delete mode 100644 branches/sca-java-0.90/modules/host-rmi/src/main/java/org/apache/tuscany/sca/rmi/RMIHost.java delete mode 100644 branches/sca-java-0.90/modules/host-rmi/src/main/java/org/apache/tuscany/sca/rmi/RMIHostException.java delete mode 100644 branches/sca-java-0.90/modules/host-rmi/src/main/java/org/apache/tuscany/sca/rmi/RMIHostRuntimeException.java delete mode 100644 branches/sca-java-0.90/modules/host-rmi/src/main/java/org/apache/tuscany/sca/rmi/module/RMIRuntimeModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/host-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/host-rmi/src/test/java/org/apache/tuscany/sca/rmi/RMIHostImplTestCase.java delete mode 100644 branches/sca-java-0.90/modules/host-webapp/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/host-webapp/LICENSE delete mode 100644 branches/sca-java-0.90/modules/host-webapp/NOTICE delete mode 100644 branches/sca-java-0.90/modules/host-webapp/pom.xml delete mode 100644 branches/sca-java-0.90/modules/host-webapp/src/main/java/org/apache/tuscany/sca/webapp/SCADomainHelper.java delete mode 100644 branches/sca-java-0.90/modules/host-webapp/src/main/java/org/apache/tuscany/sca/webapp/TuscanyContextListener.java delete mode 100644 branches/sca-java-0.90/modules/host-webapp/src/main/java/org/apache/tuscany/sca/webapp/TuscanyServlet.java delete mode 100644 branches/sca-java-0.90/modules/host-webapp/src/main/java/org/apache/tuscany/sca/webapp/WebAppModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/host-webapp/src/main/java/org/apache/tuscany/sca/webapp/WebAppServletHost.java delete mode 100644 branches/sca-java-0.90/modules/host-webapp/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/http-jetty/.ruleset delete mode 100644 branches/sca-java-0.90/modules/http-jetty/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/http-jetty/LICENSE delete mode 100644 branches/sca-java-0.90/modules/http-jetty/NOTICE delete mode 100644 branches/sca-java-0.90/modules/http-jetty/pom.xml delete mode 100644 branches/sca-java-0.90/modules/http-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyLogger.java delete mode 100644 branches/sca-java-0.90/modules/http-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/JettyServer.java delete mode 100644 branches/sca-java-0.90/modules/http-jetty/src/main/java/org/apache/tuscany/sca/http/jetty/module/JettyRuntimeModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/http-jetty/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/http-jetty/src/test/java/org/apache/tuscany/sca/http/jetty/JettyServerTestCase.java delete mode 100644 branches/sca-java-0.90/modules/http-tomcat/.ruleset delete mode 100644 branches/sca-java-0.90/modules/http-tomcat/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/http-tomcat/LICENSE delete mode 100644 branches/sca-java-0.90/modules/http-tomcat/NOTICE delete mode 100644 branches/sca-java-0.90/modules/http-tomcat/pom.xml delete mode 100644 branches/sca-java-0.90/modules/http-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/ServletWrapper.java delete mode 100644 branches/sca-java-0.90/modules/http-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/TomcatServer.java delete mode 100644 branches/sca-java-0.90/modules/http-tomcat/src/main/java/org/apache/tuscany/sca/http/tomcat/module/TomcatRuntimeModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/http-tomcat/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/http-tomcat/src/test/java/org/apache/tuscany/sca/http/tomcat/TomcatServerTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/.pmd delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/.ruleset delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/LICENSE delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/NOTICE delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/pom.xml delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/InstanceFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/InstanceFactoryProvider.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/JavaPropertyValueObjectFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceWrapper.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/context/TargetMethodNotFoundException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ArrayMultiplicityObjectFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ContextInjector.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ConversationIDObjectFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/EventInvoker.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/FieldInjector.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/InjectionRuntimeException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/Injector.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/InvalidAccessorException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/InvalidResourceTypeException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JNDIObjectFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ListMultiplicityObjectFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/MethodEventInvoker.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/MethodInjector.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/NoAccessorException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/NoMultiplicityTypeException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ObjectCallbackException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/PojoObjectFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/RequestContextObjectFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceHost.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceNotFoundException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceObjectFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ResourceResolutionException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/SingletonObjectFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/InvalidConversationSequenceException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaComponentInfo.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProvider.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaImplementationProviderFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/JavaTargetInvoker.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/NoConversationalContractException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/PassByValueInvoker.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/PojoComponentContextFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/PojoConfiguration.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/TargetInvoker.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/TargetInvokerInvoker.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/module/JavaRuntimeModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/monitor/ExceptionFormatter.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/monitor/ExceptionFormatterImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/monitor/FormatterRegistry.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/monitor/InvalidLevelException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/monitor/JavaLoggingMonitorFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/monitor/MonitorFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/monitor/MonitorFactoryUtil.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/monitor/NullMonitorFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/monitor/ProxyMonitorFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/context/ModelHelper.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/context/MultiplicityTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/context/ReflectiveInstanceWrapperTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/CallbackWireObjectFactoryTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/FieldInjectorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/JNDIObjectFactoryTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/MethodEventInvokerTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/MethodInjectorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/PojoObjectFactoryTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/RequestContextObjectFactoryTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/ResourceObjectFactoryTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/injection/SingletonObjectFactoryTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/integration/AbstractConversationTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/integration/ConversationIdleExpireTestCase.java.FIXME delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/integration/ConversationMaxAgeExpireTestCase.java.FIXME delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/integration/ConversationStartStopEndTestCase.java.FIXME delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/integration/ReferenceInjectionTestCase.java.FIXME delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/AsyncTarget.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/BadContextPojo.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/BadNamePojo.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/BasicInterface.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/BasicInterfaceImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/CompositeScopeComponent.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/CompositeScopeComponentImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/CompositeScopeDestroyOnlyComponent.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/CompositeScopeInitDestroyComponent.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/CompositeScopeInitOnlyComponent.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/ConversationalScopeComponent.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/ConversationalScopeComponentImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/ConversationalScopeDestroyOnlyComponent.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/ConversationalScopeInitDestroyComponent.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/ConversationalScopeInitOnlyComponent.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/MockFactory.java.FIXME delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/MockStaticInvoker.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/MockSyncInterceptor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/OrderException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/OrderedDependentPojo.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/OrderedDependentPojoImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/OrderedEagerInitPojo.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/OrderedInitPojo.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/OrderedInitPojoImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/OtherTarget.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/OtherTargetImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/RequestScopeComponent.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/RequestScopeDestroyOnlyComponent.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/RequestScopeInitDestroyComponent.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/RequestScopeInitOnlyComponent.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/SessionScopeComponent.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/SessionScopeComponentImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/SessionScopeInitDestroyComponent.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/SessionScopeInitOnlyComponent.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/SimpleTarget.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/SimpleTargetImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/Source.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/SourceImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/StatelessComponent.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/StatelessComponentImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/Target.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/mock/TargetImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/monitor/ExceptionFormatterTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/monitor/JavaLoggingTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Bean1.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/Bean2.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/JavaIntrospectionHelperTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-runtime/src/test/java/org/apache/tuscany/sca/implementation/java/util/SuperBean.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/.pmd delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/.ruleset delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/LICENSE delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/NOTICE delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/pom.xml delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/api/annotation/LogLevel.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/api/annotation/Monitor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/api/annotation/Resource.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/DefaultJavaClassIntrospectorExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/DuplicatePropertyException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/ExtensibleJavaClassIntrospector.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/IllegalPropertyException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/IntrospectionException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaClassIntrospector.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaClassIntrospectorExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/JavaClassVisitor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractPropertyProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AllowsPassByReferenceProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AmbiguousConstructorException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/BaseJavaClassVisitor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ContextProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DestroyProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateConstructorException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateDestructorException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateInitException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateReferenceException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DuplicateResourceException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/EagerInitProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalCallbackReferenceException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalContextException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalDestructorException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalInitException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalReferenceException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalResourceException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/IllegalServiceDefinitionException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InitProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidConstructorException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidConversationalImplementation.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidPropertyException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidReferenceException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidResourceException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InvalidServiceType.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/JavaIntrospectionHelper.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/NoConstructorException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PropertyProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ResourceProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ScopeProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceTypeNotFoundException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/introspect/impl/UnknownContextTypeException.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationConstants.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/main/java/org/apache/tuscany/sca/implementation/java/xml/JavaImplementationProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/calculator/AddService.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/calculator/AddServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/calculator/CalculatorService.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/calculator/CalculatorServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/calculator/DivideService.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/calculator/DivideServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/calculator/MultiplyService.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/calculator/MultiplyServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/calculator/SubtractService.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/calculator/SubtractServiceImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/DefaultJavaClassIntrospectorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractProcessorTest.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AbstractPropertyProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/AllowsPassByReferenceProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorPropertyTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorReferenceTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConstructorResourceTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ContextProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConversationProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ConvertTimeMillisTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/DestroyProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/EagerInitProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicAndPropertyTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicConstructorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeuristicPojoProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/HeutisticExtensibleConstructorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/InitProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ModelHelper.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PolicyProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/PropertyProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ReferenceProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ResourceProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ScopeProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceCallbackTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/introspect/impl/ServiceProcessorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/ReadTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/TestModelResolver.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/java/org/apache/tuscany/sca/implementation/java/xml/WriteTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java-xml/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/Calculator.composite delete mode 100644 branches/sca-java-0.90/modules/implementation-java/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/implementation-java/.pmd delete mode 100644 branches/sca-java-0.90/modules/implementation-java/.ruleset delete mode 100644 branches/sca-java-0.90/modules/implementation-java/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/implementation-java/LICENSE delete mode 100644 branches/sca-java-0.90/modules/implementation-java/NOTICE delete mode 100644 branches/sca-java-0.90/modules/implementation-java/pom.xml delete mode 100644 branches/sca-java-0.90/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/BaseJavaImplementation.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/DefaultJavaImplementationFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaImplementation.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/JavaImplementationFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/BaseJavaImplementationImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaConstructorImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaElementImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaImplementationFactoryImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaImplementationImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaParameterImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaResourceImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-java/src/main/java/org/apache/tuscany/sca/implementation/java/impl/JavaScopeImpl.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/implementation-script/LICENSE delete mode 100644 branches/sca-java-0.90/modules/implementation-script/NOTICE delete mode 100644 branches/sca-java-0.90/modules/implementation-script/pom.xml delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/main/java/org/apache/tuscany/implementation/spi/AbstractImplementation.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/main/java/org/apache/tuscany/implementation/spi/AbstractStAXArtifactProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/main/java/org/apache/tuscany/implementation/spi/PropertyValueObjectFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/main/java/org/apache/tuscany/implementation/spi/ResourceHelper.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptArtifactProcessor.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementation.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementationProvider.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementationProviderFactory.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptInvoker.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/engines/TuscanyJRubyScriptEngine.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/AbstractSCATestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/AbstractHelloWorldTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/GroovyHelloWorldTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/HelloWorld.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/HelloWorldProxy.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JRubyHelloWorldTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScriptHelloWorldTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/helloworld/JythonHelloWorldTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/AbstractHelloWorldTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/GroovyHelloWorldTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/HelloWorld.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/HelloWorldProxy.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/JRubyHelloWorldTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/JavaScriptHelloWorldTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/properties/JythonHelloWorldTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/GroovyReferenceTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/HelloWorldTarget.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/JRubyReferenceTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/JavaScriptReferenceTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/java/org/apache/tuscany/sca/implementation/script/itests/references/JythonReferenceTestCase.java delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/GroovyHelloWorld.composite delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JRubyHelloWorld.composite delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JavaScriptHelloWorld.composite delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/JythonHelloWorld.composite delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.componentType delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.groovy delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.js delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.py delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/helloworld/helloworld.rb delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/GroovyHelloWorld.composite delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/JRubyHelloWorld.composite delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/JavaScriptHelloWorld.composite delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/JythonHelloWorld.composite delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.componentType delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.groovy delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.js delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.py delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/properties/helloworld.rb delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/GroovyReference.composite delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/JRubyReference.composite delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/JavaScriptReference.composite delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/JythonReference.composite delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.componentType delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.groovy delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.js delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.py delete mode 100644 branches/sca-java-0.90/modules/implementation-script/src/test/resources/org/apache/tuscany/sca/implementation/script/itests/references/reference.rb delete mode 100644 branches/sca-java-0.90/modules/interface-java-runtime/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/interface-java-runtime/LICENSE delete mode 100644 branches/sca-java-0.90/modules/interface-java-runtime/NOTICE delete mode 100644 branches/sca-java-0.90/modules/interface-java-runtime/pom.xml delete mode 100644 branches/sca-java-0.90/modules/interface-java-runtime/src/main/java/org/apache/tuscany/sca/interfacedef/java/module/JavaInterfaceRuntimeModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/interface-java-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/.pmd delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/.ruleset delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/LICENSE delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/NOTICE delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/pom.xml delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/introspect/DefaultJavaInterfaceIntrospectorExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/introspect/ExtensibleJavaInterfaceIntrospector.java delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/introspect/JavaInterfaceIntrospector.java delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/introspect/JavaInterfaceIntrospectorExtensionPoint.java delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/introspect/JavaInterfaceVisitor.java delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaConstants.java delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/src/main/java/org/apache/tuscany/sca/interfacedef/java/xml/JavaInterfaceProcessor.java delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/ConversationalIntrospectionTestCase.java delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/src/test/java/org/apache/tuscany/sca/interfacedef/java/introspection/impl/JavaInterfaceProcessorRegistryImplTestCase.java delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/src/test/java/org/apache/tuscany/sca/interfacedef/java/xml/ReadTestCase.java delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/src/test/java/org/apache/tuscany/sca/interfacedef/java/xml/WriteTestCase.java delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/java/xml/Calculator.composite delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/java/xml/CalculatorComponent.constrainingType delete mode 100644 branches/sca-java-0.90/modules/interface-java-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/java/xml/CalculatorImpl.componentType delete mode 100644 branches/sca-java-0.90/modules/interface-java/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/interface-java/.pmd delete mode 100644 branches/sca-java-0.90/modules/interface-java/.ruleset delete mode 100644 branches/sca-java-0.90/modules/interface-java/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/interface-java/LICENSE delete mode 100644 branches/sca-java-0.90/modules/interface-java/NOTICE delete mode 100644 branches/sca-java-0.90/modules/interface-java/pom.xml delete mode 100644 branches/sca-java-0.90/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/DefaultJavaInterfaceFactory.java delete mode 100644 branches/sca-java-0.90/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterface.java delete mode 100644 branches/sca-java-0.90/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterfaceContract.java delete mode 100644 branches/sca-java-0.90/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/JavaInterfaceFactory.java delete mode 100644 branches/sca-java-0.90/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceContractImpl.java delete mode 100644 branches/sca-java-0.90/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceFactoryImpl.java delete mode 100644 branches/sca-java-0.90/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceImpl.java delete mode 100644 branches/sca-java-0.90/modules/interface-java/src/main/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtil.java delete mode 100644 branches/sca-java-0.90/modules/interface-java/src/test/java/org/apache/tuscany/sca/interfacedef/java/impl/JavaInterfaceUtilTestCase.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-runtime/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-runtime/LICENSE delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-runtime/NOTICE delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-runtime/pom.xml delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-runtime/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/module/WSDLInterfaceRuntimeModuleActivator.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-runtime/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/.pmd delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/.ruleset delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/LICENSE delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/NOTICE delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/pom.xml delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/DefaultWSDLInterfaceIntrospector.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/InvalidWSDLException.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospector.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperation.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XSDDocumentProcessor.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/DefaultWSDLInterfaceIntrospectorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/TestModelResolver.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationTestCase.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorComponent.constrainingType delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl-xml/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/.pmd delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/.ruleset delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/LICENSE delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/NOTICE delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/pom.xml delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/DefaultWSDLFactory.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLDefinition.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLFactory.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterface.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/WSDLInterfaceContract.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/XSDefinition.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLFactoryImpl.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceContractImpl.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLInterfaceImpl.java delete mode 100644 branches/sca-java-0.90/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/XSDefinitionImpl.java delete mode 100644 branches/sca-java-0.90/modules/interface/.checkstyle delete mode 100644 branches/sca-java-0.90/modules/interface/.pmd delete mode 100644 branches/sca-java-0.90/modules/interface/.ruleset delete mode 100644 branches/sca-java-0.90/modules/interface/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/interface/LICENSE delete mode 100644 branches/sca-java-0.90/modules/interface/NOTICE delete mode 100644 branches/sca-java-0.90/modules/interface/pom.xml delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/ConversationSequence.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/DataType.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/IncompatibleInterfaceContractException.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContract.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InterfaceContractMapper.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidCallbackException.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidInterfaceException.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/InvalidOperationException.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/OverloadedOperationException.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/DataTypeImpl.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractImpl.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/ElementInfo.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/FaultException.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/JavaXMLMapper.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/TypeInfo.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/WrapperInfo.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/util/XMLType.java delete mode 100644 branches/sca-java-0.90/modules/interface/src/test/java/org/apache/tuscany/sca/interfacedef/impl/ContractCompatibilityTestCase.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/LICENSE delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/NOTICE delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/pom.xml delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/GenerationParameters.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGenerator.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2OMBuilder.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLBuilder.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLConstants.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLOptionsValidator.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanySchemaGenerator.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyTypeTable.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyWSDLTypesGenerator.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenEvent.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenListener.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/util/XMLNameUtil.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/resources/META-INF/LICENSE.txt delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/resources/META-INF/NOTICE delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/resources/META-INF/README.txt delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/main/resources/RemotableInterfaceTemplate.xsl delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/test/java/org/soapinterop/CreditScoreDocLit.java delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/test/resources/AccountService.wsdl delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/test/resources/CreditScoreDocLit.wsdl delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/test/resources/helloworld.wsdl delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/test/resources/interopdoc.wsdl delete mode 100644 branches/sca-java-0.90/modules/java2wsdl/src/test/resources/sequences.xsd delete mode 100644 branches/sca-java-0.90/modules/maven-java2wsdl/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/maven-java2wsdl/LICENSE delete mode 100644 branches/sca-java-0.90/modules/maven-java2wsdl/NOTICE delete mode 100644 branches/sca-java-0.90/modules/maven-java2wsdl/pom.xml delete mode 100644 branches/sca-java-0.90/modules/maven-java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/plugin/Java2WSDLGeneratorMojo.java delete mode 100644 branches/sca-java-0.90/modules/maven-wsdl2java/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/maven-wsdl2java/LICENSE delete mode 100644 branches/sca-java-0.90/modules/maven-wsdl2java/NOTICE delete mode 100644 branches/sca-java-0.90/modules/maven-wsdl2java/pom.xml delete mode 100644 branches/sca-java-0.90/modules/maven-wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDL2JavaGeneratorMojo.java delete mode 100644 branches/sca-java-0.90/modules/maven-wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDLFileOption.java delete mode 100644 branches/sca-java-0.90/modules/policy/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/policy/LICENSE delete mode 100644 branches/sca-java-0.90/modules/policy/NOTICE delete mode 100644 branches/sca-java-0.90/modules/policy/pom.xml delete mode 100644 branches/sca-java-0.90/modules/policy/src/main/java/org/apache/tuscany/sca/policy/DefaultPolicyFactory.java delete mode 100644 branches/sca-java-0.90/modules/policy/src/main/java/org/apache/tuscany/sca/policy/Intent.java delete mode 100644 branches/sca-java-0.90/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentAttachPoint.java delete mode 100644 branches/sca-java-0.90/modules/policy/src/main/java/org/apache/tuscany/sca/policy/IntentMap.java delete mode 100644 branches/sca-java-0.90/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicyFactory.java delete mode 100644 branches/sca-java-0.90/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicySet.java delete mode 100644 branches/sca-java-0.90/modules/policy/src/main/java/org/apache/tuscany/sca/policy/PolicySetAttachPoint.java delete mode 100644 branches/sca-java-0.90/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/IntentImpl.java delete mode 100644 branches/sca-java-0.90/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/IntentMapImpl.java delete mode 100644 branches/sca-java-0.90/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicyFactoryImpl.java delete mode 100644 branches/sca-java-0.90/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/PolicySetImpl.java delete mode 100644 branches/sca-java-0.90/modules/policy/src/test/java/org/apache/tuscany/sca/policy/PolicyFactoryTestCase.java delete mode 100644 branches/sca-java-0.90/modules/pom.xml delete mode 100644 branches/sca-java-0.90/modules/sca-api/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/sca-api/LICENSE delete mode 100644 branches/sca-java-0.90/modules/sca-api/NOTICE delete mode 100644 branches/sca-java-0.90/modules/sca-api/pom.xml delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/CallableReference.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/ComponentContext.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/Constants.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/Conversation.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/ConversationEndedException.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/NoRegisteredCallbackException.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/RequestContext.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/ServiceReference.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/ServiceRuntimeException.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/ServiceUnavailableException.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/AllowsPassByReference.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Authentication.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Callback.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/ComponentName.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Confidentiality.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Constructor.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Context.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/ConversationAttributes.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/ConversationID.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Conversational.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Destroy.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/EagerInit.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/EndsConversation.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Init.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Integrity.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Intent.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/OneWay.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/PolicySets.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Property.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Qualifier.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Reference.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Remotable.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Requires.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Scope.java delete mode 100644 branches/sca-java-0.90/modules/sca-api/src/main/java/org/osoa/sca/annotations/Service.java delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/DISCLAIMER delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/LICENSE delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/NOTICE delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/pom.xml delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.java delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingTypeMappingEntry.java delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.java delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/util/XMLNameUtil.java delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/main/resources/META-INF/LICENSE.txt delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/main/resources/META-INF/NOTICE delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/main/resources/META-INF/README.txt delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/main/resources/RemotableInterfaceTemplate.xsl delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/test/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGeneratorTestCase.java delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/test/java/org/soapinterop/CreditScoreDocLit.java delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/test/resources/AccountService.wsdl delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/test/resources/CreditScoreDocLit.wsdl delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/test/resources/helloworld.wsdl delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/test/resources/interopdoc.wsdl delete mode 100644 branches/sca-java-0.90/modules/wsdl2java/src/test/resources/sequences.xsd (limited to 'branches/sca-java-0.90/modules') diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/DISCLAIMER b/branches/sca-java-0.90/modules/assembly-java-dsl/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/LICENSE b/branches/sca-java-0.90/modules/assembly-java-dsl/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/NOTICE b/branches/sca-java-0.90/modules/assembly-java-dsl/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/pom.xml b/branches/sca-java-0.90/modules/assembly-java-dsl/pom.xml deleted file mode 100644 index 879e950ec8..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - tuscany-assembly-java-dsl - Apache Tuscany SCA Assembly Java DSL - - - - org.apache.tuscany.sca - tuscany-assembly - 0.90-incubating-SNAPSHOT - - - diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/AssemblyBuilder.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/AssemblyBuilder.java deleted file mode 100644 index 28a5ecdc24..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/AssemblyBuilder.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - - -public interface AssemblyBuilder { - - CompositeBuilder composite(String name); - - ComponentBuilder component(String name); - - ComponentReferenceBuilder reference(String name); - - ComponentServiceBuilder service(String name); - - ComponentPropertyBuilder property(String name); - - CompositeBuilder domain(String uri); - -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentBuilder.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentBuilder.java deleted file mode 100644 index 98f247e5cc..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentBuilder.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - -public interface ComponentBuilder { - - ComponentBuilder implementedBy(Class clazz); - - ComponentBuilder implementedBy(CompositeBuilder composite); - - public ComponentBuilder uses(ComponentReferenceBuilder... componentReferences); - - public ComponentBuilder provides(ComponentServiceBuilder... componentServices); - - public ComponentBuilder declares(ComponentPropertyBuilder...componentProperties); - -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentPropertyBuilder.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentPropertyBuilder.java deleted file mode 100644 index 7f3c89fd2f..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentPropertyBuilder.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - -public interface ComponentPropertyBuilder { - - ComponentPropertyBuilder ofType(String type); - - ComponentPropertyBuilder configuredTo(Object value); - -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentReferenceBuilder.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentReferenceBuilder.java deleted file mode 100644 index 8966a4be9d..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentReferenceBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - -public interface ComponentReferenceBuilder { - - ComponentReferenceBuilder wiredTo(String target); - - ComponentReferenceBuilder wiredTo(ComponentServiceBuilder target); - - ComponentReferenceBuilder typedBy(Class interfaceClass); - - ComponentReferenceBuilder promotedAs(String promoted); - - ComponentReferenceBuilder promoted(); - - ComponentReferenceBuilder boundTo(String uri); - -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentServiceBuilder.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentServiceBuilder.java deleted file mode 100644 index f3e36e8c38..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/ComponentServiceBuilder.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - -public interface ComponentServiceBuilder { - - ComponentServiceBuilder typedBy(Class interfaceClass); - - ComponentServiceBuilder promotedAs(String promoted); - - ComponentServiceBuilder promoted(); - - ComponentServiceBuilder boundTo(String uri); - -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/CompositeBuilder.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/CompositeBuilder.java deleted file mode 100644 index e2108b5ef8..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/CompositeBuilder.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - - -public interface CompositeBuilder { - - CompositeBuilder contains(ComponentBuilder... components); - - CompositeBuilder includes(CompositeBuilder... includes); - -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/AssemblyBuilderImpl.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/AssemblyBuilderImpl.java deleted file mode 100644 index 0968310548..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/AssemblyBuilderImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.dsl.impl; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.dsl.AssemblyBuilder; -import org.apache.tuscany.sca.assembly.dsl.ComponentBuilder; -import org.apache.tuscany.sca.assembly.dsl.ComponentPropertyBuilder; -import org.apache.tuscany.sca.assembly.dsl.ComponentReferenceBuilder; -import org.apache.tuscany.sca.assembly.dsl.ComponentServiceBuilder; -import org.apache.tuscany.sca.assembly.dsl.CompositeBuilder; - -public class AssemblyBuilderImpl extends DefaultAssemblyFactory implements AssemblyBuilder { - - public ComponentBuilder component(String name) { - ComponentBuilderImpl component = new ComponentBuilderImpl(); - component.setName(name); - return component; - } - - public CompositeBuilder composite(String name) { - CompositeBuilderImpl composite = new CompositeBuilderImpl(); - //TODO handle namespace - composite.setName(new QName("", name)); - return composite; - } - - public CompositeBuilder domain(String uri) { - CompositeBuilderImpl composite = new CompositeBuilderImpl(); - composite.setName(new QName(uri, "")); - return composite; - } - - public ComponentPropertyBuilder property(String name) { - ComponentPropertyBuilderImpl property = new ComponentPropertyBuilderImpl(); - property.setName(name); - return property; - } - - public ComponentReferenceBuilder reference(String name) { - ComponentReferenceBuilderImpl reference = new ComponentReferenceBuilderImpl(this); - reference.setName(name); - return reference; - } - - public ComponentServiceBuilder service(String name) { - ComponentServiceBuilderImpl service = new ComponentServiceBuilderImpl(this); - service.setName(name); - return service; - } - -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentBuilderImpl.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentBuilderImpl.java deleted file mode 100644 index 9022b9d9e6..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentBuilderImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl.impl; - -import java.util.List; - -import org.apache.tuscany.sca.assembly.ComponentProperty; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.dsl.ComponentBuilder; -import org.apache.tuscany.sca.assembly.dsl.ComponentPropertyBuilder; -import org.apache.tuscany.sca.assembly.dsl.ComponentReferenceBuilder; -import org.apache.tuscany.sca.assembly.dsl.ComponentServiceBuilder; -import org.apache.tuscany.sca.assembly.dsl.CompositeBuilder; -import org.apache.tuscany.sca.assembly.impl.ComponentImpl; - -public class ComponentBuilderImpl extends ComponentImpl implements ComponentBuilder { - - public ComponentBuilderImpl() { - } - - public ComponentBuilder implementedBy(Class clazz) { - //FIXME support Java implementations - return this; - } - - public ComponentBuilder implementedBy(CompositeBuilder composite) { - setImplementation((Composite)composite); - return this; - } - - public ComponentBuilder uses(ComponentReferenceBuilder... componentReferences) { - List references = getReferences(); - for (ComponentReferenceBuilder componentReference: componentReferences) { - references.add((ComponentReference)componentReference); - } - return this; - } - - public ComponentBuilder provides(ComponentServiceBuilder... componentServices) { - List services = getServices(); - for (ComponentServiceBuilder componentService: componentServices) { - services.add((ComponentService)componentService); - } - return this; - } - - public ComponentBuilder declares(ComponentPropertyBuilder...componentProperties) { - List properties = getProperties(); - for (ComponentPropertyBuilder componentProperty: componentProperties) { - properties.add((ComponentProperty)componentProperty); - } - return this; - } - -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentPropertyBuilderImpl.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentPropertyBuilderImpl.java deleted file mode 100644 index 49f7cd46b2..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentPropertyBuilderImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl.impl; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.dsl.ComponentPropertyBuilder; -import org.apache.tuscany.sca.assembly.impl.ComponentPropertyImpl; - -public class ComponentPropertyBuilderImpl extends ComponentPropertyImpl implements ComponentPropertyBuilder { - - public ComponentPropertyBuilderImpl ofType(String type) { - //TODO handle namespace - this.setXSDType(new QName("", type)); - return this; - } - - public ComponentPropertyBuilderImpl configuredTo(Object value) { - this.setValue(value); - return this; - } - -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentReferenceBuilderImpl.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentReferenceBuilderImpl.java deleted file mode 100644 index d9aab9de22..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentReferenceBuilderImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl.impl; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.CompositeReference; -import org.apache.tuscany.sca.assembly.dsl.ComponentReferenceBuilder; -import org.apache.tuscany.sca.assembly.dsl.ComponentServiceBuilder; -import org.apache.tuscany.sca.assembly.impl.ComponentReferenceImpl; -import org.apache.tuscany.sca.assembly.impl.ComponentServiceImpl; - -public class ComponentReferenceBuilderImpl extends ComponentReferenceImpl implements ComponentReferenceBuilder { - - private CompositeReference compositeReference; - private AssemblyFactory assemblyFactory; - - protected ComponentReferenceBuilderImpl(AssemblyFactory assemblyFactory) { - this.assemblyFactory = assemblyFactory; - } - - public ComponentReferenceBuilder wiredTo(String target) { - ComponentService componentService = assemblyFactory.createComponentService(); - componentService.setUnresolved(true); - componentService.setName(target); - getTargets().add(componentService); - return this; - } - - public ComponentReferenceBuilder wiredTo(ComponentServiceBuilder target) { - getTargets().add((ComponentServiceImpl)target); - return this; - } - - public ComponentReferenceBuilderImpl typedBy(Class interfaceClass) { - //FIXME support for Java interfaces - return this; - } - - public ComponentReferenceBuilderImpl promotedAs(String promoted) { - compositeReference = assemblyFactory.createCompositeReference(); - compositeReference.setName(promoted); - return this; - } - - public ComponentReferenceBuilderImpl promoted() { - compositeReference = assemblyFactory.createCompositeReference(); - compositeReference.setName(getName()); - return this; - } - - public ComponentReferenceBuilder boundTo(String uri) { - //TODO support bindings - return this; - } - - CompositeReference getCompositeReference() { - return compositeReference; - } -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentServiceBuilderImpl.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentServiceBuilderImpl.java deleted file mode 100644 index 379429d17e..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/ComponentServiceBuilderImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl.impl; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.CompositeService; -import org.apache.tuscany.sca.assembly.dsl.ComponentServiceBuilder; -import org.apache.tuscany.sca.assembly.impl.ComponentServiceImpl; - -public class ComponentServiceBuilderImpl extends ComponentServiceImpl implements ComponentServiceBuilder { - - private CompositeService compositeService; - private AssemblyFactory assemblyFactory; - - protected ComponentServiceBuilderImpl(AssemblyFactory assemblyFactory) { - this.assemblyFactory = assemblyFactory; - } - - public ComponentServiceBuilderImpl typedBy(Class interfaceClass) { - //FIXME support for Java interfaces - return this; - } - - public ComponentServiceBuilderImpl promotedAs(String promoted) { - compositeService = assemblyFactory.createCompositeService(); - compositeService.setName(promoted); - return this; - } - - public ComponentServiceBuilderImpl promoted() { - compositeService = assemblyFactory.createCompositeService(); - compositeService.setName(getName()); - return this; - } - - public ComponentServiceBuilder boundTo(String uri) { - // TODO support bindings - return this; - } - - CompositeService getCompositeService() { - return compositeService; - } - -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/CompositeBuilderImpl.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/CompositeBuilderImpl.java deleted file mode 100644 index 709562cd72..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/main/java/org/apache/tuscany/sca/assembly/dsl/impl/CompositeBuilderImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl.impl; - -import java.util.List; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.dsl.ComponentBuilder; -import org.apache.tuscany.sca.assembly.dsl.CompositeBuilder; -import org.apache.tuscany.sca.assembly.impl.CompositeImpl; - -public class CompositeBuilderImpl extends CompositeImpl implements CompositeBuilder { - - public CompositeBuilder contains(ComponentBuilder... componentBuilders) { - List components = getComponents(); - for (ComponentBuilder componentBuilder: componentBuilders) { - Component component = (Component)componentBuilder; - components.add(component); - - for (ComponentService componentService: component.getServices()) { - ComponentServiceBuilderImpl builder = (ComponentServiceBuilderImpl)componentService; - if (builder.getCompositeService() != null) - getServices().add(builder.getCompositeService()); - } - for (ComponentReference componentReference: component.getReferences()) { - ComponentReferenceBuilderImpl builder = (ComponentReferenceBuilderImpl)componentReference; - if (builder.getCompositeReference() != null) - getReferences().add(builder.getCompositeReference()); - } - } - return this; - } - - public CompositeBuilder includes(CompositeBuilder... compositeBuilders) { - List list = getIncludes(); - for (CompositeBuilder composite: compositeBuilders) { - list.add((Composite)composite); - } - return this; - } - -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountDataService.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountDataService.java deleted file mode 100644 index ba91fd2168..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountDataService.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - -public interface AccountDataService { - -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountDataServiceImpl.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountDataServiceImpl.java deleted file mode 100644 index 4e239d03d3..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountDataServiceImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - -public class AccountDataServiceImpl { - -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountService.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountService.java deleted file mode 100644 index 030c820ed2..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountService.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - -public interface AccountService { - -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountServiceImpl.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountServiceImpl.java deleted file mode 100644 index 92f448ec87..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/AccountServiceImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - -public class AccountServiceImpl { - -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/BigBankBuilder.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/BigBankBuilder.java deleted file mode 100644 index b856201551..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/BigBankBuilder.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - -import org.apache.tuscany.sca.assembly.dsl.impl.AssemblyBuilderImpl; - -public class BigBankBuilder extends AssemblyBuilderImpl { - - public CompositeBuilder build() { - - CompositeBuilder bigbankAccount = composite("bigbank.account").contains( - - component("AccountServiceComponent"). - implementedBy(AccountServiceImpl.class). - uses( - reference("accountDataService").typedBy(AccountDataService.class).wiredTo("AccountDataServiceComponent/AccountDataService"), - reference("stockQuoteService").promotedAs("StockQuoteService") - ). - provides( - service("AccountDataService").typedBy(AccountService.class).promoted() - ). - declares( - property("currency").ofType("string").configuredTo("USD") - ), - - component("AccountDataServiceComponent"). - implementedBy(AccountDataServiceImpl.class). - provides( - service("AccountDataService").typedBy(AccountDataService.class) - ) - ); - - CompositeBuilder bigbankApp = composite("bigbank.app"). - contains( - component("BigBankAccount").implementedBy(bigbankAccount) - ); - - CompositeBuilder domain = domain("http://bigbank.org").includes(bigbankApp); - - return domain; - } -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/BigBankBuilderTestCase.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/BigBankBuilderTestCase.java deleted file mode 100644 index 90a4292546..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/BigBankBuilderTestCase.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - -import junit.framework.TestCase; - -public class BigBankBuilderTestCase extends TestCase { - - public void testBuild() throws Exception { - - BigBankBuilder builder = new BigBankBuilder(); - CompositeBuilder domain = builder.build(); - assertNotNull(domain); - - //System.out.println(); - //new PrintUtil(System.out).print(domain); - //System.out.println(); - - } - -} diff --git a/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/StockQuoteService.java b/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/StockQuoteService.java deleted file mode 100644 index a0580095a0..0000000000 --- a/branches/sca-java-0.90/modules/assembly-java-dsl/src/test/java/org/apache/tuscany/sca/assembly/dsl/StockQuoteService.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.dsl; - -public interface StockQuoteService { - -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/.checkstyle b/branches/sca-java-0.90/modules/assembly-xml/.checkstyle deleted file mode 100644 index 3e57539570..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/.checkstyle +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/branches/sca-java-0.90/modules/assembly-xml/.pmd b/branches/sca-java-0.90/modules/assembly-xml/.pmd deleted file mode 100644 index 2db10d6a6a..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/.pmd +++ /dev/null @@ -1,20 +0,0 @@ - - -truefalse \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/assembly-xml/.ruleset b/branches/sca-java-0.90/modules/assembly-xml/.ruleset deleted file mode 100644 index 830b4cfee4..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/assembly-xml/DISCLAIMER b/branches/sca-java-0.90/modules/assembly-xml/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/assembly-xml/LICENSE b/branches/sca-java-0.90/modules/assembly-xml/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/assembly-xml/NOTICE b/branches/sca-java-0.90/modules/assembly-xml/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/assembly-xml/pom.xml b/branches/sca-java-0.90/modules/assembly-xml/pom.xml deleted file mode 100644 index e1ab513836..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - tuscany-assembly-xml - Apache Tuscany SCA XML Assembly Support - - - - org.apache.tuscany.sca - tuscany-assembly - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-contribution - 0.90-incubating-SNAPSHOT - - - - stax - stax-api - 1.0.1 - - - - org.codehaus.woodstox - wstx-asl - 3.2.0 - runtime - - - - diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseArtifactProcessor.java b/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseArtifactProcessor.java deleted file mode 100644 index 9223fa8947..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseArtifactProcessor.java +++ /dev/null @@ -1,686 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import static javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI; -import static javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI; -import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; -import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.StringTokenizer; - -import javax.xml.XMLConstants; -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.assembly.AbstractContract; -import org.apache.tuscany.sca.assembly.AbstractProperty; -import org.apache.tuscany.sca.assembly.AbstractReference; -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.Contract; -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.assembly.Multiplicity; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.IntentAttachPoint; -import org.apache.tuscany.sca.policy.PolicyFactory; -import org.apache.tuscany.sca.policy.PolicySet; -import org.apache.tuscany.sca.policy.PolicySetAttachPoint; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; - -/** - * A base class with utility methods for the other artifact processors in this module. - * - * @version $Rev$ $Date$ - */ -abstract class BaseArtifactProcessor implements Constants { - - protected AssemblyFactory assemblyFactory; - protected PolicyFactory policyFactory; - protected StAXArtifactProcessor extensionProcessor; - - private static final DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); - static { - domFactory.setNamespaceAware(true); - } - - /** - * Construcst a new BaseArtifactProcessor. - * @param factory - * @param policyFactory - */ - @SuppressWarnings("unchecked") - public BaseArtifactProcessor(AssemblyFactory factory, PolicyFactory policyFactory, StAXArtifactProcessor extensionProcessor) { - this.assemblyFactory = factory; - this.policyFactory = policyFactory; - this.extensionProcessor = (StAXArtifactProcessor)extensionProcessor; - } - - /** - * Returns the string value of an attribute. - * @param reader - * @param name - * @return - */ - protected String getString(XMLStreamReader reader, String name) { - return reader.getAttributeValue(null, name); - } - - /** - * Returns the qname value of an attribute. - * @param reader - * @param name - * @return - */ - protected QName getQName(XMLStreamReader reader, String name) { - String qname = reader.getAttributeValue(null, name); - return getQNameValue(reader, qname); - } - - /** - * Returns the value of xsi:type attribute - * @param reader The XML stream reader - * @return The QName of the type, if the attribute is not present, null is - * returned. - */ - protected QName getXSIType(XMLStreamReader reader) { - String qname = reader.getAttributeValue(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI, "type"); - return getQNameValue(reader, qname); - } - - /** - * Returns a qname from a string. - * @param reader - * @param value - * @return - */ - protected QName getQNameValue(XMLStreamReader reader, String value) { - if (value != null) { - int index = value.indexOf(':'); - String prefix = index == -1 ? "" : value.substring(0, index); - String localName = index == -1 ? value : value.substring(index + 1); - String ns = reader.getNamespaceContext().getNamespaceURI(prefix); - if (ns == null) { - ns = ""; - } - return new QName(ns, localName, prefix); - } else { - return null; - } - } - - /** - * Returns the boolean value of an attribute. - * @param reader - * @param name - * @return - */ - protected boolean getBoolean(XMLStreamReader reader, String name) { - String value = reader.getAttributeValue(null, name); - if (value == null) { - value = Boolean.toString(false); - } - return Boolean.valueOf(value); - } - - /** - * Returns the value of an attribute as a list of qnames. - * @param reader - * @param name - * @return - */ - protected List getQNames(XMLStreamReader reader, String name) { - String value = reader.getAttributeValue(null, name); - if (value != null) { - List qnames = new ArrayList(); - for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) { - qnames.add(getQName(reader, tokens.nextToken())); - } - return qnames; - } else { - return Collections.emptyList(); - } - } - - /** - * Read policy intents. - * @param attachPoint - * @param reader - */ - protected void readIntents(IntentAttachPoint attachPoint, XMLStreamReader reader) { - readIntents(attachPoint, null, reader); - } - - /** - * Read policy intents associated with an operation. - * @param attachPoint - * @param operation - * @param reader - */ - protected void readIntents(IntentAttachPoint attachPoint, Operation operation, XMLStreamReader reader) { - String value = reader.getAttributeValue(null, Constants.REQUIRES); - if (value != null) { - List requiredIntents = attachPoint.getRequiredIntents(); - for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) { - QName qname = getQNameValue(reader, tokens.nextToken()); - Intent intent = policyFactory.createIntent(); - intent.setName(qname); - if (operation != null) { - intent.getOperations().add(operation); - } - requiredIntents.add(intent); - } - } - } - - /** - * Reads policy intents and policy sets. - * @param attachPoint - * @param reader - */ - protected void readPolicies(PolicySetAttachPoint attachPoint, XMLStreamReader reader) { - readPolicies(attachPoint, null, reader); - } - - /** - * Reads policy intents and policy sets associated with an operation. - * @param attachPoint - * @param operation - * @param reader - */ - protected void readPolicies(PolicySetAttachPoint attachPoint, Operation operation, XMLStreamReader reader) { - readIntents(attachPoint, operation, reader); - - String value = reader.getAttributeValue(null, Constants.POLICY_SETS); - if (value != null) { - List policySets = attachPoint.getPolicySets(); - for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) { - QName qname = getQNameValue(reader, tokens.nextToken()); - PolicySet policySet = policyFactory.createPolicySet(); - policySet.setName(qname); - if (operation != null) { - policySet.getOperations().add(operation); - } - policySets.add(policySet); - } - } - } - - /** - * Read list of reference targets - * @param reference - * @param reader - */ - protected void readTargets(Reference reference, XMLStreamReader reader) { - String value = reader.getAttributeValue(null, Constants.TARGET); - ComponentService target = null; - if (value != null) { - for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) { - target = assemblyFactory.createComponentService(); - target.setUnresolved(true); - target.setName(tokens.nextToken()); - reference.getTargets().add(target); - } - } - } - - /** - * Read a multiplicity attribute. - * @param reference - * @param reader - */ - protected void readMultiplicity(AbstractReference reference, XMLStreamReader reader) { - String value = reader.getAttributeValue(null, MULTIPLICITY); - if (ZERO_ONE.equals(value)) { - reference.setMultiplicity(Multiplicity.ZERO_ONE); - } else if (ONE_N.equals(value)) { - reference.setMultiplicity(Multiplicity.ONE_N); - } else if (ZERO_N.equals(value)) { - reference.setMultiplicity(Multiplicity.ZERO_N); - } - } - - /** - * Returns the value of a constrainingType attribute. - * @param reader - * @return - */ - protected ConstrainingType getConstrainingType(XMLStreamReader reader) { - QName constrainingTypeName = getQName(reader, "constrainingType"); - if (constrainingTypeName != null) { - ConstrainingType constrainingType = assemblyFactory.createConstrainingType(); - constrainingType.setName(constrainingTypeName); - constrainingType.setUnresolved(true); - return constrainingType; - } else { - return null; - } - } - - /** - * Reads an abstract property element. - * @param prop - * @param reader - * @throws XMLStreamException - * @throws ContributionReadException - */ - protected void readAbstractProperty(AbstractProperty prop, XMLStreamReader reader) - throws XMLStreamException, ContributionReadException { - prop.setName(getString(reader, "name")); - prop.setMany(getBoolean(reader, "many")); - prop.setMustSupply(getBoolean(reader, "mustSupply")); - prop.setXSDElement(getQName(reader, "element")); - prop.setXSDType(getQName(reader, "type")); - try { - Document value = readPropertyValue(reader, prop.getXSDType()); - prop.setValue(value); - } catch (ParserConfigurationException e) { - throw new ContributionReadException(e); - } - } - - /** - * Reads a property element. - * @param prop - * @param reader - * @throws XMLStreamException - * @throws ContributionReadException - */ - protected void readProperty(Property prop, XMLStreamReader reader) - throws XMLStreamException, ContributionReadException { - readAbstractProperty(prop, reader); - } - - /** - * Parse the next child element. - * @param reader - * @return - * @throws XMLStreamException - */ - protected boolean nextChildElement(XMLStreamReader reader) throws XMLStreamException { - while (reader.hasNext()) { - int event = reader.next(); - if (event == END_ELEMENT) { - return false; - } - if (event == START_ELEMENT) { - return true; - } - } - return false; - } - - /** - * Advance the stream to the next END_ELEMENT event skipping any nested - * content. - * @param reader the reader to advance - * @throws XMLStreamException if there was a problem reading the stream - */ - protected void skipToEndElement(XMLStreamReader reader) throws XMLStreamException { - int depth = 0; - while (reader.hasNext()) { - int event = reader.next(); - if (event == XMLStreamConstants.START_ELEMENT) { - depth++; - } else if (event == XMLStreamConstants.END_ELEMENT) { - if (depth == 0) { - return; - } - depth--; - } - } - } - - /** - * Resolve an implementation. - * @param implementation - * @param resolver - * @return - * @throws ContributionResolveException - */ - protected Implementation resolveImplementation(Implementation implementation, ModelResolver resolver) throws ContributionResolveException { - if (implementation != null) { - if (implementation.isUnresolved()) { - implementation = resolver.resolveModel(Implementation.class, implementation); - - // Lazily resolve implementations - if (implementation.isUnresolved()) { - extensionProcessor.resolve(implementation, resolver); - if (!implementation.isUnresolved()) { - resolver.addModel(implementation); - } - } - } - } - return implementation; - } - - /** - * Resolve interface, callback interface and bindings on a list of contracts. - * @param contracts the list of contracts - * @param resolver the resolver to use to resolve models - */ - protected void resolveContracts(List contracts, ModelResolver resolver) throws ContributionResolveException { - for (Contract contract: contracts) { - - // Resolve the interface contract - InterfaceContract interfaceContract = contract.getInterfaceContract(); - if (interfaceContract != null) { - extensionProcessor.resolve(interfaceContract, resolver); - } - - // Resolve bindings - for (int i = 0, n = contract.getBindings().size(); i < n; i++) { - Binding binding = contract.getBindings().get(i); - extensionProcessor.resolve(binding, resolver); - } - } - } - - /** - * Resolve interface and callback interface on a list of abstract contracts. - * @param contracts the list of contracts - * @param resolver the resolver to use to resolve models - */ - protected void resolveAbstractContracts(List contracts, ModelResolver resolver) throws ContributionResolveException { - for (AbstractContract contract: contracts) { - - // Resolve the interface contract - InterfaceContract interfaceContract = contract.getInterfaceContract(); - if (interfaceContract != null) { - extensionProcessor.resolve(interfaceContract, resolver); - } - } - } - - /** - * Start an element. - * @param uri - * @param name - * @param attrs - * @throws XMLStreamException - */ - protected void writeStart(XMLStreamWriter writer, String uri, String name, XAttr... attrs) throws XMLStreamException { - writer.writeStartElement(uri, name); - writeAttributes(writer, attrs); - } - - /** - * Start an element. - * @param writer - * @param name - * @param attrs - * @throws XMLStreamException - */ - protected void writeStart(XMLStreamWriter writer, String name, XAttr... attrs) throws XMLStreamException { - writer.writeStartElement(SCA10_NS, name); - writeAttributes(writer, attrs); - } - - /** - * End an element. - * @param writer - * @throws XMLStreamException - */ - protected void writeEnd(XMLStreamWriter writer) throws XMLStreamException { - writer.writeEndElement(); - } - - /** - * Start a document. - * @param writer - * @throws XMLStreamException - */ - protected void writeStartDocument(XMLStreamWriter writer, String name, XAttr... attrs) throws XMLStreamException { - writer.writeStartDocument(); - writer.setDefaultNamespace(SCA10_NS); - writeStart(writer, name, attrs); - writer.writeDefaultNamespace(SCA10_NS); - } - - /** - * End a document. - * @param writer - * @throws XMLStreamException - */ - protected void writeEndDocument(XMLStreamWriter writer) throws XMLStreamException { - writer.writeEndDocument(); - } - - /** - * Write attributes to the current element. - * @param writer - * @param attrs - * @throws XMLStreamException - */ - protected void writeAttributes(XMLStreamWriter writer, XAttr... attrs) throws XMLStreamException { - for (XAttr attr : attrs) { - if (attr != null) - attr.write(writer); - } - } - - /** - * Write an SCA abstract property declaration. - * @param writer - * @param prop - */ - protected void writeAbstractProperty(XMLStreamWriter writer, AbstractProperty prop) throws XMLStreamException { - } - - /** - * Write an SCA property declaration. - * @param writer - * @param prop - */ - protected void writeProperty(XMLStreamWriter writer, Property prop) throws XMLStreamException { - writeAbstractProperty(writer, prop); - } - - /** - * Returns a constrainingType attribute. - * @param componentType - * @return - */ - protected QName getConstrainingTypeAttr(ComponentType componentType) { - ConstrainingType constrainingType = componentType.getConstrainingType(); - if (constrainingType != null) - return constrainingType.getName(); - else - return null; - } - - /** - * Read a property value into a DOM document. - * @param reader - * @param type - * @return - * @throws XMLStreamException - * @throws ContributionReadException - * @throws ParserConfigurationException - */ - protected Document readPropertyValue(XMLStreamReader reader, QName type) - throws XMLStreamException, ParserConfigurationException { - - Document doc = createDocument(); - - // root element has no namespace and local name "value" - Element root = doc.createElementNS(null, "value"); - if (type != null) { - org.w3c.dom.Attr xsi = doc.createAttributeNS(XMLNS_ATTRIBUTE_NS_URI, "xmlns:xsi"); - xsi.setValue(W3C_XML_SCHEMA_INSTANCE_NS_URI); - root.setAttributeNodeNS(xsi); - - String prefix = type.getPrefix(); - if (prefix == null || prefix.length() == 0) { - prefix = "ns"; - } - - declareNamespace(root, prefix, type.getNamespaceURI()); - - org.w3c.dom.Attr xsiType = doc.createAttributeNS(W3C_XML_SCHEMA_INSTANCE_NS_URI, "xsi:type"); - xsiType.setValue(prefix + ":" + type.getLocalPart()); - root.setAttributeNodeNS(xsiType); - } - doc.appendChild(root); - - loadElement(reader, root); - return doc; - } - - /** - * Create a new DOM document. - * @return - * @throws ContributionReadException - */ - private Document createDocument() throws ParserConfigurationException { - return domFactory.newDocumentBuilder().newDocument(); - } - - /** - * Create a DOM element - * @param document - * @param name - * @return - */ - private Element createElement(Document document, QName name) { - String prefix = name.getPrefix(); - String qname = (prefix != null && prefix.length() > 0) ? prefix + ":" + name.getLocalPart() : name - .getLocalPart(); - return document.createElementNS(name.getNamespaceURI(), qname); - } - - /** - * Declare a namespace. - * @param element - * @param prefix - * @param ns - */ - private void declareNamespace(Element element, String prefix, String ns) { - String qname = null; - if ("".equals(prefix)) { - qname = "xmlns"; - } else { - qname = "xmlns:" + prefix; - } - Node node = element; - boolean declared = false; - while (node != null && node.getNodeType() == Node.ELEMENT_NODE) { - NamedNodeMap attrs = node.getAttributes(); - if (attrs == null) { - break; - } - Node attr = attrs.getNamedItem(qname); - if (attr != null) { - declared = ns.equals(attr.getNodeValue()); - break; - } - node = node.getParentNode(); - } - if (!declared) { - org.w3c.dom.Attr attr = element.getOwnerDocument().createAttributeNS(XMLNS_ATTRIBUTE_NS_URI, qname); - attr.setValue(ns); - element.setAttributeNodeNS(attr); - } - } - - /** - * Load a property value specification from an StAX stream into a DOM - * Document. Only elements, text and attributes are processed; all comments - * and other whitespace are ignored. - * - * @param reader the stream to read from - * @param root the DOM node to load - * @throws javax.xml.stream.XMLStreamException - */ - private void loadElement(XMLStreamReader reader, Element root) throws XMLStreamException { - Document document = root.getOwnerDocument(); - Node current = root; - while (true) { - switch (reader.next()) { - case XMLStreamConstants.START_ELEMENT: - QName name = reader.getName(); - Element child = createElement(document, name); - - // push the new element and make it the current one - current.appendChild(child); - current = child; - - declareNamespace(child, name.getPrefix(), name.getNamespaceURI()); - - int count = reader.getNamespaceCount(); - for (int i = 0; i < count; i++) { - String prefix = reader.getNamespacePrefix(i); - String ns = reader.getNamespaceURI(i); - declareNamespace(child, prefix, ns); - } - - // add the attributes for this element - count = reader.getAttributeCount(); - for (int i = 0; i < count; i++) { - String ns = reader.getAttributeNamespace(i); - String prefix = reader.getAttributePrefix(i); - String localPart = reader.getAttributeLocalName(i); - String value = reader.getAttributeValue(i); - child.setAttributeNS(ns, localPart, value); - declareNamespace(child, prefix, ns); - } - - break; - case XMLStreamConstants.CDATA: - current.appendChild(document.createCDATASection(reader.getText())); - break; - case XMLStreamConstants.CHARACTERS: - current.appendChild(document.createTextNode(reader.getText())); - break; - case XMLStreamConstants.END_ELEMENT: - // if we are back at the root then we are done - if (current == root) { - return; - } - - // pop the element off the stack - current = current.getParentNode(); - } - } - } -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeDocumentProcessor.java b/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeDocumentProcessor.java deleted file mode 100644 index 32655689b2..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeDocumentProcessor.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.net.URL; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; - -/** - * A componentType processor. - * - * @version $Rev$ $Date$ - */ -public class ComponentTypeDocumentProcessor extends BaseArtifactProcessor implements URLArtifactProcessor { - private XMLInputFactory inputFactory; - - /** - * Constructs a new componentType processor. - * @param factory - * @param policyFactory - * @param registry - */ - public ComponentTypeDocumentProcessor(StAXArtifactProcessor staxProcessor, XMLInputFactory inputFactory) { - super(null, null, staxProcessor); - this.inputFactory = inputFactory; - } - - public ComponentType read(URL contributionURL, URI uri, URL url) throws ContributionReadException { - InputStream urlStream = null; - try { - urlStream = url.openStream(); - XMLStreamReader reader = inputFactory.createXMLStreamReader(urlStream); - reader.nextTag(); - ComponentType componentType = (ComponentType)extensionProcessor.read(reader); - componentType.setURI(url.toString()); - return componentType; - - } catch (XMLStreamException e) { - throw new ContributionReadException(e); - } catch (IOException e) { - throw new ContributionReadException(e); - } finally { - try { - if (urlStream != null) { - urlStream.close(); - urlStream = null; - } - } catch (IOException ioe) { - //ignore - } - } - } - - public void resolve(ComponentType componentType, ModelResolver resolver) throws ContributionResolveException { - extensionProcessor.resolve(componentType, resolver); - } - - public String getArtifactType() { - return ".componentType"; - } - - public Class getModelType() { - return ComponentType.class; - } -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeProcessor.java b/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeProcessor.java deleted file mode 100644 index 386842e8d6..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ComponentTypeProcessor.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; -import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Base; -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Callback; -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.Contract; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.contribution.service.ContributionWriteException; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * A componentType processor. - * - * @version $Rev$ $Date$ - */ -public class ComponentTypeProcessor extends BaseArtifactProcessor implements StAXArtifactProcessor { - - /** - * Constructs a new componentType processor. - * @param factory - * @param policyFactory - * @param registry - */ - public ComponentTypeProcessor(AssemblyFactory factory, PolicyFactory policyFactory, StAXArtifactProcessor extensionProcessor) { - super(factory, policyFactory, extensionProcessor); - } - - public ComponentType read(XMLStreamReader reader) throws ContributionReadException { - ComponentType componentType = null; - Service service = null; - Reference reference = null; - Contract contract = null; - Property property = null; - Callback callback = null; - QName name = null; - - try { - - // Read the componentType document - while (reader.hasNext()) { - int event = reader.getEventType(); - switch (event) { - case START_ELEMENT: - name = reader.getName(); - - if (Constants.COMPONENT_TYPE_QNAME.equals(name)) { - - // Read a - componentType = assemblyFactory.createComponentType(); - componentType.setConstrainingType(getConstrainingType(reader)); - readPolicies(componentType, reader); - - } else if (Constants.SERVICE_QNAME.equals(name)) { - - // Read a - service = assemblyFactory.createService(); - contract = service; - service.setName(getString(reader, Constants.NAME)); - componentType.getServices().add(service); - readPolicies(service, reader); - - } else if (Constants.REFERENCE_QNAME.equals(name)) { - // Read a - reference = assemblyFactory.createReference(); - contract = reference; - reference.setName(getString(reader, Constants.NAME)); - reference.setWiredByImpl(getBoolean(reader, Constants.WIRED_BY_IMPL)); - readMultiplicity(reference, reader); - readTargets(reference, reader); - componentType.getReferences().add(reference); - readPolicies(reference, reader); - - } else if (Constants.PROPERTY_QNAME.equals(name)) { - - // Read a - property = assemblyFactory.createProperty(); - readPolicies(property, reader); - readProperty(property, reader); - componentType.getProperties().add(property); - - } else if (Constants.CALLBACK_QNAME.equals(name)) { - - // Read a - callback = assemblyFactory.createCallback(); - contract.setCallback(callback); - readPolicies(callback, reader); - - } else if (OPERATION.equals(name)) { - - // Read an - Operation operation = assemblyFactory.createOperation(); - operation.setName(getString(reader, NAME)); - operation.setUnresolved(true); - if (callback != null) { - readPolicies(callback, operation, reader); - } else { - readPolicies(contract, operation, reader); - } - } else { - - // Read an extension element - Object extension = extensionProcessor.read(reader); - if (extension != null) { - if (extension instanceof InterfaceContract) { - - // and - contract.setInterfaceContract((InterfaceContract)extension); - - } else if (extension instanceof Binding) { - - // and - contract.getBindings().add((Binding)extension); - } - } - } - break; - - case END_ELEMENT: - name = reader.getName(); - - // Clear current state when reading reaching end element - if (SERVICE_QNAME.equals(name)) { - service = null; - contract = null; - } else if (REFERENCE_QNAME.equals(name)) { - reference = null; - contract = null; - } else if (PROPERTY_QNAME.equals(name)) { - property = null; - } else if (CALLBACK_QNAME.equals(name)) { - callback = null; - } - break; - } - - // Read the next element - if (reader.hasNext()) { - reader.next(); - } - } - - } catch (XMLStreamException e) { - throw new ContributionReadException(e); - } - return componentType; - } - - public void validate(ComponentType componentType, List problems) { - if (problems == null) { - problems = new ArrayList(); - } - validatePropertyDefinitions(componentType.getProperties(), problems); - } - - public void validatePropertyDefinitions(List properties, List problems) { - for(Property aProperty : properties) { - if (aProperty.isMustSupply() && aProperty.getValue() != null) { - problems.add(aProperty); - } - } - } - - public void write(ComponentType componentType, XMLStreamWriter writer) throws ContributionWriteException { - - try { - writeStartDocument(writer, COMPONENT_TYPE, - new XAttr(CONSTRAINING_TYPE, getConstrainingTypeAttr(componentType))); - - for (Service service : componentType.getServices()) { - writeStart(writer, SERVICE, new XAttr(NAME, service.getName())); - - extensionProcessor.write(service.getInterfaceContract(), writer); - - for (Binding binding: service.getBindings()) { - extensionProcessor.write(binding, writer); - } - - if (service.getCallback() != null) { - writeStart(writer, CALLBACK); - writeEnd(writer); - } - writeEnd(writer); - } - - for (Reference reference : componentType.getReferences()) { - // TODO handle multivalued target attribute - String target = reference.getTargets().isEmpty() ? null : reference.getTargets().get(0).getName(); - writeStart(writer, REFERENCE, - new XAttr(NAME, reference.getName()), - new XAttr(TARGET, target)); - - extensionProcessor.write(reference.getInterfaceContract(), writer); - - for (Binding binding: reference.getBindings()) { - extensionProcessor.write(binding, writer); - } - - if (reference.getCallback() != null) { - writeStart(writer, CALLBACK); - writeEnd(writer); - } - writeEnd(writer); - } - - for (Property property : componentType.getProperties()) { - writeStart(writer, PROPERTY, new XAttr(NAME, property.getName())); - writeEnd(writer); - } - - writeEndDocument(writer); - - } catch (XMLStreamException e) { - throw new ContributionWriteException(e); - } - } - - public void resolve(ComponentType componentType, ModelResolver resolver) throws ContributionResolveException { - - // Resolve component type services and references - resolveContracts(componentType.getServices(), resolver); - resolveContracts(componentType.getReferences(), resolver); - } - - public QName getArtifactType() { - return COMPONENT_TYPE_QNAME; - } - - public Class getModelType() { - return ComponentType.class; - } -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java b/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java deleted file mode 100644 index feafb73c05..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeDocumentProcessor.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.net.URL; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; - -/** - * A composite processor. - * - * @version $Rev$ $Date$ - */ -public class CompositeDocumentProcessor extends BaseArtifactProcessor implements URLArtifactProcessor { - private XMLInputFactory inputFactory; - - /** - * Construct a new composite processor - * @param assemblyFactory - * @param policyFactory - * @param staxProcessor - */ - public CompositeDocumentProcessor(StAXArtifactProcessor staxProcessor, XMLInputFactory inputFactory) { - super(null, null, staxProcessor); - this.inputFactory = inputFactory; - } - - public Composite read(URL contributionURL, URI uri, URL url) throws ContributionReadException { - InputStream urlStream = null; - try { - urlStream = url.openStream(); - XMLStreamReader reader = inputFactory.createXMLStreamReader(urlStream); - reader.nextTag(); - Composite composite = (Composite)extensionProcessor.read(reader); - return composite; - - } catch (XMLStreamException e) { - throw new ContributionReadException(e); - } catch (IOException e) { - throw new ContributionReadException(e); - } finally { - try { - if (urlStream != null) { - urlStream.close(); - urlStream = null; - } - } catch (IOException ioe) { - //ignore - } - } - } - - public void resolve(Composite composite, ModelResolver resolver) throws ContributionResolveException { - extensionProcessor.resolve(composite, resolver); - } - - public String getArtifactType() { - return ".composite"; - } - - public Class getModelType() { - return Composite.class; - } -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java b/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java deleted file mode 100644 index 6e68780ff5..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeProcessor.java +++ /dev/null @@ -1,503 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; -import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; - -import java.util.StringTokenizer; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Callback; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentProperty; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.CompositeReference; -import org.apache.tuscany.sca.assembly.CompositeService; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.Contract; -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.assembly.Wire; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.contribution.service.ContributionWriteException; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * A composite processor. - * - * @version $Rev$ $Date$ - */ -public class CompositeProcessor extends BaseArtifactProcessor implements StAXArtifactProcessor { - - /** - * Construct a new composite processor - * @param assemblyFactory - * @param policyFactory - * @param extensionProcessor - */ - public CompositeProcessor(AssemblyFactory factory, PolicyFactory policyFactory, - InterfaceContractMapper interfaceContractMapper, - StAXArtifactProcessor extensionProcessor) { - super(factory, policyFactory, extensionProcessor); - } - - public Composite read(XMLStreamReader reader) throws ContributionReadException { - Composite composite = null; - Composite include = null; - Component component = null; - Property property = null; - ComponentService componentService = null; - ComponentReference componentReference = null; - ComponentProperty componentProperty = null; - CompositeService compositeService = null; - CompositeReference compositeReference = null; - Contract contract = null; - Wire wire = null; - Callback callback = null; - QName name = null; - - try { - - // Read the composite document - while (reader.hasNext()) { - int event = reader.getEventType(); - switch (event) { - case START_ELEMENT: - name = reader.getName(); - - if (COMPOSITE_QNAME.equals(name)) { - - // Read a - composite = assemblyFactory.createComposite(); - composite.setName(new QName(getString(reader, TARGET_NAMESPACE), getString(reader, NAME))); - composite.setAutowire(getBoolean(reader, AUTOWIRE)); - composite.setLocal(getBoolean(reader, LOCAL)); - composite.setConstrainingType(getConstrainingType(reader)); - readPolicies(composite, reader); - - } else if (INCLUDE_QNAME.equals(name)) { - - // Read an - include = assemblyFactory.createComposite(); - include.setUnresolved(true); - composite.getIncludes().add(include); - - } else if (SERVICE_QNAME.equals(name)) { - if (component != null) { - - // Read a - componentService = assemblyFactory.createComponentService(); - contract = componentService; - componentService.setName(getString(reader, NAME)); - component.getServices().add(componentService); - readPolicies(contract, reader); - } else { - - // Read a - compositeService = assemblyFactory.createCompositeService(); - contract = compositeService; - compositeService.setName(getString(reader, NAME)); - - ComponentService promoted = assemblyFactory.createComponentService(); - promoted.setUnresolved(true); - promoted.setName(getString(reader, PROMOTE)); - compositeService.setPromotedService(promoted); - - composite.getServices().add(compositeService); - readPolicies(contract, reader); - } - - } else if (REFERENCE_QNAME.equals(name)) { - if (component != null) { - // Read a - componentReference = assemblyFactory.createComponentReference(); - contract = componentReference; - componentReference.setName(getString(reader, NAME)); - readMultiplicity(componentReference, reader); - componentReference.setAutowire(getBoolean(reader, AUTOWIRE)); - readTargets(componentReference, reader); - componentReference.setWiredByImpl(getBoolean(reader, WIRED_BY_IMPL)); - component.getReferences().add(componentReference); - readPolicies(contract, reader); - } else { - // Read a - compositeReference = assemblyFactory.createCompositeReference(); - contract = compositeReference; - compositeReference.setName(getString(reader, NAME)); - readMultiplicity(compositeReference, reader); - readTargets(compositeReference, reader); - readPromotes(compositeReference, reader); - compositeReference.setWiredByImpl(getBoolean(reader, WIRED_BY_IMPL)); - composite.getReferences().add(compositeReference); - readPolicies(contract, reader); - } - - } else if (PROPERTY_QNAME.equals(name)) { - if (component != null) { - // Read a - componentProperty = assemblyFactory.createComponentProperty(); - property = componentProperty; - componentProperty.setSource(getString(reader, SOURCE)); - componentProperty.setFile(getString(reader, FILE)); - readPolicies(property, reader); - readProperty(componentProperty, reader); - component.getProperties().add(componentProperty); - } else { - - // Read a - property = assemblyFactory.createProperty(); - readPolicies(property, reader); - readProperty(property, reader); - composite.getProperties().add(property); - } - - } else if (COMPONENT_QNAME.equals(name)) { - - // Read a - component = assemblyFactory.createComponent(); - component.setName(getString(reader, NAME)); - component.setConstrainingType(getConstrainingType(reader)); - composite.getComponents().add(component); - readPolicies(component, reader); - - } else if (WIRE_QNAME.equals(name)) { - - // Read a - wire = assemblyFactory.createWire(); - ComponentReference source = assemblyFactory.createComponentReference(); - source.setUnresolved(true); - source.setName(getString(reader, SOURCE)); - wire.setSource(source); - - ComponentService target = assemblyFactory.createComponentService(); - target.setUnresolved(true); - target.setName(getString(reader, TARGET)); - wire.setTarget(target); - - composite.getWires().add(wire); - readPolicies(wire, reader); - - } else if (CALLBACK_QNAME.equals(name)) { - - // Read a - callback = assemblyFactory.createCallback(); - contract.setCallback(callback); - readPolicies(callback, reader); - - } else if (OPERATION_QNAME.equals(name)) { - - // Read an - Operation operation = assemblyFactory.createOperation(); - operation.setName(getString(reader, NAME)); - operation.setUnresolved(true); - if (callback != null) { - readPolicies(callback, operation, reader); - } else { - readPolicies(contract, operation, reader); - } - } else if (IMPLEMENTATION_COMPOSITE_QNAME.equals(name)) { - - // Read an implementation.composite - Composite implementation = assemblyFactory.createComposite(); - implementation.setName(getQName(reader, NAME)); - implementation.setUnresolved(true); - component.setImplementation(implementation); - - } else { - - // Read an extension element - Object extension = extensionProcessor.read(reader); - if (extension != null) { - if (extension instanceof InterfaceContract) { - - // and - // - contract.setInterfaceContract((InterfaceContract)extension); - - } else if (extension instanceof Binding) { - // and - contract.getBindings().add((Binding)extension); - - } else if (extension instanceof Implementation) { - - // - component.setImplementation((Implementation)extension); - } else { - - // FIXME: We need to decide where to host the extensions - composite.getExtensions().add(extension); - } - } - } - break; - - case XMLStreamConstants.CHARACTERS: - - // Read an qname - if (include != null && INCLUDE_QNAME.equals(name)) { - include.setName(getQNameValue(reader, reader.getText().trim())); - } - - break; - - case END_ELEMENT: - name = reader.getName(); - - // Clear current state when reading reaching end element - if (SERVICE_QNAME.equals(name)) { - componentService = null; - compositeService = null; - contract = null; - } else if (INCLUDE_QNAME.equals(name)) { - include = null; - } else if (REFERENCE_QNAME.equals(name)) { - componentReference = null; - compositeReference = null; - contract = null; - } else if (PROPERTY_QNAME.equals(name)) { - componentProperty = null; - property = null; - } else if (COMPONENT_QNAME.equals(name)) { - component = null; - } else if (WIRE_QNAME.equals(name)) { - wire = null; - } else if (CALLBACK_QNAME.equals(name)) { - callback = null; - } - break; - } - - // Read the next element - if (reader.hasNext()) { - reader.next(); - } - } - return composite; - - } catch (XMLStreamException e) { - throw new ContributionReadException(e); - } - } - - public void write(Composite composite, XMLStreamWriter writer) throws ContributionWriteException { - - try { - writeStartDocument(writer, COMPOSITE, - new XAttr(CONSTRAINING_TYPE, getConstrainingTypeAttr(composite)), - new XAttr(TARGET_NAMESPACE, composite.getName().getNamespaceURI()), - new XAttr(NAME, composite.getName().getLocalPart())); - - for (Service service : composite.getServices()) { - CompositeService compositeService = (CompositeService)service; - ComponentService promotedService = compositeService.getPromotedService(); - String promote = promotedService != null ? promotedService.getName() : null; - writeStart(writer, SERVICE, new XAttr(NAME, service.getName()), new XAttr(PROMOTE, promote)); - - extensionProcessor.write(service.getInterfaceContract(), writer); - - for (Binding binding: service.getBindings()) { - extensionProcessor.write(binding, writer); - } - - if (service.getCallback() != null) { - writeStart(writer, CALLBACK); - writeEnd(writer); - } - writeEnd(writer); - } - - for (Component component : composite.getComponents()) { - writeStart(writer, COMPONENT, new XAttr(NAME, component.getName())); - - for (ComponentService service : component.getServices()) { - writeStart(writer, SERVICE, new XAttr(NAME, service.getName())); - - extensionProcessor.write(service.getInterfaceContract(), writer); - - for (Binding binding: service.getBindings()) { - extensionProcessor.write(binding, writer); - } - - if (service.getCallback() != null) { - writeStart(writer, CALLBACK); - writeEnd(writer); - } - writeEnd(writer); - } - - for (ComponentReference reference : component.getReferences()) { - // TODO handle multivalued target attribute - String target = reference.getTargets().isEmpty() ? null : reference.getTargets().get(0).getName(); - writeStart(writer, REFERENCE, - new XAttr(NAME, reference.getName()), - new XAttr(TARGET,target)); - - extensionProcessor.write(reference.getInterfaceContract(), writer); - - for (Binding binding: reference.getBindings()) { - extensionProcessor.write(binding, writer); - } - - if (reference.getCallback() != null) { - writeStart(writer, CALLBACK); - writeEnd(writer); - } - writeEnd(writer); - } - - for (ComponentProperty property : component.getProperties()) { - writeStart(writer, PROPERTY, new XAttr(NAME, property.getName())); - writeEnd(writer); - } - - // Write the component implementation - Implementation implementation = component.getImplementation(); - if (implementation instanceof Composite) { - writeStart(writer, IMPLEMENTATION_COMPOSITE, - new XAttr(NAME, composite.getName())); - writeEnd(writer); - } else { - extensionProcessor.write(component.getImplementation(), writer); - } - - writeEnd(writer); - } - - for (Reference reference : composite.getReferences()) { - // TODO handle multivalued promote attribute - CompositeReference compositeReference = (CompositeReference)reference; - String promote; - if (!compositeReference.getPromotedReferences().isEmpty()) - promote = compositeReference.getPromotedReferences().get(0).getName(); - else - promote = null; - writeStart(writer, REFERENCE, - new XAttr(NAME, reference.getName()), - new XAttr(PROMOTE, promote)); - - extensionProcessor.write(reference.getInterfaceContract(), writer); - - for (Binding binding: reference.getBindings()) { - extensionProcessor.write(binding, writer); - } - - if (reference.getCallback() != null) { - writeStart(writer, CALLBACK); - writeEnd(writer); - } - writeEnd(writer); - } - - for (Property property : composite.getProperties()) { - writeStart(writer, PROPERTY, new XAttr(NAME, property.getName())); - writeEnd(writer); - } - - writeEndDocument(writer); - - } catch (XMLStreamException e) { - throw new ContributionWriteException(e); - } - } - - public void resolve(Composite composite, ModelResolver resolver) throws ContributionResolveException { - - // Resolve constraining type - ConstrainingType constrainingType = composite.getConstrainingType(); - constrainingType = resolver.resolveModel(ConstrainingType.class, constrainingType); - composite.setConstrainingType(constrainingType); - - // Resolve includes in the composite - for (int i = 0, n = composite.getIncludes().size(); i < n; i++) { - Composite include = composite.getIncludes().get(i); - include = resolver.resolveModel(Composite.class, include); - composite.getIncludes().set(i, include); - } - - // resolve and extensions to the standard SCDL that appear in the - // SCDL. - for (int i = 0, n = composite.getExtensions().size(); i < n; i++) { - Object model = composite.getExtensions().get(i); - extensionProcessor.resolve(model, resolver); - } - - // Resolve component implementations, services and references - for (Component component: composite.getComponents()) { - constrainingType = component.getConstrainingType(); - constrainingType = resolver.resolveModel(ConstrainingType.class, constrainingType); - component.setConstrainingType(constrainingType); - - Implementation implementation = component.getImplementation(); - implementation = resolveImplementation(implementation, resolver); - component.setImplementation(implementation); - - resolveContracts(component.getServices(), resolver); - resolveContracts(component.getReferences(), resolver); - } - - // Resolve composite services and references - resolveContracts(composite.getServices(), resolver); - resolveContracts(composite.getReferences(), resolver); - } - - public QName getArtifactType() { - return COMPOSITE_QNAME; - } - - public Class getModelType() { - return Composite.class; - } - - /** - * Read list of refence targets - * @param reference - * @param reader - */ - protected void readPromotes(CompositeReference reference, XMLStreamReader reader) { - String value = reader.getAttributeValue(null, Constants.PROMOTE); - ComponentReference promoted = null; - if (value != null) { - for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) { - promoted = assemblyFactory.createComponentReference(); - promoted.setUnresolved(true); - promoted.setName(tokens.nextToken()); - reference.getPromotedReferences().add(promoted); - } - } - } -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java b/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java deleted file mode 100644 index cd98685203..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Constants.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import javax.xml.namespace.QName; - -/** - * Constants used in SCA assembly XML files. - */ -public interface Constants { - String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0"; - String COMPONENT_TYPE = "componentType"; - QName COMPONENT_TYPE_QNAME = new QName(SCA10_NS, COMPONENT_TYPE); - String SERVICE = "service"; - QName SERVICE_QNAME = new QName(SCA10_NS, SERVICE); - String REFERENCE = "reference"; - QName REFERENCE_QNAME = new QName(SCA10_NS, REFERENCE); - String PROPERTY = "property"; - QName PROPERTY_QNAME = new QName(SCA10_NS, PROPERTY); - String CONSTRAINING_TYPE = "constrainingType"; - QName CONSTRAINING_TYPE_QNAME = new QName(SCA10_NS, CONSTRAINING_TYPE); - String COMPOSITE = "composite"; - QName COMPOSITE_QNAME = new QName(SCA10_NS, COMPOSITE); - String INCLUDE = "include"; - QName INCLUDE_QNAME = new QName(SCA10_NS, INCLUDE); - String COMPONENT = "component"; - QName COMPONENT_QNAME = new QName(SCA10_NS, COMPONENT); - String WIRE = "wire"; - QName WIRE_QNAME = new QName(SCA10_NS, WIRE); - String NAME = "name"; - String TARGET_NAMESPACE = "targetNamespace"; - String LOCAL = "local"; - String AUTOWIRE = "autowire"; - String REQUIRES = "requires"; - String POLICY_SETS = "policySets"; - String OPERATION = "operation"; - QName OPERATION_QNAME = new QName(SCA10_NS, OPERATION); - String CALLBACK = "callback"; - QName CALLBACK_QNAME = new QName(SCA10_NS, CALLBACK); - String PROMOTE = "promote"; - String TARGET = "target"; - String WIRED_BY_IMPL = "wiredByImpl"; - String MULTIPLICITY = "multiplicity"; - String TYPE = "type"; - String ELEMENT = "element"; - String MANY = "many"; - String MUST_SUPPLY = "mustSupply"; - String SOURCE = "source"; - String FILE = "file"; - String URI = "uri"; - String ZERO_ONE = "0..1"; - String ZERO_N = "0..n"; - String ONE_ONE = "1..1"; - String ONE_N = "1..n"; - String IMPLEMENTATION_COMPOSITE = "implementation.composite"; - QName IMPLEMENTATION_COMPOSITE_QNAME = new QName(SCA10_NS, IMPLEMENTATION_COMPOSITE); -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeDocumentProcessor.java b/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeDocumentProcessor.java deleted file mode 100644 index fa22602356..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeDocumentProcessor.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.net.URL; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; - -/** - * A contrainingType content handler. - * - * @version $Rev$ $Date$ - */ -public class ConstrainingTypeDocumentProcessor extends BaseArtifactProcessor implements URLArtifactProcessor { - private XMLInputFactory inputFactory; - - /** - * Construct a new constrainingType processor. - * @param factory - * @param policyFactory - * @param staxProcessor - */ - public ConstrainingTypeDocumentProcessor(StAXArtifactProcessor staxProcessor, XMLInputFactory inputFactory) { - super(null, null, staxProcessor); - this.inputFactory = inputFactory; - } - - public ConstrainingType read(URL contributionURL, URI uri, URL url) throws ContributionReadException { - InputStream urlStream = null; - try { - urlStream = url.openStream(); - XMLStreamReader reader = inputFactory.createXMLStreamReader(urlStream); - reader.nextTag(); - ConstrainingType constrainingType = (ConstrainingType)extensionProcessor.read(reader); - return constrainingType; - - } catch (XMLStreamException e) { - throw new ContributionReadException(e); - } catch (IOException e) { - throw new ContributionReadException(e); - } finally { - try { - if (urlStream != null) { - urlStream.close(); - urlStream = null; - } - } catch (IOException ioe) { - //ignore - } - } - } - - public void resolve(ConstrainingType constrainingType, ModelResolver resolver) throws ContributionResolveException { - extensionProcessor.resolve(constrainingType, resolver); - } - - public String getArtifactType() { - return ".constrainingType"; - } - - public Class getModelType() { - return ConstrainingType.class; - } -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeProcessor.java b/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeProcessor.java deleted file mode 100644 index 74a9fc430e..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ConstrainingTypeProcessor.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; -import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.assembly.AbstractContract; -import org.apache.tuscany.sca.assembly.AbstractProperty; -import org.apache.tuscany.sca.assembly.AbstractReference; -import org.apache.tuscany.sca.assembly.AbstractService; -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.contribution.service.ContributionWriteException; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * A contrainingType content handler. - * - * @version $Rev$ $Date$ - */ -public class ConstrainingTypeProcessor extends BaseArtifactProcessor implements StAXArtifactProcessor { - - /** - * Construct a new constrainingType processor. - * @param factory - * @param policyFactory - * @param extensionProcessor - */ - public ConstrainingTypeProcessor(AssemblyFactory factory, PolicyFactory policyFactory, StAXArtifactProcessor extensionProcessor) { - super(factory, policyFactory, extensionProcessor); - } - - public ConstrainingType read(XMLStreamReader reader) throws ContributionReadException { - ConstrainingType constrainingType = null; - AbstractService abstractService = null; - AbstractReference abstractReference = null; - AbstractProperty abstractProperty = null; - AbstractContract abstractContract = null; - QName name = null; - - try { - - // Read the constrainingType document - while (reader.hasNext()) { - int event = reader.getEventType(); - switch (event) { - - case START_ELEMENT: - name = reader.getName(); - - // Read a - if (Constants.CONSTRAINING_TYPE_QNAME.equals(name)) { - constrainingType = assemblyFactory.createConstrainingType(); - constrainingType.setName(new QName(getString(reader, TARGET_NAMESPACE), getString(reader, NAME))); - readIntents(constrainingType, reader); - - } else if (Constants.SERVICE_QNAME.equals(name)) { - - // Read a - abstractService = assemblyFactory.createAbstractService(); - abstractContract = abstractService; - abstractService.setName(getString(reader, Constants.NAME)); - constrainingType.getServices().add(abstractService); - readIntents(abstractService, reader); - - } else if (Constants.REFERENCE_QNAME.equals(name)) { - - // Read a - abstractReference = assemblyFactory.createAbstractReference(); - abstractContract = abstractReference; - abstractReference.setName(getString(reader, Constants.NAME)); - readMultiplicity(abstractReference, reader); - constrainingType.getReferences().add(abstractReference); - readIntents(abstractReference, reader); - - } else if (Constants.PROPERTY_QNAME.equals(name)) { - - // Read a - abstractProperty = assemblyFactory.createAbstractProperty(); - readAbstractProperty(abstractProperty, reader); - constrainingType.getProperties().add(abstractProperty); - readIntents(abstractProperty, reader); - - } else if (OPERATION.equals(name)) { - - // Read an - Operation operation = assemblyFactory.createOperation(); - operation.setName(getString(reader, NAME)); - operation.setUnresolved(true); - readIntents(abstractContract, operation, reader); - - } else { - - // Read an extension element - Object extension = extensionProcessor.read(reader); - if (extension instanceof InterfaceContract) { - - // and - abstractContract.setInterfaceContract((InterfaceContract)extension); - } - } - break; - - case END_ELEMENT: - name = reader.getName(); - - // Clear current state when reading reaching end element - if (SERVICE_QNAME.equals(name)) { - abstractService = null; - abstractContract = null; - } else if (REFERENCE_QNAME.equals(name)) { - abstractReference = null; - abstractContract = null; - } else if (PROPERTY_QNAME.equals(name)) { - abstractProperty = null; - } - break; - } - if (reader.hasNext()) { - reader.next(); - } - } - return constrainingType; - - } catch (XMLStreamException e) { - throw new ContributionReadException(e); - } - } - - public void write(ConstrainingType constrainingType, XMLStreamWriter writer) throws ContributionWriteException { - - try { - writeStartDocument(writer, CONSTRAINING_TYPE, - new XAttr(TARGET_NAMESPACE, constrainingType.getName().getNamespaceURI()), - new XAttr(NAME, constrainingType.getName().getLocalPart())); - - for (AbstractService service : constrainingType.getServices()) { - writeStart(writer, SERVICE, new XAttr(NAME, service.getName())); - extensionProcessor.write(service.getInterfaceContract(), writer); - writeEnd(writer); - } - - for (AbstractReference reference : constrainingType.getReferences()) { - writeStart(writer, REFERENCE, - new XAttr(NAME, reference.getName())); - extensionProcessor.write(reference.getInterfaceContract(), writer); - writeEnd(writer); - } - - for (AbstractProperty property : constrainingType.getProperties()) { - writeStart(writer, PROPERTY, new XAttr(NAME, property.getName())); - writeEnd(writer); - } - - writeEndDocument(writer); - - } catch (XMLStreamException e) { - throw new ContributionWriteException(e); - } - } - - public void resolve(ConstrainingType constrainingType, ModelResolver resolver) throws ContributionResolveException { - - // Resolve component type services and references - resolveAbstractContracts(constrainingType.getServices(), resolver); - resolveAbstractContracts(constrainingType.getReferences(), resolver); - } - - public QName getArtifactType() { - return CONSTRAINING_TYPE_QNAME; - } - - public Class getModelType() { - return ConstrainingType.class; - } -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/XAttr.java b/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/XAttr.java deleted file mode 100644 index 3c991798de..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/XAttr.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import javax.xml.namespace.NamespaceContext; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamWriter; - - -/** - * Represents an XML attribute that needs to be written to a document. - * - * @version $Rev$ $Date$ - */ -class XAttr { - - String uri = Constants.SCA10_NS; - String name; - Object value; - - public XAttr(String uri, String name, String value) { - this.uri = uri; - this.name = name; - this.value = value; - } - - public XAttr(String name, String value) { - this.name = name; - this.value = value; - } - - public XAttr(String uri, String name, boolean value) { - this.uri = uri; - this.name = name; - this.value = value; - } - - public XAttr(String name, boolean value) { - this.name = name; - this.value = value; - } - - public XAttr(String uri, String name, QName value) { - this.uri = uri; - this.name = name; - this.value = value; - } - - public XAttr(String name, QName value) { - this.name = name; - this.value = value; - } - - /** - * Writes a string from a qname and registers a prefix for its namespace. - * @param reader - * @param value - * @return - */ - protected String writeQNameValue(XMLStreamWriter writer, QName qname) throws XMLStreamException { - if (qname != null) { - String prefix = qname.getPrefix(); - String uri = qname.getNamespaceURI(); - prefix = writer.getPrefix(uri); - if (prefix != null) { - - // Use the prefix already bound to the given uri - return prefix + ":" + qname.getLocalPart(); - } else { - - // Find an available prefix and bind it to the given uri - NamespaceContext nsc = writer.getNamespaceContext(); - for (int i=1; ; i++) { - prefix = "ns" + i; - if (nsc.getNamespaceURI(prefix) == null) { - break; - } - } - writer.setPrefix(prefix, uri); - writer.writeNamespace(prefix, uri); - return prefix + ":" + qname.getLocalPart(); - } - } else { - return null; - } - } - - void write(XMLStreamWriter writer) throws XMLStreamException { - if (value != null) { - String str; - if (value instanceof QName) { - str = writeQNameValue(writer, (QName)value); - } else { - str = String.valueOf(value); - } - if (uri != null && !uri.equals(Constants.SCA10_NS)) { - writer.writeAttribute(uri, name, str); - } else { - writer.writeAttribute(name,str); - } - } - } - -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadAllTestCase.java b/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadAllTestCase.java deleted file mode 100644 index 110e155bb0..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadAllTestCase.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import java.io.InputStream; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Callback; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.CompositeReference; -import org.apache.tuscany.sca.assembly.CompositeService; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.policy.DefaultPolicyFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -/** - * Test reading SCA XML assemblies. - * - * @version $Rev$ $Date$ - */ -public class ReadAllTestCase extends TestCase { - private ExtensibleStAXArtifactProcessor staxProcessor; - - public void setUp() throws Exception { - AssemblyFactory factory = new DefaultAssemblyFactory(); - PolicyFactory policyFactory = new DefaultPolicyFactory(); - InterfaceContractMapper mapper = new InterfaceContractMapperImpl(); - - StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance()); - - staxProcessors.addArtifactProcessor(new CompositeProcessor(factory, policyFactory, mapper, staxProcessor)); - staxProcessors.addArtifactProcessor(new ComponentTypeProcessor(factory, policyFactory, staxProcessor)); - staxProcessors.addArtifactProcessor(new ConstrainingTypeProcessor(factory, policyFactory, staxProcessor)); - } - - public void tearDown() throws Exception { - staxProcessor = null; - } - - public void testReadComposite() throws Exception { - InputStream is = getClass().getResourceAsStream("TestAllCalculator.composite"); - Composite composite = (Composite)staxProcessor.read(is, Composite.class); - assertNotNull(composite); - assertEquals(composite.getName(), new QName("http://calc", "TestAllCalculator")); - assertEquals(composite.getConstrainingType().getName(), new QName("http://calc", "CalculatorComponent")); - assertTrue(composite.isLocal()); - assertFalse(composite.isAutowire()); - assertEquals(composite.getRequiredIntents().get(0).getName(), new QName("http://test/confidentiality", - "confidentiality")); - assertEquals(composite.getPolicySets().get(0).getName(), new QName("http://test/secure", "secure")); - - Composite include = composite.getIncludes().get(0); - assertEquals(include.getName(), new QName("http://calc", "TestAllDivide")); - - CompositeService calcCompositeService = (CompositeService)composite.getServices().get(0); - assertEquals(calcCompositeService.getName(), "CalculatorService"); - assertTrue(calcCompositeService.getPromotedService().isUnresolved()); - assertEquals(calcCompositeService.getPromotedService().getName(), - "CalculatorServiceComponent/CalculatorService"); - assertEquals(calcCompositeService.getRequiredIntents().get(0).getName(), - new QName("http://test/confidentiality", "confidentiality")); - assertEquals(calcCompositeService.getPolicySets().get(0).getName(), new QName("http://test/secure", "secure")); - // TODO test operations - Callback calcServiceCallback = calcCompositeService.getCallback(); - assertNotNull(calcServiceCallback); - assertEquals(calcServiceCallback.getRequiredIntents().get(0).getName(), - new QName("http://test/confidentiality", "confidentiality")); - assertEquals(calcServiceCallback.getPolicySets().get(0).getName(), new QName("http://test/secure", "secure")); - // TODO test operations - - Component calcComponent = composite.getComponents().get(0); - assertEquals(calcComponent.getName(), "CalculatorServiceComponent"); - assertEquals(calcComponent.isAutowire(), false); - assertEquals(calcComponent.getConstrainingType().getName(), new QName("http://calc", - "CalculatorComponent")); - assertEquals(calcComponent.getRequiredIntents().get(0).getName(), new QName("http://test/confidentiality", - "confidentiality")); - assertEquals(calcComponent.getPolicySets().get(0).getName(), new QName("http://test/secure", "secure")); - - ComponentService calcComponentService = calcComponent.getServices().get(0); - assertEquals(calcComponentService.getName(), "CalculatorService"); - assertEquals(calcComponentService.getRequiredIntents().get(0).getName(), - new QName("http://test/confidentiality", "confidentiality")); - assertEquals(calcComponentService.getPolicySets().get(0).getName(), new QName("http://test/secure", "secure")); - // TODO test operations - - ComponentReference calcComponentReference = calcComponent.getReferences().get(0); - assertEquals(calcComponentReference.getName(), "addService"); - assertEquals(calcComponentReference.isAutowire(), false); - assertEquals(calcComponentReference.isWiredByImpl(), false); - assertEquals(calcComponentReference.getRequiredIntents().get(0).getName(), - new QName("http://test/confidentiality", "confidentiality")); - assertEquals(calcComponentReference.getPolicySets().get(0).getName(), new QName("http://test/secure", "secure")); - // TODO test operations - - Property property = calcComponent.getProperties().get(0); - assertEquals(property.getName(), "round"); - Document doc = (Document) property.getValue(); - Element element = doc.getDocumentElement(); - String value = element.getTextContent(); - assertEquals(value, "true"); - assertEquals(property.getXSDType(), new QName("http://www.w3.org/2001/XMLSchema", "boolean")); - assertEquals(property.isMany(), false); - - CompositeReference calcCompositeReference = (CompositeReference)composite.getReferences().get(0); - assertEquals(calcCompositeReference.getName(), "MultiplyService"); - assertTrue(calcCompositeReference.getPromotedReferences().get(0).isUnresolved()); - assertEquals(calcCompositeReference.getPromotedReferences().get(0).getName(), - "CalculatorServiceComponent/multiplyService"); - assertEquals(calcCompositeReference.getRequiredIntents().get(0).getName(), - new QName("http://test/confidentiality", "confidentiality")); - assertEquals(calcCompositeReference.getPolicySets().get(0).getName(), new QName("http://test/secure", "secure")); - // TODO test operations - Callback calcCallback = calcCompositeReference.getCallback(); - assertEquals(calcCompositeReference.getRequiredIntents().get(0).getName(), - new QName("http://test/confidentiality", "confidentiality")); - assertEquals(calcCompositeReference.getPolicySets().get(0).getName(), new QName("http://test/secure", "secure")); - assertNotNull(calcCallback); - // TODO test operations - - //new PrintUtil(System.out).print(composite); - } - -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadDocumentTestCase.java b/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadDocumentTestCase.java deleted file mode 100644 index 967256c54a..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadDocumentTestCase.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import java.net.URL; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.DefaultURLArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.policy.DefaultPolicyFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * Test reading SCA XML assembly documents. - * - * @version $Rev$ $Date$ - */ -public class ReadDocumentTestCase extends TestCase { - - private ExtensibleURLArtifactProcessor documentProcessor; - private TestModelResolver resolver; - - public void setUp() throws Exception { - AssemblyFactory factory = new DefaultAssemblyFactory(); - PolicyFactory policyFactory = new DefaultPolicyFactory(); - InterfaceContractMapper mapper = new InterfaceContractMapperImpl(); - - URLArtifactProcessorExtensionPoint documentProcessors = new DefaultURLArtifactProcessorExtensionPoint(); - documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors); - - // Create Stax processors - DefaultStAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(); - ExtensibleStAXArtifactProcessor staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance()); - staxProcessors.addArtifactProcessor(new CompositeProcessor(factory, policyFactory, mapper, staxProcessor)); - staxProcessors.addArtifactProcessor(new ComponentTypeProcessor(factory, policyFactory, staxProcessor)); - staxProcessors.addArtifactProcessor(new ConstrainingTypeProcessor(factory, policyFactory, staxProcessor)); - - // Create document processors - XMLInputFactory inputFactory = XMLInputFactory.newInstance(); - documentProcessors.addArtifactProcessor(new CompositeDocumentProcessor(staxProcessor, inputFactory)); - documentProcessors.addArtifactProcessor(new ComponentTypeDocumentProcessor(staxProcessor, inputFactory)); - documentProcessors.addArtifactProcessor(new ConstrainingTypeDocumentProcessor(staxProcessor, inputFactory)); - - resolver = new TestModelResolver(getClass().getClassLoader()); - } - - public void tearDown() throws Exception { - documentProcessor = null; - resolver = null; - } - - public void testResolveConstrainingType() throws Exception { - - URL url = getClass().getResource("CalculatorComponent.constrainingType"); - ConstrainingType constrainingType = (ConstrainingType)documentProcessor.read(null, null, url); - assertNotNull(constrainingType); - resolver.addModel(constrainingType); - - url = getClass().getResource("TestAllCalculator.composite"); - Composite composite = (Composite)documentProcessor.read(null, null, url); - assertNotNull(composite); - - documentProcessor.resolve(composite, resolver); - - assertEquals(composite.getConstrainingType(), constrainingType); - assertEquals(composite.getComponents().get(0).getConstrainingType(), constrainingType); - } - - public void testResolveComposite() throws Exception { - URL url = getClass().getResource("Calculator.composite"); - Composite nestedComposite = (Composite)documentProcessor.read(null, null, url); - assertNotNull(nestedComposite); - resolver.addModel(nestedComposite); - - url = getClass().getResource("TestAllCalculator.composite"); - Composite composite = (Composite)documentProcessor.read(null, null, url); - - documentProcessor.resolve(composite, resolver); - - assertEquals(composite.getComponents().get(2).getImplementation(), nestedComposite); - } - -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadTestCase.java b/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadTestCase.java deleted file mode 100644 index 50a429a82c..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadTestCase.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import java.io.InputStream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.policy.DefaultPolicyFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * Test reading SCA XML assemblies. - * - * @version $Rev$ $Date$ - */ -public class ReadTestCase extends TestCase { - - private XMLInputFactory inputFactory; - private DefaultStAXArtifactProcessorExtensionPoint staxProcessors; - private ExtensibleStAXArtifactProcessor staxProcessor; - private AssemblyFactory factory; - private PolicyFactory policyFactory; - private InterfaceContractMapper mapper; - - public void setUp() throws Exception { - factory = new DefaultAssemblyFactory(); - policyFactory = new DefaultPolicyFactory(); - mapper = new InterfaceContractMapperImpl(); - inputFactory = XMLInputFactory.newInstance(); - staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance()); - } - - public void tearDown() throws Exception { - inputFactory = null; - staxProcessors = null; - policyFactory = null; - factory = null; - mapper = null; - } - - public void testReadComponentType() throws Exception { - ComponentTypeProcessor componentTypeReader = new ComponentTypeProcessor(factory, policyFactory, staxProcessor); - InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType"); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - assertNotNull(componentTypeReader.read(reader)); - is.close(); - } - - public void testReadConstrainingType() throws Exception { - InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType"); - ConstrainingTypeProcessor constrainingTypeReader = new ConstrainingTypeProcessor(factory, policyFactory, staxProcessor); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - assertNotNull(constrainingTypeReader.read(reader)); - is.close(); - - } - - public void testReadComposite() throws Exception { - InputStream is = getClass().getResourceAsStream("Calculator.composite"); - CompositeProcessor compositeReader = new CompositeProcessor(factory, policyFactory, mapper, staxProcessor); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - assertNotNull(compositeReader.read(reader)); - is.close(); - - } - - public void testReadCompositeAndWireIt() throws Exception { - InputStream is = getClass().getResourceAsStream("Calculator.composite"); - CompositeProcessor compositeReader = new CompositeProcessor(factory, policyFactory, mapper, staxProcessor); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - assertNotNull(compositeReader.read(reader)); - is.close(); - } - -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolveTestCase.java b/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolveTestCase.java deleted file mode 100644 index 407354c2d2..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolveTestCase.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import java.io.InputStream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.policy.DefaultPolicyFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * Test resolving SCA XML assemblies. - * - * @version $Rev$ $Date$ - */ -public class ResolveTestCase extends TestCase { - - private XMLInputFactory inputFactory; - private DefaultStAXArtifactProcessorExtensionPoint staxProcessors; - private ExtensibleStAXArtifactProcessor staxProcessor; - private TestModelResolver resolver; - private AssemblyFactory factory; - private PolicyFactory policyFactory; - private InterfaceContractMapper mapper; - - public void setUp() throws Exception { - factory = new DefaultAssemblyFactory(); - policyFactory = new DefaultPolicyFactory(); - mapper = new InterfaceContractMapperImpl(); - inputFactory = XMLInputFactory.newInstance(); - staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance()); - resolver = new TestModelResolver(getClass().getClassLoader()); - } - - public void tearDown() throws Exception { - inputFactory = null; - staxProcessors = null; - resolver = null; - policyFactory = null; - factory = null; - mapper = null; - } - - public void testResolveConstrainingType() throws Exception { - InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType"); - ConstrainingTypeProcessor constrainingTypeReader = new ConstrainingTypeProcessor(factory, policyFactory, staxProcessor); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - ConstrainingType constrainingType = constrainingTypeReader.read(reader); - is.close(); - assertNotNull(constrainingType); - resolver.addModel(constrainingType); - - is = getClass().getResourceAsStream("TestAllCalculator.composite"); - CompositeProcessor compositeReader = new CompositeProcessor(factory, policyFactory, mapper, staxProcessor); - reader = inputFactory.createXMLStreamReader(is); - Composite composite = compositeReader.read(reader); - is.close(); - assertNotNull(composite); - - compositeReader.resolve(composite, resolver); - - assertEquals(composite.getConstrainingType(), constrainingType); - assertEquals(composite.getComponents().get(0).getConstrainingType(), constrainingType); - } - - public void testResolveComposite() throws Exception { - InputStream is = getClass().getResourceAsStream("Calculator.composite"); - CompositeProcessor compositeReader = new CompositeProcessor(factory, policyFactory, mapper, staxProcessor); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - Composite nestedComposite = compositeReader.read(reader); - is.close(); - assertNotNull(nestedComposite); - resolver.addModel(nestedComposite); - - is = getClass().getResourceAsStream("TestAllCalculator.composite"); - compositeReader = new CompositeProcessor(factory, policyFactory, mapper, staxProcessor); - reader = inputFactory.createXMLStreamReader(is); - Composite composite = compositeReader.read(reader); - is.close(); - - compositeReader.resolve(composite, resolver); - - assertEquals(composite.getComponents().get(2).getImplementation(), nestedComposite); - } - -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/StAXPerfTest.java b/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/StAXPerfTest.java deleted file mode 100644 index 46ed9ea425..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/StAXPerfTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import java.io.InputStream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.policy.DefaultPolicyFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * Test the performance of StAX parsing. - * - * @version $Rev$ $Date$ - */ -public class StAXPerfTest { - - private XMLInputFactory inputFactory; - private AssemblyFactory assemblyFactory; - private PolicyFactory policyFactory; - private InterfaceContractMapper interfaceContractMapper; - private ExtensibleStAXArtifactProcessor staxProcessor; - private DefaultStAXArtifactProcessorExtensionPoint staxProcessors; - - public static void main(String[] args) throws Exception { - - StAXPerfTest perfTest = new StAXPerfTest(); - perfTest.setUp(); - - // Warm up - for (long i = 0; i < 500; i++) { - perfTest.testReadComposite(); - } - - long begin = System.currentTimeMillis(); - long iter = 50000; - for (long i = 0; i < iter; i++) { - perfTest.testReadComposite(); - } - long end = System.currentTimeMillis(); - System.out.println("Iterations: " + iter); - double time = ((double)(end - begin)) / ((double)iter); - System.out.println("Time: " + time); - System.out.println("Memory: " + Runtime.getRuntime().totalMemory() / 1024); - - } - - public void setUp() throws Exception { - inputFactory = XMLInputFactory.newInstance(); - assemblyFactory = new DefaultAssemblyFactory(); - policyFactory = new DefaultPolicyFactory(); - interfaceContractMapper = new InterfaceContractMapperImpl(); - staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance()); - } - - public void tearDown() throws Exception { - assemblyFactory = null; - policyFactory = null; - inputFactory = null; - staxProcessors = null; - } - - public void testReadComposite() throws Exception { - InputStream is = getClass().getResourceAsStream("TestAllCalculator.composite"); - CompositeProcessor loader = new CompositeProcessor(assemblyFactory, - policyFactory, interfaceContractMapper, staxProcessor); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - - Composite composite = loader.read(reader); - is.close(); - - if (composite == null) { - throw new IllegalStateException("Null composite"); - } - } - -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestModelResolver.java b/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestModelResolver.java deleted file mode 100644 index 7a4077188a..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestModelResolver.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; - - -/** - * A default implementation of an artifact resolver, based on a map. - * - * @version $Rev$ $Date$ - */ -public class TestModelResolver implements ModelResolver { - private static final long serialVersionUID = -7826976465762296634L; - - private Map map = new HashMap(); - - public TestModelResolver(ClassLoader classLoader) { - } - - public T resolveModel(Class modelClass, T unresolved) { - Object resolved = map.get(unresolved); - if (resolved != null) { - - // Return the resolved object - return modelClass.cast(resolved); - - } else { - - // Return the unresolved object - return unresolved; - } - } - - public void addModel(Object resolved) { - map.put(resolved, resolved); - } - - public Object removeModel(Object resolved) { - return map.remove(resolved); - } - -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WireTestCase.java b/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WireTestCase.java deleted file mode 100644 index 2b95057f23..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WireTestCase.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import java.io.InputStream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.DefaultSCABindingFactory; -import org.apache.tuscany.sca.assembly.SCABindingFactory; -import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.policy.DefaultPolicyFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * Test the wiring of SCA XML assemblies. - * - * @version $Rev$ $Date$ - */ -public class WireTestCase extends TestCase { - - private XMLInputFactory inputFactory; - private DefaultStAXArtifactProcessorExtensionPoint staxProcessors; - private ExtensibleStAXArtifactProcessor staxProcessor; - private TestModelResolver resolver; - private AssemblyFactory assemblyFactory; - private SCABindingFactory scaBindingFactory; - private PolicyFactory policyFactory; - private InterfaceContractMapper mapper; - - public void setUp() throws Exception { - inputFactory = XMLInputFactory.newInstance(); - staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance()); - resolver = new TestModelResolver(getClass().getClassLoader()); - assemblyFactory = new DefaultAssemblyFactory(); - scaBindingFactory = new DefaultSCABindingFactory(); - policyFactory = new DefaultPolicyFactory(); - mapper = new InterfaceContractMapperImpl(); - } - - public void tearDown() throws Exception { - inputFactory = null; - staxProcessors = null; - resolver = null; - policyFactory = null; - assemblyFactory = null; - mapper = null; - } - - public void testResolveConstrainingType() throws Exception { - InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType"); - ConstrainingTypeProcessor constrainingTypeReader = new ConstrainingTypeProcessor(assemblyFactory, policyFactory, staxProcessor); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - ConstrainingType constrainingType = constrainingTypeReader.read(reader); - is.close(); - assertNotNull(constrainingType); - resolver.addModel(constrainingType); - - is = getClass().getResourceAsStream("TestAllCalculator.composite"); - CompositeProcessor compositeReader = new CompositeProcessor(assemblyFactory, policyFactory, mapper, staxProcessor); - reader = inputFactory.createXMLStreamReader(is); - Composite composite = compositeReader.read(reader); - is.close(); - assertNotNull(composite); - - compositeReader.resolve(composite, resolver); - CompositeBuilderImpl compositeUtil = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, mapper, null); - compositeUtil.build(composite); - - assertEquals(composite.getConstrainingType(), constrainingType); - assertEquals(composite.getComponents().get(0).getConstrainingType(), constrainingType); - } - - public void testResolveComposite() throws Exception { - InputStream is = getClass().getResourceAsStream("Calculator.composite"); - CompositeProcessor compositeReader = new CompositeProcessor(assemblyFactory, policyFactory, mapper, staxProcessor); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - Composite nestedComposite = compositeReader.read(reader); - is.close(); - assertNotNull(nestedComposite); - resolver.addModel(nestedComposite); - - is = getClass().getResourceAsStream("TestAllCalculator.composite"); - compositeReader = new CompositeProcessor(assemblyFactory, policyFactory, mapper, staxProcessor); - reader = inputFactory.createXMLStreamReader(is); - Composite composite = compositeReader.read(reader); - is.close(); - - compositeReader.resolve(composite, resolver); - CompositeBuilderImpl compositeUtil = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, mapper, null); - compositeUtil.build(composite); - - assertEquals(composite.getComponents().get(2).getImplementation(), nestedComposite); - } - -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WriteAllTestCase.java b/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WriteAllTestCase.java deleted file mode 100644 index 39b9b04a3e..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/WriteAllTestCase.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.xml; - -import java.io.ByteArrayOutputStream; -import java.io.InputStream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.DefaultSCABindingFactory; -import org.apache.tuscany.sca.assembly.SCABindingFactory; -import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.policy.DefaultPolicyFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * Test writing SCA XML assemblies. - * - * @version $Rev$ $Date$ - */ -public class WriteAllTestCase extends TestCase { - private DefaultStAXArtifactProcessorExtensionPoint staxProcessors; - private ExtensibleStAXArtifactProcessor staxProcessor; - private TestModelResolver resolver; - private AssemblyFactory assemblyFactory; - private SCABindingFactory scaBindingFactory; - private PolicyFactory policyFactory; - private InterfaceContractMapper mapper; - private CompositeBuilderImpl compositeUtil; - - - public void setUp() throws Exception { - assemblyFactory = new DefaultAssemblyFactory(); - scaBindingFactory = new DefaultSCABindingFactory(); - policyFactory = new DefaultPolicyFactory(); - mapper = new InterfaceContractMapperImpl(); - compositeUtil = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, mapper, null); - staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance()); - staxProcessors.addArtifactProcessor(new CompositeProcessor(assemblyFactory, policyFactory, mapper, staxProcessor)); - staxProcessors.addArtifactProcessor(new ComponentTypeProcessor(assemblyFactory, policyFactory, staxProcessor)); - staxProcessors.addArtifactProcessor(new ConstrainingTypeProcessor(assemblyFactory, policyFactory, staxProcessor)); - resolver = new TestModelResolver(getClass().getClassLoader()); - } - - public void tearDown() throws Exception { - staxProcessors = null; - resolver = null; - policyFactory = null; - assemblyFactory = null; - mapper = null; - } - - public void testReadWriteComposite() throws Exception { - InputStream is = getClass().getResourceAsStream("TestAllCalculator.composite"); - Composite composite = staxProcessor.read(is, Composite.class); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(composite, bos); - } - - public void testReadWireWriteComposite() throws Exception { - InputStream is = getClass().getResourceAsStream("TestAllCalculator.composite"); - Composite composite = staxProcessor.read(is, Composite.class); - staxProcessor.resolve(composite, resolver); - compositeUtil.build(composite); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(composite, bos); - } - - public void testReadWriteComponentType() throws Exception { - InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType"); - ComponentType componentType = staxProcessor.read(is, ComponentType.class); - staxProcessor.resolve(componentType, resolver); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(componentType, bos); - } - - public void testReadWriteConstrainingType() throws Exception { - InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType"); - ConstrainingType constrainingType = staxProcessor.read(is, ConstrainingType.class); - staxProcessor.resolve(constrainingType, resolver); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(constrainingType, bos); - } - -} diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Calculator.composite b/branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Calculator.composite deleted file mode 100644 index 4546fddb2d..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Calculator.composite +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/CalculatorComponent.constrainingType b/branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/CalculatorComponent.constrainingType deleted file mode 100644 index 072fe8fde1..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/CalculatorComponent.constrainingType +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/CalculatorImpl.componentType b/branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/CalculatorImpl.componentType deleted file mode 100644 index d67ba3ec2b..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/CalculatorImpl.componentType +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllCalculator.composite b/branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllCalculator.composite deleted file mode 100644 index 2fedb28df2..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllCalculator.composite +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - tns:TestAllDivide - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AValue - InterestingURI - - - BValue - BoringURI - - - - diff --git a/branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllDivide.composite b/branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllDivide.composite deleted file mode 100644 index 74cb8950a3..0000000000 --- a/branches/sca-java-0.90/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/TestAllDivide.composite +++ /dev/null @@ -1,56 +0,0 @@ - - - - - tns:CompleteDivide - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/assembly/.checkstyle b/branches/sca-java-0.90/modules/assembly/.checkstyle deleted file mode 100644 index e3c216986d..0000000000 --- a/branches/sca-java-0.90/modules/assembly/.checkstyle +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/branches/sca-java-0.90/modules/assembly/.pmd b/branches/sca-java-0.90/modules/assembly/.pmd deleted file mode 100644 index aa1ce3e754..0000000000 --- a/branches/sca-java-0.90/modules/assembly/.pmd +++ /dev/null @@ -1,21 +0,0 @@ - - - -truefalse \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/assembly/.ruleset b/branches/sca-java-0.90/modules/assembly/.ruleset deleted file mode 100644 index ba9b5ce886..0000000000 --- a/branches/sca-java-0.90/modules/assembly/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/assembly/DISCLAIMER b/branches/sca-java-0.90/modules/assembly/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/assembly/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/assembly/LICENSE b/branches/sca-java-0.90/modules/assembly/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/assembly/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/assembly/NOTICE b/branches/sca-java-0.90/modules/assembly/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/assembly/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/assembly/pom.xml b/branches/sca-java-0.90/modules/assembly/pom.xml deleted file mode 100644 index 1f119f2efd..0000000000 --- a/branches/sca-java-0.90/modules/assembly/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - tuscany-assembly - Apache Tuscany Assembly Model - - - - org.apache.tuscany.sca - tuscany-policy - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-interface - 0.90-incubating-SNAPSHOT - - - diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractContract.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractContract.java deleted file mode 100644 index 8f371defde..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractContract.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.policy.IntentAttachPoint; - -/** - * Interface contracts define one or more business functions. These business - * functions are provided by services and are used by references. - * - * @version $Rev$ $Date$ - */ -public interface AbstractContract extends Base, IntentAttachPoint { - - /** - * Returns the name of the contract. - * - * @return the name of the contract - */ - String getName(); - - /** - * Sets the name of the contract. - * - * @param name the name of the contract - */ - void setName(String name); - - /** - * Returns the interface contract defining the interface and callback - * interface for the contract. - * - * @return the interface contract - */ - InterfaceContract getInterfaceContract(); - - - /** - * Returns the interface contract defining the interface and callback - * interface for the contract. - * - * @param interfaceContract the interface contract - */ - void setInterfaceContract(InterfaceContract interfaceContract); -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractProperty.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractProperty.java deleted file mode 100644 index 35c5da4123..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractProperty.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.policy.IntentAttachPoint; - -/** - * A property allows for the configuration of an implementation with externally - * set data values. An implementation can have zero or more properties. Each - * property has a data type, which may be either simple or complex. An - * implementation may also define a default value for a property. - */ -public interface AbstractProperty extends Base, IntentAttachPoint { - - /** - * 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 getValue(); - - /** - * Sets the default value of the property. - * - * @param defaultValue the default value of ths property - */ - void setValue(Object defaultValue); - - /** - * 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 many true if the property should allow multiple values - */ - void setMany(boolean many); - - /** - * Returns true if a value must be supplied for the property. - * - * @return true is a value must be supplied for the property - */ - boolean isMustSupply(); - - /** - * Sets whether a value must be supplied for the property. - * - * @param mustSupply set to true to require that a value be supplied for - * uses of this property - */ - void setMustSupply(boolean mustSupply); - - /** - * Returns the data type of this property. This is the qualified name of an - * XML schema type. - * - * @return the type of this property - */ - QName getXSDType(); - - /** - * Sets the data type of this property. This is the qualified name of an XML - * schema type. - * - * @param type the type of this property - */ - void setXSDType(QName type); - - /** - * Returns the element defining the data type of this property. This is the - * qualified name of an XML schema element. - * - * @return the element defining the type of this property - */ - QName getXSDElement(); - - /** - * Sets the element defining the data type of this property. This is the - * qualified name of an XML schema element. - * - * @param type the element defining the type of this property - */ - void setXSDElement(QName element); - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractReference.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractReference.java deleted file mode 100644 index a9ef26bbb9..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractReference.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * Represents a reference contract. - * - * @version $Rev$ $Date$ - */ -public interface AbstractReference extends AbstractContract { - - /** - * 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/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractService.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractService.java deleted file mode 100644 index 9ae511c07b..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AbstractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * Represents a service contract. - * - * @version $Rev$ $Date$ - */ -public interface AbstractService extends AbstractContract { - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java deleted file mode 100644 index 3937d34f92..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/AssemblyFactory.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import org.apache.tuscany.sca.interfacedef.Operation; - -/** - * A factory for the assembly model - * - * @version $Rev$ $Date$ - */ -public interface AssemblyFactory { - - /** - * Create a new abstract property. - * - * @return a new abstract property - */ - AbstractProperty createAbstractProperty(); - - /** - * Create a new abstract reference. - * - * @return a new abstract reference - */ - AbstractReference createAbstractReference(); - - /** - * Create a new abstract service. - * - * @return a new abstract service - */ - AbstractService createAbstractService(); - - /** - * Create a new callback. - * - * @return - */ - Callback createCallback(); - - /** - * Create a new component. - * - * @return a new component - */ - Component createComponent(); - - /** - * Create a new component property. - * - * @return a new component property - */ - ComponentProperty createComponentProperty(); - - /** - * Create a new component reference. - * - * @return a new component reference - */ - ComponentReference createComponentReference(); - - /** - * Create a new component service. - * - * @return a new component service - */ - ComponentService createComponentService(); - - /** - * Create a new component type - * - * @return a new component type - */ - ComponentType createComponentType(); - - /** - * Create a new composite. - * - * @return a new composite - */ - Composite createComposite(); - - /** - * Create a new composite reference. - * - * @return a new composite reference - */ - CompositeReference createCompositeReference(); - - /** - * Create a new composite service. - * - * @return a new composite service - */ - CompositeService createCompositeService(); - - /** - * Create a new constraining type. - * - * @return a new constraining type - */ - ConstrainingType createConstrainingType(); - - /** - * Create a new property. - * - * @return a new property - */ - Property createProperty(); - - /** - * Create a new reference. - * - * @return a new reference - */ - Reference createReference(); - - /** - * Create a new service. - * - * @return a new service - */ - Service createService(); - - /** - * Create a new wire. - * - * @return a new wire - */ - Wire createWire(); - - /** - * Create a new operation. - * - * @return a new operation - */ - Operation createOperation(); - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Base.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Base.java deleted file mode 100644 index 9681ff0c40..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Base.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -/** - * Base interface for all assembly model objects. - * - * @version $Rev$ $Date$ - */ -public interface Base { - - /** - * Returns a list of extension objects contained in this model object. - * - * @return a list of extension objects container in this model object - */ - List getExtensions(); - - /** - * Returns true if the model element is unresolved. - * - * @return true if the model element is unresolved. - */ - boolean isUnresolved(); - - /** - * Sets whether the model element is unresolved. - * - * @param unresolved whether the model element is unresolved - */ - void setUnresolved(boolean unresolved); - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Binding.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Binding.java deleted file mode 100644 index 8d7d6958be..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Binding.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import org.apache.tuscany.sca.policy.IntentAttachPoint; -import org.apache.tuscany.sca.policy.PolicySetAttachPoint; - -/** - * Represents a binding. - * - * @version $Rev$ $Date$ - */ -public interface Binding extends Base, IntentAttachPoint, PolicySetAttachPoint { - - /** - * Returns the binding URI. - * - * @return the binding uri - */ - String getURI(); - - /** - * Sets the binding URI. - * - * @param uri the binding uri - */ - void setURI(String uri); - - /** - * Returns the binding name. - * - * @return the binding name - */ - String getName(); - - /** - * Sets the binding name. - * - * @param name the binding name - */ - void setName(String name); -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java deleted file mode 100644 index b50e4ec06b..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Callback.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -import org.apache.tuscany.sca.policy.IntentAttachPoint; -import org.apache.tuscany.sca.policy.PolicySetAttachPoint; - -/** - * Represents a callback object describing the bindings to use for callbacks. - * - * @version $Rev$ $Date$ - */ -public interface Callback extends Base, IntentAttachPoint, PolicySetAttachPoint { - - /** - * Returns the bindings supported for callbacks. - * - * @return the bindings supported for callbacks - */ - List getBindings(); - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Component.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Component.java deleted file mode 100644 index 72ee71de8c..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Component.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -import org.apache.tuscany.sca.policy.IntentAttachPoint; -import org.apache.tuscany.sca.policy.PolicySetAttachPoint; - -/** - * Represents a component. A component is a configured instance of an - * implementation. - * - * @version $Rev$ $Date$ - */ -public interface Component extends Base, IntentAttachPoint, PolicySetAttachPoint, Visitable { - - /** - * Returns the URI of the component. - * - * @return the URI of the component - */ - String getURI(); - - /** - * Sets the URI of the component. - * - * @param uri the URI of the component - */ - void setURI(String uri); - - /** - * Returns the name of the component. - * - * @return the name of the component - */ - String getName(); - - /** - * Sets the name of the component. - * - * @param name the name of the component - */ - void setName(String name); - - /** - * Returns the component implementation. - * - * @return the component implementation - */ - Implementation getImplementation(); - - /** - * Sets the component implementation - * - * @param implementation the component implementation - */ - void setImplementation(Implementation implementation); - - /** - * Returns a list of references used by the component. - * - * @return a list of references used by the component - */ - List getReferences(); - - /** - * Returns a list of services exposed by the component. - * - * @return a list of services exposed by the component - */ - List getServices(); - - /** - * Returns a list of properties for the component. - * - * @return a list of properties - */ - List getProperties(); - - /** - * Returns a constraining type defining the shape of the component. - * - * @return a constraining type - */ - ConstrainingType getConstrainingType(); - - /** - * Sets a constraining type defining the shape of the component. - * - * @param constrainingType the constraining type - */ - void setConstrainingType(ConstrainingType constrainingType); - - /** - * Returns true if the component references should be autowired. - * - * @return whether component references should be autowired. - */ - boolean isAutowire(); - - /** - * Sets whether component references should be autowired. - * - * @param autowire whether component references should be autowired - */ - void setAutowire(boolean autowire); - - /** - * Returns a clone of the component. - * - * @return a clone of the component - * @throws CloneNotSupportedException - */ - Object clone() throws CloneNotSupportedException; - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentProperty.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentProperty.java deleted file mode 100644 index 9a344afb09..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentProperty.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * Represents a configured property of a component. - * - * @version $Rev$ $Date$ - */ -public interface ComponentProperty extends Property, Cloneable { - - /** - * Returns the property defined by the component implementation. - * - * @return the property defined by the component implementation - */ - Property getProperty(); - - /** - * Sets the property type that defines this property. - * - * @param type the property that defines this property - */ - void setProperty(Property property); - - /** - * Returns an xpath expression referencing a property of the enclosing - * composite. - * - * @return an xpath expression referencing a property of the enclosing - * composite - */ - String getSource(); - - /** - * Sets an xpath expression referencing a property of the enclosing - * composite. - * - * @param source an xpath expression referencing a property of the enclosing - * composite - */ - void setSource(String source); - - /** - * Returns a URI to a file containing the property value. - * - * @return a URI to a file containing the property value - */ - String getFile(); - - /** - * Sets a URI to a file containing the property value. - * - * @param file a URI to a file containing the property value - */ - void setFile(String file); - - /** - * Clone the component property. - * - * @return a clone of the component property - */ - Object clone() throws CloneNotSupportedException; -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java deleted file mode 100644 index 1f4b4f0801..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentReference.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - - -/** - * An instance of a reference associated with a particular component. - * - * @version $Rev$ $Date$ - */ -public interface ComponentReference extends Reference { - - /** - * Returns the reference defined by the implementation for this reference. - * - * @return - */ - Reference getReference(); - - /** - * Sets the reference defined by the implementation for this reference. - * - * @param reference - */ - void setReference(Reference reference); - - /** - * Returns true if the reference should be autowired. - * - * @return whether the reference should be autowired. - */ - boolean isAutowire(); - - /** - * Sets whether the reference should be autowired. - * - * @param autowire whether the reference should be autowired - */ - void setAutowire(boolean autowire); - - - /** - * Clone the component reference. - * - * @return a clone of the component reference - */ - Object clone() throws CloneNotSupportedException; -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentService.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentService.java deleted file mode 100644 index c0e42dbb93..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentService.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - - -/** - * An addressable instance of a service associated with a particular component. - * - * @version $Rev$ $Date$ - */ -public interface ComponentService extends Service { - - /** - * Returns the service defined by the implementation for this service. - * - * @return - */ - Service getService(); - - /** - * Sets the service defined by the implementation for this service. - * - * @param service - */ - void setService(Service service); - - /** - * Clone the component service. - * - * @return a clone of the component service - */ - Object clone() throws CloneNotSupportedException; -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentType.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentType.java deleted file mode 100644 index ffdef42aed..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ComponentType.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -import org.apache.tuscany.sca.policy.IntentAttachPoint; -import org.apache.tuscany.sca.policy.PolicySetAttachPoint; - -/** - * Describes an implementation and represents its configurable aspects. - * - * @version $Rev$ $Date$ - */ -public interface ComponentType extends Base, IntentAttachPoint, PolicySetAttachPoint { - - /** - * Returns the URI of this component type. - * @return the URI of the component type - */ - String getURI(); - - /** - * Sets the URI of this component type. - * @param uri the URI of the component type - */ - void setURI(String uri); - - /** - * Returns a list of services that are offered. - * - * @return a list of services that are offered - */ - List getServices(); - - /** - * Returns the list of reference types that are used. - * - * @return the list of reference types that are used - */ - List getReferences(); - - /** - * Returns the list of properties that can be set. - * - * @return the list of properties that can be set - */ - List getProperties(); - - /** - * Returns a constraining type defining the shape of the implementation. - * - * @return a constraining type - */ - ConstrainingType getConstrainingType(); - - /** - * Sets a constraining type defining the shape of the implementation. - * - * @param constrainingType the constraining type to set - */ - void setConstrainingType(ConstrainingType constrainingType); - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java deleted file mode 100644 index 1fe402d829..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Composite.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -import javax.xml.namespace.QName; - - -/** - * Represents a composite. - * - * @version $Rev$ $Date$ - */ -public interface Composite extends Implementation, Visitable { - - /** - * Returns the name of the composite. - * - * @return the name of the composite - */ - QName getName(); - - /** - * Sets the name of the composite. - * - * @param name the name of the composite - */ - void setName(QName name); - - /** - * Returns a list of composites included in this composite. - * - * @return a list of composites included in this composite. - */ - List getIncludes(); - - /** - * Returns a list of components contained in this composite. - * - * @return a list of components contained in this composite - */ - List getComponents(); - - /** - * Returns a list of wires contained in this composite. - * - * @return a list of wires contained in this composite - */ - List getWires(); - - /** - * Returns true if all the components within the composite must run in the - * same process. - * - * @return true if all the components within the composite must run in the - * same process - */ - boolean isLocal(); - - /** - * Sets whether all the components within the composite must run in the same - * process. - * - * @param local whether all the components within the composite must run in - * the same process - */ - void setLocal(boolean local); - - /** - * Returns true if autowiring is enabled in the composite. - * - * @return true if autowiring is enabled in the composite - */ - boolean isAutowire(); - - /** - * Sets whether autowiring is enabled in the composite. - * - * @param autowire whether autowiring is enabled in the composite - */ - void setAutowire(boolean autowire); - - /** - * Returns a clone of the component type. - * - * @return a clone of the component type - * @throws CloneNotSupportedException - */ - Object clone() throws CloneNotSupportedException; - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeReference.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeReference.java deleted file mode 100644 index d3fa80ba74..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeReference.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -/** - * Represents composite reference. - * - * @version $Rev$ $Date$ - */ -public interface CompositeReference extends Reference { - - /** - * Returns the promoted composite references. - * - * @return the promoted composite references - */ - List getPromotedReferences(); - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeService.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeService.java deleted file mode 100644 index 757e2bda2e..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/CompositeService.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * Represents a composite service. - * - * @version $Rev$ $Date$ - */ -public interface CompositeService extends Service { - - /** - * Returns the promoted component service . - * - * @return the promoted component service. - */ - ComponentService getPromotedService(); - - /** - * Sets the promoted component service - * - * @param promotedService the promoted component service. - */ - void setPromotedService(ComponentService promotedService); - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ConstrainingType.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ConstrainingType.java deleted file mode 100644 index 4119d0a268..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/ConstrainingType.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.policy.IntentAttachPoint; - -/** - * A constrainingType provides the "shape" for a component and its - * implementation. Any component configuration that points to a constrainingType - * is constrained by this shape. The constrainingType specifies the services, - * references and properties that must be implemented. - * - * @version $Rev$ $Date$ - */ -public interface ConstrainingType extends Base, IntentAttachPoint { - - /** - * Returns the name of the constrainingType. - * - * @return the name of the constrainingType - */ - QName getName(); - - /** - * Sets the name of the constrainingType. - * - * @param name the name of the constrainingType - */ - void setName(QName name); - - /** - * Returns a list of services that are offered. - * - * @return a list of services that are offered - */ - List getServices(); - - /** - * Returns the list of references that are used. - * - * @return the list of references that are used - */ - List getReferences(); - - /** - * Returns the list of properties that can be set. - * - * @return the list of properties that can be set - */ - List getProperties(); - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java deleted file mode 100644 index 830ede478a..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Contract.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -import org.apache.tuscany.sca.policy.PolicySetAttachPoint; - -/** - * Represents a contract. A contract can be either a service or a reference. - * - * @version $Rev$ $Date$ - */ -public interface Contract extends AbstractContract, PolicySetAttachPoint { - - /** - * Returns the bindings supported by this contract. - * - * @return the bindings supported by this contract - */ - List getBindings(); - - /** - * Returns a binding of the specified type or null if there is no such - * binding configured on this contract. - * - * @param the binding type - * @param bindingClass the binding type class - * @return the binding or null if there is no binding of the specified type - */ - B getBinding(Class bindingClass); - - /** - * Returns a callback definition of the bindings to use for callbacks. - * - * @return a definition of the bindings to use for callbacks - */ - Callback getCallback(); - - /** - * Sets a callback definition of the bindings to use for callbacks - * - * @param callback a definition of the bindings to use for callbacks - */ - void setCallback(Callback callback); - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultAssemblyFactory.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultAssemblyFactory.java deleted file mode 100644 index 5dd256e3c4..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultAssemblyFactory.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly; - -import org.apache.tuscany.sca.assembly.impl.AssemblyFactoryImpl; - -/** - * A factory for the assembly model. - * - * @version $Rev$ $Date$ - */ -public class DefaultAssemblyFactory extends AssemblyFactoryImpl implements AssemblyFactory { - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultSCABindingFactory.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultSCABindingFactory.java deleted file mode 100644 index 793a8f960b..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DefaultSCABindingFactory.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly; - -import org.apache.tuscany.sca.assembly.impl.SCABindingFactoryImpl; - -/** - * A factory for the SCA binding model. - * - * @version $Rev$ $Date$ - */ -public class DefaultSCABindingFactory extends SCABindingFactoryImpl implements SCABindingFactory { - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Implementation.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Implementation.java deleted file mode 100644 index e79f9bccdb..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Implementation.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * Represents a component implementation. - * - * @version $Rev$ $Date$ - */ -public interface Implementation extends ComponentType { - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Multiplicity.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Multiplicity.java deleted file mode 100644 index 5d15ce9938..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Multiplicity.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * Enumeration for multiplicity. Defines the number of wires that can connect a - * reference to target services. - * - * @version $Rev$ $Date$ - */ -public enum Multiplicity { - - /** - * Zero or one wire can have the reference as a source. - */ - ZERO_ONE, - - /** - * The default setting, one wire can have the reference as a source. - */ - ONE_ONE, - - /** - * Zero or more wires can have the reference as a source. - */ - ZERO_N, - - /** - * One or more wires can have the reference as a source. - */ - ONE_N - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Property.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Property.java deleted file mode 100644 index 98089d66cb..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Property.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import org.apache.tuscany.sca.policy.PolicySetAttachPoint; - -/** - * A property allows for the configuration of an implementation with externally - * set data values. An implementation can have zero or more properties. Each - * property has a data type, which may be either simple or complex. An - * implementation may also define a default value for a property. - * - * @version $Rev$ $Date$ - */ -public interface Property extends AbstractProperty, PolicySetAttachPoint { - - /** - * Returns a clone of the property. - * - * @return a clone of the property - * @throws CloneNotSupportedException - */ - Object clone() throws CloneNotSupportedException; - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java deleted file mode 100644 index 3b2d2b124c..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Reference.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -/** - * Represents a reference. References within an implementation represent links - * to services that the implementation uses that must be provided by other - * components. - * - * @version $Rev$ $Date$ - */ -public interface Reference extends AbstractReference, Contract { - - /** - * Returns a boolean value, "false" by default, which indicates that the - * implementation wires this reference dynamically. - * - * @return true if the implementation wires this reference dynamically - */ - boolean isWiredByImpl(); - - /** - * Sets a boolean value, "false" by default, which indicates that the - * implementation wires this reference dynamically. - * - * @param wiredByImpl whether the implementation wires this reference - * dynamically - */ - void setWiredByImpl(boolean wiredByImpl); - - /** - * Returns the targets of this reference. - * - * @return the targets of this reference. - */ - List getTargets(); - - /** - * Returns a clone of the reference. - * - * @return a clone of the reference - * @throws CloneNotSupportedException - */ - Object clone() throws CloneNotSupportedException; - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java deleted file mode 100644 index eaf60aa6d9..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABinding.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * Represents an SCA binding. - * - * @version $Rev$ $Date$ - */ -public interface SCABinding extends Binding { - - Component getComponent(); - - void setComponent(Component component); - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java deleted file mode 100644 index 0abfd13d10..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/SCABindingFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - - -/** - * A factory for the SCA binding model - * - * @version $Rev$ $Date$ - */ -public interface SCABindingFactory { - - /** - * Create a new SCA binding. - * - * @return a new SCA binding - */ - SCABinding createSCABinding(); - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java deleted file mode 100644 index ea32efb769..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Service.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * Represents a service. Services are used to publish services provided by - * implementations, so that they are addressable by other components. - * - * @version $Rev$ $Date$ - */ -public interface Service extends AbstractService, Contract { - - /** - * Returns a clone of the service. - * - * @return a clone of the service - * @throws CloneNotSupportedException - */ - Object clone() throws CloneNotSupportedException; - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Visitable.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Visitable.java deleted file mode 100644 index 6d3998b79e..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Visitable.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -/** - * This interface is implemented by object that can accept a visitor. - */ -public interface Visitable { - - /** - * Accepts the given visitor. The visitor's visit method is called with this - * model object. If the visitor returns true, this method visits this - * object's children. - * - * @param visitor - * @return true if the model object's chidren should be visited, false if - * they should be skipped - */ - boolean accept(Visitor visitor); - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Visitor.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Visitor.java deleted file mode 100644 index a15354e401..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Visitor.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - - -/** - * This interface is implemented by objects that visit assembly model trees. - */ -public interface Visitor { - - /** - * Visits the given assembly model object. - * - * @param object - * @return true if the model object's chidren should be visited, false if - * they should be skipped - */ - boolean visit(Base object); - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java deleted file mode 100644 index 58562eb5ad..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/Wire.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import org.apache.tuscany.sca.policy.IntentAttachPoint; -import org.apache.tuscany.sca.policy.PolicySetAttachPoint; - -/** - * Represents a wire. - * - * @version $Rev$ $Date$ - */ -public interface Wire extends Base, IntentAttachPoint, PolicySetAttachPoint { - - /** - * Returns the source of the wire. - * - * @return the source of the wire - */ - ComponentReference getSource(); - - /** - * Sets the source of the wire. - * - * @param source the source of the wire - */ - void setSource(ComponentReference source); - - /** - * Returns the target of the wire. - * - * @return the target of the wire - */ - ComponentService getTarget(); - - /** - * Sets the target of the wire. - * - * @param target the target of the wire - */ - void setTarget(ComponentService target); - - /** - * Returns a clone of the wire. - * - * @return a clone of the wire - * @throws CloneNotSupportedException - */ - Object clone() throws CloneNotSupportedException; - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilder.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilder.java deleted file mode 100644 index 26bdc3cffa..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilder.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.builder; - -import org.apache.tuscany.sca.assembly.Composite; - -/** - * A builder that handles the configuration of the components inside a - * composite and the wiring of component references to component services. - * - * @version $Rev$ $Date$ - */ -public interface CompositeBuilder { - - /** - * Build, configure and wire a composite. - * - * @param composite - * @throws CompositeBuilderException - */ - void build(Composite composite) throws CompositeBuilderException; - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderException.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderException.java deleted file mode 100644 index 5a2015f55e..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderException.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.builder; - -/** - * Reports a composite builder exception. - * - * @version $Rev$ $Date$ - */ -public class CompositeBuilderException extends Exception { - private static final long serialVersionUID = -8916323176803443856L; - - public CompositeBuilderException() { - } - - public CompositeBuilderException(String message) { - super(message); - } - - public CompositeBuilderException(Throwable cause) { - super(cause); - } - - public CompositeBuilderException(String message, Throwable cause) { - super(message, cause); - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderMonitor.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderMonitor.java deleted file mode 100644 index aecdf417f2..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/CompositeBuilderMonitor.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.builder; - -/** - * A monitor for the composite builder. - * - * @version $Rev$ $Date$ - */ -public interface CompositeBuilderMonitor { - - /** - * Reports a build problem. - * - * @param problem - */ - void problem(Problem problem); - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/Problem.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/Problem.java deleted file mode 100644 index 8965410438..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/Problem.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.builder; - - -/** - * Reports a composite assembly problem. - * - * @version $Rev$ $Date$ - */ -public interface Problem { - - public enum Severity { - INFO, - WARNING, - ERROR - } - - Severity getSeverity(); - - String getMessage(); - - Object getModel(); - - Object getResource(); - - Exception getCause(); -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java deleted file mode 100644 index dbb0674522..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java +++ /dev/null @@ -1,1340 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.builder.impl; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentProperty; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.CompositeReference; -import org.apache.tuscany.sca.assembly.CompositeService; -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.assembly.Multiplicity; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.SCABinding; -import org.apache.tuscany.sca.assembly.SCABindingFactory; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.assembly.Wire; -import org.apache.tuscany.sca.assembly.builder.CompositeBuilder; -import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException; -import org.apache.tuscany.sca.assembly.builder.CompositeBuilderMonitor; -import org.apache.tuscany.sca.assembly.builder.Problem; -import org.apache.tuscany.sca.assembly.builder.Problem.Severity; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; - -/** - * A builder that handles the configuration of the components inside a - * composite and the wiring of component references to component services. - * - * @version $Rev$ $Date$ - */ -public class CompositeBuilderImpl implements CompositeBuilder { - - private AssemblyFactory assemblyFactory; - private SCABindingFactory scaBindingFactory; - private InterfaceContractMapper interfaceContractMapper; - private CompositeBuilderMonitor monitor; - - /** - * Constructs a new composite util. - * - * @param assemblyFactory - * @param interfaceContractMapper - */ - public CompositeBuilderImpl(AssemblyFactory assemblyFactory, - SCABindingFactory scaBindingFactory, - InterfaceContractMapper interfaceContractMapper, - CompositeBuilderMonitor monitor) { - this.assemblyFactory = assemblyFactory; - this.scaBindingFactory = scaBindingFactory; - this.interfaceContractMapper = interfaceContractMapper; - - if (monitor != null) { - this.monitor = monitor; - } else { - // Create a default monitor that does nothing. - this.monitor = new CompositeBuilderMonitor() { - public void problem(Problem problem) { - } - }; - } - } - - public void build(Composite composite) throws CompositeBuilderException { - - // Collect and fuse includes - fuseIncludes(composite); - - // Expand nested composites - expandComposites(composite); - - // Configure all components - configureComponents(composite); - - // Wire the composite - wireComposite(composite); - - // Activate composite services - activateCompositeServices(composite); - - // Wire composite references - wireCompositeReferences(composite); - } - - /** - * Collect all includes in a graph of includes. - * - * @param composite - * @param includes - */ - private void collectIncludes(Composite composite, List includes) { - for (Composite include : composite.getIncludes()) { - includes.add(include); - collectIncludes(include, includes); - } - } - - /** - * Copy a list of includes into a composite. - * - * @param composite - * @param includes - */ - protected void fuseIncludes(Composite composite) { - - // First collect all includes - List includes = new ArrayList(); - collectIncludes(composite, includes); - - // Then clone them - for (Composite include : includes) { - Composite clone; - try { - clone = (Composite)include.clone(); - } catch (CloneNotSupportedException e) { - throw new RuntimeException(e); - } - composite.getComponents().addAll(clone.getComponents()); - composite.getServices().addAll(clone.getServices()); - composite.getReferences().addAll(clone.getReferences()); - composite.getProperties().addAll(clone.getProperties()); - composite.getWires().addAll(clone.getWires()); - composite.getPolicySets().addAll(clone.getPolicySets()); - composite.getRequiredIntents().addAll(clone.getRequiredIntents()); - } - - // Clear the list of includes - composite.getIncludes().clear(); - } - - /** - * Reconcile component services and services defined on the component type. - * - * @param component - * @param services - * @param componentServices - * @param problems - */ - private void reconcileServices(Component component, - Map services, - Map componentServices) { - - // Connect each component service to the corresponding service - for (ComponentService componentService : component.getServices()) { - Service service = services.get(componentService.getName()); - if (service != null) { - componentService.setService(service); - } else { - warning("Service not found for component service: " + component.getName() + "/" + componentService.getName(), component); - } - } - - // Create a component service for each service - if (component.getImplementation() != null) { - for (Service service : component.getImplementation().getServices()) { - if (!componentServices.containsKey(service.getName())) { - ComponentService componentService = assemblyFactory.createComponentService(); - componentService.setName(service.getName()); - componentService.setService(service); - component.getServices().add(componentService); - } - } - } - - // Reconcile each component service with its service - for (ComponentService componentService : component.getServices()) { - Service service = componentService.getService(); - if (service != null) { - - // Reconcile interface - if (componentService.getInterfaceContract() != null) { - if (!componentService.getInterfaceContract().equals(service.getInterfaceContract())) { - if (!interfaceContractMapper.isCompatible(componentService.getInterfaceContract(), service - .getInterfaceContract())) { - warning("Component service interface incompatible with service interface: " + component.getName() + "/" + componentService.getName(), component); - } - } - } else { - componentService.setInterfaceContract(service.getInterfaceContract()); - } - - // Reconcile bindings - if (componentService.getBindings().isEmpty()) { - componentService.getBindings().addAll(service.getBindings()); - } - } - - } - } - - /** - * Reconcile component references with the references defined on the - * component type. - * - * @param component - * @param references - * @param componentReferences - * @param problems - */ - private void reconcileReferences(Component component, - Map references, - Map componentReferences) { - - // Connect each component reference to the corresponding reference - for (ComponentReference componentReference : component.getReferences()) { - Reference reference = references.get(componentReference.getName()); - if (reference != null) { - componentReference.setReference(reference); - } else { - if (!componentReference.getName().startsWith("$self$.")) { - warning("Reference not found for component reference: " + component.getName() + "/" + componentReference.getName(), component); - } - } - } - - // Create a component reference for each reference - if (component.getImplementation() != null) { - for (Reference reference : component.getImplementation().getReferences()) { - if (!componentReferences.containsKey(reference.getName())) { - ComponentReference componentReference = assemblyFactory.createComponentReference(); - componentReference.setName(reference.getName()); - componentReference.setReference(reference); - component.getReferences().add(componentReference); - } - } - } - - // Reconcile each component reference with its reference - for (ComponentReference componentReference : component.getReferences()) { - Reference reference = componentReference.getReference(); - if (reference != null) { - - // Reconcile multiplicity - if (componentReference.getMultiplicity() != null) { - if (!ReferenceUtil.isValidMultiplicityOverride(reference.getMultiplicity(), componentReference - .getMultiplicity())) { - warning("Component reference multiplicity incompatible with reference multiplicity: " + component.getName() + "/" + componentReference.getName(), component); - } - } else { - componentReference.setMultiplicity(reference.getMultiplicity()); - } - - // Reconcile interface - if (componentReference.getInterfaceContract() != null) { - if (!componentReference.getInterfaceContract().equals(reference.getInterfaceContract())) { - if (!interfaceContractMapper.isCompatible(reference.getInterfaceContract(), componentReference - .getInterfaceContract())) { - warning("Component reference interface incompatible with reference interface: " + component.getName() + "/" + componentReference.getName(), component); - } - } - } else { - componentReference.setInterfaceContract(reference.getInterfaceContract()); - } - - // Reconcile bindings - if (componentReference.getBindings().isEmpty()) { - componentReference.getBindings().addAll(reference.getBindings()); - } - - // Propagate autowire setting from the component - if (component.isAutowire()) { - componentReference.setAutowire(true); - } - - // Reconcile targets - if (componentReference.getTargets().isEmpty()) { - componentReference.getTargets().addAll(reference.getTargets()); - } - } - } - } - - /** - * Reconcile component properties and the properties defined by the - * component type. - * - * @param component - * @param properties - * @param componentProperties - * @param problems - */ - private void reconcileProperties(Component component, - Map properties, - Map componentProperties) { - - // Connect component properties to their properties - for (ComponentProperty componentProperty : component.getProperties()) { - Property property = properties.get(componentProperty.getName()); - if (property != null) { - componentProperty.setProperty(property); - } else { - warning("Property not found for component property: " + component.getName() + "/" + componentProperty.getName(), component); - } - } - - // Create component properties for all properties - if (component.getImplementation() != null) { - for (Property property : component.getImplementation().getProperties()) { - if (!componentProperties.containsKey(property.getName())) { - ComponentProperty componentProperty = assemblyFactory.createComponentProperty(); - componentProperty.setName(property.getName()); - componentProperty.setMany(property.isMany()); - componentProperty.setXSDElement(property.getXSDElement()); - componentProperty.setXSDType(property.getXSDType()); - componentProperty.setProperty(property); - component.getProperties().add(componentProperty); - } - } - } - - // Reconcile component properties and their properties - for (ComponentProperty componentProperty : component.getProperties()) { - Property property = componentProperty.getProperty(); - if (property != null) { - - // Check that a component property does not override the - // mustSupply attribute - if (!property.isMustSupply() && componentProperty.isMustSupply()) { - warning("Component property mustSupply attribute incompatible with property: " + component.getName() + "/" + componentProperty.getName(), component); - } - - // Default to the mustSupply attribute specified on the property - if (!componentProperty.isMustSupply()) - componentProperty.setMustSupply(property.isMustSupply()); - - // Default to the value specified on the property - if (componentProperty.getValue() == null) { - componentProperty.setValue(property.getValue()); - } - - // Check that a value is supplied - if (componentProperty.getValue() == null && property.isMustSupply()) { - warning("No value configured on a mustSupply property: " + component.getName() + "/" + componentProperty.getName(), component); - } - - // Check that a a component property does not override the - // many attribute - if (!property.isMany() && componentProperty.isMany()) { - warning("Component property many attribute incompatible with property: " + component.getName() + "/" + componentProperty.getName(), component); - } - - // Default to the many attribute defined on the property - componentProperty.setMany(property.isMany()); - - // Default to the type and element defined on the property - if (componentProperty.getXSDType() == null) { - componentProperty.setXSDType(property.getXSDType()); - } - if (componentProperty.getXSDElement() == null) { - componentProperty.setXSDElement(property.getXSDElement()); - } - - // Check that a type or element are specified - if (componentProperty.getXSDElement() == null && componentProperty.getXSDType() == null) { - warning("No type specified on component property: " + component.getName() + "/" + componentProperty.getName(), component); - } - } - } - } - - /** - * Configure components in the composite. - * - * @param composite - * @param problems - */ - protected void configureComponents(Composite composite) { - configureComponents(composite, null); - } - - private void indexImplPropServRef(Component component, - Map services, - Map references, - Map properties) { - // First check that the component has a resolved implementation - Implementation implementation = component.getImplementation(); - if (implementation == null) { - - // A component must have an implementation - warning("No implementation for component: " + component.getName(), component); - - } else if (implementation.isUnresolved()) { - - // The implementation must be fully resolved - warning("Component implementation not found: " + component.getName() - + " : " - + implementation.getURI(), component); - - } else { - - // Index properties, services and references, also check for - // duplicates - for (Property property : implementation.getProperties()) { - if (properties.containsKey(property.getName())) { - warning("Duplicate property name: " + component.getName() - + "/" - + property.getName(), component); - } else { - properties.put(property.getName(), property); - } - } - for (Service service : implementation.getServices()) { - if (services.containsKey(service.getName())) { - warning("Duplicate service name: " + component.getName() - + "/" - + service.getName(), component); - } else { - services.put(service.getName(), service); - } - } - for (Reference reference : implementation.getReferences()) { - if (references.containsKey(reference.getName())) { - warning("Duplicate reference name: " + component.getName() - + "/" - + reference.getName(), component); - } else { - references.put(reference.getName(), reference); - } - } - } - - } - - private void indexCompPropServRef(Component component, - Map componentServices, - Map componentReferences, - Map componentProperties) { - for (ComponentService componentService : component.getServices()) { - if (componentServices.containsKey(componentService.getName())) { - warning("Duplicate component service name: " + component.getName() - + "/" - + componentService.getName(), component); - } else { - componentServices.put(componentService.getName(), componentService); - } - - // Initialize binding names - for (Binding binding : componentService.getBindings()) { - if (binding.getName() == null) { - binding.setName(componentService.getName()); - } - } - } - for (ComponentReference componentReference : component.getReferences()) { - if (componentReferences.containsKey(componentReference.getName())) { - warning("Duplicate component reference name: " + component.getName() - + "/" - + componentReference.getName(), component); - } else { - componentReferences.put(componentReference.getName(), componentReference); - } - - // Initialize binding names - for (Binding binding : componentReference.getBindings()) { - if (binding.getName() == null) { - binding.setName(componentReference.getName()); - } - } - } - for (ComponentProperty componentProperty : component.getProperties()) { - if (componentProperties.containsKey(componentProperty.getName())) { - warning("Duplicate component property name: " + component.getName() - + "/" - + componentProperty.getName(), component); - } else { - componentProperties.put(componentProperty.getName(), componentProperty); - } - } - - } - - /** - * Configure components in the composite. - * - * @param composite - * @param uri - * @param problems - */ - private void configureComponents(Composite composite, String uri) { - - // Process nested composites recursively - for (Component component : composite.getComponents()) { - - // Initialize component URI - String componentURI; - if (uri == null) { - componentURI = component.getName(); - } else { - componentURI = uri + "/" + component.getName(); - } - component.setURI(componentURI); - - Implementation implementation = component.getImplementation(); - if (implementation instanceof Composite) { - - // Process nested composite - configureComponents((Composite)implementation, componentURI); - } - } - - // Set default binding names - for (Service service : composite.getServices()) { - for (Binding binding : service.getBindings()) { - if (binding.getName() == null) { - binding.setName(service.getName()); - } - } - } - for (Reference reference : composite.getReferences()) { - for (Binding binding : reference.getBindings()) { - if (binding.getName() == null) { - binding.setName(reference.getName()); - } - } - } - - // Initialize all component services and references - Map components = new HashMap(); - for (Component component : composite.getComponents()) { - - // Index all components and check for duplicates - if (components.containsKey(component.getName())) { - warning("Duplicate component name: " + composite.getName() + " : " + component.getName(), composite); - } else { - components.put(component.getName(), component); - } - - // Propagate the autowire flag from the composite to components - if (composite.isAutowire()) { - component.setAutowire(true); - } - - - Map services = new HashMap(); - Map references = new HashMap(); - Map properties = new HashMap(); - //Index properties, services and references - indexImplPropServRef(component, services, references, properties); - - Map componentServices = new HashMap(); - Map componentReferences = new HashMap(); - Map componentProperties = new HashMap(); - //Index component services, references and properties - // Also check for duplicates - indexCompPropServRef(component, componentServices, componentReferences, componentProperties); - - // Reconcile component services/references/properties and - // implementation - // services/references and create component - // services/references/properties - // for the services/references declared by the implementation - reconcileServices(component, services, componentServices); - reconcileReferences(component, references, componentReferences); - reconcileProperties(component, properties, componentProperties); - - // Create self references to the component's services - if (!(component.getImplementation() instanceof Composite)) { - createSelfReferences(component); - } - } - } - - /** - * Create SCA bindings for component services and references. - * - * @param composite - * @param componentServices - * @param componentReferences - * @param problems - */ - private void createSCABindings(Composite composite, - Map componentServices, - Map componentReferences) { - - for (Component component : composite.getComponents()) { - int i = 0; - for (ComponentService componentService : component.getServices()) { - String uri = component.getName() + '/' + componentService.getName(); - componentServices.put(uri, componentService); - if (i == 0) { - componentServices.put(component.getName(), componentService); - } - i++; - - // Create and configure an SCA binding for the service - SCABinding scaBinding = componentService.getBinding(SCABinding.class); - if (scaBinding == null) { - scaBinding = scaBindingFactory.createSCABinding(); - scaBinding.setName(componentService.getName()); - componentService.getBindings().add(scaBinding); - } - scaBinding.setURI(uri); - scaBinding.setComponent(component); - } - for (ComponentReference componentReference : component.getReferences()) { - String uri = component.getName() + '/' + componentReference.getName(); - componentReferences.put(uri, componentReference); - - // Create and configure an SCA binding for the reference - SCABinding scaBinding = componentReference.getBinding(SCABinding.class); - if (scaBinding == null) { - scaBinding = scaBindingFactory.createSCABinding(); - scaBinding.setName(componentReference.getName()); - componentReference.getBindings().add(scaBinding); - } - scaBinding.setURI(uri); - scaBinding.setComponent(component); - } - } - - } - - /** - * Connect composite services to the component services that they promote. - * - * @param composite - * @param componentServices - * @param problems - */ - private void connectCompositeServices(Composite composite, - Map componentServices) { - - // Propagate interfaces from inner composite components' services to - // their component services - for (Component component : composite.getComponents()) { - if (component.getImplementation() instanceof Composite) { - for (ComponentService componentService : component.getServices()) { - Service service = componentService.getService(); - if (service != null) { - if (componentService.getInterfaceContract() == null) { - componentService.setInterfaceContract(service.getInterfaceContract()); - } - } - } - } - } - - // Connect composite services to the component services that they - // promote - for (Service service : composite.getServices()) { - - CompositeService compositeService = (CompositeService)service; - ComponentService componentService = compositeService.getPromotedService(); - if (componentService != null && componentService.isUnresolved()) { - ComponentService promotedService = componentServices.get(componentService.getName()); - if (promotedService != null) { - - // Point to the resolved component service - compositeService.setPromotedService(promotedService); - - // Use the interface contract from the component service if - // none is specified on the composite service - if (compositeService.getInterfaceContract() == null) { - compositeService.setInterfaceContract(promotedService.getInterfaceContract()); - } - - } else { - warning("Promoted component service not found: " + componentService.getName(), composite); - } - } - } - - } - - /** - * Resolves promoted references. - * - * @param composite - * @param componentReferences - * @param problems - */ - private void connectCompositeReferences(Composite composite, - Map componentReferences) { - - // Propagate interfaces from inner composite components' references to - // their component references - for (Component component : composite.getComponents()) { - if (component.getImplementation() instanceof Composite) { - for (ComponentReference componentReference : component.getReferences()) { - Reference reference = componentReference.getReference(); - if (reference != null) { - if (componentReference.getInterfaceContract() == null) { - componentReference.setInterfaceContract(reference.getInterfaceContract()); - } - } - } - } - } - - // Connect composite references to the component references - // that they promote - for (Reference reference : composite.getReferences()) { - CompositeReference compositeReference = (CompositeReference)reference; - List promotedReferences = compositeReference.getPromotedReferences(); - for (int i = 0, n = promotedReferences.size(); i < n; i++) { - ComponentReference componentReference = promotedReferences.get(i); - if (componentReference.isUnresolved()) { - String componentReferenceName = componentReference.getName(); - componentReference = componentReferences.get(componentReferenceName); - if (componentReference != null) { - - // Point to the resolved component reference - promotedReferences.set(i, componentReference); - - // Use the interface contract from the component - // reference if none - // is specified on the composite reference - if (compositeReference.getInterfaceContract() == null) { - compositeReference.setInterfaceContract(componentReference.getInterfaceContract()); - } - - } else { - warning("Promoted component reference not found: " + componentReferenceName, composite); - } - } - } - } - } - - /** - * Connect references to their targets. - * - * @param composite - * @param componentServices - * @param componentReferences - * @param problems - */ - private void connectComponentReferences(Composite composite, - Map componentServices, - Map componentReferences) { - - for (ComponentReference componentReference : componentReferences.values()) { - List targets = componentReference.getTargets(); - - if (componentReference.isAutowire()) { - - // Find suitable targets in the current composite for an - // autowired reference - Multiplicity multiplicity = componentReference.getMultiplicity(); - for (Component component : composite.getComponents()) { - for (ComponentService componentService : component.getServices()) { - if (componentReference.getInterfaceContract() == null || interfaceContractMapper - .isCompatible(componentReference.getInterfaceContract(), componentService - .getInterfaceContract())) { - - targets.add(componentService); - if (multiplicity == Multiplicity.ZERO_ONE || multiplicity == Multiplicity.ONE_ONE) { - break; - } - } - } - } - - } else if (!targets.isEmpty()) { - - // Resolve targets specified on the component reference - for (int i = 0, n = targets.size(); i < n; i++) { - ComponentService target = targets.get(i); - if (target.isUnresolved()) { - ComponentService resolved = componentServices.get(target.getName()); - if (resolved != null) { - - // Check that the target component service provides - // a superset of - // the component reference interface - if (componentReference.getInterfaceContract() == null || interfaceContractMapper - .isCompatible(componentReference.getInterfaceContract(), resolved - .getInterfaceContract())) { - - targets.set(i, resolved); - } else { - warning("Incompatible interfaces on component reference and target: " + componentReference.getName() + " : " + target.getName(), composite); - } - } else { - warning("Component reference target not found: " + target.getName(), composite); - } - } - } - } else if (componentReference.getReference() != null) { - - // Resolve targets from the corresponding reference in the - // componentType - for (ComponentService target : componentReference.getReference().getTargets()) { - if (target.isUnresolved()) { - ComponentService resolved = componentServices.get(target.getName()); - if (resolved != null) { - - // Check that the target component service provides - // a superset of - // the component reference interface - if (componentReference.getInterfaceContract() == null || interfaceContractMapper - .isCompatible(componentReference.getInterfaceContract(), resolved - .getInterfaceContract())) { - - targets.add(resolved); - } else { - warning("Incompatible interfaces on component reference and target: " + componentReference.getName() + " : " + target.getName(), composite); - } - } else { - warning("Reference target not found: " + target.getName(), composite); - } - } - } - } - } - } - - /** - * Resolve wires and connect the sources to their targets - * - * @param composite - * @param componentServices - * @param componentReferences - * @param problems - */ - private void connectWires(Composite composite, - Map componentServices, - Map componentReferences) { - - // For each wire, resolve the source reference, the target service, and - // add it to the list of targets of the reference - List wires = composite.getWires(); - for (int i = 0, n = wires.size(); i < n; i++) { - Wire wire = wires.get(i); - - ComponentReference resolvedReference; - ComponentService resolvedService; - - // Resolve the source reference - ComponentReference source = wire.getSource(); - if (source != null && source.isUnresolved()) { - resolvedReference = componentReferences.get(source.getName()); - if (resolvedReference != null) { - wire.setSource(resolvedReference); - } else { - warning("Wire source not found: " + source.getName(), composite); - } - } else { - resolvedReference = wire.getSource(); - } - - // Resolve the target service - ComponentService target = wire.getTarget(); - if (target != null && target.isUnresolved()) { - resolvedService = componentServices.get(target.getName()); - if (resolvedService != null) { - wire.setTarget(target); - } else { - warning("Wire target not found: " + source.getName(), composite); - } - } else { - resolvedService = wire.getTarget(); - } - - // Add the target service to the list of targets of the - // reference - if (resolvedReference != null && resolvedService != null) { - // Check that the target component service provides - // a superset of - // the component reference interface - if (resolvedReference.getInterfaceContract() == null || interfaceContractMapper - .isCompatible(resolvedReference.getInterfaceContract(), resolvedService - .getInterfaceContract())) { - - resolvedReference.getTargets().add(resolvedService); - } else { - warning("Incompatible interfaces on wire source and target: " + source.getName() + " : " + target.getName(), composite); - } - } - } - - // Clear the list of wires - composite.getWires().clear(); - } - - /** - * Follow a service promotion chain down to the inner most (non composite) - * component service. - * - * @param topCompositeService - * @return - */ - private ComponentService getPromotedComponentService(CompositeService compositeService) { - ComponentService componentService = compositeService.getPromotedService(); - if (componentService != null) { - Service service = componentService.getService(); - if (componentService.getName() != null && service instanceof CompositeService) { - - // Continue to follow the service promotion chain - return getPromotedComponentService((CompositeService)service); - - } else { - - // Found a non-composite service - return componentService; - } - } else { - - // No promoted service - return null; - } - } - - /** - * Follow a reference promotion chain down to the inner most (non composite) - * component references. - * - * @param compositeReference - * @return - */ - private List getPromotedComponentReferences(CompositeReference compositeReference) { - List componentReferences = new ArrayList(); - collectPromotedComponentReferences(compositeReference, componentReferences); - return componentReferences; - } - - /** - * Follow a reference promotion chain down to the inner most (non composite) - * component references. - * - * @param compositeReference - * @param componentReferences - * @return - */ - private void collectPromotedComponentReferences(CompositeReference compositeReference, - List componentReferences) { - for (ComponentReference componentReference : compositeReference.getPromotedReferences()) { - Reference reference = componentReference.getReference(); - if (reference instanceof CompositeReference) { - - // Continue to follow the reference promotion chain - collectPromotedComponentReferences((CompositeReference)reference, componentReferences); - - } else if (reference != null) { - - // Found a non-composite reference - componentReferences.add(componentReference); - } - } - } - - /** - * Activate composite services in nested composites. - * - * @param composite - * @param problems - */ - protected void activateCompositeServices(Composite composite) { - - // Process nested composites recursively - for (Component component : composite.getComponents()) { - Implementation implementation = component.getImplementation(); - if (implementation instanceof Composite) { - - // First process nested composites - activateCompositeServices((Composite)implementation); - - // Process the component services declared on components - // in this composite - for (ComponentService componentService : component.getServices()) { - CompositeService compositeService = (CompositeService)componentService.getService(); - if (compositeService != null) { - - // Get the inner most promoted service - ComponentService promotedService = getPromotedComponentService(compositeService); - if (promotedService != null) { - - // Default to use the interface from the promoted service - if (compositeService.getInterfaceContract() == null) { - compositeService.setInterfaceContract(promotedService.getInterfaceContract()); - } - if (componentService.getInterfaceContract() == null) { - componentService.setInterfaceContract(promotedService.getInterfaceContract()); - } - - // Create a new component service to represent this composite - // service on the promoted component - SCABinding scaBinding = promotedService.getBinding(SCABinding.class); - if (scaBinding != null) { - Component promotedComponent = scaBinding.getComponent(); - ComponentService newComponentService = assemblyFactory.createComponentService(); - newComponentService.setName("$promoted$." + compositeService.getName()); - //newComponentService.setService(compositeService); - promotedComponent.getServices().add(newComponentService); - newComponentService.getBindings().add(scaBinding); - newComponentService.getBindings().addAll(compositeService.getBindings()); - newComponentService.setInterfaceContract(compositeService.getInterfaceContract()); - newComponentService.setCallback(compositeService.getCallback()); - - // FIXME: [rfeng] Set the service to promoted - newComponentService.setService(promotedService.getService()); - - // Change the composite service to now promote the newly - // created component service directly - compositeService.setPromotedService(newComponentService); - - } else { - warning("Promoted component service not found: " + promotedService.getName(), composite); - } - } - } - } - } - } - - // Process composite services declared in this composite - for (Service service : composite.getServices()) { - CompositeService compositeService = (CompositeService)service; - - // Get the inner most promoted service - ComponentService promotedService = getPromotedComponentService(compositeService); - if (promotedService != null) { - - // Default to use the interface from the promoted service - if (compositeService.getInterfaceContract() == null && promotedService.getInterfaceContract() != null) { - compositeService.setInterfaceContract(promotedService.getInterfaceContract()); - } - - // Create a new component service to represent this composite - // service on the promoted component - SCABinding scaBinding = promotedService.getBinding(SCABinding.class); - if (scaBinding != null) { - Component promotedComponent = scaBinding.getComponent(); - ComponentService newComponentService = assemblyFactory.createComponentService(); - newComponentService.setName("$promoted$." + compositeService.getName()); - //newComponentService.setService(compositeService); - promotedComponent.getServices().add(newComponentService); - newComponentService.getBindings().add(scaBinding); - newComponentService.getBindings().addAll(compositeService.getBindings()); - newComponentService.setInterfaceContract(compositeService.getInterfaceContract()); - newComponentService.setCallback(compositeService.getCallback()); - - // FIXME: [rfeng] Set the service to promoted - newComponentService.setService(promotedService.getService()); - - // Change the composite service to now promote the newly - // created component service directly - compositeService.setPromotedService(newComponentService); - } else { - warning("Promoted component service not found: " + promotedService.getName(), composite); - } - } - } - } - - /** - * Wire composite references in nested composites. - * - * @param composite - * @param problems - */ - protected void wireCompositeReferences(Composite composite) { - - // Process nested composites recursively - for (Component component : composite.getComponents()) { - Implementation implementation = component.getImplementation(); - if (implementation instanceof Composite) { - wireCompositeReferences((Composite)implementation); - } - } - - // Process composite references declared in this composite - for (Reference reference : composite.getReferences()) { - CompositeReference compositeReference = (CompositeReference)reference; - List promotedReferences = getPromotedComponentReferences(compositeReference); - for (ComponentReference promotedReference : promotedReferences) { - - // Override the configuration of the promoted reference - SCABinding scaBinding = promotedReference.getBinding(SCABinding.class); - promotedReference.getBindings().clear(); - promotedReference.getBindings().add(scaBinding); - promotedReference.getBindings().addAll(compositeReference.getBindings()); - } - } - - // Process the component references declared on components - // in this composite - for (Component component : composite.getComponents()) { - Implementation implementation = component.getImplementation(); - if (implementation instanceof Composite) { - for (ComponentReference componentReference : component.getReferences()) { - CompositeReference compositeReference = (CompositeReference)componentReference.getReference(); - if (compositeReference != null) { - List promotedReferences = getPromotedComponentReferences(compositeReference); - for (ComponentReference promotedReference : promotedReferences) { - - // Override the configuration of the promoted - // reference - SCABinding scaBinding = promotedReference.getBinding(SCABinding.class); - promotedReference.getBindings().clear(); - promotedReference.getBindings().add(scaBinding); - promotedReference.getBindings().addAll(componentReference.getBindings()); - - // Wire the promoted reference to the actual - // non-composite component services - promotedReference.getTargets().clear(); - for (ComponentService target : componentReference.getTargets()) { - if (target.getService() instanceof CompositeService) { - - // Wire to the actual component service - // promoted by a composite service - CompositeService compositeService = (CompositeService)target.getService(); - ComponentService componentService = compositeService.getPromotedService(); - if (componentService != null) { - promotedReference.getTargets().add(componentService); - } - } else { - - // Wire to a non-composite target service - promotedReference.getTargets().add(target); - } - } - } - } - } - } else { - for (ComponentReference componentReference : component.getReferences()) { - - // Wire the component reference to the actual - // non-composite component services - List targets = componentReference.getTargets(); - for (int i = 0, n = targets.size(); i componentServices = new HashMap(); - Map componentReferences = new HashMap(); - - // Create SCA bindings on all component services and references - createSCABindings(composite, componentServices, componentReferences); - - // Connect composite services and references to the component - // services and references that they promote - connectCompositeServices(composite, componentServices); - connectCompositeReferences(composite, componentReferences); - - // Connect component references to their targets - connectComponentReferences(composite, componentServices, componentReferences); - - // Connect component references as described in wires - connectWires(composite, componentServices, componentReferences); - - // Resolve sourced properties - resolveSourcedProperties(composite, null); - - // Validate that references are wired or promoted, according - // to their multiplicity - for (ComponentReference componentReference : componentReferences.values()) { - if (!ReferenceUtil.validateMultiplicityAndTargets(componentReference.getMultiplicity(), componentReference - .getTargets(), componentReference.getBindings())) { - if (componentReference.getTargets().isEmpty()) { - - // No warning if the reference is promoted out of the current composite - boolean promoted = false; - for (Reference reference: composite.getReferences()) { - CompositeReference compositeReference = (CompositeReference)reference; - if (compositeReference.getPromotedReferences().contains(componentReference)) { - promoted = true; - break; - } - } - if (!promoted) { - warning("No targets for reference: " + componentReference.getName(), composite); - } - } else { - warning("Too many targets on reference: " + componentReference.getName(), composite); - } - } - } - } - - private ComponentProperty getComponentPropertyByName(String propertyName, List properties) { - if (properties != null) { - for (ComponentProperty aProperty : properties) { - if (aProperty.getName().equals(propertyName)) { - return aProperty; - } - } - } - return null; - } - - - /** - * @param composite - */ - private void resolveSourcedProperties(Composite composite, List propertySettings) { - // Resolve properties - Map compositeProperties = new HashMap(); - ComponentProperty componentProperty = null; - for (Property p : composite.getProperties()) { - componentProperty = getComponentPropertyByName(p.getName(), propertySettings); - if ( componentProperty != null ) { - compositeProperties.put(p.getName(), componentProperty); - } else { - compositeProperties.put(p.getName(), p); - } - } - - for (Component component : composite.getComponents()) { - try { - PropertyUtil.sourceComponentProperties(compositeProperties, component); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - Implementation impl = component.getImplementation(); - if (impl instanceof Composite) { - resolveSourcedProperties((Composite)impl, component.getProperties()); - } - } - } - - - /** - * Expand composite component implementations. - * - * @param composite - * @param problems - */ - protected void expandComposites(Composite composite) { - for (Component component : composite.getComponents()) { - Implementation implementation = component.getImplementation(); - if (implementation instanceof Composite) { - - Composite compositeImplementation = (Composite)implementation; - Composite clone; - try { - clone = (Composite)compositeImplementation.clone(); - } catch (CloneNotSupportedException e) { - throw new RuntimeException(e); - } - component.setImplementation(clone); - expandComposites(clone); - } - } - } - - /** - * For all the services, create a corresponding self-reference. - * - * @param component - */ - private void createSelfReferences(Component component) { - for (ComponentService service : component.getServices()) { - ComponentReference componentReference = assemblyFactory.createComponentReference(); - componentReference.setName("$self$." + service.getName()); - componentReference.getBindings().addAll(service.getBindings()); - ComponentService componentService = assemblyFactory.createComponentService(); - componentService.setName(component.getName() + "/" + service.getName()); - componentService.setUnresolved(true); - componentReference.getTargets().add(componentService); - componentReference.getPolicySets().addAll(service.getPolicySets()); - componentReference.getRequiredIntents().addAll(service.getRequiredIntents()); - componentReference.setInterfaceContract(service.getInterfaceContract()); - componentReference.setMultiplicity(Multiplicity.ONE_ONE); - component.getReferences().add(componentReference); - } - } - - /** - * Report an error. - * - * @param problems - * @param message - * @param model - */ - @SuppressWarnings("unused") - private void error(String message, Object model) { - monitor.problem(new ProblemImpl(Severity.ERROR, message, model)); - } - - /** - * Report a warning. - * - * @param problems - * @param message - * @param model - */ - private void warning(String message, Object model) { - monitor.problem(new ProblemImpl(Severity.WARNING, message, model)); - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ProblemImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ProblemImpl.java deleted file mode 100644 index 2b85cec9fa..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ProblemImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.builder.impl; - -import org.apache.tuscany.sca.assembly.builder.Problem; - - -/** - * Reports a composite assembly problem. - * - * @version $Rev$ $Date$ - */ -public class ProblemImpl implements Problem { - - private String message; - private Severity severity; - private Object model; - private Object resource; - private Exception cause; - - /** - * Constructs a new problem. - * - * @param severity - * @param message - * @param model - */ - public ProblemImpl(Severity severity, String message, Object model) { - this.severity = severity; - this.message = message; - this.model = model; - } - - /** - * Constructs a new problem. - * - * @param severity - * @param message - * @param model - * @param resource - */ - public ProblemImpl(Severity severity, String message, Object model, Object resource) { - this.severity = severity; - this.message = message; - this.model = model; - this.resource = resource; - } - - /** - * Constructs a new problem. - * - * @param severity - * @param message - * @param cause - */ - public ProblemImpl(Severity severity, String message, Exception cause) { - this.severity = severity; - this.message = message; - this.cause = cause; - } - - public Severity getSeverity() { - return severity; - } - - public String getMessage() { - return message; - } - - public Object getModel() { - return model; - } - - public Object getResource() { - return resource; - } - - public Exception getCause() { - return cause; - } -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyUtil.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyUtil.java deleted file mode 100644 index 71be058795..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PropertyUtil.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.builder.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.NamespaceContext; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.Source; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMResult; -import javax.xml.transform.sax.SAXSource; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpression; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentProperty; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.xml.sax.InputSource; - -/** - * Utility class to deal with processing of component properties that are taking values from the parent - * composite's properties or an external file. - */ -public class PropertyUtil { - private static final XPathFactory XPATH_FACTORY = XPathFactory.newInstance(); - private static final DocumentBuilderFactory DOC_BUILDER_FACTORY = DocumentBuilderFactory.newInstance(); - private static final TransformerFactory TRANSFORMER_FACTORY = TransformerFactory.newInstance(); - - static private Document evaluate(NamespaceContext nsContext, Node node, String xPathExpression) - throws XPathExpressionException, ParserConfigurationException { - XPath path = XPATH_FACTORY.newXPath(); - - if (nsContext != null) { - path.setNamespaceContext(nsContext); - } else { - path.setNamespaceContext(new DOMNamespaceContext(node)); - } - - XPathExpression expression = path.compile(xPathExpression); - Node result = (Node)expression.evaluate(node, XPathConstants.NODE); - if (result == null) { - return null; - } - - // TODO: How to wrap the result into a Document? - Document document = DOC_BUILDER_FACTORY.newDocumentBuilder().newDocument(); - if (result instanceof Document) { - return (Document)result; - } else { - //Element root = document.createElementNS(null, "value"); - //document.appendChild(root); - document.appendChild(document.importNode(result, true)); - return document; - } - } - - static private Document loadFromFile(String file) throws MalformedURLException, IOException, - TransformerException, ParserConfigurationException { - URI uri = URI.create(file); - URL url = null; - if (!uri.isAbsolute()) { - url = Thread.currentThread().getContextClassLoader().getResource(file); - } else { - url = uri.toURL(); - } - InputStream is = url.openStream(); - - Source streamSource = new SAXSource(new InputSource(is)); - DOMResult result = new DOMResult(); - javax.xml.transform.Transformer transformer = TRANSFORMER_FACTORY.newTransformer(); - transformer.transform(streamSource, result); - is.close(); - - return (Document)result.getNode(); - } - - static void sourceComponentProperties(Map compositeProperties, - Component componentDefinition) throws CompositeBuilderException, - ParserConfigurationException, - XPathExpressionException, - TransformerException, - IOException { - - List componentProperties = componentDefinition.getProperties(); - for (ComponentProperty aProperty : componentProperties) { - String source = aProperty.getSource(); - String file = aProperty.getFile(); - if (source != null) { - // $/... - int index = source.indexOf('/'); - if (index == -1) { - // Tolerating $prop - source = source + "/"; - index = source.length() - 1; - } - if (source.charAt(0) == '$') { - String name = source.substring(1, index); - Property compositeProp = compositeProperties.get(name); - if (compositeProp == null) { - throw new CompositeBuilderException("The 'source' cannot be resolved to a composite property: " + source); - } - - Document compositePropDefValues = (Document)compositeProp.getValue(); - - // Adding /value because the document root is "value" - String path = source.substring(index); - String xpath = null; - - if ("/".equals(path)) { - // trailing / is not legal for xpath - xpath = "/value"; - } else { - xpath = "/value" + path; - } - - // FIXME: How to deal with namespaces? - Document node = evaluate(null, compositePropDefValues, xpath); - - if (node != null) { - aProperty.setValue(node); - } - } else { - throw new CompositeBuilderException("The 'source' has an invalid value: " + source); - } - } else if (file != null) { - aProperty.setValue(loadFromFile(aProperty.getFile())); - - } - } - } - - private static class DOMNamespaceContext implements NamespaceContext { - private Node node; - - /** - * @param node - */ - public DOMNamespaceContext(Node node) { - super(); - this.node = node; - } - - public String getNamespaceURI(String prefix) { - return node.lookupNamespaceURI(prefix); - } - - public String getPrefix(String namespaceURI) { - return node.lookupPrefix(namespaceURI); - } - - public Iterator getPrefixes(String namespaceURI) { - return null; - } - - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ReferenceUtil.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ReferenceUtil.java deleted file mode 100644 index 9802e9ba63..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ReferenceUtil.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.builder.impl; - -import java.util.List; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Multiplicity; -import org.apache.tuscany.sca.assembly.SCABinding; - -/** - * This class encapsulates utility methods to deal with reference definitions - * - */ -class ReferenceUtil { - static boolean isValidMultiplicityOverride(Multiplicity definedMul, Multiplicity overridenMul) { - if (definedMul != overridenMul) { - switch (definedMul) { - case ZERO_N: - return overridenMul == Multiplicity.ZERO_ONE; - case ONE_N: - return overridenMul == Multiplicity.ONE_ONE; - default: - return false; - } - } else { - return true; - } - } - - static boolean validateMultiplicityAndTargets(Multiplicity multiplicity, - List targets, List bindings) { - - // Count targets - int count = targets.size(); - - //FIXME workaround, this validation is sometimes invoked too early - // before we get a chance to init the multiplicity attribute - if (multiplicity == null) { - return true; - } - - switch (multiplicity) { - case ZERO_N: - break; - case ZERO_ONE: - if (count > 1) { - return false; - } - break; - case ONE_ONE: - if (count != 1) { - if (count == 0) { - for (Binding binding: bindings) { - if (!(binding instanceof SCABinding)) { - return true; - } - } - } - return false; - } - break; - case ONE_N: - if (count < 1) { - if (count == 0) { - for (Binding binding: bindings) { - if (!(binding instanceof SCABinding)) { - return true; - } - } - } - return false; - } - break; - } - return true; - } -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractPropertyImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractPropertyImpl.java deleted file mode 100644 index 989aea1237..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractPropertyImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.AbstractProperty; -import org.apache.tuscany.sca.policy.Intent; - -/** - * Represents an abstract property. - * - * @version $Rev$ $Date$ - */ -public class AbstractPropertyImpl extends BaseImpl implements AbstractProperty { - private Object value; - private String name; - private QName xsdType; - private QName xsdElement; - private boolean many; - private boolean mustSupply; - private List requiredIntents = new ArrayList(); - - /** - * Constructs a new abstract property. - */ - protected AbstractPropertyImpl() { - } - - public Object getValue() { - return value; - } - - public String getName() { - return name; - } - - public QName getXSDElement() { - return xsdElement; - } - - public QName getXSDType() { - return xsdType; - } - - public boolean isMany() { - return many; - } - - public boolean isMustSupply() { - return mustSupply; - } - - public void setValue(Object defaultValue) { - this.value = defaultValue; - } - - public void setMany(boolean many) { - this.many = many; - } - - public void setMustSupply(boolean mustSupply) { - this.mustSupply = mustSupply; - } - - public void setName(String name) { - this.name = name; - } - - public void setXSDElement(QName element) { - this.xsdElement = element; - } - - public void setXSDType(QName type) { - this.xsdType = type; - } - - public List getRequiredIntents() { - return requiredIntents; - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractReferenceImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractReferenceImpl.java deleted file mode 100644 index d0ee3832c5..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractReferenceImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import org.apache.tuscany.sca.assembly.AbstractReference; -import org.apache.tuscany.sca.assembly.Multiplicity; - -/** - * Represents an abstract reference - * - * @version $Rev$ $Date$ - */ -public class AbstractReferenceImpl extends ContractImpl implements AbstractReference { - private Multiplicity multiplicity = Multiplicity.ONE_ONE; - - /** - * Constructs a new abstract reference. - */ - protected AbstractReferenceImpl() { - } - - public Multiplicity getMultiplicity() { - return multiplicity; - } - - public void setMultiplicity(Multiplicity multiplicity) { - this.multiplicity = multiplicity; - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractServiceImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractServiceImpl.java deleted file mode 100644 index 346764b1b4..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AbstractServiceImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import org.apache.tuscany.sca.assembly.AbstractService; - -/** - * Represents an abstract service - * - * @version $Rev$ $Date$ - */ -public class AbstractServiceImpl extends ContractImpl implements AbstractService { - - /** - * Constructs a new abstract service. - */ - protected AbstractServiceImpl() { - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java deleted file mode 100644 index 1e623d35f2..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/AssemblyFactoryImpl.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import org.apache.tuscany.sca.assembly.AbstractProperty; -import org.apache.tuscany.sca.assembly.AbstractReference; -import org.apache.tuscany.sca.assembly.AbstractService; -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Callback; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentProperty; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.CompositeReference; -import org.apache.tuscany.sca.assembly.CompositeService; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.assembly.Wire; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.impl.OperationImpl; - -/** - * A factory for the assembly model. - * - * @version $Rev$ $Date$ - */ -public abstract class AssemblyFactoryImpl implements AssemblyFactory { - - public AbstractProperty createAbstractProperty() { - return new AbstractPropertyImpl(); - } - - public AbstractReference createAbstractReference() { - return new AbstractReferenceImpl(); - } - - public AbstractService createAbstractService() { - return new AbstractServiceImpl(); - } - - public Callback createCallback() { - return new CallbackImpl(); - } - - public Component createComponent() { - return new ComponentImpl(); - } - - public ComponentProperty createComponentProperty() { - return new ComponentPropertyImpl(); - } - - public ComponentReference createComponentReference() { - return new ComponentReferenceImpl(); - } - - public ComponentService createComponentService() { - return new ComponentServiceImpl(); - } - - public ComponentType createComponentType() { - return new ComponentTypeImpl(); - } - - public Composite createComposite() { - return new CompositeImpl(); - } - - public CompositeReference createCompositeReference() { - return new CompositeReferenceImpl(); - } - - public CompositeService createCompositeService() { - return new CompositeServiceImpl(); - } - - public ConstrainingType createConstrainingType() { - return new ConstrainingTypeImpl(); - } - - public Property createProperty() { - return new PropertyImpl(); - } - - public Reference createReference() { - return new ReferenceImpl(); - } - - public Service createService() { - return new ServiceImpl(); - } - - public Wire createWire() { - return new WireImpl(); - } - - public Operation createOperation() { - return new OperationImpl(); - } -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BaseImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BaseImpl.java deleted file mode 100644 index 40c07d2e4f..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/BaseImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Base; -import org.apache.tuscany.sca.assembly.Visitable; -import org.apache.tuscany.sca.assembly.Visitor; - -/** - * Convenience base class for assembly model objects. - * - * @version $Rev$ $Date$ - */ -public abstract class BaseImpl implements Base, Visitable { - private List extensions = new ArrayList(); - private boolean unresolved; - - /** - * Constructs a new base model object. - */ - protected BaseImpl() { - } - - public List getExtensions() { - return extensions; - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setUnresolved(boolean undefined) { - this.unresolved = undefined; - } - - public boolean accept(Visitor visitor) { - return visitor.visit(this); - } -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java deleted file mode 100644 index 87ef907a80..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CallbackImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Callback; -import org.apache.tuscany.sca.assembly.Visitor; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents a reference. - * - * @version $Rev$ $Date$ - */ -public class CallbackImpl extends BaseImpl implements Callback { - private List bindings = new ArrayList(); - private List policySets = new ArrayList(); - private List requiredIntents = new ArrayList(); - - protected CallbackImpl() { - } - - public List getBindings() { - return bindings; - } - - public List getPolicySets() { - return policySets; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public boolean accept(Visitor visitor) { - if (!super.accept(visitor)) { - return false; - } - return true; - } -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java deleted file mode 100644 index ec837c060c..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentImpl.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentProperty; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.assembly.Visitor; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents a component. - * - * @version $Rev$ $Date$ - */ -public class ComponentImpl extends BaseImpl implements Component, Cloneable { - private ConstrainingType constrainingType; - private Implementation implementation; - private String name; - private String uri; - private List properties = new ArrayList(); - private List references = new ArrayList(); - private List services = new ArrayList(); - private List requiredIntents = new ArrayList(); - private List policySets = new ArrayList(); - private boolean autowire; - - /** - * Constructs a new component. - */ - protected ComponentImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - ComponentImpl clone = (ComponentImpl)super.clone(); - - clone.properties = new ArrayList(); - for (ComponentProperty property: getProperties()) { - clone.properties.add((ComponentProperty)property.clone()); - } - clone.references = new ArrayList(); - for (ComponentReference reference: getReferences()) { - clone.references.add((ComponentReference)reference.clone()); - } - clone.services = new ArrayList(); - for (ComponentService service: getServices()) { - clone.services.add((ComponentService)service.clone()); - } - return clone; - } - - public String getURI() { - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - } - - public ConstrainingType getConstrainingType() { - return constrainingType; - } - - public Implementation getImplementation() { - return implementation; - } - - public String getName() { - return name; - } - - public List getProperties() { - return properties; - } - - public List getReferences() { - return references; - } - - public List getServices() { - return services; - } - - public void setConstrainingType(ConstrainingType constrainingType) { - this.constrainingType = constrainingType; - } - - public void setImplementation(Implementation implementation) { - this.implementation = implementation; - } - - public void setName(String name) { - this.name = name; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public List getPolicySets() { - return policySets; - } - - public boolean isAutowire() { - return autowire; - } - - public void setAutowire(boolean autowire) { - this.autowire = autowire; - } - - public boolean accept(Visitor visitor) { - if (!super.accept(visitor)) { - return false; - } - for (ComponentProperty property : properties) { - if (!visitor.visit(property)) { - return false; - } - } - for (ComponentReference reference : references) { - if (!visitor.visit(reference)) { - return false; - } - } - for (ComponentService service : services) { - if (!visitor.visit(service)) { - return false; - } - } - return true; - } -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentPropertyImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentPropertyImpl.java deleted file mode 100644 index 8a9b8e446d..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentPropertyImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import org.apache.tuscany.sca.assembly.ComponentProperty; -import org.apache.tuscany.sca.assembly.Property; - -/** - * Represents a component property. - * - * @version $Rev$ $Date$ - */ -public class ComponentPropertyImpl extends PropertyImpl implements ComponentProperty, Cloneable { - private String file; - private Property property; - private String source; - - /** - * Constructs a new component property. - */ - protected ComponentPropertyImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public Object getValue() { - if (super.getValue() == null && property != null) { - return property.getValue(); - } else { - return super.getValue(); - } - } - - public String getFile() { - return file; - } - - public Property getProperty() { - return property; - } - - public String getSource() { - return source; - } - - public void setFile(String file) { - this.file = file; - } - - public void setProperty(Property property) { - this.property = property; - } - - public void setSource(String source) { - this.source = source; - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java deleted file mode 100644 index bd593f7502..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentReferenceImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.CompositeReference; -import org.apache.tuscany.sca.assembly.Reference; - -/** - * Represents a component reference - * - * @version $Rev$ $Date$ - */ -public class ComponentReferenceImpl extends ReferenceImpl implements ComponentReference, Cloneable { - private Reference reference; - private boolean autowire; - private List promotedAs = new ArrayList(); - - /** - * Constructs a new component reference. - */ - protected ComponentReferenceImpl() { - // Set multiplicity to null so that by default it'll inherit from the Reference - setMultiplicity(null); - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public Reference getReference() { - return reference; - } - - public void setReference(Reference reference) { - this.reference = reference; - } - - public boolean isAutowire() { - return autowire; - } - - public void setAutowire(boolean autowire) { - this.autowire = autowire; - } - - public List promotedAs() { - return promotedAs; - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentServiceImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentServiceImpl.java deleted file mode 100644 index 66883133d7..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentServiceImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.CompositeService; -import org.apache.tuscany.sca.assembly.Service; - -/** - * Represents a component service - * - * @version $Rev$ $Date$ - */ -public class ComponentServiceImpl extends ServiceImpl implements ComponentService, Cloneable { - private Service service; - private List promotedAs = new ArrayList(); - - /** - * Constructs a new component service. - */ - protected ComponentServiceImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public Service getService() { - return service; - } - - public void setService(Service service) { - this.service = service; - } - - public List promotedAs() { - return promotedAs; - } -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentTypeImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentTypeImpl.java deleted file mode 100644 index e57f25551a..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ComponentTypeImpl.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.assembly.Visitor; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents a component type. - * - * @version $Rev$ $Date$ - */ -public class ComponentTypeImpl extends BaseImpl implements ComponentType, Cloneable { - private String uri; - private ConstrainingType constrainingType; - private List properties = new ArrayList(); - private List references = new ArrayList(); - private List services = new ArrayList(); - private List requiredIntents = new ArrayList(); - private List policySets = new ArrayList(); - - /** - * Constructs a new component type. - */ - protected ComponentTypeImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - ComponentTypeImpl clone = (ComponentTypeImpl)super.clone(); - - clone.services = new ArrayList(); - for (Service service: getServices()) { - clone.services.add((Service)service.clone()); - } - clone.references = new ArrayList(); - for (Reference reference: getReferences()) { - clone.references.add((Reference)reference.clone()); - } - clone.properties = new ArrayList(); - for (Property property: getProperties()) { - clone.properties.add((Property)property.clone()); - } - return clone; - } - - public String getURI() { - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - } - - public ConstrainingType getConstrainingType() { - return constrainingType; - } - - public List getProperties() { - return properties; - } - - public List getReferences() { - return references; - } - - public List getServices() { - return services; - } - - public void setConstrainingType(ConstrainingType constrainingType) { - this.constrainingType = constrainingType; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public List getPolicySets() { - return policySets; - } - - public boolean accept(Visitor visitor) { - if (!super.accept(visitor)) { - return false; - } - for (Property property : properties) { - if (!visitor.visit(property)) { - return false; - } - } - for (Reference reference : references) { - if (!visitor.visit(reference)) { - return false; - } - } - for (Service service : services) { - if (!visitor.visit(service)) { - return false; - } - } - return true; - } - - @Override - public int hashCode() { - return String.valueOf(getURI()).hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } else { - if (obj instanceof ComponentType) { - if (getURI() != null) { - return getURI().equals(((ComponentType)obj).getURI()); - } else { - return ((ComponentType)obj).getURI() == null; - } - } else { - return false; - } - } - } -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java deleted file mode 100644 index 5c40f9445b..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeImpl.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.Visitor; -import org.apache.tuscany.sca.assembly.Wire; - -public class CompositeImpl extends ComponentTypeImpl implements Composite, Cloneable { - private List components = new ArrayList(); - private List includes = new ArrayList(); - private QName name; - private List wires = new ArrayList(); - private boolean autowire; - private boolean local = true; - - /** - * Constructs a new composite. - */ - protected CompositeImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - CompositeImpl clone = (CompositeImpl)super.clone(); - - clone.components = new ArrayList(); - for (Component component: getComponents()) { - clone.components.add((Component)component.clone()); - } - clone.wires = new ArrayList(); - for (Wire wire: getWires()) { - clone.wires.add((Wire)wire.clone()); - } - return clone; - } - - public List getComponents() { - return components; - } - - public List getIncludes() { - return includes; - } - - public QName getName() { - return name; - } - - public List getWires() { - return wires; - } - - public boolean isAutowire() { - return autowire; - } - - public boolean isLocal() { - return local; - } - - public void setAutowire(boolean autowire) { - this.autowire = autowire; - } - - public void setLocal(boolean local) { - this.local = local; - } - - public void setName(QName name) { - this.name = name; - } - - @Override - public boolean accept(Visitor visitor) { - boolean result = super.accept(visitor); - if (!result) { - return false; - } - - for (Component component: components) { - if (!component.accept(visitor)) { - return false; - } - } - - for (Wire wire: wires) { - if (!visitor.visit(wire)) - return false; - } - return true; - } - - @Override - public int hashCode() { - return String.valueOf(getName()).hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } else if (obj instanceof Composite) { - if (getName() != null) { - return getName().equals(((Composite)obj).getName()); - } else { - return ((Composite)obj).getName() == null; - } - } else { - return false; - } - } -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeReferenceImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeReferenceImpl.java deleted file mode 100644 index 4348e08fcb..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeReferenceImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.CompositeReference; - -/** - * Represents a composite reference. - * - * @version $Rev$ $Date$ - */ -public class CompositeReferenceImpl extends ReferenceImpl implements CompositeReference, Cloneable { - private List promotedReferences = new ArrayList(); - - /** - * Constructs a new composite reference. - */ - protected CompositeReferenceImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public List getPromotedReferences() { - return promotedReferences; - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeServiceImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeServiceImpl.java deleted file mode 100644 index 19a6ed56c2..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/CompositeServiceImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.CompositeService; - -/** - * Represents a composite service - * - * @version $Rev$ $Date$ - */ -public class CompositeServiceImpl extends ServiceImpl implements CompositeService, Cloneable { - private ComponentService promotedService; - - /** - * Constructs a new composite service. - */ - protected CompositeServiceImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public ComponentService getPromotedService() { - return promotedService; - } - - public void setPromotedService(ComponentService promotedService) { - this.promotedService = promotedService; - } -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConstrainingTypeImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConstrainingTypeImpl.java deleted file mode 100644 index f9fbae6659..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ConstrainingTypeImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.AbstractProperty; -import org.apache.tuscany.sca.assembly.AbstractReference; -import org.apache.tuscany.sca.assembly.AbstractService; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.Visitor; -import org.apache.tuscany.sca.policy.Intent; - -/** - * Represents a constraining type. - * - * @version $Rev$ $Date$ - */ -public class ConstrainingTypeImpl extends BaseImpl implements ConstrainingType { - private QName name; - private List properties = new ArrayList(); - private List references = new ArrayList(); - private List services = new ArrayList(); - private List requiredIntents = new ArrayList(); - - /** - * Constructs a new ConstrainingType - */ - protected ConstrainingTypeImpl() { - } - - public QName getName() { - return name; - } - - public void setName(QName name) { - this.name = name; - } - - public List getProperties() { - return properties; - } - - public List getReferences() { - return references; - } - - public List getServices() { - return services; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public boolean accept(Visitor visitor) { - if (!super.accept(visitor)) { - return false; - } - for (AbstractProperty property : properties) { - if (!visitor.visit(property)) { - return false; - } - } - for (AbstractReference reference : references) { - if (!visitor.visit(reference)) { - return false; - } - } - for (AbstractService service : services) { - if (!visitor.visit(service)) { - return false; - } - } - return true; - } - - @Override - public int hashCode() { - return String.valueOf(getName()).hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } else if (obj instanceof ConstrainingType) { - if (getName() != null) { - return getName().equals(((ConstrainingType)obj).getName()); - } else { - return ((ConstrainingType)obj).getName() == null; - } - } else { - return false; - } - } -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ContractImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ContractImpl.java deleted file mode 100644 index d295384305..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ContractImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.AbstractContract; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.policy.Intent; - -public class ContractImpl extends BaseImpl implements AbstractContract { - private InterfaceContract interfaceContract; - private String name; - private List requiredIntents = new ArrayList(); - - /** - * Constructs a new contract. - */ - protected ContractImpl() { - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public InterfaceContract getInterfaceContract() { - return interfaceContract; - } - - public void setInterfaceContract(InterfaceContract interfaceContract) { - this.interfaceContract = interfaceContract; - } - - public List getRequiredIntents() { - return requiredIntents; - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/PropertyImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/PropertyImpl.java deleted file mode 100644 index ebdcdf580b..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/PropertyImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents a property. - * - * @version $Rev$ $Date$ - */ -public class PropertyImpl extends AbstractPropertyImpl implements Property, Cloneable { - private List policySets = new ArrayList(); - - /** - * Constructs a new property. - */ - protected PropertyImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public List getPolicySets() { - return policySets; - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java deleted file mode 100644 index 5ceb5bb950..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ReferenceImpl.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Callback; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents a reference. - * - * @version $Rev$ $Date$ - */ -public class ReferenceImpl extends AbstractReferenceImpl implements Reference, Cloneable { - private List bindings = new ArrayList(); - private boolean wiredByImpl; - private List policySets = new ArrayList(); - private List targets = new ArrayList(); - private Callback callback; - - /** - * Constructs a new reference. - */ - protected ReferenceImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - ReferenceImpl clone = (ReferenceImpl)super.clone(); - clone.bindings = new ArrayList(); - clone.bindings.addAll(getBindings()); - clone.targets = new ArrayList(); - clone.targets.addAll(getTargets()); - return clone; - } - - public List getBindings() { - return bindings; - } - - public B getBinding(Class bindingClass) { - for (Binding binding : bindings) { - if (bindingClass.isInstance(binding)) { - return bindingClass.cast(binding); - } - } - return null; - } - - public boolean isWiredByImpl() { - return wiredByImpl; - } - - public void setWiredByImpl(boolean wiredByImpl) { - this.wiredByImpl = wiredByImpl; - } - - public List getPolicySets() { - return policySets; - } - - public List getTargets() { - return targets; - } - - public Callback getCallback() { - return callback; - } - - public void setCallback(Callback callback) { - this.callback = callback; - } -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingFactoryImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingFactoryImpl.java deleted file mode 100644 index 402b90706d..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingFactoryImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import org.apache.tuscany.sca.assembly.SCABinding; -import org.apache.tuscany.sca.assembly.SCABindingFactory; - -/** - * A factory for the SCA binding model. - * - * @version $Rev$ $Date$ - */ -public abstract class SCABindingFactoryImpl implements SCABindingFactory { - - public SCABinding createSCABinding() { - return new SCABindingImpl(); - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingImpl.java deleted file mode 100644 index 93b7d7a88f..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/SCABindingImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.SCABinding; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents an SCA binding. - * - * @version $Rev$ $Date$ - */ -public class SCABindingImpl implements SCABinding { - private String name; - private String uri; - private List policySets = new ArrayList(); - private List requiredIntents = new ArrayList(); - private List extensions = new ArrayList(); - - private Component component; - - /** - * Constructs a new SCA binding. - */ - protected SCABindingImpl() { - } - - public Component getComponent() { - return component; - } - - public void setComponent(Component component) { - this.component = component; - } - - public String getName() { - return name; - } - - public String getURI() { - return uri; - } - - public void setName(String name) { - this.name = name; - } - - public void setURI(String uri) { - this.uri = uri; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public List getPolicySets() { - return policySets; - } - - public List getExtensions() { - return extensions; - } - - public boolean isUnresolved() { - return false; - } - - public void setUnresolved(boolean unresolved) { - } -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java deleted file mode 100644 index c5bf3a10d0..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ServiceImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Callback; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents a reference. - * - * @version $Rev$ $Date$ - */ -public class ServiceImpl extends AbstractServiceImpl implements Service, Cloneable { - private List bindings = new ArrayList(); - private List policySets = new ArrayList(); - private Callback callback; - - /** - * Constructs a new service. - */ - protected ServiceImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - ServiceImpl clone = (ServiceImpl)super.clone(); - clone.bindings = new ArrayList(); - clone.bindings.addAll(getBindings()); - return clone; - } - - public List getBindings() { - return bindings; - } - - public B getBinding(Class bindingClass) { - for (Binding binding : bindings) { - if (bindingClass.isInstance(binding)) { - return bindingClass.cast(binding); - } - } - return null; - } - - public List getPolicySets() { - return policySets; - } - - public Callback getCallback() { - return callback; - } - - public void setCallback(Callback callback) { - this.callback = callback; - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java deleted file mode 100644 index 06db488fba..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/WireImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Wire; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents a wire - * - * @version $Rev$ $Date$ - */ -public class WireImpl extends BaseImpl implements Wire, Cloneable { - private ComponentReference source; - private ComponentService target; - private List requiredIntents = new ArrayList(); - private List policySets = new ArrayList(); - - /** - * Constructs a new wire. - */ - protected WireImpl() { - } - - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - public ComponentReference getSource() { - return source; - } - - public ComponentService getTarget() { - return target; - } - - public void setSource(ComponentReference source) { - this.source = source; - } - - public void setTarget(ComponentService target) { - this.target = target; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public List getPolicySets() { - return policySets; - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/util/PrintUtil.java b/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/util/PrintUtil.java deleted file mode 100644 index 08b39f976b..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/util/PrintUtil.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly.util; - -import java.beans.BeanInfo; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.w3c.dom.Node; - -/** - * A simple print utility class to help print model instances. - * - * @version $Rev$ $Date$ - */ -public class PrintUtil { - - private PrintWriter out; - private int indent; - - public PrintUtil(OutputStream out) { - this.out = new PrintWriter(new OutputStreamWriter(out), true); - } - - void indent() { - for (int i = 0; i < indent; i++) { - out.print(" "); - } - } - - /** - * Print an object. - * - * @param object - */ - public void print(Object object) { - Set objects = new HashSet(); - print(object, objects); - } - - /** - * Print an object. - * - * @param object - */ - private void print(Object object, Set printed) { - if (object == null) { - return; - } - int id = System.identityHashCode(object); - if (printed.contains(id)) { - - // If we've already printed an object, print just it's hashcode - indent(); - out.println(object.getClass().getName() + "@" + id); - } else { - printed.add(id); - try { - - // Print the object class name - indent(); - out.println(object.getClass().getSimpleName() + " {"); - - // Get the object's properties - BeanInfo beanInfo = Introspector.getBeanInfo(object.getClass()); - for (PropertyDescriptor propertyDescriptor : beanInfo.getPropertyDescriptors()) { - try { - - // Get the value of each property - Method getter = propertyDescriptor.getReadMethod(); - if (getter == null) { - continue; - } - Object value = getter.invoke(object); - if (value != null) { - - // Convert array value into a list - if (value.getClass().isArray()) { - value = Arrays.asList((Object[])value); - } - - // Print elements in a list - if (value instanceof List) { - if (!((List)value).isEmpty()) { - indent++; - indent(); - out.println(propertyDescriptor.getName() + "= ["); - - // Print each element, recursively - for (Object element : (List)value) { - indent++; - print(element, printed); - indent--; - } - indent(); - out.println(" ]"); - indent--; - } - } else { - Class valueClass = value.getClass(); - - // Print a primitive, java built in type or - // enum, using toString() - if (valueClass.isPrimitive() || valueClass.getName().startsWith("java.") - || valueClass.getName().startsWith("javax.") - || valueClass.isEnum()) { - if (!propertyDescriptor.getName().equals("class")) { - if (!(Boolean.FALSE.equals(value))) { - indent++; - indent(); - out.println(propertyDescriptor.getName() + "=" + value.toString()); - indent--; - } - } - } else if (value instanceof Node) { - indent++; - indent(); - out.println(propertyDescriptor.getName() + "=" + value.toString()); - indent--; - } else { - - // Print an object, recursively - indent++; - indent(); - out.println(propertyDescriptor.getName() + "= {"); - indent++; - print(value, printed); - indent--; - indent(); - out.println("}"); - indent--; - } - } - } - } catch (Exception e) { - } - } - indent(); - out.println("}"); - } catch (IntrospectionException e) { - indent(); - out.println(e); - } - } - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/AssemblyFactoryTestCase.java b/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/AssemblyFactoryTestCase.java deleted file mode 100644 index cde42cbc62..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/AssemblyFactoryTestCase.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import javax.xml.namespace.QName; - -import junit.framework.TestCase; - - -/** - * Test building of assembly model instances using the assembly factory. - * - * @version $Rev$ $Date$ - */ -public class AssemblyFactoryTestCase extends TestCase { - - AssemblyFactory factory; - - public void setUp() throws Exception { - factory = new DefaultAssemblyFactory(); - } - - public void tearDown() throws Exception { - factory = null; - } - - public void testCreateComponent() { - createComponent("AccountServiceComponent1"); - } - - public void testCreateComponentType() { - createComponentType(); - } - - public void testCreateComposite() { - createComposite(); - } - - public void testCreateConstrainingType() { - createConstrainingType(); - } - - /** - * Create a composite - */ - Composite createComposite() { - Composite c = factory.createComposite(); - - Component c1 = createComponent("AccountServiceComponent1"); - c.getComponents().add(c1); - Component c2 = createComponent("AccountServiceComponent2"); - c.getComponents().add(c2); - - Wire w = factory.createWire(); - w.setSource(c1.getReferences().get(0)); - w.setTarget(c2.getServices().get(0)); - c.getWires().add(w); - - CompositeService cs = factory.createCompositeService(); - cs.setName("AccountService"); - cs.setPromotedService(c1.getServices().get(0)); - cs.setInterfaceContract(new TestInterfaceContract(factory)); - c.getServices().add(cs); - cs.getBindings().add(new TestBinding(factory)); - - CompositeReference cr = factory.createCompositeReference(); - cr.setName("StockQuoteService"); - cr.getPromotedReferences().add(c2.getReferences().get(1)); - cr.setInterfaceContract(new TestInterfaceContract(factory)); - c.getReferences().add(cr); - cr.getBindings().add(new TestBinding(factory)); - - return c; - } - - /** - * Create a new component - */ - Component createComponent(String name) { - Component c = factory.createComponent(); - c.setName(name); - - ConstrainingType constraint = createConstrainingType(); - c.setConstrainingType(constraint); - - Implementation i = new TestImplementation(factory); - c.setImplementation(i); - - ComponentProperty p = factory.createComponentProperty(); - p.setName("currency"); - p.setValue("USD"); - p.setMustSupply(true); - p.setXSDType(new QName("", "")); - p.setProperty(i.getProperties().get(0)); - c.getProperties().add(p); - - ComponentReference ref1 = factory.createComponentReference(); - ref1.setName("accountDataService"); - ref1.setMultiplicity(Multiplicity.ONE_ONE); - ref1.setInterfaceContract(new TestInterfaceContract(factory)); - ref1.setReference(i.getReferences().get(0)); - c.getReferences().add(ref1); - ref1.getBindings().add(new TestBinding(factory)); - - ComponentReference ref2 = factory.createComponentReference(); - ref2.setName("stockQuoteService"); - ref2.setMultiplicity(Multiplicity.ONE_ONE); - ref2.setInterfaceContract(new TestInterfaceContract(factory)); - ref2.setReference(i.getReferences().get(1)); - c.getReferences().add(ref2); - ref2.getBindings().add(new TestBinding(factory)); - - ComponentService s = factory.createComponentService(); - s.setName("AccountService"); - s.setInterfaceContract(new TestInterfaceContract(factory)); - s.setService(i.getServices().get(0)); - c.getServices().add(s); - s.getBindings().add(new TestBinding(factory)); - - return c; - } - - /** - * Create a new component type - * - * @return - */ - ComponentType createComponentType() { - ComponentType ctype = factory.createComponentType(); - - Property p = factory.createProperty(); - p.setName("currency"); - p.setValue("USD"); - p.setMustSupply(true); - p.setXSDType(new QName("", "")); - ctype.getProperties().add(p); - - Reference ref1 = factory.createReference(); - ref1.setName("accountDataService"); - ref1.setInterfaceContract(new TestInterfaceContract(factory)); - ref1.setMultiplicity(Multiplicity.ONE_ONE); - ctype.getReferences().add(ref1); - ref1.getBindings().add(new TestBinding(factory)); - - Reference ref2 = factory.createReference(); - ref2.setName("stockQuoteService"); - ref2.setInterfaceContract(new TestInterfaceContract(factory)); - ref2.setMultiplicity(Multiplicity.ONE_ONE); - ctype.getReferences().add(ref2); - ref2.getBindings().add(new TestBinding(factory)); - - Service s = factory.createService(); - s.setName("AccountService"); - s.setInterfaceContract(new TestInterfaceContract(factory)); - ctype.getServices().add(s); - s.getBindings().add(new TestBinding(factory)); - - return ctype; - } - - /** - * Create a new constraining type - * - * @return - */ - ConstrainingType createConstrainingType() { - ConstrainingType ctype = factory.createConstrainingType(); - - AbstractProperty p = factory.createAbstractProperty(); - p.setName("currency"); - p.setValue("USD"); - p.setMustSupply(true); - p.setXSDType(new QName("", "")); - ctype.getProperties().add(p); - - AbstractReference ref1 = factory.createAbstractReference(); - ref1.setName("accountDataService"); - ref1.setInterfaceContract(new TestInterfaceContract(factory)); - ref1.setMultiplicity(Multiplicity.ONE_ONE); - ctype.getReferences().add(ref1); - - AbstractReference ref2 = factory.createAbstractReference(); - ref2.setName("stockQuoteService"); - ref2.setInterfaceContract(new TestInterfaceContract(factory)); - ref2.setMultiplicity(Multiplicity.ONE_ONE); - ctype.getReferences().add(ref2); - - AbstractService s = factory.createAbstractService(); - s.setName("AccountService"); - s.setInterfaceContract(new TestInterfaceContract(factory)); - ctype.getServices().add(s); - - return ctype; - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestBinding.java b/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestBinding.java deleted file mode 100644 index 9b3ac4c2d4..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestBinding.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import java.util.List; - -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * A test interface model. - * - * @version $Rev$ $Date$ - */ -public class TestBinding implements Binding { - - public TestBinding(AssemblyFactory factory) { - setURI("http://test"); - } - - public String getName() { - return null; - } - - public String getURI() { - return "http://test"; - } - - public void setName(String name) { - } - - public void setURI(String uri) { - } - - public List getPolicySets() { - return null; - } - - public List getRequiredIntents() { - return null; - } - - public List getExtensions() { - return null; - } - - public void setUnresolved(boolean unresolved) { - } - - public boolean isUnresolved() { - return false; - } -} diff --git a/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestImplementation.java b/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestImplementation.java deleted file mode 100644 index 9e34fafb05..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestImplementation.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.impl.ComponentTypeImpl; - -/** - * A test component implementation model. - * - * @version $Rev$ $Date$ - */ -public class TestImplementation extends ComponentTypeImpl implements Implementation { - - public TestImplementation(AssemblyFactory factory) { - - Property p = factory.createProperty(); - p.setName("currency"); - p.setValue("USD"); - p.setMustSupply(true); - p.setXSDType(new QName("", "")); - getProperties().add(p); - - Reference ref1 = factory.createReference(); - ref1.setName("accountDataService"); - ref1.setMultiplicity(Multiplicity.ONE_ONE); - getReferences().add(ref1); - ref1.getBindings().add(new TestBinding(factory)); - - Reference ref2 = factory.createReference(); - ref2.setName("stockQuoteService"); - ref2.setMultiplicity(Multiplicity.ONE_ONE); - ref2.setInterfaceContract(new TestInterfaceContract(factory)); - getReferences().add(ref2); - ref2.getBindings().add(new TestBinding(factory)); - - Service s = factory.createService(); - s.setName("AccountService"); - s.setInterfaceContract(new TestInterfaceContract(factory)); - getServices().add(s); - s.getBindings().add(new TestBinding(factory)); - - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestInterface.java b/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestInterface.java deleted file mode 100644 index dbe0cb8225..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestInterface.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import org.apache.tuscany.sca.interfacedef.Interface; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceImpl; - -/** - * A test interface model. - * - * @version $Rev$ $Date$ - */ -public class TestInterface extends InterfaceImpl implements Interface { - - public TestInterface(AssemblyFactory factory) { - - setRemotable(true); - - Operation operation = new TestOperation(); - operation.setName("test"); - getOperations().add(operation); - - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestInterfaceContract.java b/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestInterfaceContract.java deleted file mode 100644 index ee6b95edc9..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestInterfaceContract.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractImpl; - -/** - * A test interface contract model. - * - * @version $Rev$ $Date$ - */ -public class TestInterfaceContract extends InterfaceContractImpl implements InterfaceContract { - - public TestInterfaceContract(AssemblyFactory factory) { - - TestInterface testInterface = new TestInterface(factory); - setInterface(testInterface); - - TestInterface testCallbackInterface = new TestInterface(factory); - setCallbackInterface(testCallbackInterface); - - } - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestOperation.java b/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestOperation.java deleted file mode 100644 index 460672c1ef..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/TestOperation.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.assembly; - -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.impl.OperationImpl; - -/** - * A test operation model. - * - * @version $Rev$ $Date$ - */ -public class TestOperation extends OperationImpl implements Operation { - -} diff --git a/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderTestCase.java b/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderTestCase.java deleted file mode 100644 index aeb076a392..0000000000 --- a/branches/sca-java-0.90/modules/assembly/src/test/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderTestCase.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.assembly.builder.impl; - -import javax.xml.namespace.QName; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.CompositeReference; -import org.apache.tuscany.sca.assembly.CompositeService; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.DefaultSCABindingFactory; -import org.apache.tuscany.sca.assembly.SCABindingFactory; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; - -public class CompositeBuilderTestCase extends TestCase { - - private CompositeBuilderImpl compositeUtil; - private AssemblyFactory assemblyFactory; - private SCABindingFactory scaBindingFactory; - - protected void setUp() throws Exception { - assemblyFactory = new DefaultAssemblyFactory(); - scaBindingFactory = new DefaultSCABindingFactory(); - - compositeUtil = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, new InterfaceContractMapperImpl(), null); - } - - protected void tearDown() throws Exception { - compositeUtil = null; - assemblyFactory = null; - } - - public void testFuseIncludes() { - Composite c1 = assemblyFactory.createComposite(); - c1.setName(new QName("http://foo", "C1")); - Component a = assemblyFactory.createComponent(); - a.setName("a"); - c1.getComponents().add(a); - CompositeService s = assemblyFactory.createCompositeService(); - s.setName("s"); - c1.getServices().add(s); - CompositeReference r = assemblyFactory.createCompositeReference(); - r.setName("r"); - c1.getReferences().add(r); - - Composite c2 = assemblyFactory.createComposite(); - c2.setName(new QName("http://foo", "C2")); - c1.getIncludes().add(c2); - Component b = assemblyFactory.createComponent(); - b.setName("b"); - c2.getComponents().add(b); - - Composite c = assemblyFactory.createComposite(); - c.setName(new QName("http://foo", "C")); - c.getIncludes().add(c1); - - compositeUtil.fuseIncludes(c); - - assertTrue(c.getComponents().get(0).getName().equals("a")); - assertTrue(c.getComponents().get(1).getName().equals("b")); - assertTrue(c.getServices().get(0).getName().equals("s")); - assertTrue(c.getReferences().get(0).getName().equals("r")); - } - - public void testExpandComposites() { - Composite c1 = assemblyFactory.createComposite(); - c1.setName(new QName("http://foo", "C1")); - Component a = assemblyFactory.createComponent(); - a.setName("a"); - c1.getComponents().add(a); - CompositeService s = assemblyFactory.createCompositeService(); - s.setName("s"); - c1.getServices().add(s); - CompositeReference r = assemblyFactory.createCompositeReference(); - r.setName("r"); - c1.getReferences().add(r); - - Composite c2 = assemblyFactory.createComposite(); - c2.setName(new QName("http://foo", "C2")); - Component b = assemblyFactory.createComponent(); - b.setName("b"); - c2.getComponents().add(b); - - Composite c = assemblyFactory.createComposite(); - c.setName(new QName("http://foo", "C")); - Component x = assemblyFactory.createComponent(); - x.setName("x"); - x.setImplementation(c1); - c.getComponents().add(x); - Component y = assemblyFactory.createComponent(); - y.setName("y"); - y.setImplementation(c2); - c.getComponents().add(y); - Component z = assemblyFactory.createComponent(); - z.setName("z"); - z.setImplementation(c1); - c.getComponents().add(z); - - compositeUtil.expandComposites(c); - - assertTrue(c.getComponents().get(0).getImplementation() != c1); - assertTrue(c.getComponents().get(1).getImplementation() != c2); - assertTrue(c.getComponents().get(2).getImplementation() != c1); - - Composite i = (Composite)c.getComponents().get(0).getImplementation(); - assertTrue(i.getComponents().get(0) != a); - assertTrue(i.getComponents().get(0).getName().equals("a")); - assertTrue(i.getServices().get(0).getName().equals("s")); - assertTrue(i.getServices().get(0) != s); - assertTrue(i.getReferences().get(0).getName().equals("r")); - assertTrue(i.getReferences().get(0) != r); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/DISCLAIMER b/branches/sca-java-0.90/modules/binding-jsonrpc/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/LICENSE b/branches/sca-java-0.90/modules/binding-jsonrpc/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/NOTICE b/branches/sca-java-0.90/modules/binding-jsonrpc/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/pom.xml b/branches/sca-java-0.90/modules/binding-jsonrpc/pom.xml deleted file mode 100644 index d5493a95de..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/pom.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - - tuscany-binding-jsonrpc - Apache Tuscany JSON-RPC Binding - - - - apache.incubator - http://people.apache.org/repo/m2-incubating-repository - - - - - - com.metaparadigm - json-rpc - 1.0 - compile - - - - net.sf.json-lib - json-lib - 0.8 - test - - - - org.apache.tuscany.sca - sca-api - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-assembly - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-core-spi - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-host-embedded - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 0.90-incubating-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-interface-java - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-host-http - 0.90-incubating-SNAPSHOT - - - - javax.servlet - servlet-api - 2.4 - provided - - - - org.apache.tuscany.sca - tuscany-http-jetty - 0.90-incubating-SNAPSHOT - test - - - - org.apache.tuscany.sca - tuscany-host-embedded - 0.90-incubating-SNAPSHOT - test - - - - junit - junit - 4.2 - test - - - httpunit - httpunit - 1.6.1 - test - - - - - diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/DefaultJSONRPCBindingFactory.java b/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/DefaultJSONRPCBindingFactory.java deleted file mode 100644 index 31575518f4..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/DefaultJSONRPCBindingFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.jsonrpc; - -import org.apache.tuscany.sca.binding.jsonrpc.impl.JSONRPCBindingImpl; - -/** - * A factory for the JSONRPC binding model. - * - * @version $Rev$ $Date$ - */ -public class DefaultJSONRPCBindingFactory implements JSONRPCBindingFactory { - - public JSONRPCBinding createJSONRPCBinding() { - return new JSONRPCBindingImpl(); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCBinding.java b/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCBinding.java deleted file mode 100644 index 5e0e3b5b28..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCBinding.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.jsonrpc; - -import org.apache.tuscany.sca.assembly.Binding; - -/** - * A model for the sample JSONRPC binding. - * - * @version $Rev$ $Date$ - */ -public interface JSONRPCBinding extends Binding { -} diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCBindingFactory.java b/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCBindingFactory.java deleted file mode 100644 index 7ba422eb85..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCBindingFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.jsonrpc; - -/** - * A factory for the JSONRPC binding model. - * - * @version $Rev$ $Date$ - */ -public interface JSONRPCBindingFactory { - - /** - * Creates a new JSONRPC binding. - * - * @return a new JSONRPC binding - */ - JSONRPCBinding createJSONRPCBinding(); -} diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/impl/JSONRPCBindingImpl.java b/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/impl/JSONRPCBindingImpl.java deleted file mode 100644 index 66f6dd640d..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/impl/JSONRPCBindingImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.jsonrpc.impl; - -import java.util.Collections; -import java.util.List; - -import org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBinding; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - - -/** - * Implementation of the JSONRPC binding model. - * - * @version $Rev$ $Date$ - */ -public class JSONRPCBindingImpl implements JSONRPCBinding { - - private String name; - private String uri; - - public String getName() { - return name; - } - - public String getURI() { - return uri; - } - - public void setName(String name) { - this.name = name; - } - - public void setURI(String uri) { - this.uri = uri; - } - - public List getPolicySets() { - // The sample binding does not support policies - return Collections.emptyList(); - } - - public List getRequiredIntents() { - // The sample binding does not support policies - return Collections.emptyList(); - } - - public List getExtensions() { - // The sample binding does not support extensions - return Collections.emptyList(); - } - - public boolean isUnresolved() { - return false; - } - - public void setUnresolved(boolean unresolved) { - // The sample binding is always resolved - } - -} diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/impl/JSONRPCBindingProcessor.java b/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/impl/JSONRPCBindingProcessor.java deleted file mode 100644 index 1ff888ace6..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/impl/JSONRPCBindingProcessor.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.jsonrpc.impl; - -import static org.osoa.sca.Constants.SCA_NS; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBinding; -import org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBindingFactory; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.contribution.service.ContributionWriteException; - - -/** - * A processor for elements. - * - * @version $Rev$ $Date$ - */ -public class JSONRPCBindingProcessor implements StAXArtifactProcessor { - - private QName BINDING_JSONRPC = new QName(SCA_NS, "binding.jsonrpc"); - - private final JSONRPCBindingFactory factory; - - public JSONRPCBindingProcessor(JSONRPCBindingFactory factory) { - this.factory = factory; - } - - public QName getArtifactType() { - return BINDING_JSONRPC; - } - - public Class getModelType() { - return JSONRPCBinding.class; - } - - public JSONRPCBinding read(XMLStreamReader reader) throws ContributionReadException { - String uri = reader.getAttributeValue(null, "uri"); - JSONRPCBinding JSONRPCBinding = factory.createJSONRPCBinding(); - if (uri != null) { - JSONRPCBinding.setURI(uri.trim()); - } - return JSONRPCBinding; - } - - public void write(JSONRPCBinding JSONRPCBinding, XMLStreamWriter writer) throws ContributionWriteException { - } - - public void resolve(JSONRPCBinding JSONRPCBinding, ModelResolver resolver) throws ContributionResolveException { - } - -} diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/module/JSONRPCModuleActivator.java b/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/module/JSONRPCModuleActivator.java deleted file mode 100644 index 3475a31923..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/module/JSONRPCModuleActivator.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.jsonrpc.module; - -import org.apache.tuscany.sca.binding.jsonrpc.DefaultJSONRPCBindingFactory; -import org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBindingFactory; -import org.apache.tuscany.sca.binding.jsonrpc.impl.JSONRPCBindingProcessor; -import org.apache.tuscany.sca.binding.jsonrpc.provider.JSONRPCBindingProviderFactory; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.ModuleActivator; -import org.apache.tuscany.sca.http.ServletHost; -import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint; - -/** - * A module activator for the JSONRPC binding extension. - * - * @version $Rev$ $Date$ - */ -public class JSONRPCModuleActivator implements ModuleActivator { - - public Object[] getExtensionPoints() { - // No extensionPoints being contributed here - return null; - } - - public void start(ExtensionPointRegistry registry) { - - // Create the JSONRPC model factory - JSONRPCBindingFactory JSONRPCFactory = new DefaultJSONRPCBindingFactory(); - - // Add the JSONRPCProcessor extension - StAXArtifactProcessorExtensionPoint processors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class); - JSONRPCBindingProcessor JSONRPCBindingProcessor = new JSONRPCBindingProcessor(JSONRPCFactory); - processors.addArtifactProcessor(JSONRPCBindingProcessor); - - ProviderFactoryExtensionPoint providerFactories = registry.getExtensionPoint(ProviderFactoryExtensionPoint.class); - ServletHost servletHost = registry.getExtensionPoint(ServletHost.class); - providerFactories.addProviderFactory(new JSONRPCBindingProviderFactory(servletHost)); - } - - public void stop(ExtensionPointRegistry registry) { - } - -} diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingInvoker.java b/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingInvoker.java deleted file mode 100644 index ade2603516..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingInvoker.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.jsonrpc.provider; - -import java.lang.reflect.InvocationTargetException; - -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.Message; - -/** - * Interceptor for the sample JSONRPC binding. - * - * @version $Rev$ $Date$ - */ -public class JSONRPCBindingInvoker implements Invoker { - - private Object echo(Object[] args) throws InvocationTargetException { - // echo back the result, a real binding would invoke some API for flowing the request - return args[0]; - } - - public Message invoke(Message msg) { - try { - Object resp = echo((Object[])msg.getBody()); - msg.setBody(resp); - } catch (InvocationTargetException e) { - msg.setFaultBody(e.getCause()); - } catch (Throwable e) { - msg.setFaultBody(e); - } - return msg; - } - -} diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingProviderFactory.java b/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingProviderFactory.java deleted file mode 100644 index 4bbf39e02c..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCBindingProviderFactory.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.jsonrpc.provider; - -import org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBinding; -import org.apache.tuscany.sca.http.ServletHost; -import org.apache.tuscany.sca.provider.BindingProviderFactory; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - - - -/** - * Implementation of the JSONRPC binding model. - * - * @version $Rev$ $Date$ - */ -public class JSONRPCBindingProviderFactory implements BindingProviderFactory { - - ServletHost servletHost; - - public JSONRPCBindingProviderFactory(ServletHost servletHost) { - this.servletHost = servletHost; - } - - public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, RuntimeComponentReference reference, JSONRPCBinding binding) { - return new JSONRPCReferenceBindingProvider(component, reference, binding); - } - - public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, RuntimeComponentService service, JSONRPCBinding binding) { - return new JSONRPCServiceBindingProvider(component, service, binding, servletHost); - } - - public Class getModelType() { - return JSONRPCBinding.class; - } -} diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCReferenceBindingProvider.java b/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCReferenceBindingProvider.java deleted file mode 100644 index c8e43d824a..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCReferenceBindingProvider.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.jsonrpc.provider; - -import org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBinding; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; - - -/** - * Implementation of the JSONRPC binding provider. - * - * @version $Rev$ $Date$ - */ -public class JSONRPCReferenceBindingProvider implements ReferenceBindingProvider { - - private RuntimeComponentReference reference; - - public JSONRPCReferenceBindingProvider(RuntimeComponent component, - RuntimeComponentReference reference, - JSONRPCBinding binding) { - this.reference = reference; - } - - public Invoker createInvoker(Operation operation, boolean isCallback) { - if (isCallback) { - throw new UnsupportedOperationException(); - } else { - return new JSONRPCBindingInvoker(); - } - } - - public InterfaceContract getBindingInterfaceContract() { - return reference.getInterfaceContract(); - } - - public void start() { - } - - public void stop() { - } - -} diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceBindingProvider.java b/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceBindingProvider.java deleted file mode 100644 index be593baa97..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceBindingProvider.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.jsonrpc.provider; - -import org.apache.tuscany.sca.binding.jsonrpc.JSONRPCBinding; -import org.apache.tuscany.sca.binding.jsonrpc.server.JSONRPCEntryPointServlet; -import org.apache.tuscany.sca.binding.jsonrpc.server.JSONRPCScriptServlet; -import org.apache.tuscany.sca.http.ServletHost; -import org.apache.tuscany.sca.interfacedef.Interface; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.java.JavaInterface; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -/** - * Implementation of the JSONRPC binding provider. - * - * @version $Rev$ $Date$ - */ -public class JSONRPCServiceBindingProvider implements ServiceBindingProvider { - - private static int servletRegistrationCount = 0; - private RuntimeComponent component; - private RuntimeComponentService service; - private JSONRPCBinding binding; - private ServletHost servletHost; - - // path to the JSONRPC javascript servlet - public static final String SCRIPT_GETTER_SERVICE_MAPPING = "/SCA/scripts"; - - public static final String JSONRPC_SERVICE_MAPPING_PREFIX = "/"; - - public JSONRPCServiceBindingProvider(RuntimeComponent component, - RuntimeComponentService service, - JSONRPCBinding binding, - ServletHost servletHost) { - this.component = component; - this.service = service; - this.binding = binding; - this.servletHost = servletHost; - } - - public InterfaceContract getBindingInterfaceContract() { - return service.getInterfaceContract(); - } - - public void start() { - JSONRPCEntryPointServlet servlet; - - Class aClass = getTargetJavaClass(service.getInterfaceContract().getInterface()); - Object instance = component.createSelfReference(aClass).getService(); - - servlet = new JSONRPCEntryPointServlet(binding.getName(), aClass, instance); - - // register the servlet based on the service name - servletHost.addServletMapping(JSONRPC_SERVICE_MAPPING_PREFIX + binding.getName(), servlet); - - // if the script getter servlet is not already registered then register - // it - if (servletRegistrationCount == 0) { - servletHost.addServletMapping(SCRIPT_GETTER_SERVICE_MAPPING, new JSONRPCScriptServlet()); - } - - // increase the registered servlet count - servletRegistrationCount++; - } - - public void stop() { - - // Unregister from the servlet mapping - servletHost.removeServletMapping(JSONRPC_SERVICE_MAPPING_PREFIX + binding.getName()); - servletRegistrationCount--; - // if we unregistered the last JSONRPC servlet, then unreister the - // script servlet - if (servletRegistrationCount == 0) { - servletHost.removeServletMapping(SCRIPT_GETTER_SERVICE_MAPPING); - } - } - - private Class getTargetJavaClass(Interface targetInterface) { - // TODO: right now assume that the target is always a Java - // Implementation. Need to figure out - // how to generate Java Interface in cases where the target is not a - // Java Implementation - return ((JavaInterface)targetInterface).getJavaClass(); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/server/JSONRPCEntryPointServlet.java b/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/server/JSONRPCEntryPointServlet.java deleted file mode 100644 index cab8965f90..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/server/JSONRPCEntryPointServlet.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.jsonrpc.server; - -import java.io.BufferedReader; -import java.io.CharArrayWriter; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.text.ParseException; - -import javax.servlet.ServletConfig; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.tuscany.sca.binding.jsonrpc.util.JavaToSmd; -import org.json.JSONObject; - -import com.metaparadigm.jsonrpc.JSONRPCBridge; -import com.metaparadigm.jsonrpc.JSONRPCResult; -import com.metaparadigm.jsonrpc.JSONRPCServlet; - -/** - * - * - */ -public class JSONRPCEntryPointServlet extends JSONRPCServlet { - private static final long serialVersionUID = 1L; - - private static final int BUF_SIZE = 4096; - - String serviceName; - - Object serviceInstance; - - Class serviceInterface; - - // default constructor for unit testing - public JSONRPCEntryPointServlet() { - } - - public JSONRPCEntryPointServlet(String serviceName, Class serviceInterface, Object serviceInstance) { - this.serviceName = serviceName; - this.serviceInterface = serviceInterface; - this.serviceInstance = serviceInstance; - } - - /** - * Override to do nothing as the JSONRPCServlet is setup by the - * service method in this class. - */ - @Override - public void init(ServletConfig config) { - } - - @Override - public void service(HttpServletRequest request, HttpServletResponse response) - throws IOException, ClassCastException { - - // if there is a smd parameter, we should retrun the SMD for this service - if (request.getParameter("smd") != null) { - String serviceUrl = request.getRequestURL().toString(); - String smd = JavaToSmd.interfaceToSmd(serviceInterface, serviceUrl); - - response.setContentType("text/plain;charset=utf-8"); - OutputStream out = response.getOutputStream(); - byte[] bout = smd.getBytes("UTF-8"); - - out.write(bout); - out.flush(); - out.close(); - } else { - /* - * Create a new bridge for every request to aviod all the problems with - * JSON-RPC-Java storing the bridge in the session - */ - HttpSession session = request.getSession(); - - JSONRPCBridge jsonrpcBridge = new JSONRPCBridge(); - jsonrpcBridge.registerObject(serviceName, serviceInstance, serviceInterface); - session.setAttribute("JSONRPCBridge", jsonrpcBridge); - - // Encode using UTF-8, although We are actually ASCII clean as - // all unicode data is JSON escaped using backslash u. This is - // less data efficient for foreign character sets but it is - // needed to support naughty browsers such as Konqueror and Safari - // which do not honour the charset set in the response - response.setContentType("text/plain;charset=utf-8"); - OutputStream out = response.getOutputStream(); - - // Decode using the charset in the request if it exists otherwise - // use UTF-8 as this is what all browser implementations use. - // The JSON-RPC-Java JavaScript client is ASCII clean so it - // although here we can correctly handle data from other clients - // that do not escape non ASCII data - String charset = request.getCharacterEncoding(); - if (charset == null) { - charset = "UTF-8"; - } - BufferedReader in = new BufferedReader(new InputStreamReader(request.getInputStream(), charset)); - - // Read the request - CharArrayWriter data = new CharArrayWriter(); - char buf[] = new char[BUF_SIZE]; - int ret; - while ((ret = in.read(buf, 0, BUF_SIZE)) != -1) { - data.write(buf, 0, ret); - } - - // Process the request - JSONObject jsonReq = null; - JSONRPCResult jsonResp = null; - try { - jsonReq = new JSONObject(data.toString()); - String method = jsonReq.getString("method"); - if ((method != null) && (method.indexOf('.') < 0)) { - jsonReq.putOpt("method", serviceName + "." + method); - } - jsonResp = jsonrpcBridge.call(new Object[] {request}, jsonReq); - } catch (ParseException e) { - throw new RuntimeException("Unable to parse request", e); - } - - byte[] bout = jsonResp.toString().getBytes("UTF-8"); - - out.write(bout); - out.flush(); - out.close(); - - } - } - -} diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/server/JSONRPCScriptServlet.java b/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/server/JSONRPCScriptServlet.java deleted file mode 100644 index 0fff49100e..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/server/JSONRPCScriptServlet.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.jsonrpc.server; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; - -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -public class JSONRPCScriptServlet extends HttpServlet { - - private static final long serialVersionUID = 1L; - - // private static final String SCA_INIT_JS = "SCA = new JSONRpcClient(\"serviceBindings/HelloWorldService\");"; - - public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { - URL url = getClass().getResource("jsonrpc.js"); - InputStream is = url.openStream(); - writeToStream(response, is); - - // writeToStream(response, new ByteArrayInputStream(SCA_INIT_JS.getBytes())); - } - - private void writeToStream(HttpServletResponse response, InputStream is) throws IOException { - ServletOutputStream os = response.getOutputStream(); - int i; - while ((i = is.read()) != -1) { // NOPMD - os.write(i); - } - } - -} diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/util/JavaToSmd.java b/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/util/JavaToSmd.java deleted file mode 100644 index 339aca376c..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/util/JavaToSmd.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - package org.apache.tuscany.sca.binding.jsonrpc.util; - -import java.lang.reflect.Method; - - -public class JavaToSmd { - - public static String interfaceToSmd(Class klazz, String serviceUrl) { - String name = klazz.getSimpleName(); - Method methods[] = klazz.getMethods(); - - StringBuffer smdSb = new StringBuffer(); - smdSb.append("{\"SMDVersion\":\".1\",\"objectName\":\"" + name + "\",\"serviceType\":\"JSON-RPC\",\"serviceURL\":\""+ serviceUrl + "\",\"methods\":["); - for (int i = 0; i < methods.length; i++) { - if (i != 0) smdSb.append(","); - Class params[] = methods[i].getParameterTypes(); - smdSb.append("{\"name\":\""+methods[i].getName() + "\",\"parameters\":["); - for (int j = 0; j < params.length; j++) { - if (j != 0) smdSb.append(","); - // right now Dojo doesn't look at the type value, so we'll default it to STRING - // also, since we can't introspect the method paramater names we'll just create an incrementing parameter name - smdSb.append("{\"name\":\"param" + j + "\",\"type\":\"STRING\"}"); - } - smdSb.append("]}"); - } - smdSb.append("]}"); - - return smdSb.toString(); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/resources/JSONRPCBinding.composite b/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/resources/JSONRPCBinding.composite deleted file mode 100644 index 38a596ecf9..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/resources/JSONRPCBinding.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator deleted file mode 100644 index c4fa1f5de1..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# Implementation class for the ExtensionActivator -org.apache.tuscany.sca.binding.jsonrpc.module.JSONRPCModuleActivator diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/resources/org/apache/tuscany/sca/binding/jsonrpc/server/jsonrpc.js b/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/resources/org/apache/tuscany/sca/binding/jsonrpc/server/jsonrpc.js deleted file mode 100644 index 2b9efbb55c..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/main/resources/org/apache/tuscany/sca/binding/jsonrpc/server/jsonrpc.js +++ /dev/null @@ -1,484 +0,0 @@ -/* - * JSON-RPC JavaScript client - * - * $Id: jsonrpc.js,v 1.36.2.3 2006/03/08 15:09:37 mclark Exp $ - * - * Copyright (c) 2003-2004 Jan-Klaas Kollhof - * Copyright (c) 2005 Michael Clark, Metaparadigm Pte Ltd - * - * This code is based on Jan-Klaas' JavaScript o lait library (jsolait). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - - -/* escape a character */ - -escapeJSONChar = -function escapeJSONChar(c) -{ - if(c == "\"" || c == "\\") return "\\" + c; - else if (c == "\b") return "\\b"; - else if (c == "\f") return "\\f"; - else if (c == "\n") return "\\n"; - else if (c == "\r") return "\\r"; - else if (c == "\t") return "\\t"; - var hex = c.charCodeAt(0).toString(16); - if(hex.length == 1) return "\\u000" + hex; - else if(hex.length == 2) return "\\u00" + hex; - else if(hex.length == 3) return "\\u0" + hex; - else return "\\u" + hex; -}; - - -/* encode a string into JSON format */ - -escapeJSONString = -function escapeJSONString(s) -{ - /* The following should suffice but Safari's regex is b0rken - (doesn't support callback substitutions) - return "\"" + s.replace(/([^\u0020-\u007f]|[\\\"])/g, - escapeJSONChar) + "\""; - */ - - /* Rather inefficient way to do it */ - var parts = s.split(""); - for(var i=0; i < parts.length; i++) { - var c =parts[i]; - if(c == '"' || - c == '\\' || - c.charCodeAt(0) < 32 || - c.charCodeAt(0) >= 128) - parts[i] = escapeJSONChar(parts[i]); - } - return "\"" + parts.join("") + "\""; -}; - - -/* Marshall objects to JSON format */ - -toJSON = function toJSON(o) -{ - if(o == null) { - return "null"; - } else if(o.constructor == String) { - return escapeJSONString(o); - } else if(o.constructor == Number) { - return o.toString(); - } else if(o.constructor == Boolean) { - return o.toString(); - } else if(o.constructor == Date) { - return '{javaClass: "java.util.Date", time: ' + o.valueOf() +'}'; - } else if(o.constructor == Array) { - var v = []; - for(var i = 0; i < o.length; i++) v.push(toJSON(o[i])); - return "[" + v.join(", ") + "]"; - } else { - var v = []; - for(attr in o) { - if(o[attr] == null) v.push("\"" + attr + "\": null"); - else if(typeof o[attr] == "function"); /* skip */ - else v.push(escapeJSONString(attr) + ": " + toJSON(o[attr])); - } - return "{" + v.join(", ") + "}"; - } -}; - - -/* JSONRpcClient constructor */ - -JSONRpcClient = -function JSONRpcClient_ctor(serverURL, user, pass, objectID) -{ - this.serverURL = serverURL; - this.user = user; - this.pass = pass; - this.objectID = objectID; - - /* Add standard methods */ - if(this.objectID) { - this._addMethods(["listMethods"]); - var req = this._makeRequest("listMethods", []); - } else { - this._addMethods(["system.listMethods"]); - var req = this._makeRequest("system.listMethods", []); - } - var m = this._sendRequest(req); - this._addMethods(m); -}; - - -/* JSONRpcCLient.Exception */ - -JSONRpcClient.Exception = -function JSONRpcClient_Exception_ctor(code, message, javaStack) -{ - this.code = code; - var name; - if(javaStack) { - this.javaStack = javaStack; - var m = javaStack.match(/^([^:]*)/); - if(m) name = m[0]; - } - if(name) this.name = name; - else this.name = "JSONRpcClientException"; - this.message = message; -}; - -JSONRpcClient.Exception.CODE_REMOTE_EXCEPTION = 490; -JSONRpcClient.Exception.CODE_ERR_CLIENT = 550; -JSONRpcClient.Exception.CODE_ERR_PARSE = 590; -JSONRpcClient.Exception.CODE_ERR_NOMETHOD = 591; -JSONRpcClient.Exception.CODE_ERR_UNMARSHALL = 592; -JSONRpcClient.Exception.CODE_ERR_MARSHALL = 593; - -JSONRpcClient.Exception.prototype = new Error(); - -JSONRpcClient.Exception.prototype.toString = -function JSONRpcClient_Exception_toString(code, msg) -{ - return this.name + ": " + this.message; -}; - - -/* Default top level exception handler */ - -JSONRpcClient.default_ex_handler = -function JSONRpcClient_default_ex_handler(e) { alert(e); }; - - -/* Client settable variables */ - -JSONRpcClient.toplevel_ex_handler = JSONRpcClient.default_ex_handler; -JSONRpcClient.profile_async = false; -JSONRpcClient.max_req_active = 1; -JSONRpcClient.requestId = 1; - - -/* JSONRpcClient implementation */ - -JSONRpcClient.prototype._createMethod = -function JSONRpcClient_createMethod(methodName) -{ - var fn=function() - { - var args = []; - var callback = null; - for(var i=0;i 0) { - var res = JSONRpcClient.async_responses.shift(); - if(res.canceled) continue; - if(res.profile) res.profile.dispatch = new Date(); - try { - res.cb(res.result, res.ex, res.profile); - } catch(e) { - JSONRpcClient.toplevel_ex_handler(e); - } - } - - while(JSONRpcClient.async_requests.length > 0 && - JSONRpcClient.num_req_active < JSONRpcClient.max_req_active) { - var req = JSONRpcClient.async_requests.shift(); - if(req.canceled) continue; - req.client._sendRequest.call(req.client, req); - } -}; - -JSONRpcClient.kick_async = -function JSONRpcClient_kick_async() -{ - if(JSONRpcClient.async_timeout == null) - JSONRpcClient.async_timeout = - setTimeout(JSONRpcClient._async_handler, 0); -}; - -JSONRpcClient.cancelRequest = -function JSONRpcClient_cancelRequest(requestId) -{ - /* If it is in flight then mark it as canceled in the inflight map - and the XMLHttpRequest callback will discard the reply. */ - if(JSONRpcClient.async_inflight[requestId]) { - JSONRpcClient.async_inflight[requestId].canceled = true; - return true; - } - - /* If its not in flight yet then we can just mark it as canceled in - the the request queue and it will get discarded before being sent. */ - for(var i in JSONRpcClient.async_requests) { - if(JSONRpcClient.async_requests[i].requestId == requestId) { - JSONRpcClient.async_requests[i].canceled = true; - return true; - } - } - - /* It may have returned from the network and be waiting for its callback - to be dispatched, so mark it as canceled in the response queue - and the response will get discarded before calling the callback. */ - for(var i in JSONRpcClient.async_responses) { - if(JSONRpcClient.async_responses[i].requestId == requestId) { - JSONRpcClient.async_responses[i].canceled = true; - return true; - } - } - - return false; -}; - -JSONRpcClient.prototype._makeRequest = -function JSONRpcClient_makeRequest(methodName, args, cb) -{ - var req = {}; - req.client = this; - req.requestId = JSONRpcClient.requestId++; - - var obj = {}; - obj.id = req.requestId; - if (this.objectID) - obj.method = ".obj#" + this.objectID + "." + methodName; - else - obj.method = methodName; - obj.params = args; - - if (cb) req.cb = cb; - if (JSONRpcClient.profile_async) - req.profile = { "submit": new Date() }; - req.data = toJSON(obj); - - return req; -}; - -JSONRpcClient.prototype._sendRequest = -function JSONRpcClient_sendRequest(req) -{ - if(req.profile) req.profile.start = new Date(); - - /* Get free http object from the pool */ - var http = JSONRpcClient.poolGetHTTPRequest(); - JSONRpcClient.num_req_active++; - - /* Send the request */ - if (typeof(this.user) == "undefined") { - http.open("POST", this.serverURL, (req.cb != null)); - } else { - http.open("POST", this.serverURL, (req.cb != null), this.user, this.pass); - } - - /* setRequestHeader is missing in Opera 8 Beta */ - try { http.setRequestHeader("Content-type", "text/plain"); } catch(e) {} - - /* Construct call back if we have one */ - if(req.cb) { - var self = this; - http.onreadystatechange = function() { - if(http.readyState == 4) { - http.onreadystatechange = function () {}; - var res = { "cb": req.cb, "result": null, "ex": null}; - if (req.profile) { - res.profile = req.profile; - res.profile.end = new Date(); - } - try { res.result = self._handleResponse(http); } - catch(e) { res.ex = e; } - if(!JSONRpcClient.async_inflight[req.requestId].canceled) - JSONRpcClient.async_responses.push(res); - delete JSONRpcClient.async_inflight[req.requestId]; - JSONRpcClient.kick_async(); - } - }; - } else { - http.onreadystatechange = function() {}; - } - - JSONRpcClient.async_inflight[req.requestId] = req; - - try { - http.send(req.data); - } catch(e) { - JSONRpcClient.poolReturnHTTPRequest(http); - JSONRpcClient.num_req_active--; - throw new JSONRpcClient.Exception - (JSONRpcClient.Exception.CODE_ERR_CLIENT, "Connection failed"); - } - - if(!req.cb) return this._handleResponse(http); -}; - -JSONRpcClient.prototype._handleResponse = -function JSONRpcClient_handleResponse(http) -{ - /* Get the charset */ - if(!this.charset) { - this.charset = JSONRpcClient._getCharsetFromHeaders(http); - } - - /* Get request results */ - var status, statusText, data; - try { - status = http.status; - statusText = http.statusText; - data = http.responseText; - } catch(e) { - JSONRpcClient.poolReturnHTTPRequest(http); - JSONRpcClient.num_req_active--; - JSONRpcClient.kick_async(); - throw new JSONRpcClient.Exception - (JSONRpcClient.Exception.CODE_ERR_CLIENT, "Connection failed"); - } - - /* Return http object to the pool; */ - JSONRpcClient.poolReturnHTTPRequest(http); - JSONRpcClient.num_req_active--; - - /* Unmarshall the response */ - if(status != 200) { - throw new JSONRpcClient.Exception(status, statusText); - } - var obj; - try { - eval("obj = " + data); - } catch(e) { - throw new JSONRpcClient.Exception(550, "error parsing result"); - } - if(obj.error) - throw new JSONRpcClient.Exception(obj.error.code, obj.error.msg, - obj.error.trace); - var res = obj.result; - - /* Handle CallableProxy */ - if(res && res.objectID && res.JSONRPCType == "CallableReference") - return new JSONRpcClient(this.serverURL, this.user, - this.pass, res.objectID); - - return res; -}; - - -/* XMLHttpRequest wrapper code */ - -/* XMLHttpRequest pool globals */ -JSONRpcClient.http_spare = []; -JSONRpcClient.http_max_spare = 8; - -JSONRpcClient.poolGetHTTPRequest = -function JSONRpcClient_pool_getHTTPRequest() -{ - if(JSONRpcClient.http_spare.length > 0) { - return JSONRpcClient.http_spare.pop(); - } - return JSONRpcClient.getHTTPRequest(); -}; - -JSONRpcClient.poolReturnHTTPRequest = -function JSONRpcClient_poolReturnHTTPRequest(http) -{ - if(JSONRpcClient.http_spare.length >= JSONRpcClient.http_max_spare) - delete http; - else - JSONRpcClient.http_spare.push(http); -}; - -JSONRpcClient.msxmlNames = [ "MSXML2.XMLHTTP.5.0", - "MSXML2.XMLHTTP.4.0", - "MSXML2.XMLHTTP.3.0", - "MSXML2.XMLHTTP", - "Microsoft.XMLHTTP" ]; - -JSONRpcClient.getHTTPRequest = -function JSONRpcClient_getHTTPRequest() -{ - /* Mozilla XMLHttpRequest */ - try { - JSONRpcClient.httpObjectName = "XMLHttpRequest"; - return new XMLHttpRequest(); - } catch(e) {} - - /* Microsoft MSXML ActiveX */ - for (var i=0;i < JSONRpcClient.msxmlNames.length; i++) { - try { - JSONRpcClient.httpObjectName = JSONRpcClient.msxmlNames[i]; - return new ActiveXObject(JSONRpcClient.msxmlNames[i]); - } catch (e) {} - } - - /* None found */ - JSONRpcClient.httpObjectName = null; - throw new JSONRpcClient.Exception(0, "Can't create XMLHttpRequest object"); -}; - diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/Echo.java b/branches/sca-java-0.90/modules/binding-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/Echo.java deleted file mode 100644 index 584228abde..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/Echo.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.jsonrpc; - -/** - * Interface of our sample JSONRPC service. - * - * @version $Rev$ $Date$ - */ -public interface Echo { - - String echo(String msg); -} diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/EchoComponentImpl.java b/branches/sca-java-0.90/modules/binding-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/EchoComponentImpl.java deleted file mode 100644 index e63cafd6a6..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/EchoComponentImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.jsonrpc; - - - -/** - * A simple client component that uses a reference with an JSONRPC binding. - * - * @version $Rev$ $Date$ - */ -public class EchoComponentImpl implements Echo { - - public String echo(String msg) { - System.out.println("Echo: "+ msg); - return "echo: " + msg; - } -} diff --git a/branches/sca-java-0.90/modules/binding-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.java b/branches/sca-java-0.90/modules/binding-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.java deleted file mode 100644 index 898807c7ef..0000000000 --- a/branches/sca-java-0.90/modules/binding-jsonrpc/src/test/java/org/apache/tuscany/sca/binding/jsonrpc/JSONRPCServiceTestCase.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.jsonrpc; - -import java.io.ByteArrayInputStream; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.json.JSONObject; - -import com.meterware.httpunit.PostMethodWebRequest; -import com.meterware.httpunit.WebConversation; -import com.meterware.httpunit.WebRequest; -import com.meterware.httpunit.WebResponse; - -/** - * @version $Rev: 536083 $ $Date: 2007-05-08 02:18:29 -0400 (Tue, 08 May 2007) $ - */ -public class JSONRPCServiceTestCase extends TestCase { - - private static final String SERVICE_PATH = "/EchoService"; - private static final String SERVICE_URL = "http://localhost:8080/" + SERVICE_PATH; - private SCADomain domain; - - protected void setUp() throws Exception { - domain = SCADomain.newInstance("JSONRPCBinding.composite"); - } - - protected void tearDown() throws Exception { - domain.close(); - } - - public void testJSONRPCBinding() throws Exception { - JSONObject jsonRequest = new JSONObject("{ \"method\": \"echo\", \"params\": [\"Hello JSON-RPC\"], \"id\": 1}"); - - WebConversation wc = new WebConversation(); - WebRequest request = new PostMethodWebRequest( SERVICE_URL, new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")),"application/json"); - WebResponse response = wc.getResource(request); - - assertEquals(200, response.getResponseCode()); - JSONObject jsonResp = new JSONObject(response.getText()); - assertEquals("echo: Hello JSON-RPC", jsonResp.getString("result")); - } - - -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/.ruleset b/branches/sca-java-0.90/modules/binding-rmi/.ruleset deleted file mode 100644 index 3886f07f2d..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-rmi/DISCLAIMER b/branches/sca-java-0.90/modules/binding-rmi/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/binding-rmi/LICENSE b/branches/sca-java-0.90/modules/binding-rmi/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/binding-rmi/NOTICE b/branches/sca-java-0.90/modules/binding-rmi/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/binding-rmi/pom.xml b/branches/sca-java-0.90/modules/binding-rmi/pom.xml deleted file mode 100755 index 3953552b03..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/pom.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - tuscany-binding-rmi - Apache Tuscany Java RMI Binding - - - - - org.apache.tuscany.sca - tuscany-core - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-assembly-xml - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-interface-java - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-core-spi - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-host-rmi - 0.90-incubating-SNAPSHOT - - - - cglib - cglib-nodep - 2.1_3 - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 0.90-incubating-SNAPSHOT - test - - - - org.apache.tuscany.sca - tuscany-host-embedded - 0.90-incubating-SNAPSHOT - - - diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/DefaultRMIBindingFactory.java b/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/DefaultRMIBindingFactory.java deleted file mode 100644 index bc92dba962..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/DefaultRMIBindingFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.rmi; - - -/** - * A factory for the WSDL model. - * - * @version $Rev: 526508 $ $Date: 2007-04-08 07:42:42 +0530 (Sun, 08 Apr 2007) $ - */ -public class DefaultRMIBindingFactory implements RMIBindingFactory { - - public DefaultRMIBindingFactory() { - } - - public RMIBinding createRMIBinding() { - return new RMIBindingImpl(); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/NoRemoteMethodException.java b/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/NoRemoteMethodException.java deleted file mode 100644 index 874a2ca066..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/NoRemoteMethodException.java +++ /dev/null @@ -1,40 +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.sca.binding.rmi; - -/** - * @version $Rev$ $Date$ - */ -public class NoRemoteMethodException extends RuntimeException { - - private static final long serialVersionUID = -4706646034473965972L; - - public NoRemoteMethodException() { - } - - public NoRemoteMethodException(String message) { - super(message); - } - - public NoRemoteMethodException(String message, Throwable cause) { - super(message, cause); - } - - public NoRemoteMethodException(Throwable cause) { - super(cause); - } -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/NoRemoteServiceException.java b/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/NoRemoteServiceException.java deleted file mode 100644 index 81b51c7e53..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/NoRemoteServiceException.java +++ /dev/null @@ -1,38 +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.sca.binding.rmi; - -/** - */ -public class NoRemoteServiceException extends RMIRuntimeException { - private static final long serialVersionUID = 4940083022809126473L; - - public NoRemoteServiceException() { - } - - public NoRemoteServiceException(String message) { - super(message); - } - - public NoRemoteServiceException(String message, Throwable cause) { - super(message, cause); - } - - public NoRemoteServiceException(Throwable cause) { - super(cause); - } -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java b/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java deleted file mode 100644 index d01c26f368..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBinding.java +++ /dev/null @@ -1,55 +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.sca.binding.rmi; - -import org.apache.tuscany.sca.assembly.Binding; - -/** - * Represents a binding to an RMI service. - */ -public interface RMIBinding extends Binding { - /** - * @return the host name of the RMI Service - */ - String getRmiHostName(); - - /** - * @param rmiHostName the hostname of the RMI Service - */ - void setRmiHostName(String rmiHostName); - - /** - * @return the port number for the RMI Service - */ - String getRmiPort(); - - /** - * @param rmiPort the port number for the RMI Service - */ - void setRmiPort(String rmiPort); - - /** - * @return returns the RMI Service Name - */ - String getRmiServiceName(); - - /** - * Sets the service name for the RMI Server - * @param rmiServiceName the name of the RMI service - */ - void setRmiServiceName(String rmiServiceName); -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingConstants.java b/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingConstants.java deleted file mode 100644 index e350386ca0..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingConstants.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.rmi; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.xml.Constants; - -public interface RMIBindingConstants { - - String BINDING_RMI = "binding.rmi"; - QName BINDING_RMI_QNAME = new QName(Constants.SCA10_NS, BINDING_RMI); - String RMI_HOST = "host"; - String RMI_PORT = "port"; - String RMI_SERVICE = "serviceName"; - - String COLON = ":"; - String FWD_SLASH = "/"; - String LOCAL_HOST = "localhost"; -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingFactory.java b/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingFactory.java deleted file mode 100644 index 199b4053e3..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingFactory.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.rmi; - -/** - * Factory for the RMI binding model. - */ -public interface RMIBindingFactory { - - /** - * Creates a new RMI binding. - * - * @return a new RMI binding - */ - RMIBinding createRMIBinding(); - -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingImpl.java b/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingImpl.java deleted file mode 100644 index 144bc3623a..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingImpl.java +++ /dev/null @@ -1,129 +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.sca.binding.rmi; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - - -/** - * Represents a binding to an RMI service. - * - * @version $Rev: 490475 $ $Date: 2006-12-27 15:53:42 +0530 (Wed, 27 Dec 2006) $ - */ -public class RMIBindingImpl implements RMIBinding, RMIBindingConstants { - private String name; - private List policySets = new ArrayList(); - private List requiredIntents = new ArrayList(); - private String host; - private String port; - private String serviceName; - private List extensions = new ArrayList(); - - protected RMIBindingImpl() { - } - - public String getURI() { - return host + COLON + port + serviceName; - } - - public String getRmiHostName() { - if (host == null) { - extractFromUri(); - } - return host; - } - - public void setRmiHostName(String host) { - this.host = host; - } - - public String getRmiPort() { - if (port == null) { - extractFromUri(); - } - return port; - } - - public void setRmiPort(String port) { - this.port = port; - } - - public String getRmiServiceName() { - if (serviceName == null) { - extractFromUri(); - } - return serviceName; - } - - public void setRmiServiceName(String serviceName) { - this.serviceName = serviceName; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public void setURI(String uri) { - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public List getPolicySets() { - return policySets; - } - - public List getExtensions() { - return extensions; - } - - public boolean isUnresolved() { - return false; - } - - public void setUnresolved(boolean unresolved) { - } - - private void extractFromUri() { - if (getURI() != null && getURI().length() > 0) { - int colonIndex = getURI().indexOf(COLON); - if (colonIndex != -1) { - setRmiHostName(getURI().substring(0, colonIndex)); - setRmiPort(getURI().substring(colonIndex + 1)); - } - - int slashIndex = getURI().indexOf(FWD_SLASH); - if (slashIndex != -1) { - if (colonIndex == -1) { - setRmiHostName(getURI().substring(0, slashIndex)); - } - setRmiServiceName(getURI().substring(slashIndex + 1)); - } else { - setRmiServiceName(getURI()); - } - } - } -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingInvoker.java b/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingInvoker.java deleted file mode 100644 index 50ff9233ef..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingInvoker.java +++ /dev/null @@ -1,83 +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.sca.binding.rmi; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.rmi.Remote; - -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.rmi.RMIHost; -import org.apache.tuscany.sca.rmi.RMIHostException; - -public class RMIBindingInvoker implements Invoker { - private RMIHost rmiHost; - private String host; - private String port; - private String svcName; - private Method remoteMethod; - private Remote proxy; - - public RMIBindingInvoker(RMIHost rmiHost, String host, String port, String svcName, Method remoteMethod) { - this.rmiHost = rmiHost; - this.remoteMethod = remoteMethod; - this.host = host; - this.port = port; - this.svcName = svcName; - } - - public Message invoke(Message msg) { - try { - Object[] args = msg.getBody(); - Object resp = invokeTarget(args); - msg.setBody(resp); - } catch (InvocationTargetException e) { - msg.setFaultBody(e.getCause()); - } catch (Throwable e) { - msg.setFaultBody(e); - } - return msg; - } - - - public Object invokeTarget(final Object payload) throws InvocationTargetException { - try { - if (proxy == null) { - proxy = rmiHost.findService(host, port, svcName); - // proxy = Naming.lookup(serviceURI); - } - remoteMethod = proxy.getClass().getMethod(remoteMethod.getName(), remoteMethod.getParameterTypes()); - - if (payload != null && !payload.getClass().isArray()) { - return remoteMethod.invoke(proxy, payload); - } else { - return remoteMethod.invoke(proxy, (Object[])payload); - - } - } catch (RMIHostException e) { - // the method we are passed must be accessible - throw new AssertionError(e); - } catch (IllegalAccessException e) { - // the method we are passed must be accessible - throw new AssertionError(e); - } catch (NoSuchMethodException e) { - throw new AssertionError(e); - } - - } - -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingProvider.java b/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingProvider.java deleted file mode 100644 index b22ddd936a..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingProvider.java +++ /dev/null @@ -1,244 +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.sca.binding.rmi; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.URI; -import java.rmi.Remote; -import java.rmi.server.UnicastRemoteObject; - -import net.sf.cglib.asm.ClassWriter; -import net.sf.cglib.asm.Constants; -import net.sf.cglib.asm.Type; -import net.sf.cglib.proxy.Enhancer; -import net.sf.cglib.proxy.MethodInterceptor; -import net.sf.cglib.proxy.MethodProxy; - -import org.apache.tuscany.sca.core.invocation.ThreadMessageContext; -import org.apache.tuscany.sca.interfacedef.Interface; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.java.JavaInterface; -import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.invocation.MessageFactory; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.rmi.RMIHost; -import org.apache.tuscany.sca.rmi.RMIHostException; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -/** - * RMIBindingProvider - */ -public class RMIBindingProvider implements ReferenceBindingProvider, ServiceBindingProvider, MethodInterceptor { - - private RuntimeComponent component; - private RuntimeComponentService service; - private RuntimeComponentReference reference; - private RMIBinding binding; - private MessageFactory messageFactory; - private RMIHost rmiHost; - - // need this member to morph the service interface to extend from Remote if - // it does not - // the base class's member variable interfaze is to be maintained to enable - // the connection - // of the service outbound to the component's inbound wire which requires - // that the service - // and the component match in their service contracts. - private Interface serviceInterface; - - public RMIBindingProvider(RuntimeComponent component, - RuntimeComponentService service, - RMIBinding binding, - MessageFactory messageFactory, - RMIHost rmiHost) { - this.component = component; - this.service = service; - this.binding = binding; - this.rmiHost = rmiHost; - this.messageFactory = messageFactory; - } - - public RMIBindingProvider(RuntimeComponent component, - RuntimeComponentReference reference, - RMIBinding binding, - RMIHost rmiHost) { - this.component = component; - this.reference = reference; - this.binding = binding; - this.rmiHost = rmiHost; - } - - public InterfaceContract getBindingInterfaceContract() { - if (service != null) - return service.getInterfaceContract(); - else - return reference.getInterfaceContract(); - } - - public void start() { - if (service != null) { - URI uri = URI.create(component.getURI() + "/" + binding.getName()); - binding.setURI(uri.toString()); - - this.serviceInterface = service.getInterfaceContract().getInterface(); - - Remote rmiProxy = createRmiService(); - - try { - rmiHost.registerService(binding.getRmiServiceName(), getPort(binding.getRmiPort()), rmiProxy); - } catch (RMIHostException e) { - throw new NoRemoteServiceException(e); - } - } - } - - public void stop() { - if (service != null) { - try { - rmiHost.unregisterService(binding.getRmiServiceName(), getPort(binding.getRmiPort())); - } catch (RMIHostException e) { - throw new NoRemoteServiceException(e.getMessage()); - } - } - } - - public Invoker createInvoker(Operation operation, boolean isCallback) { - try { - Method remoteMethod = JavaInterfaceUtil.findMethod(((JavaInterface)reference.getInterfaceContract() - .getInterface()).getJavaClass(), operation); - return new RMIBindingInvoker(rmiHost, binding.getRmiHostName(), binding.getRmiPort(), binding - .getRmiServiceName(), remoteMethod); - } catch (NoSuchMethodException e) { - throw new NoRemoteMethodException(operation.toString(), e); - } - } - - protected Remote createRmiService() { - Enhancer enhancer = new Enhancer(); - enhancer.setSuperclass(UnicastRemoteObject.class); - enhancer.setCallback(this); - Class targetJavaInterface = getTargetJavaClass(serviceInterface); - if (!Remote.class.isAssignableFrom(targetJavaInterface)) { - RMIServiceClassLoader classloader = new RMIServiceClassLoader(getClass().getClassLoader()); - final byte[] byteCode = generateRemoteInterface(targetJavaInterface); - targetJavaInterface = classloader.defineClass(byteCode); - enhancer.setClassLoader(classloader); - } - enhancer.setInterfaces(new Class[] {targetJavaInterface}); - return (Remote)enhancer.create(); - } - - // if the interface of the component whose serviceBindings must be exposed - // as RMI Service, does not - // implement java.rmi.Remote, then generate such an interface. This method - // will stop with - // just generating the bytecode. Defining the class from the byte code must - // tbe the responsibility - // of the caller of this method, since it requires a classloader to be - // created to define and load - // this interface. - protected byte[] generateRemoteInterface(Class serviceInterface) { - String interfazeName = serviceInterface.getCanonicalName(); - ClassWriter cw = new ClassWriter(false); - - String simpleName = serviceInterface.getSimpleName(); - cw.visit(Constants.V1_5, Constants.ACC_PUBLIC + Constants.ACC_ABSTRACT + Constants.ACC_INTERFACE, interfazeName - .replace('.', '/'), "java/lang/Object", new String[] {"java/rmi/Remote"}, simpleName + ".java"); - - StringBuffer argsAndReturn = null; - Method[] methods = serviceInterface.getMethods(); - for (Method method : methods) { - argsAndReturn = new StringBuffer("("); - Class[] paramTypes = method.getParameterTypes(); - Class returnType = method.getReturnType(); - - for (Class paramType : paramTypes) { - argsAndReturn.append(Type.getType(paramType)); - } - argsAndReturn.append(")"); - argsAndReturn.append(Type.getType(returnType)); - - cw.visitMethod(Constants.ACC_PUBLIC + Constants.ACC_ABSTRACT, - method.getName(), - argsAndReturn.toString(), - new String[] {"java/rmi/RemoteException"}, - null); - } - cw.visitEnd(); - return cw.toByteArray(); - } - - public Object intercept(Object object, Method method, Object[] args, MethodProxy methodProxy) throws Throwable { - // since incoming method signatures have 'remotemethod invocation' it - // will not match with the - // wired component's method signatures. Hence need to pull in the - // corresponding method from the - // component's service contract interface to make this invocation. - - return invokeTarget(JavaInterfaceUtil.findOperation(method, serviceInterface.getOperations()), args); - } - - public Object invokeTarget(Operation op, Object[] args) throws InvocationTargetException { - - Message requestMsg = messageFactory.createMessage(); - ThreadMessageContext.setMessageContext(requestMsg); - requestMsg.setBody(args); - - Message responseMsg = service.getInvoker(binding, op).invoke(requestMsg); - - if (responseMsg.isFault()) { - throw new InvocationTargetException((Throwable)responseMsg.getBody()); - } - return responseMsg.getBody(); - } - - protected int getPort(String port) { - int portNumber = RMIHost.RMI_DEFAULT_PORT; - if (port != null && port.length() > 0) { - portNumber = Integer.decode(port); - } - - return portNumber; - } - - private Class getTargetJavaClass(Interface targetInterface) { - // TODO: right now assume that the target is always a Java - // Implementation. Need to figure out - // how to generate Java Interface in cases where the target is not a - // Java Implementation - return ((JavaInterface)targetInterface).getJavaClass(); - } - - private class RMIServiceClassLoader extends ClassLoader { - public RMIServiceClassLoader(ClassLoader parent) { - super(parent); - } - - public Class defineClass(byte[] byteArray) { - return defineClass(null, byteArray, 0, byteArray.length); - } - } - -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingProviderFactory.java b/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingProviderFactory.java deleted file mode 100644 index 604eae3ab0..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIBindingProviderFactory.java +++ /dev/null @@ -1,57 +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.sca.binding.rmi; - -import org.apache.tuscany.sca.invocation.MessageFactory; -import org.apache.tuscany.sca.provider.BindingProviderFactory; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.rmi.RMIHost; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - - -/** - * - * RMIBindingProvider - * - * @version $Rev$ $Date$ - */ -public class RMIBindingProviderFactory implements BindingProviderFactory { - - private RMIHost rmiHost; - private MessageFactory messageFactory; - - public RMIBindingProviderFactory(MessageFactory messageFactory, RMIHost rmiHost) { - this.rmiHost = rmiHost; - this.messageFactory = messageFactory; - } - - public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, RuntimeComponentReference reference, RMIBinding binding) { - return new RMIBindingProvider(component, reference, binding, rmiHost); - } - - public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, RuntimeComponentService service, RMIBinding binding) { - return new RMIBindingProvider(component, service, binding, messageFactory, rmiHost); - } - - public Class getModelType() { - return RMIBinding.class; - } -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIModuleActivator.java b/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIModuleActivator.java deleted file mode 100644 index aaf77bbf66..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIModuleActivator.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.rmi; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.binding.rmi.xml.RMIBindingProcessor; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.core.ModuleActivator; -import org.apache.tuscany.sca.invocation.MessageFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; -import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint; -import org.apache.tuscany.sca.rmi.RMIHost; - -public class RMIModuleActivator implements ModuleActivator { - - public void start(ExtensionPointRegistry registry) { - - ModelFactoryExtensionPoint factories = registry.getExtensionPoint(ModelFactoryExtensionPoint.class); - AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class); - PolicyFactory policyFactory = factories.getFactory(PolicyFactory.class); - MessageFactory messageFactory = factories.getFactory(MessageFactory.class); - - StAXArtifactProcessorExtensionPoint processors = - registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class); - - RMIHost rmiHost = registry.getExtensionPoint(RMIHost.class); - RMIBindingFactory rmiFactory = new DefaultRMIBindingFactory(); - processors.addArtifactProcessor(new RMIBindingProcessor(assemblyFactory, policyFactory, rmiFactory)); - - ProviderFactoryExtensionPoint providerFactories = registry.getExtensionPoint(ProviderFactoryExtensionPoint.class); - providerFactories.addProviderFactory(new RMIBindingProviderFactory(messageFactory, rmiHost)); - } - - public void stop(ExtensionPointRegistry registry) { - } - - public Object[] getExtensionPoints() { - return null; - } - -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIRuntimeException.java b/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIRuntimeException.java deleted file mode 100644 index 79382c75c6..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/RMIRuntimeException.java +++ /dev/null @@ -1,37 +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.sca.binding.rmi; - - -/** - */ -public abstract class RMIRuntimeException extends RuntimeException { - protected RMIRuntimeException() { - } - - protected RMIRuntimeException(String message) { - super(message); - } - - protected RMIRuntimeException(String message, Throwable cause) { - super(message, cause); - } - - protected RMIRuntimeException(Throwable cause) { - super(cause); - } -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/xml/RMIBindingProcessor.java b/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/xml/RMIBindingProcessor.java deleted file mode 100644 index 0a33e00548..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/main/java/org/apache/tuscany/sca/binding/rmi/xml/RMIBindingProcessor.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.rmi.xml; - -import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; - -import java.util.List; -import java.util.StringTokenizer; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.xml.Constants; -import org.apache.tuscany.sca.binding.rmi.RMIBinding; -import org.apache.tuscany.sca.binding.rmi.RMIBindingConstants; -import org.apache.tuscany.sca.binding.rmi.RMIBindingFactory; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.contribution.service.ContributionWriteException; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicyFactory; -import org.apache.tuscany.sca.policy.PolicySet; -import org.apache.tuscany.sca.policy.PolicySetAttachPoint; - -public class RMIBindingProcessor implements - StAXArtifactProcessor, RMIBindingConstants { - - private RMIBindingFactory rmiBindingFactory; - private PolicyFactory policyFactory; - - public RMIBindingProcessor(AssemblyFactory assemblyFactory, - PolicyFactory policyFactory, - RMIBindingFactory rmiBindingFactory) { - this.policyFactory = policyFactory; - this.rmiBindingFactory = rmiBindingFactory; - } - - public RMIBinding read(XMLStreamReader reader) throws ContributionReadException { - try { - RMIBinding rmiBinding = rmiBindingFactory.createRMIBinding(); - - //Read policies - readPolicies(rmiBinding, reader); - - //Read host, port and service name - rmiBinding.setRmiHostName(reader.getAttributeValue(null, RMI_HOST)); - rmiBinding.setRmiPort(reader.getAttributeValue(null, RMI_PORT)); - rmiBinding.setRmiServiceName(reader.getAttributeValue(null, RMI_SERVICE)); - - // Skip to end element - while (reader.hasNext()) { - if (reader.next() == END_ELEMENT && BINDING_RMI_QNAME.equals(reader.getName())) { - break; - } - } - return rmiBinding; - - } catch (XMLStreamException e) { - throw new ContributionReadException(e); - } - } - - public void write(RMIBinding rmiBinding, XMLStreamWriter writer) throws ContributionWriteException { - try { - // Write a - writer.writeStartElement(Constants.SCA10_NS, BINDING_RMI); - - if (rmiBinding.getRmiHostName() != null) { - writer.writeAttribute(RMIBindingConstants.RMI_HOST, rmiBinding.getRmiHostName()); - } - - if (rmiBinding.getRmiPort() != null) { - writer.writeAttribute(RMIBindingConstants.RMI_PORT, rmiBinding.getRmiPort()); - } - - if (rmiBinding.getRmiServiceName() != null) { - writer.writeAttribute(RMIBindingConstants.RMI_SERVICE, rmiBinding.getRmiServiceName()); - } - writer.writeEndElement(); - - } catch (XMLStreamException e) { - throw new ContributionWriteException(e); - } - } - - public void resolve(RMIBinding model, ModelResolver resolver) throws ContributionResolveException { - } - - public QName getArtifactType() { - return RMIBindingConstants.BINDING_RMI_QNAME; - } - - public Class getModelType() { - return RMIBinding.class; - } - - /** - * Reads policy intents and policy sets. - * @param attachPoint - * @param reader - */ - private void readPolicies(PolicySetAttachPoint attachPoint, XMLStreamReader reader) { - String value = reader.getAttributeValue(null, Constants.REQUIRES); - if (value != null) { - List requiredIntents = attachPoint.getRequiredIntents(); - for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) { - QName qname = getQNameValue(reader, tokens.nextToken()); - Intent intent = policyFactory.createIntent(); - intent.setName(qname); - requiredIntents.add(intent); - } - } - - value = reader.getAttributeValue(null, Constants.POLICY_SETS); - if (value != null) { - List policySets = attachPoint.getPolicySets(); - for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) { - QName qname = getQNameValue(reader, tokens.nextToken()); - PolicySet policySet = policyFactory.createPolicySet(); - policySet.setName(qname); - policySets.add(policySet); - } - } - } - - /** - * Returns a qname from a string. - * @param reader - * @param value - * @return - */ - private QName getQNameValue(XMLStreamReader reader, String value) { - if (value != null) { - int index = value.indexOf(':'); - String prefix = index == -1 ? "" : value.substring(0, index); - String localName = index == -1 ? value : value.substring(index + 1); - String ns = reader.getNamespaceContext().getNamespaceURI(prefix); - if (ns == null) { - ns = ""; - } - return new QName(ns, localName, prefix); - } else { - return null; - } - } - -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-java-0.90/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator deleted file mode 100644 index 9cc4a2ed7f..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# Implementation class for the ExtensionActivator -org.apache.tuscany.sca.binding.rmi.RMIModuleActivator diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldImpl.java b/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldImpl.java deleted file mode 100644 index acb81a00f6..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworld; - -import org.osoa.sca.annotations.Service; - - -/** - * This class implements the HelloWorld service. - */ -@Service(HelloWorldService.class) -public class HelloWorldImpl implements HelloWorldService { - - public String sayHello(String name) { - return "Hello from the RMI Service to - " + name; - } - - public String sayHi(String name, String greeter) { - return "Hi from " + greeter + " in RMI Service to - " + name; - } -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiImpl.java b/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiImpl.java deleted file mode 100644 index 73aedc3b6c..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworld; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -/** - * This class implements the HelloWorld service. - */ -@Service(HelloWorldRmiService.class) -public class HelloWorldRmiImpl implements HelloWorldRmiService { - private HelloWorldService extService; - - public HelloWorldService getExtService() { - return extService; - } - - @Reference - public void setExtService(HelloWorldService extService) { - this.extService = extService; - } - - public String sayRmiHello(String name) { - return extService.sayHello(name) + " thro the RMI Reference"; - } - - public String sayRmiHi(String name, String greeter) { - return extService.sayHi(name, greeter) + " thro the RMI Reference"; - } - -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiService.java b/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiService.java deleted file mode 100644 index f636c8f7d8..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldRmiService.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworld; - -/** - * This is the business interface of the HelloWorld greetings service. - */ -public interface HelloWorldRmiService { - - String sayRmiHello(String name); - String sayRmiHi(String name, String greeter); - -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldService.java b/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldService.java deleted file mode 100644 index d5dc509f3e..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/test/java/helloworld/HelloWorldService.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworld; - -/** - * This is the business interface of the HelloWorld greetings service. - */ -public interface HelloWorldService { - - String sayHello(String name); - String sayHi(String name, String greeter); - -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java b/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java deleted file mode 100644 index e9991185a8..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/BindingTestCase.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.rmi; - -import helloworld.HelloWorldRmiService; -import junit.framework.Assert; - -import org.apache.tuscany.sca.host.embedded.SCADomain; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -public class BindingTestCase { - private static HelloWorldRmiService helloWorldRmiService; - private static SCADomain domain; - - @Test - public void testRmiService() { - System.out.println(helloWorldRmiService.sayRmiHello("Tuscany World!")); - Assert.assertEquals("Hello from the RMI Service to - Tuscany World! thro the RMI Reference", - helloWorldRmiService.sayRmiHello("Tuscany World!")); - - System.out.println(helloWorldRmiService.sayRmiHi("Tuscany World!", "Apache World")); - - Assert.assertEquals("Hi from Apache World in RMI Service to - Tuscany World! thro the RMI Reference", - helloWorldRmiService.sayRmiHi("Tuscany World!", "Apache World")); - } - - - - @BeforeClass - public static void init() throws Exception { - domain = SCADomain.newInstance("RMIBindingTest.composite"); - helloWorldRmiService = - domain.getService(HelloWorldRmiService.class, "HelloWorldRmiServiceComponent"); - } - - @AfterClass - public static void destroy() throws Exception { - domain.close(); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/NoRemoteMethodExceptionTestCase.java b/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/NoRemoteMethodExceptionTestCase.java deleted file mode 100644 index 3f9aa9950f..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/NoRemoteMethodExceptionTestCase.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.rmi; - -import junit.framework.TestCase; - -public class NoRemoteMethodExceptionTestCase extends TestCase { - - public void testNoArgs() { - assertNotNull(new NoRemoteMethodException()); - } - - public void testMsgArg() { - NoRemoteMethodException e = new NoRemoteMethodException("foo"); - assertEquals("foo", e.getMessage()); - } - - public void test2Args() { - Exception cause = new Exception(); - NoRemoteMethodException e = new NoRemoteMethodException("foo", cause); - assertEquals("foo", e.getMessage()); - assertEquals(cause, e.getCause()); - } - - public void testCauseArgs() { - Exception cause = new Exception(); - NoRemoteMethodException e = new NoRemoteMethodException(cause); - assertEquals(cause, e.getCause()); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/NoRemoteServiceExceptionTestCase.java b/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/NoRemoteServiceExceptionTestCase.java deleted file mode 100644 index d4de9996de..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/test/java/org/apache/tuscany/sca/binding/rmi/NoRemoteServiceExceptionTestCase.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.rmi; - -import junit.framework.TestCase; - -public class NoRemoteServiceExceptionTestCase extends TestCase { - - public void testNoArgs() { - assertNotNull(new NoRemoteServiceException()); - } - - public void testMsgArg() { - NoRemoteServiceException e = new NoRemoteServiceException("foo"); - assertEquals("foo", e.getMessage()); - } - - public void test2Args() { - Exception cause = new Exception(); - NoRemoteServiceException e = new NoRemoteServiceException("foo", cause); - assertEquals("foo", e.getMessage()); - assertEquals(cause, e.getCause()); - } - - public void testCauseArgs() { - Exception cause = new Exception(); - NoRemoteServiceException e = new NoRemoteServiceException(cause); - assertEquals(cause, e.getCause()); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/HelloWorldImpl.componentType b/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/HelloWorldImpl.componentType deleted file mode 100644 index 224a68f88d..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/HelloWorldImpl.componentType +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/HelloWorldRmiImpl.componentType b/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/HelloWorldRmiImpl.componentType deleted file mode 100644 index a83e7e6d1d..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/HelloWorldRmiImpl.componentType +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/META-INF/LICENSE.txt b/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/META-INF/LICENSE.txt deleted file mode 100644 index 0084319535..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/META-INF/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, serviceDefinition marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/META-INF/NOTICE b/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/META-INF/NOTICE deleted file mode 100644 index d83ebbe236..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/META-INF/NOTICE +++ /dev/null @@ -1,14 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2006 The Apache Software Foundation - -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/RMIBindingTest.composite b/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/RMIBindingTest.composite deleted file mode 100644 index 9f7b2548bf..0000000000 --- a/branches/sca-java-0.90/modules/binding-rmi/src/test/resources/RMIBindingTest.composite +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - HelloWorldServiceComponent - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/DISCLAIMER b/branches/sca-java-0.90/modules/binding-ws-axis2/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/LICENSE b/branches/sca-java-0.90/modules/binding-ws-axis2/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/NOTICE b/branches/sca-java-0.90/modules/binding-ws-axis2/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/pom.xml b/branches/sca-java-0.90/modules/binding-ws-axis2/pom.xml deleted file mode 100755 index 3807157bef..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/pom.xml +++ /dev/null @@ -1,181 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - - tuscany-binding-ws-axis2 - Apache Tuscany Web Services Binding using Apache Axis2 - - - - apache.ws - Apache WebServices Repository - http://ws.zones.apache.org/repository/ - legacy - - - - - - org.apache.tuscany.sca - tuscany-core - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-interface-wsdl-xml - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-assembly-xml - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-binding-ws-xml - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-core-databinding - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-databinding-axiom - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-host-http - 0.90-incubating-SNAPSHOT - - - - org.apache.axis2 - axis2-kernel - 1.2 - - - org.codehaus.woodstox - wstx-asl - - - - - - org.apache.ws.commons.axiom - axiom-api - 1.2.4 - - - - org.apache.ws.commons.axiom - axiom-impl - 1.2.4 - - - - org.apache.woden - woden - 1.0-incubating-M7a - runtime - - - - commons-logging - commons-logging - 1.1 - - - - org.apache.neethi - neethi - 2.0.1 - - - - org.apache.ws.commons.schema - XmlSchema - 1.3.1 - - - - commons-httpclient - commons-httpclient - 3.0.1 - - - - javax.mail - mail - 1.4 - - - - backport-util-concurrent - backport-util-concurrent - 2.2 - runtime - - - - commons-codec - commons-codec - 1.3 - runtime - - - - org.apache.tuscany.sca - tuscany-http-jetty - 0.90-incubating-SNAPSHOT - test - - - - org.apache.tuscany.sca - tuscany-host-embedded - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 0.90-incubating-SNAPSHOT - test - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/assembly/axis2.xml b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/assembly/axis2.xml deleted file mode 100644 index 52a61790ca..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/assembly/axis2.xml +++ /dev/null @@ -1,306 +0,0 @@ - - - - - - - false - false - false - false - - - - - - 30 - - - - true - - - - - - false - - admin - axis2 - - - - - - - - - - - - - - false - - - - - - - true - - - false - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6060 - - - - - - - - - - - - - - - - - - - - - - - - 6060 - - - - - - - - - - - - - HTTP/1.1 - chunked - - - HTTP/1.1 - chunked - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2AsyncBindingInvoker.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2AsyncBindingInvoker.java deleted file mode 100644 index e2517e02d8..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2AsyncBindingInvoker.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -import java.lang.reflect.InvocationTargetException; -import java.util.concurrent.CountDownLatch; - -import javax.xml.namespace.QName; - -import org.apache.axiom.soap.SOAPFactory; -import org.apache.axis2.AxisFault; -import org.apache.axis2.client.OperationClient; -import org.apache.axis2.client.Options; -import org.apache.axis2.client.ServiceClient; - -public class Axis2AsyncBindingInvoker extends Axis2BindingInvoker { - - private Axis2ReferenceCallbackTargetInvoker callbackInvoker; - - public Axis2AsyncBindingInvoker(ServiceClient serviceClient, - QName wsdlOperationName, - Options options, - SOAPFactory soapFactory) { - super(serviceClient, wsdlOperationName, options, soapFactory); - } - - private Object invokeTarget(final Object payload, String conversationId) - throws InvocationTargetException { - try { - Object[] args = (Object[]) payload; - OperationClient operationClient = createOperationClient(args, conversationId); - Axis2ReferenceCallback callback = new Axis2ReferenceCallback(callbackInvoker); - operationClient.setCallback(callback); - - // FIXME Synchronize with callback thread to get return value - CountDownLatch doneSignal = new CountDownLatch(1); - callbackInvoker.setSignal(doneSignal); - - operationClient.execute(false); - - try { - doneSignal.await(); - } catch(InterruptedException e) { - e.printStackTrace(); - } - - // FIXME returning value from callback thread - Object response = callbackInvoker.getReturnPayload(); - return response; - } catch (AxisFault e) { - throw new InvocationTargetException(e); - } - } - - public void setCallbackTargetInvoker(Axis2ReferenceCallbackTargetInvoker callbackInvoker) { - this.callbackInvoker = callbackInvoker; - } -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2BindingInvoker.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2BindingInvoker.java deleted file mode 100644 index fe33416f8b..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2BindingInvoker.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -import java.lang.reflect.InvocationTargetException; - -import javax.xml.namespace.QName; - -import org.apache.axiom.om.OMElement; -import org.apache.axiom.soap.SOAPBody; -import org.apache.axiom.soap.SOAPEnvelope; -import org.apache.axiom.soap.SOAPFactory; -import org.apache.axiom.soap.SOAPHeader; -import org.apache.axis2.AxisFault; -import org.apache.axis2.addressing.AddressingConstants; -import org.apache.axis2.addressing.EndpointReference; -import org.apache.axis2.client.OperationClient; -import org.apache.axis2.client.Options; -import org.apache.axis2.client.ServiceClient; -import org.apache.axis2.context.MessageContext; -import org.apache.axis2.transport.http.HTTPConstants; -import org.apache.axis2.wsdl.WSDLConstants; -import org.apache.tuscany.sca.interfacedef.ConversationSequence; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.Message; -import org.osoa.sca.Constants; - -/** - * Axis2BindingInvoker uses an Axis2 OperationClient to invoke a remote web service - */ -public class Axis2BindingInvoker implements Invoker { - - private ServiceClient serviceClient; - private QName wsdlOperationName; - private Options options; - private SOAPFactory soapFactory; - - public static final QName CONVERSATION_ID_REFPARM_QN = new QName(Constants.SCA_NS,"conversationID"); - - public Axis2BindingInvoker(ServiceClient serviceClient, QName wsdlOperationName, - Options options, SOAPFactory soapFactory) { - this.serviceClient = serviceClient; - this.wsdlOperationName = wsdlOperationName; - this.options = options; - this.soapFactory = soapFactory; - } - - public Message invoke(Message msg) { - try { - // getCallbackUris() has been removed from the Message interface - // LinkedList callbackRoutingChain = msg.getCallbackUris(); - // if (callbackRoutingChain != null) { - // workContext.setCallbackUris(callbackRoutingChain); - // } - Object resp = invokeTarget(msg.getBody(), msg.getConversationSequence(), msg.getConversationID()); - msg.setBody(resp); - } catch (InvocationTargetException e) { - msg.setFaultBody(e.getCause()); - } catch (Throwable e) { - msg.setFaultBody(e); - } - return msg; - } - - protected Object invokeTarget(final Object payload, final ConversationSequence sequence, String conversationId) throws InvocationTargetException { - try { - - Object[] args = (Object[]) payload; - OperationClient operationClient = createOperationClient(args, conversationId); - - // ensure connections are tracked so that they can be closed by the reference binding - MessageContext requestMC = operationClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE); - requestMC.getOptions().setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE); - requestMC.getOptions().setTimeOutInMilliSeconds(120000L); - - operationClient.execute(true); - - MessageContext responseMC = operationClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE); - - operationClient.complete(requestMC); - - return responseMC.getEnvelope().getBody().getFirstElement(); - - } catch (AxisFault e) { - throw new InvocationTargetException(e); - } - } - - @SuppressWarnings("deprecation") - protected OperationClient createOperationClient(Object[] args, String conversationId) throws AxisFault { - SOAPEnvelope env = soapFactory.getDefaultEnvelope(); - if (args != null && args.length > 0) { - SOAPBody body = env.getBody(); - for (Object bc : args) { - if (bc instanceof OMElement) { - body.addChild((OMElement) bc); - } else { - throw new IllegalArgumentException( - "Can't handle mixed payloads betweem OMElements and other types."); - } - } - } - MessageContext requestMC = new MessageContext(); - requestMC.setEnvelope(env); - - // Axis2 operationClients can not be shared so create a new one for each request - OperationClient operationClient = serviceClient.createClient(wsdlOperationName); - - if (conversationId != null && conversationId.length() != 0) { - EndpointReference fromEPR = new EndpointReference(AddressingConstants.Final.WSA_ANONYMOUS_URL); - fromEPR.addReferenceParameter(CONVERSATION_ID_REFPARM_QN, conversationId); - options.setFrom(fromEPR); - requestMC.setFrom(fromEPR); //who knows why two ways ? - - //For now do this the brute force method. Need to figure out how to do axis addressing .. configure mar in flow. - SOAPEnvelope sev = requestMC.getEnvelope(); - SOAPHeader sh = sev.getHeader(); - OMElement el = fromEPR.toOM(AddressingConstants.Final.WSA_NAMESPACE, - AddressingConstants.WSA_FROM, - AddressingConstants.WSA_DEFAULT_PREFIX); - sh.addChild(el); - } - - operationClient.setOptions(options); - operationClient.addMessageContext(requestMC); - - return operationClient; - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2BindingProviderFactory.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2BindingProviderFactory.java deleted file mode 100644 index f6631d7e1f..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2BindingProviderFactory.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -import org.apache.tuscany.sca.binding.ws.WebServiceBinding; -import org.apache.tuscany.sca.http.ServletHost; -import org.apache.tuscany.sca.invocation.MessageFactory; -import org.apache.tuscany.sca.provider.BindingProviderFactory; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -/** - * Axis2BindingProviderFactory - * - * @version $Rev$ $Date$ - */ - -public class Axis2BindingProviderFactory implements BindingProviderFactory { - - private MessageFactory messageFactory; - private ServletHost servletHost; - - public Axis2BindingProviderFactory(ServletHost servletHost, MessageFactory messageFactory) { - this.servletHost = servletHost; - this.messageFactory = messageFactory; - } - - public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, RuntimeComponentReference reference, WebServiceBinding binding) { - return new Axis2ReferenceBindingProvider(component, reference, binding, messageFactory); - } - - public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, RuntimeComponentService service, WebServiceBinding binding) { - return new Axis2ServiceBindingProvider(component, service, binding, servletHost, messageFactory); - } - - public Class getModelType() { - return WebServiceBinding.class; - } -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2CallbackInvocationHandler.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2CallbackInvocationHandler.java deleted file mode 100644 index 91d0f05bde..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2CallbackInvocationHandler.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -import java.net.URI; -import java.util.LinkedList; - -import org.apache.tuscany.sca.core.invocation.AbstractInvocationHandler; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.MessageFactory; -import org.apache.tuscany.sca.runtime.RuntimeWire; - -public class Axis2CallbackInvocationHandler extends AbstractInvocationHandler { - - private RuntimeWire wire; - - public Axis2CallbackInvocationHandler(MessageFactory messageFactory, RuntimeWire wire) { - super(messageFactory, false); - this.wire = wire; - } - - public Object invoke(Operation operation, Object[] args, LinkedList callbackRoutingChain) throws Throwable { -// Object targetAddress = callbackRoutingChain.removeFirst(); -// if (targetAddress == null) { -// throw new AssertionError("Popped a null from address from stack"); -// } - -// //TODO optimize as this is slow in local invocations -// Map sourceCallbackInvocationChains = -// wire.getCallbackInvocationChains(); -// InvocationChain chain = sourceCallbackInvocationChains.get(operation); -// chain.g -// TargetInvoker invoker = chain.getTargetInvoker(); -// return invoke(chain, invoker, args, null, callbackRoutingChain, null); - throw new UnsupportedOperationException("not yet implemented"); - } -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ModuleActivator.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ModuleActivator.java deleted file mode 100644 index 50e916c084..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ModuleActivator.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.binding.ws.DefaultWebServiceBindingFactory; -import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory; -import org.apache.tuscany.sca.binding.ws.xml.WebServiceBindingProcessor; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.core.ModuleActivator; -import org.apache.tuscany.sca.http.ServletHost; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.introspect.DefaultWSDLInterfaceIntrospector; -import org.apache.tuscany.sca.interfacedef.wsdl.introspect.WSDLInterfaceIntrospector; -import org.apache.tuscany.sca.invocation.MessageFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; -import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint; - -public class Axis2ModuleActivator implements ModuleActivator { - - public void start(ExtensionPointRegistry registry) { - - ModelFactoryExtensionPoint factories = registry.getExtensionPoint(ModelFactoryExtensionPoint.class); - AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class); - PolicyFactory policyFactory = factories.getFactory(PolicyFactory.class); - MessageFactory messageFactory = factories.getFactory(MessageFactory.class); - - WebServiceBindingFactory wsFactory = new DefaultWebServiceBindingFactory(); - WSDLFactory wsdlFactory = new DefaultWSDLFactory(); - - StAXArtifactProcessorExtensionPoint processors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class); - WSDLInterfaceIntrospector introspector = new DefaultWSDLInterfaceIntrospector(wsdlFactory); - WebServiceBindingProcessor processor = - new WebServiceBindingProcessor(assemblyFactory, policyFactory, wsFactory, wsdlFactory, introspector); - processors.addArtifactProcessor(processor); - - ProviderFactoryExtensionPoint providerFactories = registry.getExtensionPoint(ProviderFactoryExtensionPoint.class); - ServletHost servletHost = registry.getExtensionPoint(ServletHost.class); - Axis2BindingProviderFactory providerFactory = new Axis2BindingProviderFactory(servletHost, messageFactory); - providerFactories.addProviderFactory(providerFactory); - } - - public void stop(ExtensionPointRegistry registry) { - } - - public Object[] getExtensionPoints() { - return null; - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2OneWayBindingInvoker.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2OneWayBindingInvoker.java deleted file mode 100644 index fb95022c6b..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2OneWayBindingInvoker.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -import java.lang.reflect.InvocationTargetException; - -import javax.xml.namespace.QName; - -import org.apache.axiom.soap.SOAPFactory; -import org.apache.axis2.AxisFault; -import org.apache.axis2.client.OperationClient; -import org.apache.axis2.client.Options; -import org.apache.axis2.client.ServiceClient; - -public class Axis2OneWayBindingInvoker extends Axis2BindingInvoker { - - public Axis2OneWayBindingInvoker(ServiceClient serviceClient, - QName wsdlOperationName, - Options options, - SOAPFactory soapFactory) { - - super(serviceClient, wsdlOperationName, options, soapFactory); - } - - protected Object invokeTarget(final Object payload, final short sequence, String conversationId) throws InvocationTargetException { - try { - Object[] args = (Object[]) payload; - - OperationClient operationClient = createOperationClient(args, conversationId); - operationClient.execute(false); - - // REVIEW it seems ok to return null - return null; - - } catch (AxisFault e) { - throw new InvocationTargetException(e); - } catch (Throwable t) { - throw new InvocationTargetException(t); - } - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceBindingProvider.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceBindingProvider.java deleted file mode 100644 index 98994aa917..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceBindingProvider.java +++ /dev/null @@ -1,267 +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.sca.binding.axis2; - -import java.util.List; - -import javax.wsdl.Binding; -import javax.wsdl.BindingOperation; -import javax.wsdl.Definition; -import javax.wsdl.extensions.soap.SOAPAddress; -import javax.wsdl.extensions.soap.SOAPOperation; -import javax.xml.namespace.QName; - -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.om.OMElement; -import org.apache.axiom.soap.SOAPFactory; -import org.apache.axis2.AxisFault; -import org.apache.axis2.addressing.EndpointReference; -import org.apache.axis2.client.Options; -import org.apache.axis2.client.ServiceClient; -import org.apache.axis2.context.ConfigurationContext; -import org.apache.axis2.description.AxisService; -import org.apache.axis2.transport.http.HTTPConstants; -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; -import org.apache.tuscany.sca.binding.ws.WebServiceBinding; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.MessageFactory; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeWire; - -public class Axis2ReferenceBindingProvider implements ReferenceBindingProvider { - - private MessageFactory messageFactory; - private RuntimeComponent component; - private RuntimeComponentReference reference; - private WebServiceBinding wsBinding; - private ConfigurationContext configContext; - private ServiceClient serviceClient; - - public Axis2ReferenceBindingProvider(RuntimeComponent component, - RuntimeComponentReference reference, - WebServiceBinding wsBinding, - MessageFactory messageFactory) { - - this.component = component; - this.reference = reference; - this.wsBinding = wsBinding; - this.messageFactory = messageFactory; - - try { - TuscanyAxisConfigurator tuscanyAxisConfigurator = new TuscanyAxisConfigurator(); - configContext = tuscanyAxisConfigurator.getConfigurationContext(); - } catch (AxisFault e) { - throw new RuntimeException(e); // TODO: better exception - } - initServiceClient(); - } - - // methods for ReferenceBindingActivator - - public void initServiceClient() { - InterfaceContract contract = wsBinding.getBindingInterfaceContract(); - if (contract == null) { - contract = reference.getInterfaceContract(); - wsBinding.setBindingInterfaceContract(contract); - } - - // Set to use the Axiom data binding - contract.getInterface().setDefaultDataBinding(OMElement.class.getName()); - - // ??? following line was in Axis2BindingBuilder before the SPI changes - // and code reorg - // - // URI targetURI = wsBinding.getURI() != null ? - // URI.create(wsBinding.getURI()) : URI.create("foo"); - // - // targetURI was passed to the ReferenceBindingExtension constructor and - // apparently was unused - // Do we still need a targetURI? - - // wsBinding.setURI(component.getURI() + "#" + reference.getName()); - - // create an Axis2 ServiceClient - serviceClient = createServiceClient(); - } - - public void start() { - } - - public void stop() { - - // close all connections that we have initiated, so that the jetty - // server - // can be restarted without seeing ConnectExceptions - HttpClient httpClient = (HttpClient)serviceClient.getServiceContext().getConfigurationContext() - .getProperty(HTTPConstants.CACHED_HTTP_CLIENT); - if (httpClient != null) - ((MultiThreadedHttpConnectionManager)httpClient.getHttpConnectionManager()).shutdown(); - } - - /** - * Create an Axis2 ServiceClient - */ - protected ServiceClient createServiceClient() { - try { - QName serviceQName = wsBinding.getServiceName(); - String portName = wsBinding.getPortName(); - Definition wsdlDefinition = wsBinding.getWSDLDefinition().getDefinition(); - AxisService axisService = AxisService.createClientSideAxisService(wsdlDefinition, - serviceQName, - portName, - new Options()); - - return new ServiceClient(configContext, axisService); - } catch (AxisFault e) { - throw new RuntimeException(e); // TODO: better exception - } - } - - // methods for ReferenceBindingProvider - - public InterfaceContract getBindingInterfaceContract() { - return wsBinding.getBindingInterfaceContract(); - } - - public Invoker createInvoker(Operation operation, boolean isCallback) { - - Axis2BindingInvoker invoker; - - InterfaceContract contract = wsBinding.getBindingInterfaceContract(); - if (contract == null) { - contract = reference.getInterfaceContract(); - wsBinding.setBindingInterfaceContract(contract); - } - - if (wsBinding.getBindingInterfaceContract().getCallbackInterface() == null) { - invoker = createOperationInvoker(serviceClient, operation, false, operation.isNonBlocking()); - } else { - // FIXME: SDODataBinding needs to pass in TypeHelper and classLoader - // as parameters. - - // FIXME: This makes the (BIG) assumption that there is only one - // callback method - // Relaxing this assumption, however, does not seem to be trivial, - // it may depend on knowledge - // of what actual callback method was invoked by the service at the - // other end - - RuntimeWire wire = reference.getRuntimeWire(wsBinding); - Operation callbackOperation = findCallbackOperation(wire); - Axis2CallbackInvocationHandler invocationHandler = new Axis2CallbackInvocationHandler(messageFactory, wire); - Axis2ReferenceCallbackTargetInvoker callbackInvoker = new Axis2ReferenceCallbackTargetInvoker( - callbackOperation, - wire, - invocationHandler); - - Axis2AsyncBindingInvoker asyncInvoker = (Axis2AsyncBindingInvoker)createOperationInvoker(serviceClient, - operation, - true, - false); - asyncInvoker.setCallbackTargetInvoker(callbackInvoker); - invoker = asyncInvoker; - } - - return invoker; - } - - private Operation findCallbackOperation(RuntimeWire wire) { - InterfaceContract contract = wire.getTarget().getInterfaceContract(); // TODO: - // which - // end? - List callbackOperations = contract.getCallbackInterface().getOperations(); - if (callbackOperations.size() != 1) { - throw new RuntimeException("Can only handle one callback operation"); - } - Operation callbackOperation = (Operation)callbackOperations.get(0); - return callbackOperation; - } - - /** - * Create and configure an Axis2BindingInvoker for each operation - */ - private Axis2BindingInvoker createOperationInvoker(ServiceClient serviceClient, - Operation operation, - boolean hasCallback, - boolean isOneWay) { - - Options options = new Options(); - options.setTo(getPortLocationEPR()); - options.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE); - - String operationName = operation.getName(); - - String soapAction = getSOAPAction(operationName); - if (soapAction != null && soapAction.length() > 1) { - options.setAction(soapAction); - } - - options.setTimeOutInMilliSeconds(30 * 1000); // 30 seconds - - SOAPFactory soapFactory = OMAbstractFactory.getSOAP11Factory(); - QName wsdlOperationQName = new QName(operationName); - - Axis2BindingInvoker invoker; - if (hasCallback) { - invoker = new Axis2AsyncBindingInvoker(serviceClient, wsdlOperationQName, options, soapFactory); - } else if (isOneWay) { - invoker = new Axis2OneWayBindingInvoker(serviceClient, wsdlOperationQName, options, soapFactory); - } else { - invoker = new Axis2BindingInvoker(serviceClient, wsdlOperationQName, options, soapFactory); - } - - return invoker; - } - - protected EndpointReference getPortLocationEPR() { - String ep = wsBinding.getURI(); - if (ep == null && wsBinding.getPort() != null) { - List wsdlPortExtensions = wsBinding.getPort().getExtensibilityElements(); - for (final Object extension : wsdlPortExtensions) { - if (extension instanceof SOAPAddress) { - ep = ((SOAPAddress)extension).getLocationURI(); - break; - } - } - } - return new EndpointReference(ep); - } - - protected String getSOAPAction(String operationName) { - Binding binding = wsBinding.getBinding(); - if (binding != null) { - for (Object o : binding.getBindingOperations()) { - BindingOperation bop = (BindingOperation)o; - if (bop.getName().equalsIgnoreCase(operationName)) { - for (Object o2 : bop.getExtensibilityElements()) { - if (o2 instanceof SOAPOperation) { - return ((SOAPOperation)o2).getSoapActionURI(); - } - } - } - } - } - return null; - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceCallback.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceCallback.java deleted file mode 100644 index cbc82f9c68..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceCallback.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -import java.lang.reflect.InvocationTargetException; - -import org.apache.axiom.om.OMElement; -import org.apache.axis2.client.async.AsyncResult; -import org.apache.axis2.client.async.Callback; -import org.apache.axis2.context.MessageContext; - -public class Axis2ReferenceCallback extends Callback { - - private Axis2ReferenceCallbackTargetInvoker targetInvoker; - - public Axis2ReferenceCallback(Axis2ReferenceCallbackTargetInvoker targetInvoker) { - this.targetInvoker = targetInvoker; - } - - public void onComplete(AsyncResult result) { - MessageContext responseMC = result.getResponseMessageContext(); - OMElement responseOM = responseMC.getEnvelope().getBody().getFirstElement(); - try { - targetInvoker.invokeTarget(new Object[] {responseOM}, null); - } catch (InvocationTargetException e) { - // FIXME what is the appropriate exception here? - throw new RuntimeException(e); - } - } - - public void setComplete(boolean complete) { - super.setComplete(complete); - } - - public void onError(Exception e) { - throw new RuntimeException(e); - } -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceCallbackTargetInvoker.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceCallbackTargetInvoker.java deleted file mode 100644 index dce9bf8cf1..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceCallbackTargetInvoker.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -import java.lang.reflect.InvocationTargetException; -import java.util.concurrent.CountDownLatch; - -import org.apache.tuscany.sca.interfacedef.ConversationSequence; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.runtime.RuntimeWire; - -public class Axis2ReferenceCallbackTargetInvoker { - - private Operation operation; - private RuntimeWire inboundWire; - private boolean cacheable; - Axis2CallbackInvocationHandler invocationHandler; - private CountDownLatch signal; - private Object returnPayload; - - public Axis2ReferenceCallbackTargetInvoker(Operation operation, - RuntimeWire inboundWire, - Axis2CallbackInvocationHandler invocationHandler) { - - this.operation = operation; - this.inboundWire = inboundWire; - this.invocationHandler = invocationHandler; - } - - public Object invokeTarget(final Object payload, final ConversationSequence sequence) throws InvocationTargetException { - Object[] args; - if (payload != null && !payload.getClass().isArray()) { - args = new Object[]{payload}; - returnPayload = payload; - } else { - args = (Object[]) payload; - returnPayload = args[0]; - } - // FIXME synchronize with forward thread to return value - signal.countDown(); - try { -// return invocationHandler.invoke(operation, args, callbackRoutingChain); - return null; // TODO ??? - } catch (Throwable t) { - t.printStackTrace(); - throw new InvocationTargetException(t); - } - } - - public Message invoke(Message msg) { - try { - Object resp = invokeTarget(msg.getBody(), null); - msg.setBody(resp); - } catch (InvocationTargetException e) { - msg.setFaultBody(e.getCause()); - } catch (Throwable e) { - msg.setFaultBody(e); - } - return msg; - } - - public boolean isCacheable() { - return cacheable; - } - - public void setCacheable(boolean cacheable) { - this.cacheable = cacheable; - } - - public boolean isOptimizable() { - return isCacheable(); // we only need to check if the scopes are correct - } - - public Axis2ReferenceCallbackTargetInvoker clone() throws CloneNotSupportedException { - Axis2ReferenceCallbackTargetInvoker invoker = (Axis2ReferenceCallbackTargetInvoker) super.clone(); - invoker.operation = this.operation; - invoker.inboundWire = this.inboundWire; - invoker.cacheable = this.cacheable; - invoker.invocationHandler = this.invocationHandler; - return invoker; - } - - public void setSignal(CountDownLatch signal) { - this.signal = signal; - } - - public Object getReturnPayload() { - return returnPayload; - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceBindingProvider.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceBindingProvider.java deleted file mode 100644 index f843cb07a4..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceBindingProvider.java +++ /dev/null @@ -1,418 +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.sca.binding.axis2; - -import java.lang.reflect.InvocationTargetException; -import java.net.URI; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CountDownLatch; - -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.extensions.soap.SOAPAddress; -import javax.xml.namespace.QName; - -import org.apache.axiom.om.OMElement; -import org.apache.axiom.soap.SOAPFactory; -import org.apache.axis2.AxisFault; -import org.apache.axis2.context.ConfigurationContext; -import org.apache.axis2.context.MessageContext; -import org.apache.axis2.description.AxisOperation; -import org.apache.axis2.description.AxisService; -import org.apache.axis2.description.Parameter; -import org.apache.axis2.description.WSDL11ToAxisServiceBuilder; -import org.apache.axis2.description.WSDL2Constants; -import org.apache.axis2.description.WSDLToAxisServiceBuilder; -import org.apache.axis2.engine.MessageReceiver; -import org.apache.axis2.wsdl.WSDLConstants; -import org.apache.tuscany.sca.binding.ws.WebServiceBinding; -import org.apache.tuscany.sca.core.invocation.ThreadMessageContext; -import org.apache.tuscany.sca.http.ServletHost; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.invocation.MessageFactory; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -public class Axis2ServiceBindingProvider implements ServiceBindingProvider { - - private RuntimeComponent component; - private RuntimeComponentService service; - private WebServiceBinding wsBinding; - private ServletHost servletHost; - private ConfigurationContext configContext; - private MessageFactory messageFactory; - - // TODO: what to do about the base URI? - private static final String BASE_URI = "http://localhost:8080/"; - - public Axis2ServiceBindingProvider(RuntimeComponent component, - RuntimeComponentService service, - WebServiceBinding wsBinding, - ServletHost servletHost, - MessageFactory messageFactory) { - - this.component = component; - this.service = service; - this.wsBinding = wsBinding; - this.servletHost = servletHost; - this.messageFactory = messageFactory; - - try { - TuscanyAxisConfigurator tuscanyAxisConfigurator = new TuscanyAxisConfigurator(); - configContext = tuscanyAxisConfigurator.getConfigurationContext(); - } catch (AxisFault e) { - throw new RuntimeException(e); // TODO: better exception - } - } - - // methods for ServiceBindingActivator - - public void start() { - - // TODO: add back in from duplicate code in getBindingInterfaceContract - // to temporarily bypass NPE - InterfaceContract contract = wsBinding.getBindingInterfaceContract(); - if (contract == null) { - contract = service.getInterfaceContract(); - wsBinding.setBindingInterfaceContract(contract); - } - - // Set to use the Axiom data binding - contract.getInterface().setDefaultDataBinding(OMElement.class.getName()); - - String uri = computeActualURI(BASE_URI, component, service).normalize().toString(); - if (uri.endsWith("/")) { - uri = uri.substring(0, uri.length() - 1); - } - wsBinding.setURI(uri.toString()); - - // TODO: if specifies the wsdl service then should create a - // service for every port - - try { - configContext.getAxisConfiguration().addService(createAxisService()); - } catch (AxisFault e) { - throw new RuntimeException(e); - } - - Axis2ServiceServlet servlet = new Axis2ServiceServlet(); - servlet.init(configContext); - String servletURI = wsBinding.getURI(); - configContext.setContextRoot(servletURI); - servletHost.addServletMapping(servletURI, servlet); - } - - public void stop() { - servletHost.removeServletMapping(wsBinding.getURI()); - try { - configContext.getAxisConfiguration().removeService(wsBinding.getURI()); - } catch (AxisFault e) { - throw new RuntimeException(e); - } - } - - /** - * Compute the endpoint URI based on section 2.1.1 of the WS binding spec 1. - * The URIs in the endpoint(s) of the referenced WSDL, which may be relative - * 2. The URI specified by the wsa:Address element of the - * wsa:EndpointReference, which may be relative 3. The explicitly stated URI - * in the "uri" attribute of the binding.ws element, which may be relative, - * 4. The implicit URI as defined by in section 1.7 in the SCA Assembly spec - * If the has no wsdlElement but does have a uri attribute then - * the uri takes precidence over any implicitly used WSDL. - * - * @param parent - */ - protected URI computeActualURI(String baseURI, RuntimeComponent component, RuntimeComponentService service) { - - // TODO: support wsa:Address - - URI wsdlURI = null; - if (wsBinding.getServiceName() != null && wsBinding.getBindingName() == null) { - // explicitly points at a wsdl port, may be a relative - // URI - wsdlURI = getEndpoint(wsBinding.getPort()); - } - if (wsdlURI != null && wsdlURI.isAbsolute()) { - if (wsBinding.getURI() != null && (wsBinding.getServiceName() != null && wsBinding.getBindingName() == null)) { - throw new IllegalArgumentException("binding URI cannot be used with absolute WSDL endpoint URI"); - } - return URI.create(wsdlURI.toString()); - } - - // either there is no wsdl port endpoint URI or that URI is relative - - URI bindingURI = null; - if (wsBinding.getURI() != null) { - bindingURI = URI.create(wsBinding.getURI()); - } - if (bindingURI != null && bindingURI.isAbsolute()) { - // there is an absoulte uri specified on the binding: 1) { - // if the binding doesn't have a name use the name of the service - // (assumption, not in spec) - if (wsBinding.getName() != null) { - bindingURI = URI.create(wsBinding.getName()); - } else { - bindingURI = URI.create(service.getName()); - } - } - - // add any relative binding URI - if (bindingURI != null) { - actualURI += "/" + bindingURI; - } - - // add any relative WSDL port URI - if (wsdlURI != null) { - actualURI += "/" + wsdlURI.toString(); - } - - return URI.create(actualURI); - } - - /** - * Returns the endpoint of a given port. - */ - protected URI getEndpoint(Port wsdlPort) { - if (wsdlPort != null) { - List wsdlPortExtensions = wsdlPort.getExtensibilityElements(); - for (Object extension : wsdlPortExtensions) { - if (extension instanceof SOAPAddress) { - return URI.create(((SOAPAddress)extension).getLocationURI()); - } - } - } - return null; - } - - private AxisService createAxisService() throws AxisFault { - Definition definition = wsBinding.getWSDLDefinition().getDefinition(); - - // WSDLToAxisServiceBuilder only uses the service and port to find the - // wsdl4J Binding - // An SCA service with binding.ws does not require a service or port so - // we may not have these - // but - - WSDLToAxisServiceBuilder builder = new WSDL11ToAxisServiceBuilder(definition, wsBinding.getServiceName(), - wsBinding.getPortName()); - builder.setServerSide(true); - AxisService axisService = builder.populateService(); - - String path = URI.create(wsBinding.getURI()).getPath(); - axisService.setName(path); - axisService.setServiceDescription("Tuscany configured AxisService for service: " + wsBinding.getURI()); - - // Use the existing WSDL - Parameter wsdlParam = new Parameter(WSDLConstants.WSDL_4_J_DEFINITION, null); - wsdlParam.setValue(definition); - axisService.addParameter(wsdlParam); - Parameter userWSDL = new Parameter("useOriginalwsdl", "true"); - axisService.addParameter(userWSDL); - - for (Iterator i = axisService.getOperations(); i.hasNext();) { - AxisOperation axisOp = (AxisOperation)i.next(); - Operation op = getOperation(axisOp); - if (op != null) { - - if (op.isNonBlocking()) { - axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_ONLY); - } else { - axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_OUT); - } - - MessageReceiver msgrec = null; - if (wsBinding.getBindingInterfaceContract().getCallbackInterface() != null) { - msgrec = new Axis2ServiceInOutAsyncMessageReceiver(this, op); - } else if (op.isNonBlocking()) { - msgrec = new Axis2ServiceInMessageReceiver(this, op); - } else { - msgrec = new Axis2ServiceInOutSyncMessageReceiver(this, op); - } - axisOp.setMessageReceiver(msgrec); - } - } - - return axisService; - } - - protected Operation getOperation(AxisOperation axisOp) { - String operationName = axisOp.getName().getLocalPart(); - for (Operation op : wsBinding.getBindingInterfaceContract().getInterface().getOperations()) { - if (op.getName().equalsIgnoreCase(operationName)) { - return op; - } - } - return null; - } - - // methods for ServiceBindingProvider - - public InterfaceContract getBindingInterfaceContract() { - InterfaceContract contract = wsBinding.getBindingInterfaceContract(); - if (contract == null) { - contract = service.getInterfaceContract(); - wsBinding.setBindingInterfaceContract(contract); - } - - // Set to use the Axiom data binding - contract.getInterface().setDefaultDataBinding(OMElement.class.getName()); - return contract; - } - - // other methods that were previously in Axis2ServiceBinding - // TODO: are these still needed? - - private Map invCtxMap = new HashMap(); - - public Invoker createTargetInvoker(InterfaceContract contract, Operation operation) { - // if (!operation.isCallback()) { TODO: no isCallback methjod yet? - // throw new UnsupportedOperationException(); - // } else { - return new Axis2ServiceCallbackTargetInvoker(this); - // } - } - - public void addMapping(Object msgId, InvocationContext invCtx) { - this.invCtxMap.put(msgId, invCtx); - } - - public InvocationContext retrieveMapping(Object msgId) { - return this.invCtxMap.get(msgId); - } - - public void removeMapping(Object msgId) { - this.invCtxMap.remove(msgId); - } - - /** - * @param inMC - * @return - */ - protected static String getConversationID(MessageContext inMC) { - String conversationID = null; - Iterator i = inMC.getEnvelope().getHeader() - .getChildrenWithName(new QName("http://www.w3.org/2005/08/addressing", "From")); - for (; i.hasNext();) { - Object a = i.next(); - if (a instanceof OMElement) { - OMElement ao = (OMElement)a; - for (Iterator rpI = ao.getChildrenWithName(new QName("http://www.w3.org/2005/08/addressing", - "ReferenceParameters")); rpI.hasNext();) { - OMElement rpE = (OMElement)rpI.next(); - for (Iterator cidI = rpE.getChildrenWithName(Axis2BindingInvoker.CONVERSATION_ID_REFPARM_QN); cidI - .hasNext();) { - OMElement cidE = (OMElement)cidI.next(); - conversationID = cidE.getText(); - } - } - - } - - } - return conversationID; - } - - public Object invokeTarget(Operation op, Object[] args, Object messageId, String conversationID) - throws InvocationTargetException { - - Message requestMsg = messageFactory.createMessage(); - - if (messageId != null) { - requestMsg.setMessageID(messageId); - } - requestMsg.setBody(args); - - Message workContext = ThreadMessageContext.getMessageContext(); - - ThreadMessageContext.setMessageContext(requestMsg); - try { - if (isConversational() && conversationID != null) { - requestMsg.setConversationID(conversationID); - } else { - requestMsg.setConversationID(null); - } - - Message responseMsg = service.getInvoker(wsBinding, op).invoke(requestMsg); - - if (responseMsg.isFault()) { - throw new InvocationTargetException((Throwable)responseMsg.getBody()); - } - return responseMsg.getBody(); - - } finally { - ThreadMessageContext.setMessageContext(workContext); - } - } - - protected class InvocationContext { - public MessageContext inMessageContext; - - public Operation operation; - - public SOAPFactory soapFactory; - - public CountDownLatch doneSignal; - - public InvocationContext(MessageContext messageCtx, - Operation operation, - SOAPFactory soapFactory, - CountDownLatch doneSignal) { - this.inMessageContext = messageCtx; - this.operation = operation; - this.soapFactory = soapFactory; - this.doneSignal = doneSignal; - } - } - - public boolean isConversational() { - return wsBinding.getBindingInterfaceContract().getInterface().isConversational(); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceCallbackTargetInvoker.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceCallbackTargetInvoker.java deleted file mode 100644 index 29eb24bc61..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceCallbackTargetInvoker.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -import java.lang.reflect.InvocationTargetException; - -import org.apache.axiom.om.OMElement; -import org.apache.axiom.soap.SOAPEnvelope; -import org.apache.axis2.AxisFault; -import org.apache.axis2.Constants; -import org.apache.axis2.context.MessageContext; -import org.apache.axis2.engine.AxisEngine; -import org.apache.axis2.util.Utils; -import org.apache.tuscany.sca.binding.axis2.Axis2ServiceBindingProvider.InvocationContext; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.Message; - -public class Axis2ServiceCallbackTargetInvoker implements Invoker { - - private Axis2ServiceBindingProvider service; - - protected static final OMElement RESPONSE = null; - - public Axis2ServiceCallbackTargetInvoker(Axis2ServiceBindingProvider service) { - this.service = service; - } - - private Object invokeTarget(final Object payload, Object correlationId) throws InvocationTargetException { - try { - // Use current correlation id as index to retrieve inv context - InvocationContext invCtx = service.retrieveMapping(correlationId); - - MessageContext outMC = Utils.createOutMessageContext(invCtx.inMessageContext); - outMC.getOperationContext().addMessageContext(outMC); - - OMElement responseOM; - if (payload != null && !payload.getClass().isArray()) { - responseOM = (OMElement) payload; - } else { - responseOM = (OMElement) ((Object[]) payload)[0]; - } - SOAPEnvelope soapEnvelope = invCtx.soapFactory.getDefaultEnvelope(); - soapEnvelope.getBody().addChild(responseOM); - outMC.setEnvelope(soapEnvelope); - outMC.getOperationContext().setProperty(Constants.RESPONSE_WRITTEN, Constants.VALUE_TRUE); - - AxisEngine engine = - new AxisEngine( - invCtx.inMessageContext.getOperationContext().getServiceContext().getConfigurationContext()); - engine.send(outMC); - - invCtx.doneSignal.countDown(); - - service.removeMapping(correlationId); - } catch (AxisFault e) { - throw new InvocationTargetException(e); - } catch (Throwable t) { - throw new InvocationTargetException(t); - } - - return RESPONSE; - } - - public Message invoke(Message msg) { - try { - Object correlationId = msg.getCorrelationID(); - if (correlationId == null) { - throw new RuntimeException("Missing correlation id"); - } - Object resp = invokeTarget(msg.getBody(), correlationId); - msg.setBody(resp); - } catch (InvocationTargetException e) { - msg.setFaultBody(e.getCause()); - } catch (Throwable e) { - msg.setFaultBody(e); - } - return msg; - } - - public Axis2ServiceCallbackTargetInvoker clone() throws CloneNotSupportedException { - try { - return (Axis2ServiceCallbackTargetInvoker) super.clone(); - } catch (CloneNotSupportedException e) { - // will not happen - return null; - } - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceInMessageReceiver.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceInMessageReceiver.java deleted file mode 100644 index 85871c7924..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceInMessageReceiver.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -import org.apache.axiom.om.OMElement; -import org.apache.axis2.AxisFault; -import org.apache.axis2.context.MessageContext; -import org.apache.axis2.receivers.AbstractInMessageReceiver; -import org.apache.tuscany.sca.interfacedef.Operation; - -public class Axis2ServiceInMessageReceiver extends AbstractInMessageReceiver { - - protected Operation operation; - - private Axis2ServiceBindingProvider provider; - - public Axis2ServiceInMessageReceiver(Axis2ServiceBindingProvider provider, Operation operation) { - this.provider = provider; - this.operation = operation; - } - - public Axis2ServiceInMessageReceiver() { - - } - - @Override - public void invokeBusinessLogic(MessageContext inMC) throws AxisFault { - try { - OMElement requestOM = inMC.getEnvelope().getBody().getFirstElement(); - Object[] args = new Object[] {requestOM}; - String conversationID = provider.isConversational() ? Axis2ServiceBindingProvider.getConversationID(inMC) : null; - -// axis2Service.invokeTarget(operation, args, null, conversationID); - -// } catch (InvocationTargetException e) { -// Throwable t = e.getCause(); -// if (t instanceof Exception) { -// throw AxisFault.makeFault((Exception)t); -// } -// throw new InvocationRuntimeException(e); - } catch (Throwable t) { - if (t instanceof Exception) { - throw AxisFault.makeFault((Exception)t); - } - throw new RuntimeException(t); - } - - } -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceInOutAsyncMessageReceiver.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceInOutAsyncMessageReceiver.java deleted file mode 100644 index 70d705c7b8..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceInOutAsyncMessageReceiver.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -import java.util.concurrent.CountDownLatch; - -import org.apache.axiom.om.OMElement; -import org.apache.axis2.AxisFault; -import org.apache.axis2.context.MessageContext; -import org.apache.axis2.receivers.AbstractMessageReceiver; -import org.apache.tuscany.sca.interfacedef.Operation; - -public class Axis2ServiceInOutAsyncMessageReceiver extends AbstractMessageReceiver { - - private Operation operation; - - private Axis2ServiceBindingProvider provider; - - public Axis2ServiceInOutAsyncMessageReceiver(Axis2ServiceBindingProvider provider, - Operation operation) { - this.provider = provider; - this.operation = operation; - } - - public Axis2ServiceInOutAsyncMessageReceiver() { - } - - public final void receive(final MessageContext messageCtx) { - try { - Object messageId = messageCtx.getMessageID(); - if (messageId == null) { - messageId = new MessageId(); - } - - // Now use message id as index to context to be used by callback - // target invoker - CountDownLatch doneSignal = new CountDownLatch(1); -// InvocationContext invCtx = -// service.new InvocationContext(messageCtx, operation, getSOAPFactory(messageCtx), doneSignal); -// service.addMapping(messageId, invCtx); - - invokeBusinessLogic(messageCtx, messageId); - - try { - doneSignal.await(); - } catch(InterruptedException e) { - e.printStackTrace(); - } - } catch (AxisFault e) { - // log.error(e); - } - } - - private void invokeBusinessLogic(MessageContext inMC, Object messageId) throws AxisFault { - try { - OMElement requestOM = inMC.getEnvelope().getBody().getFirstElement(); - Object[] args = new Object[] {requestOM}; - String conversationID = provider.isConversational() ? Axis2ServiceBindingProvider.getConversationID(inMC) : null; -// service.invokeTarget(operation, args, messageId, conversationID); -// } catch (InvocationTargetException e) { -// Throwable t = e.getCause(); -// if (t instanceof Exception) { -// throw AxisFault.makeFault((Exception)t); -// } -// throw new InvocationRuntimeException(e); - } catch (Exception e) { - throw AxisFault.makeFault(e); - } - - } - - /** - * A unique identifier for a message flowing on a wire, potentially end-to-end (ie, through more than one SCAObject to - * SCAObject hop). - * - * This used to be in the org.apache.tuscany.spi.wire package - */ - public class MessageId { - - private long timestamp; - - public MessageId() { - this.timestamp = System.currentTimeMillis(); - } - - public long getTimestamp() { - return timestamp; - } - - public String toString() { - return "MsgId[" + timestamp + "]"; - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - final MessageId messageId = (MessageId) o; - return timestamp == messageId.timestamp; - } - - public int hashCode() { - return (int) (timestamp ^ (timestamp >>> 32)); - } - - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceInOutSyncMessageReceiver.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceInOutSyncMessageReceiver.java deleted file mode 100644 index ea5bb9f2e6..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceInOutSyncMessageReceiver.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -import java.lang.reflect.InvocationTargetException; - -import org.apache.axiom.om.OMElement; -import org.apache.axiom.soap.SOAPEnvelope; -import org.apache.axis2.AxisFault; -import org.apache.axis2.Constants; -import org.apache.axis2.context.MessageContext; -import org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver; -import org.apache.tuscany.sca.interfacedef.Operation; - -public class Axis2ServiceInOutSyncMessageReceiver extends AbstractInOutSyncMessageReceiver { - - protected Operation operation; - - private Axis2ServiceBindingProvider provider; - - public Axis2ServiceInOutSyncMessageReceiver() { - } - - public Axis2ServiceInOutSyncMessageReceiver(Axis2ServiceBindingProvider provider, Operation operation) { - this.provider = provider; - this.operation = operation; - } - - @Override - public void invokeBusinessLogic(MessageContext inMC, MessageContext outMC) throws AxisFault { - try { - OMElement requestOM = inMC.getEnvelope().getBody().getFirstElement(); - Object[] args = new Object[] {requestOM}; - - String conversationID = provider.isConversational() ? Axis2ServiceBindingProvider.getConversationID(inMC) : null; - - OMElement responseOM = (OMElement) provider.invokeTarget(operation, args, null, conversationID); - - SOAPEnvelope soapEnvelope = getSOAPFactory(inMC).getDefaultEnvelope(); - if(null != responseOM ){ - soapEnvelope.getBody().addChild(responseOM); - } - outMC.setEnvelope(soapEnvelope); - outMC.getOperationContext().setProperty(Constants.RESPONSE_WRITTEN, Constants.VALUE_TRUE); - - } catch (InvocationTargetException e) { - e.printStackTrace(); - Throwable t = e.getCause(); - if (t instanceof Exception) { - throw AxisFault.makeFault((Exception)t); - } - throw new RuntimeException(e); - } catch (Exception e) { - e.printStackTrace(); - throw AxisFault.makeFault(e); - } - - } -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceServlet.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceServlet.java deleted file mode 100644 index b313ff1b4e..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceServlet.java +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.SocketException; -import java.net.URL; -import java.util.Collections; -import java.util.Enumeration; -import java.util.Set; -import java.util.Vector; - -import javax.servlet.RequestDispatcher; -import javax.servlet.Servlet; -import javax.servlet.ServletConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.axis2.AxisFault; -import org.apache.axis2.addressing.EndpointReference; -import org.apache.axis2.context.ConfigurationContext; -import org.apache.axis2.transport.http.AxisServlet; -import org.apache.axis2.transport.http.ListingAgent; -import org.apache.axis2.transport.http.server.HttpUtils; - -/** - * This overrides the servlet init of the AxisServlet so Tuscany can use - * a single Axis2 ConfigurationContext instance shared between AxisServlet - * instances for each SCA service with a ws binding. - * TODO: need to review if thats really what we want to be doing - */ -public class Axis2ServiceServlet extends AxisServlet { - - protected TuscanyListingAgent agent; - protected boolean inited; - - private static final long serialVersionUID = 1L; - private static final ServletConfig DUMMY_CONFIG = createDummyServletConfig(); - - public void init(ConfigurationContext configContext) { - this.configContext = configContext; - try { - super.init(DUMMY_CONFIG); - } catch (ServletException e) { - throw new RuntimeException(e); - } - agent = new TuscanyListingAgent(configContext); - } - - /** - * Override Axis2 servlet method to avoid loop when init - * is called after servletConfig already initialized by - * this classes init(ConfigurationContext) method. - */ - @Override - public void init() throws ServletException { - } - - /** - * We've setup the Servlet by passing in a ConfigurationContext on our init method - * override this method to just return that - */ - @Override - protected ConfigurationContext initConfigContext(ServletConfig config) throws ServletException { - return this.configContext; - } - - @Override - public ServletConfig getServletConfig() { - return DUMMY_CONFIG; - } - - @Override - public String getServletName() { - return "TuscanyAxis2Servlet"; - } - - /** - * The AxisServlet gets NPE during init without a ServletConfig so this is a mocked up one to prevent that. - */ - private static ServletConfig createDummyServletConfig() { - ServletConfig sc = new ServletConfig() { - - public String getServletName() { - return "TuscanyAxis2DummyServlet"; - } - - public ServletContext getServletContext() { - return new ServletContext() { - - public ServletContext getContext(String uripath) { - return null; - } - - public String getContextPath() { - return null; - } - - public int getMajorVersion() { - return 0; - } - - public int getMinorVersion() { - return 0; - } - - public String getMimeType(String file) { - return null; - } - - public Set getResourcePaths(String path) { - return Collections.emptySet(); - } - - public URL getResource(String path) throws MalformedURLException { - if("/".equals(path)) { - // HACK: To avoid NPE - return new URL("/axis2"); - } - return null; - } - - public InputStream getResourceAsStream(String path) { - return null; - } - - public RequestDispatcher getRequestDispatcher(String path) { - return null; - } - - public RequestDispatcher getNamedDispatcher(String arg0) { - return null; - } - - public Servlet getServlet(String arg0) throws ServletException { - return null; - } - - public Enumeration getServlets() { - return null; - } - - public Enumeration getServletNames() { - return null; - } - - public void log(String arg0) { - } - - public void log(Exception arg0, String arg1) { - } - - public void log(String arg0, Throwable arg1) { - } - - public String getRealPath(String arg0) { - return null; - } - - public String getServerInfo() { - return null; - } - - public String getInitParameter(String arg0) { - return null; - } - - public Enumeration getInitParameterNames() { - return null; - } - - public Object getAttribute(String arg0) { - return null; - } - - public Enumeration getAttributeNames() { - return null; - } - - public void setAttribute(String arg0, Object arg1) { - } - - public void removeAttribute(String arg0) { - } - - public String getServletContextName() { - return null; - } - }; - } - - public String getInitParameter(String arg0) { - return null; - } - - public Enumeration getInitParameterNames() { - return new Vector().elements(); - } - }; - return sc; - } - - @Override - protected void service(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - // HACK: Get the correct context root which is not available during init() call - if (!inited) { - synchronized (configContext) { - configContext.setContextRoot(request.getContextPath()); - inited = true; - } - } - - super.service(request, response); - } - - @Override - public void destroy() { - try { - super.destroy(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * Override the AxisServlet doGet to use the TuscanyListingAgent for ?wsdl - */ - @Override - protected void doGet(HttpServletRequest request, - HttpServletResponse response) throws ServletException, IOException { - - initContextRoot(request); - - String query = request.getQueryString(); - if ((query != null) && (query.indexOf("wsdl2") >= 0 || - query.indexOf("wsdl") >= 0 || query.indexOf("xsd") >= 0 || - query.indexOf("policy") >= 0)) { - agent.processListService(request, response); - } else { - super.doGet(request, response); - } - } - - /** - - /** - * Override the AxisServlet method so as to not add "/services" into the url - */ - @Override - public EndpointReference[] getEPRsForService(String serviceName, String ip) throws AxisFault { - //RUNNING_PORT - String port = (String) configContext.getProperty(ListingAgent.RUNNING_PORT); - if (port == null) { - port = "8080"; - } - if (ip == null) { - try { - ip = HttpUtils.getIpAddress(); - if (ip == null) { - ip = "localhost"; - } - } catch (SocketException e) { - throw new AxisFault(e); - } - } - - - StringBuilder eprString = new StringBuilder("http://"); - eprString.append(ip).append(":").append(port); - if (!serviceName.startsWith("/")) { - eprString.append('/'); - } - eprString.append(serviceName); - EndpointReference endpoint = new EndpointReference(eprString.toString()); - - return new EndpointReference[]{endpoint}; - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/TuscanyAxisConfigurator.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/TuscanyAxisConfigurator.java deleted file mode 100755 index 370ed6e0a4..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/TuscanyAxisConfigurator.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -import org.apache.axis2.AxisFault; -import org.apache.axis2.context.ConfigurationContext; -import org.apache.axis2.context.ConfigurationContextFactory; -import org.apache.axis2.deployment.URLBasedAxisConfigurator; -import org.apache.axis2.engine.AxisConfigurator; - -/** - * Helps configure Axis2 from a resource in binding.axis2 instead of Axis2.xml - *

TODO: Review: should there be a single global Axis - * ConfigurationContext - */ -public class TuscanyAxisConfigurator extends URLBasedAxisConfigurator implements AxisConfigurator { - - public TuscanyAxisConfigurator() throws AxisFault { - super(TuscanyAxisConfigurator.class.getResource("/org/apache/tuscany/sca/binding/axis2/engine/config/axis2.xml"), null); - } - - public ConfigurationContext getConfigurationContext() throws AxisFault { - if (configContext == null) - configContext = ConfigurationContextFactory.createConfigurationContext(this); - return configContext; - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/TuscanyDispatcher.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/TuscanyDispatcher.java deleted file mode 100644 index 8988c74445..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/TuscanyDispatcher.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2; - -import java.net.URI; -import java.util.HashMap; - -import org.apache.axis2.AxisFault; -import org.apache.axis2.addressing.EndpointReference; -import org.apache.axis2.context.ConfigurationContext; -import org.apache.axis2.context.MessageContext; -import org.apache.axis2.description.AxisService; -import org.apache.axis2.description.HandlerDescription; -import org.apache.axis2.engine.AxisConfiguration; -import org.apache.axis2.engine.RequestURIBasedDispatcher; -import org.apache.axis2.util.JavaUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * A Tuscany specific Axis2 Dispatcher that enables using services - * exposed at the SCA defined service URI instead of /services/ - */ -public class TuscanyDispatcher extends RequestURIBasedDispatcher { - - public static final String NAME = "TuscanyDispatcher"; - private static final Log log = LogFactory.getLog(RequestURIBasedDispatcher.class); - private static final boolean isDebugEnabled = log.isDebugEnabled(); - - /* - * (non-Javadoc) - * - * @see org.apache.axis2.engine.AbstractDispatcher#findService(org.apache.axis2.context.MessageContext) - */ - public AxisService findService(MessageContext messageContext) throws AxisFault { - EndpointReference toEPR = messageContext.getTo(); - - if (toEPR != null) { - if(isDebugEnabled){ - log.debug("Checking for Service using target endpoint address : " + toEPR.getAddress()); - } - - String path = URI.create(toEPR.getAddress()).getPath(); - - ConfigurationContext configurationContext = messageContext.getConfigurationContext(); - AxisConfiguration registry = configurationContext.getAxisConfiguration(); - - String serviceName = findAxisServiceName(registry, path); - return registry.getService(serviceName); - - } else { - if(isDebugEnabled){ - log.debug("Attempted to check for Service using null target endpoint URI"); - } - return null; - } - } - - public void initDispatcher() { - init(new HandlerDescription(NAME)); - } - - protected String findAxisServiceName(AxisConfiguration registry, String path) { - HashMap services = registry.getServices(); - if (services == null) { - return null; - } - String[] parts = JavaUtils.split(path, '/'); - String serviceName = ""; - for (int i=parts.length-1; i>=0; i--) { - serviceName = parts[i] + serviceName; - if (services.containsKey(serviceName)) { - return serviceName; - } - serviceName = "/" + serviceName; - if (services.containsKey(serviceName)) { - return serviceName; - } - } - - return null; - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/TuscanyListingAgent.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/TuscanyListingAgent.java deleted file mode 100644 index 87338ceb27..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/java/org/apache/tuscany/sca/binding/axis2/TuscanyListingAgent.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.stream.FactoryConfigurationError; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.axiom.attachments.utils.IOUtils; -import org.apache.axis2.Constants; -import org.apache.axis2.context.ConfigurationContext; -import org.apache.axis2.deployment.DeploymentConstants; -import org.apache.axis2.description.AxisDescription; -import org.apache.axis2.description.AxisService; -import org.apache.axis2.description.PolicyInclude; -import org.apache.axis2.transport.http.ListingAgent; -import org.apache.axis2.util.ExternalPolicySerializer; -import org.apache.axis2.util.JavaUtils; -import org.apache.neethi.Policy; -import org.apache.neethi.PolicyRegistry; -import org.apache.ws.commons.schema.XmlSchema; - -/** - * A Tuscany specific Axis2 ListingAgent as the Axis2 one does not work - * with the Tuscany sevice names which include slash ('/') characters. - * Unfortunately it ends up having to copy a fair amount of Axis2 code to do this. - */ -public class TuscanyListingAgent extends ListingAgent { - - private static final String LIST_SINGLE_SERVICE_JSP_NAME = - "listSingleService.jsp"; - - public TuscanyListingAgent(ConfigurationContext aConfigContext) { - super(aConfigContext); - } - - protected String findAxisServiceName(String path) { - HashMap services = configContext.getAxisConfiguration().getServices(); - if (services == null) { - return null; - } - String[] parts = JavaUtils.split(path, '/'); - String serviceName = ""; - for (int i=parts.length-1; i>=0; i--) { - serviceName = parts[i] + serviceName; - if (services.containsKey(serviceName)) { - return serviceName; - } - serviceName = "/" + serviceName; - if (services.containsKey(serviceName)) { - return serviceName; - } - } - - return null; - } - - @Override - public void processListService(HttpServletRequest req, - HttpServletResponse res) - throws IOException, ServletException { - - - String filePart = req.getRequestURL().toString(); -// String serviceName = filePart.substring(filePart.lastIndexOf("/") + 1, -// filePart.length()); -// Change the Axis2 code so as to use the complete ServletPath as the service name -// this line is the only change to to Axis2 code - - String serviceName = findAxisServiceName(filePart); - - String query = req.getQueryString(); - int wsdl2 = query.indexOf("wsdl2"); - int wsdl = query.indexOf("wsdl"); - int xsd = query.indexOf("xsd"); - int policy = query.indexOf("policy"); - - HashMap services = configContext.getAxisConfiguration().getServices(); - if ((services != null) && !services.isEmpty()) { - Object serviceObj = services.get(serviceName); - if (serviceObj != null) { - boolean isHttp = "http".equals(req.getScheme()); - if (wsdl2 >= 0) { - OutputStream out = res.getOutputStream(); - res.setContentType("text/xml"); - String ip = extractHostAndPort(filePart, isHttp); - ((AxisService) serviceObj) - .printWSDL2(out, ip, configContext.getServiceContextPath()); - out.flush(); - out.close(); - return; - } else if (wsdl >= 0) { - OutputStream out = res.getOutputStream(); - res.setContentType("text/xml"); - String ip = extractHostAndPort(filePart, isHttp); - ((AxisService) serviceObj).printWSDL(out, ip, configContext.getServicePath()); - out.flush(); - out.close(); - return; - } else if (xsd >= 0) { - OutputStream out = res.getOutputStream(); - res.setContentType("text/xml"); - AxisService axisService = (AxisService) serviceObj; - //call the populator - axisService.populateSchemaMappings(); - Map schemaMappingtable = - axisService.getSchemaMappingTable(); - ArrayList schemas = axisService.getSchema(); - - //a name is present - try to pump the requested schema - String xsds = req.getParameter("xsd"); - if (!"".equals(xsds)) { - XmlSchema schema = - (XmlSchema) schemaMappingtable.get(xsds); - if (schema != null) { - //schema is there - pump it outs - schema.write(new OutputStreamWriter(out, "UTF8")); - out.flush(); - out.close(); - } else { - InputStream in = axisService.getClassLoader() - .getResourceAsStream(DeploymentConstants.META_INF + "/" + xsds); - if (in != null) { - out.write(IOUtils.getStreamAsByteArray(in)); - out.flush(); - out.close(); - } else { - res.sendError(HttpServletResponse.SC_NOT_FOUND); - } - } - - //multiple schemas are present and the user specified - //no name - in this case we cannot possibly pump a schema - //so redirect to the service root - } else if (schemas.size() > 1) { - res.sendRedirect(""); - //user specified no name and there is only one schema - //so pump that out - } else { - XmlSchema schema = axisService.getSchema(0); - if (schema != null) { - schema.write(new OutputStreamWriter(out, "UTF8")); - out.flush(); - out.close(); - } - } - return; - } else if (policy >= 0) { - - OutputStream out = res.getOutputStream(); - - ExternalPolicySerializer serializer = new ExternalPolicySerializer(); - serializer.setAssertionsToFilter(configContext - .getAxisConfiguration().getLocalPolicyAssertions()); - - // check whether Id is set - String idParam = req.getParameter("id"); - - if (idParam != null) { - // Id is set - - Policy targetPolicy = findPolicy(idParam, (AxisService) serviceObj); - - if (targetPolicy != null) { - XMLStreamWriter writer; - - try { - writer = XMLOutputFactory.newInstance() - .createXMLStreamWriter(out); - - res.setContentType("text/xml"); - targetPolicy.serialize(writer); - writer.flush(); - - } catch (XMLStreamException e) { - throw new ServletException( - "Error occured when serializing the Policy", - e); - - } catch (FactoryConfigurationError e) { - throw new ServletException( - "Error occured when serializing the Policy", - e); - } - - } else { - - res.setContentType("text/html"); - String outStr = "No policy found for id=" - + idParam + ""; - out.write(outStr.getBytes()); - } - - } else { - - PolicyInclude policyInclude = ((AxisService) serviceObj).getPolicyInclude(); - Policy effecPolicy = policyInclude.getEffectivePolicy(); - - if (effecPolicy != null) { - XMLStreamWriter writer; - - try { - writer = XMLOutputFactory.newInstance() - .createXMLStreamWriter(out); - - res.setContentType("text/xml"); - effecPolicy.serialize(writer); - writer.flush(); - - } catch (XMLStreamException e) { - throw new ServletException( - "Error occured when serializing the Policy", - e); - - } catch (FactoryConfigurationError e) { - throw new ServletException( - "Error occured when serializing the Policy", - e); - } - } else { - - res.setContentType("text/html"); - String outStr = "No effective policy for " - + serviceName + " servcie"; - out.write(outStr.getBytes()); - } - } - - return; - } else { - req.getSession().setAttribute(Constants.SINGLE_SERVICE, - serviceObj); - } - } else { - req.getSession().setAttribute(Constants.SINGLE_SERVICE, null); - } - } - - renderView(LIST_SINGLE_SERVICE_JSP_NAME, req, res); - } - - private String extractHostAndPort(String filePart, boolean isHttp) { - int ipindex = filePart.indexOf("//"); - String ip = null; - if (ipindex >= 0) { - ip = filePart.substring(ipindex + 2, filePart.length()); - int seperatorIndex = ip.indexOf(":"); - int slashIndex = ip.indexOf("/"); - String port; - if (seperatorIndex >= 0) { - port = ip.substring(seperatorIndex + 1, slashIndex); - ip = ip.substring(0, seperatorIndex); - } else { - ip = ip.substring(0, slashIndex); - port = "80"; - } - if (isHttp) { - configContext.setProperty(RUNNING_PORT, port); - } - } - return ip; - } - - private Policy findPolicy(String id, AxisDescription des) { - - List policyElements = des.getPolicyInclude().getPolicyElements(); - PolicyRegistry registry = des.getPolicyInclude().getPolicyRegistry(); - - Object policyComponent; - - Policy policy = registry.lookup(id); - - if (policy != null) { - return policy; - } - - for (Iterator iterator = policyElements.iterator(); iterator.hasNext();) { - policyComponent = iterator.next(); - - if (policyComponent instanceof Policy) { - // policy found for the id - - if (id.equals(((Policy) policyComponent).getId())) { - return (Policy) policyComponent; - } - } - } - - AxisDescription child; - - for (Iterator iterator = des.getChildren(); iterator.hasNext();) { - child = (AxisDescription) iterator.next(); - policy = findPolicy(id, child); - - if (policy != null) { - return policy; - } - } - - return null; - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator deleted file mode 100644 index f3bdb2511a..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# Implementation class for the ExtensionActivator -org.apache.tuscany.sca.binding.axis2.Axis2ModuleActivator diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/axis2/engine/config/axis2.xml b/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/axis2/engine/config/axis2.xml deleted file mode 100755 index 52a61790ca..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/axis2/engine/config/axis2.xml +++ /dev/null @@ -1,306 +0,0 @@ - - - - - - - false - false - false - false - - - - - - 30 - - - - true - - - - - - false - - admin - axis2 - - - - - - - - - - - - - - false - - - - - - - true - - - false - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6060 - - - - - - - - - - - - - - - - - - - - - - - - 6060 - - - - - - - - - - - - - HTTP/1.1 - chunked - - - HTTP/1.1 - chunked - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceTestCase.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceTestCase.java deleted file mode 100755 index 6b364eec68..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Axis2ReferenceTestCase.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -import junit.framework.TestCase; - -public class Axis2ReferenceTestCase extends TestCase { - - public void testInvokeService() throws Exception { -// Axis2ReferenceBinding axis2Reference = createAxis2Reference("testWebAppName", "testServiceName"); -// ServiceContract contract = new JavaServiceContract(); -// Operation operation = new Operation("sayHi", null, null, null, false, null, NO_CONVERSATION); -// TargetInvoker targetInvoker = axis2Reference.createTargetInvoker(contract, operation); -// assertNotNull(targetInvoker); -// assertFalse(targetInvoker instanceof Axis2AsyncTargetInvoker); - } - - public void testAsyncTargetInvoker() throws Exception { -// Axis2ReferenceBinding axis2Reference = createAxis2Reference("testWebAppName", "testServiceName"); -// //Create a mocked InboundWire, make the call of ServiceBindingExtension.getInterface() returns a Class -// Wire inboundWire = EasyMock.createNiceMock(Wire.class); -// JavaServiceContract contract = new JavaServiceContract(Greeter.class); -// contract.setCallbackName(""); -// contract.setCallbackClass(GreetingCallback.class); -// Operation callbackOp = -// new Operation("sayHiCallback", null, null, null, true, null, NO_CONVERSATION); -// HashMap> callbackOps = new HashMap>(); -// callbackOps.put("sayHiCallback", callbackOp); -// contract.setCallbackOperations(callbackOps); -// EasyMock.expect(inboundWire.getTargetContract()).andReturn(contract).anyTimes(); -// EasyMock.replay(inboundWire); -// -// axis2Reference.setWire(inboundWire); -// Operation operation = new Operation("sayHi", null, null, null, true, null, NO_CONVERSATION); -// TargetInvoker asyncTargetInvoker = axis2Reference.createTargetInvoker(contract, operation); -// assertNotNull(asyncTargetInvoker); -// assertTrue(asyncTargetInvoker instanceof Axis2AsyncTargetInvoker); - } - -// @SuppressWarnings("unchecked") -// private Axis2ReferenceBinding createAxis2Reference(String webAppName, String serviceName) throws Exception { -// //Create WebServiceBindingDefinition -// String wsdlLocation = "/wsdl/hello_world_doc_lit.wsdl"; -// URL url = getClass().getResource(wsdlLocation); -// assertNotNull("Could not find wsdl " + url.toString(), url); -// -// WSDLFactory factory = WSDLFactory.newInstance(); -// WSDLReader reader = factory.newWSDLReader(); -// reader.setFeature("javax.wsdl.verbose", false); -// InputSource input = new InputSource(url.openStream()); -// Definition wsdlDef = reader.readWSDL(url.toString(), input); -// Service wsdlService = wsdlDef.getService(new QName("http://objectweb.org/hello_world_soap_http", -// "SOAPService")); -// Port port = wsdlService.getPort("SoapPort"); -// WebServiceBindingDefinition wsBinding = -// new WebServiceBindingDefinition(wsdlDef, port, "uri", "portURI", wsdlService); -// //Create a mocked WireService, make the call of ServiceBindingExtension.getServiceInstance() returns a proxy instance. -// // TODO figure out what to do with the service contract -// ServiceContract contract = new WSDLServiceContract(); -// contract.setInterfaceClass(Greeter.class); -// return new Axis2ReferenceBinding(URI.create(serviceName), -// wsBinding, -// contract, -// null, -// null); -// } -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceTestCase.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceTestCase.java deleted file mode 100755 index 13ea94dd66..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Axis2ServiceTestCase.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -import junit.framework.TestCase; - -public class Axis2ServiceTestCase extends TestCase { - - public void testInvokeService() throws Exception { -// TestServletHost tomcatHost = new TestServletHost(); -// Axis2ServiceBinding axis2Service = createAxis2Service("testServiceName", tomcatHost, false); -// axis2Service.start(); -// -// if (true) return; -// Servlet servlet = tomcatHost.getMapping("testWebAppName/serviceBindings/testServiceName"); -// assertNotNull(servlet); -// -// //Create mocked HttpRequest and HttpResponse object to test the Axis2Servlet -// //To be done: - - } - - public void testAsyncMessageReceiver() throws Exception { - -// TestServletHost tomcatHost = new TestServletHost(); -// Axis2ServiceBinding axis2Service = createAxis2Service("testServiceName", tomcatHost, true); -// axis2Service.start(); - } - -// @SuppressWarnings("unchecked") -// private Axis2ServiceBinding createAxis2Service(String serviceName, ServletHost tomcatHost, boolean callback) -// throws Exception { -// //Create WebServiceBindingDefinition -// String wsdlLocation = "/wsdl/hello_world_doc_lit.wsdl"; -// URL url = getClass().getResource(wsdlLocation); -// assertNotNull("Could not find wsdl " + url.toString(), url); -// -// WSDLFactory factory = WSDLFactory.newInstance(); -// WSDLReader reader = factory.newWSDLReader(); -// reader.setFeature("javax.wsdl.verbose", false); -// InputSource input = new InputSource(url.openStream()); -// Definition wsdlDef = reader.readWSDL(url.toString(), input); -// Service wsdlService = wsdlDef.getService(new QName("http://objectweb.org/hello_world_soap_http", -// "SOAPService")); -// Port port = wsdlService.getPort("SoapPort"); -// WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition(wsdlDef, port, "uri", "portURI", wsdlService); -// -// //Create a mocked WireService, make the call of ServiceBindingExtension.getServiceInstance() returns a proxy instance. -//// WireService wireService = EasyMock.createNiceMock(WireService.class); -//// wireService.createProxy(EasyMock.isA(Class.class), EasyMock.isA(Wire.class)); -//// EasyMock.expectLastCall().andReturn(null); -//// EasyMock.replay(wireService); -// -// //Create a mocked InboundWire, make the call of ServiceBindingExtension.getInterface() returns a Class -// Wire inboundWire = EasyMock.createNiceMock(Wire.class); -// JavaServiceContract contract = new JavaServiceContract(Greeter.class); -// Map> opMap = new HashMap>(); -// for (Method m : Greeter.class.getMethods()) { -// opMap.put(m.getName(), new Operation(m.getName(), null, null, null)); -// } -// contract.setOperations(opMap); -// EasyMock.expect(inboundWire.getTargetContract()).andReturn(contract).anyTimes(); -// if (callback) { -// contract.setCallbackName(""); -// } -// EasyMock.replay(inboundWire); -// -// Wire outboundWire = EasyMock.createNiceMock(Wire.class); -// Map, InvocationChain> map = new HashMap, InvocationChain>(); -// EasyMock.expect(outboundWire.getInvocationChains()).andReturn(map).once(); -// EasyMock.replay(outboundWire); -// -// TuscanyAxisConfigurator tuscanyAxisConfigurator = new TuscanyAxisConfigurator(); -// ConfigurationContext configurationContext = tuscanyAxisConfigurator.getConfigurationContext(); -// Axis2ServiceBinding axis2Service = -// new Axis2ServiceBinding(URI.create(serviceName), -// contract, -// null, -// wsBinding, -// tomcatHost, -// configurationContext, null); -// axis2Service.setWire(inboundWire); -//// axis2Service.setOutboundWire(outboundWire); -// -// return axis2Service; -// } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Greeter.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Greeter.java deleted file mode 100755 index c604b954a4..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/Greeter.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -public interface Greeter { - - String sayHi(); - - String greetMe(String requestType); - - void greetMeOneWay(String requestType); - - void greetMeWithCallback(String requestType); - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/GreetingCallback.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/GreetingCallback.java deleted file mode 100644 index bcf9baa42d..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/GreetingCallback.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.axis2; - -public interface GreetingCallback { - - void greetMeCallback(String greetMeResponse); -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorld.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorld.java deleted file mode 100644 index dfc78e7cd8..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorld.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2.itests; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface HelloWorld { - - public String getGreetings(String s); - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldComponent.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldComponent.java deleted file mode 100644 index 3978726f2a..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldComponent.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2.itests; - -import org.osoa.sca.annotations.Reference; - -public class HelloWorldComponent implements HelloWorld { - - @Reference - public HelloWorld helloWorldWS; - - public String getGreetings(String s) { - return helloWorldWS.getGreetings(s); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldMultiService.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldMultiService.java deleted file mode 100644 index 8c1120f545..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldMultiService.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2.itests; - -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.OMFactory; - -public class HelloWorldMultiService implements HelloWorldOM, HelloWorldOM2 { - - public OMElement getGreetings(OMElement requestOM) { - String name = requestOM.getFirstElement().getText(); - - OMFactory omFactory = OMAbstractFactory.getOMFactory(); - OMElement responseOM = omFactory.createOMElement("getGreetingsResponse", "http://helloworld-om", "helloworld"); - OMElement param = omFactory.createOMElement("getGreetingsReturn", "http://helloworld-om", "helloworld"); - responseOM.addChild(param); - param.addChild(omFactory.createOMText("Hello " + name)); - - return responseOM; - } - - public OMElement getGreetings2(OMElement requestOM) { - String name = requestOM.getFirstElement().getText(); - - OMFactory omFactory = OMAbstractFactory.getOMFactory(); - OMElement responseOM = omFactory.createOMElement("getGreetingsResponse", "http://helloworld-om", "helloworld"); - OMElement param = omFactory.createOMElement("getGreetingsReturn", "http://helloworld-om", "helloworld"); - responseOM.addChild(param); - param.addChild(omFactory.createOMText("Hello2 " + name)); - - return responseOM; - } -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOM.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOM.java deleted file mode 100644 index 897ac8dcb9..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOM.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2.itests; - -import org.apache.axiom.om.OMElement; -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface HelloWorldOM { - - public OMElement getGreetings(OMElement parmE); - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOM2.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOM2.java deleted file mode 100644 index 8981541ad8..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOM2.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2.itests; - -import org.apache.axiom.om.OMElement; -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface HelloWorldOM2 { - - public OMElement getGreetings2(OMElement parmE); - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMComponent.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMComponent.java deleted file mode 100644 index 6b6abb843f..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMComponent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2.itests; - -import org.apache.axiom.om.OMElement; -import org.osoa.sca.annotations.Reference; - -public class HelloWorldOMComponent implements HelloWorldOM { - - @Reference - public HelloWorldOM helloWorldWS; - - public OMElement getGreetings(OMElement om) { - return helloWorldWS.getGreetings(om); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMService.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMService.java deleted file mode 100644 index 861509c003..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMService.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2.itests; - -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.OMFactory; - -public class HelloWorldOMService implements HelloWorldOM { - - public OMElement getGreetings(OMElement requestOM) { - String name = requestOM.getFirstElement().getText(); - - OMFactory omFactory = OMAbstractFactory.getOMFactory(); - OMElement responseOM = omFactory.createOMElement("getGreetingsResponse", "http://helloworld-om", "helloworld"); - OMElement param = omFactory.createOMElement("getGreetingsReturn", "http://helloworld-om", "helloworld"); - responseOM.addChild(param); - param.addChild(omFactory.createOMText("Hello " + name)); - - return responseOM; - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMTestCase.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMTestCase.java deleted file mode 100644 index 40aa0e4480..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldOMTestCase.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2.itests; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.OMFactory; -import org.apache.axiom.om.OMText; -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public class HelloWorldOMTestCase extends TestCase { - - private SCADomain domain; - private HelloWorldOM helloWorld; - - public void testCalculator() throws Exception { - OMFactory fac = OMAbstractFactory.getOMFactory(); - OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld"); - OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld"); - requestOM.addChild(parmE); - parmE.addChild(fac.createOMText("petra")); - OMElement responseOM = helloWorld.getGreetings(requestOM); - OMElement child = (OMElement)responseOM.getFirstElement(); - Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText()); - } - - protected void setUp() throws Exception { - domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/axis2/itests/helloworld-om.composite"); - helloWorld = domain.getService(HelloWorldOM.class, "HelloWorldComponent"); - } - - protected void tearDown() throws Exception { - domain.close(); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldService.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldService.java deleted file mode 100644 index d7d6b93f34..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2.itests; - -public class HelloWorldService implements HelloWorld { - - public String getGreetings(String s) { - return "Hello " + s; - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldTestCaseFIXME.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldTestCaseFIXME.java deleted file mode 100644 index ee42e8cb5f..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/HelloWorldTestCaseFIXME.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2.itests; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public class HelloWorldTestCaseFIXME extends TestCase { - - private SCADomain domain; - private HelloWorld helloWorld; - - public void testCalculator() throws Exception { - assertEquals("Hello petra", helloWorld.getGreetings("petra")); - } - - protected void setUp() throws Exception { - domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/axis2/itests/HelloWorld.composite"); - helloWorld = domain.getService(HelloWorld.class, "HelloWorldComponent"); - } - - protected void tearDown() throws Exception { - domain.close(); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/QuestionMarkWSDLTestCaseFIXME.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/QuestionMarkWSDLTestCaseFIXME.java deleted file mode 100644 index 11eba9a8c4..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/QuestionMarkWSDLTestCaseFIXME.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2.itests; - -import java.util.List; - -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.Service; -import javax.wsdl.extensions.soap.SOAPAddress; -import javax.wsdl.factory.WSDLFactory; -import javax.wsdl.xml.WSDLReader; -import javax.xml.namespace.QName; - -import junit.framework.TestCase; - -import org.apache.axis2.transport.http.server.HttpUtils; -import org.apache.tuscany.sca.host.embedded.SCADomain; - -/** - * TODO: This doesn't work right now as it seems to cause hangs when running - * from mvn. Also running in eclipse mostly only works if you comment out - * one of the test methods. - */ -public class QuestionMarkWSDLTestCaseFIXME extends TestCase { - - private SCADomain domain; - - /** - * Tests ?wsdl works and returns the correct port endpoint from the WSDL - */ - public void testWSDLPortEndpoint() throws Exception { - WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader(); - wsdlReader.setFeature("javax.wsdl.verbose",false); - wsdlReader.setFeature("javax.wsdl.importDocuments",true); - - Definition definition = wsdlReader.readWSDL("http://localhost:8080/services/HelloWorldWebService?wsdl"); - assertNotNull(definition); - Service service = definition.getService(new QName("http://helloworld-om", "HelloWorldService")); - Port port = service.getPort("HelloWorldSoapPort"); - - String endpoint = getEndpoint(port); - String ip = HttpUtils.getIpAddress(); - assertEquals("http://" + ip + ":8080/services/HelloWorldWebService", endpoint); - } - - /** - * Tests ?wsdl works and returns the correct port endpoint from binding.ws with a custom URI - */ - public void testCustomEndpoint() throws Exception { - WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader(); - wsdlReader.setFeature("javax.wsdl.verbose",false); - wsdlReader.setFeature("javax.wsdl.importDocuments",true); - - Definition definition = wsdlReader.readWSDL("http://localhost:8080/HelloWorldService/foo/bar?wsdl"); - assertNotNull(definition); - Service service = definition.getService(new QName("http://helloworld-om", "HelloWorldService")); - Port port = service.getPort("HelloWorldSoapPort"); - - String endpoint = getEndpoint(port); - String ip = HttpUtils.getIpAddress(); - assertEquals("http://" + ip + ":8080/HelloWorldService/foo/bar", endpoint); - } - - protected String getEndpoint(Port port) { - List wsdlPortExtensions = port.getExtensibilityElements(); - for (final Object extension : wsdlPortExtensions) { - if (extension instanceof SOAPAddress) { - return ((SOAPAddress) extension).getLocationURI(); - } - } - throw new RuntimeException("no SOAPAddress"); - } - - protected void setUp() throws Exception { - domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/axis2/itests/questionmark-wsdl.composite"); - } - - protected void tearDown() throws Exception { - domain.close(); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java deleted file mode 100644 index b52c10e341..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/AbstractHelloWorldOMTestCase.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2.itests.endpoints; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.OMFactory; -import org.apache.axiom.om.OMText; -import org.apache.tuscany.sca.binding.axis2.itests.HelloWorldOM; -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public abstract class AbstractHelloWorldOMTestCase extends TestCase { - - private SCADomain domain; - private HelloWorldOM helloWorld; - - public void testCalculator() throws Exception { - OMFactory fac = OMAbstractFactory.getOMFactory(); - OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld"); - OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld"); - requestOM.addChild(parmE); - parmE.addChild(fac.createOMText("petra")); - OMElement responseOM = helloWorld.getGreetings(requestOM); - OMElement child = (OMElement)responseOM.getFirstElement(); - Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText()); - } - - protected void setUp() throws Exception { - domain = SCADomain.newInstance(getCompositeName()); - helloWorld = domain.getService(HelloWorldOM.class, "HelloWorldComponent"); - } - - protected void tearDown() throws Exception { - domain.close(); - } - - protected String getCompositeName() { - String className = this.getClass().getName(); - return className.substring(0, className.length() - 8).replace('.', '/') + ".composite"; - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultMultiServiceTestCase.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultMultiServiceTestCase.java deleted file mode 100644 index 3f1677fa90..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultMultiServiceTestCase.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2.itests.endpoints; - -public class DefaultMultiServiceTestCase extends AbstractHelloWorldOMTestCase { - // super class does it all getting composite based on this class name -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultSingleServiceTestCase.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultSingleServiceTestCase.java deleted file mode 100644 index 9b0ee7304d..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultSingleServiceTestCase.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2.itests.endpoints; - -public class DefaultSingleServiceTestCase extends AbstractHelloWorldOMTestCase { - // super class does it all getting composite based on this class name -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLExplicitURITestCase.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLExplicitURITestCase.java deleted file mode 100644 index 7155d80100..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLExplicitURITestCase.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2.itests.endpoints; - -public class WSDLExplicitURITestCase extends AbstractHelloWorldOMTestCase { - // super class does it all getting composite based on this class name -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLRelativeURITestCase.java b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLRelativeURITestCase.java deleted file mode 100644 index ce862be74e..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLRelativeURITestCase.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.axis2.itests.endpoints; - -public class WSDLRelativeURITestCase extends AbstractHelloWorldOMTestCase { - // super class does it all getting composite based on this class name -} diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/HelloWorld.composite b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/HelloWorld.composite deleted file mode 100644 index ceb026d253..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/HelloWorld.composite +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultMultiService.composite b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultMultiService.composite deleted file mode 100644 index a58b7eb0d7..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultMultiService.composite +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultSingleService.composite b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultSingleService.composite deleted file mode 100644 index 6b16d9de21..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/DefaultSingleService.composite +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLExplicitURI.composite b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLExplicitURI.composite deleted file mode 100644 index f20e8e6574..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLExplicitURI.composite +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLRelativeURI.composite b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLRelativeURI.composite deleted file mode 100644 index a9da20141c..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/WSDLRelativeURI.composite +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/helloworld-om-relative-uri.wsdl b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/helloworld-om-relative-uri.wsdl deleted file mode 100644 index cd63064b59..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/endpoints/helloworld-om-relative-uri.wsdl +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/helloworld-om-uri.wsdl b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/helloworld-om-uri.wsdl deleted file mode 100644 index 456676e068..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/helloworld-om-uri.wsdl +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/helloworld-om.composite b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/helloworld-om.composite deleted file mode 100644 index 8c861c84be..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/helloworld-om.composite +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/helloworld-om.wsdl b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/helloworld-om.wsdl deleted file mode 100644 index 73ca02246d..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/helloworld-om.wsdl +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/helloworld.wsdl b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/helloworld.wsdl deleted file mode 100644 index 68174d1ecd..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/helloworld.wsdl +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/questionmark-wsdl.composite b/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/questionmark-wsdl.composite deleted file mode 100644 index fca9a4d754..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/axis2/itests/questionmark-wsdl.composite +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/.checkstyle b/branches/sca-java-0.90/modules/binding-ws-xml/.checkstyle deleted file mode 100644 index e3c216986d..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/.checkstyle +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/.pmd b/branches/sca-java-0.90/modules/binding-ws-xml/.pmd deleted file mode 100644 index 2db10d6a6a..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/.pmd +++ /dev/null @@ -1,20 +0,0 @@ - - -truefalse \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/.ruleset b/branches/sca-java-0.90/modules/binding-ws-xml/.ruleset deleted file mode 100644 index ba9b5ce886..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/DISCLAIMER b/branches/sca-java-0.90/modules/binding-ws-xml/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/LICENSE b/branches/sca-java-0.90/modules/binding-ws-xml/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/NOTICE b/branches/sca-java-0.90/modules/binding-ws-xml/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/pom.xml b/branches/sca-java-0.90/modules/binding-ws-xml/pom.xml deleted file mode 100644 index acc305308d..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - tuscany-binding-ws-xml - Apache Tuscany SCA XML Web Service Binding Extension - - - - org.apache.tuscany.sca - tuscany-contribution - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-assembly-xml - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-binding-ws - 0.90-incubating-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-interface-wsdl - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-interface-wsdl-xml - 0.90-incubating-SNAPSHOT - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java b/branches/sca-java-0.90/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java deleted file mode 100644 index 36afd1d92b..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceBindingProcessor.java +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.ws.xml; - -import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; - -import java.util.List; -import java.util.Map; -import java.util.StringTokenizer; - -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.PortType; -import javax.wsdl.Service; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.xml.Constants; -import org.apache.tuscany.sca.binding.ws.WebServiceBinding; -import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.contribution.service.ContributionWriteException; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract; -import org.apache.tuscany.sca.interfacedef.wsdl.introspect.WSDLInterfaceIntrospector; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicyFactory; -import org.apache.tuscany.sca.policy.PolicySet; -import org.apache.tuscany.sca.policy.PolicySetAttachPoint; - -public class WebServiceBindingProcessor implements - StAXArtifactProcessor, WebServiceConstants { - - private WSDLFactory wsdlFactory; - private WSDLInterfaceIntrospector introspector; - private WebServiceBindingFactory wsFactory; - private PolicyFactory policyFactory; - - public WebServiceBindingProcessor(AssemblyFactory assemblyFactory, - PolicyFactory policyFactory, - WebServiceBindingFactory wsFactory, - WSDLFactory wsdlFactory, - WSDLInterfaceIntrospector introspector) { - this.policyFactory = policyFactory; - this.wsFactory = wsFactory; - this.introspector = introspector; - this.wsdlFactory = wsdlFactory; - } - - public WebServiceBinding read(XMLStreamReader reader) throws ContributionReadException { - try { - - // Read a - WebServiceBinding wsBinding = wsFactory.createWebServiceBinding(); - wsBinding.setUnresolved(true); - - // Read policies - readPolicies(wsBinding, reader); - - // Read URI - wsBinding.setURI(reader.getAttributeValue(null, Constants.URI)); - - // Read a qname in the form: - // namespace#wsdl.???(name) - String wsdlElement = reader.getAttributeValue(null, WSDL_ELEMENT); - if (wsdlElement != null) { - int index = wsdlElement.indexOf('#'); - if (index == -1) { - throw new ContributionReadException( - "Invalid WebService binding wsdlElement attribute: " + wsdlElement); - } - String namespace = wsdlElement.substring(0, index); - wsBinding.setNamespace(namespace); - String name = wsdlElement.substring(index + 1); - if (name.startsWith("wsdl.service")) { - - // Read a wsdl.service - name = name.substring("wsdl.service(".length(), name.length() - 1); - wsBinding.setServiceName(new QName(namespace, name)); - - } else if (name.startsWith("wsdl.port")) { - - // Read a wsdl.port - name = name.substring("wsdl.port(".length(), name.length() - 1); - int s = name.indexOf('/'); - if (s == -1) { - throw new ContributionReadException( - "Invalid WebService binding wsdlElement attribute: " + wsdlElement); - } - wsBinding.setServiceName(new QName(namespace, name.substring(0, s))); - wsBinding.setPortName(name.substring(s + 1)); - - } else if (name.startsWith("wsdl.endpoint")) { - - // Read a wsdl.endpoint - name = name.substring("wsdl.endpoint(".length(), name.length() - 1); - int s = name.indexOf('/'); - if (s == -1) { - throw new ContributionReadException( - "Invalid WebService binding wsdlElement attribute: " + wsdlElement); - } - wsBinding.setServiceName(new QName(namespace, name.substring(0, s))); - wsBinding.setEndpointName(name.substring(s + 1)); - - } else if (name.startsWith("wsdl.binding")) { - - // Read a wsdl.service - name = name.substring("wsdl.binding(".length(), name.length() - 1); - wsBinding.setBindingName(new QName(namespace, name)); - - } else { - throw new ContributionReadException( - "Invalid WebService binding wsdlElement attribute: " + wsdlElement); - } - } - - // Read wsdlLocation - wsBinding.setLocation(reader.getAttributeValue(WSDLI_NS, WSDL_LOCATION)); - - // Skip to end element - while (reader.hasNext()) { - if (reader.next() == END_ELEMENT && BINDING_WS_QNAME.equals(reader.getName())) { - break; - } - } - return wsBinding; - - } catch (XMLStreamException e) { - throw new ContributionReadException(e); - } - } - - public void write(WebServiceBinding wsBinding, XMLStreamWriter writer) throws ContributionWriteException { - try { - // Write a - writer.writeStartElement(Constants.SCA10_NS, BINDING_WS); - - // Write binding URI - if (wsBinding.getURI() != null) { - writer.writeAttribute(Constants.URI, wsBinding.getURI()); - } - - // Write wsdlElement attribute - if (wsBinding.getPortName() != null) { - - // Write namespace#wsdl.port(service/port) - String wsdlElement = wsBinding.getServiceName().getNamespaceURI() + "#wsdl.port(" - + wsBinding.getServiceName().getLocalPart() - + "/" - + wsBinding.getPortName() - + ")"; - writer.writeAttribute(WSDL_ELEMENT, wsdlElement); - - } else if (wsBinding.getEndpointName() != null) { - - // Write namespace#wsdl.endpoint(service/endpoint) - String wsdlElement = wsBinding.getServiceName().getNamespaceURI() + "#wsdl.endpoint(" - + wsBinding.getServiceName().getLocalPart() - + "/" - + wsBinding.getEndpointName() - + ")"; - writer.writeAttribute(WSDL_ELEMENT, wsdlElement); - - } else if (wsBinding.getBindingName() != null) { - - // Write namespace#wsdl.binding(binding) - String wsdlElement = wsBinding.getBindingName().getNamespaceURI() + "#wsdl.binding(" - + wsBinding.getBindingName().getLocalPart() - + ")"; - writer.writeAttribute(WSDL_ELEMENT, wsdlElement); - - } else if (wsBinding.getServiceName() != null) { - - // Write namespace#wsdl.service(service) - String wsdlElement = wsBinding.getServiceName().getNamespaceURI() + "#wsdl.service(" - + wsBinding.getServiceName().getLocalPart() - + ")"; - writer.writeAttribute(WSDL_ELEMENT, wsdlElement); - } - - // Write location - if (wsBinding.getLocation() != null) { - writer.writeAttribute(WSDLI_NS, WSDL_LOCATION, wsBinding.getLocation()); - } - - writer.writeEndElement(); - - } catch (XMLStreamException e) { - throw new ContributionWriteException(e); - } - } - - public void resolve(WebServiceBinding model, ModelResolver resolver) throws ContributionResolveException { - WSDLDefinition wsdlDefinition = wsdlFactory.createWSDLDefinition(); - wsdlDefinition.setUnresolved(true); - wsdlDefinition.setNamespace(model.getNamespace()); - wsdlDefinition = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition); - if (!wsdlDefinition.isUnresolved()) { - model.setDefinition(wsdlDefinition); - Definition definition = wsdlDefinition.getDefinition(); - if (model.getBindingName() != null) { - model.setBinding(definition.getBinding(model.getBindingName())); - } - if (model.getServiceName() != null) { - Service service = definition.getService(model.getServiceName()); - model.setService(service); - if (service != null && model.getPortName() != null) { - Port port = service.getPort(model.getPortName()); - model.setPort(port); - model.setBinding(port.getBinding()); - } - } - - PortType portType = getPortType(model); - if (portType != null) { - WSDLInterfaceContract interfaceContract = wsdlFactory.createWSDLInterfaceContract(); - WSDLInterface wsdlInterface; - try { - wsdlInterface = introspector.introspect(portType, - wsdlDefinition.getInlinedSchemas(), - resolver); - } catch (InvalidInterfaceException e) { - throw new ContributionResolveException(e); - } - interfaceContract.setInterface(wsdlInterface); - model.setBindingInterfaceContract(interfaceContract); - } - } - } - - private PortType getPortType(WebServiceBinding model) { - PortType portType = null; - if (model.getService() != null) { - // FIXME: How to find the compatible port? - Map ports = model.getService().getPorts(); - if (!ports.isEmpty()) { - Port port = (Port)ports.values().iterator().next(); - portType = port.getBinding().getPortType(); - } - } else if (model.getPort() != null) { - portType = model.getPort().getBinding().getPortType(); - } else if (model.getEndpoint() != null) { - portType = model.getPort().getBinding().getPortType(); - } else if (model.getBinding() != null) { - portType = model.getBinding().getPortType(); - } - return portType; - } - - public QName getArtifactType() { - return WebServiceConstants.BINDING_WS_QNAME; - } - - public Class getModelType() { - return WebServiceBinding.class; - } - - /** - * Reads policy intents and policy sets. - * @param attachPoint - * @param reader - */ - private void readPolicies(PolicySetAttachPoint attachPoint, XMLStreamReader reader) { - String value = reader.getAttributeValue(null, Constants.REQUIRES); - if (value != null) { - List requiredIntents = attachPoint.getRequiredIntents(); - for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) { - QName qname = getQNameValue(reader, tokens.nextToken()); - Intent intent = policyFactory.createIntent(); - intent.setName(qname); - requiredIntents.add(intent); - } - } - - value = reader.getAttributeValue(null, Constants.POLICY_SETS); - if (value != null) { - List policySets = attachPoint.getPolicySets(); - for (StringTokenizer tokens = new StringTokenizer(value); tokens.hasMoreTokens();) { - QName qname = getQNameValue(reader, tokens.nextToken()); - PolicySet policySet = policyFactory.createPolicySet(); - policySet.setName(qname); - policySets.add(policySet); - } - } - } - - /** - * Returns a qname from a string. - * @param reader - * @param value - * @return - */ - private QName getQNameValue(XMLStreamReader reader, String value) { - if (value != null) { - int index = value.indexOf(':'); - String prefix = index == -1 ? "" : value.substring(0, index); - String localName = index == -1 ? value : value.substring(index + 1); - String ns = reader.getNamespaceContext().getNamespaceURI(prefix); - if (ns == null) { - ns = ""; - } - return new QName(ns, localName, prefix); - } else { - return null; - } - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceConstants.java b/branches/sca-java-0.90/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceConstants.java deleted file mode 100644 index 34d0fc4949..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/src/main/java/org/apache/tuscany/sca/binding/ws/xml/WebServiceConstants.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.ws.xml; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.xml.Constants; - -public interface WebServiceConstants { - - String BINDING_WS = "binding.ws"; - QName BINDING_WS_QNAME = new QName(Constants.SCA10_NS, BINDING_WS); - String WSDL_ELEMENT = "wsdlElement"; - QName WSDL_ELEMENT_QNAME = new QName(Constants.SCA10_NS, WSDL_ELEMENT); - String WSDL_LOCATION = "wsdlLocation"; - String WSDLI_NS = "http://www.w3.org/2004/08/wsdl-instance"; - QName WSDL_LOCATION_QNAME = new QName(WSDLI_NS, WSDL_LOCATION); - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/ReadTestCase.java b/branches/sca-java-0.90/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/ReadTestCase.java deleted file mode 100644 index 8a0e462624..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/ReadTestCase.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.ws.xml; - -import java.io.InputStream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.DefaultSCABindingFactory; -import org.apache.tuscany.sca.assembly.SCABindingFactory; -import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl; -import org.apache.tuscany.sca.assembly.xml.ComponentTypeProcessor; -import org.apache.tuscany.sca.assembly.xml.CompositeProcessor; -import org.apache.tuscany.sca.binding.ws.DefaultWebServiceBindingFactory; -import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.introspect.DefaultWSDLInterfaceIntrospector; -import org.apache.tuscany.sca.interfacedef.wsdl.introspect.WSDLInterfaceIntrospector; -import org.apache.tuscany.sca.policy.DefaultPolicyFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * Test reading WSDL interfaces. - * - * @version $Rev$ $Date$ - */ -public class ReadTestCase extends TestCase { - - XMLInputFactory inputFactory; - DefaultStAXArtifactProcessorExtensionPoint staxProcessors; - ExtensibleStAXArtifactProcessor staxProcessor; - private AssemblyFactory assemblyFactory; - private SCABindingFactory scaBindingFactory; - private PolicyFactory policyFactory; - private InterfaceContractMapper mapper; - private WebServiceBindingFactory wsFactory; - private WSDLInterfaceIntrospector introspector; - private WSDLFactory wsdlFactory; - - public void setUp() throws Exception { - assemblyFactory = new DefaultAssemblyFactory(); - scaBindingFactory = new DefaultSCABindingFactory(); - policyFactory = new DefaultPolicyFactory(); - mapper = new InterfaceContractMapperImpl(); - inputFactory = XMLInputFactory.newInstance(); - staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance()); - wsFactory = new DefaultWebServiceBindingFactory(); - wsdlFactory = new DefaultWSDLFactory(); - - introspector = new DefaultWSDLInterfaceIntrospector(wsdlFactory); - - WebServiceBindingProcessor wsdlProcessor = new WebServiceBindingProcessor( - assemblyFactory, policyFactory, wsFactory, - wsdlFactory, introspector); - staxProcessors.addArtifactProcessor(wsdlProcessor); - } - - public void tearDown() throws Exception { - inputFactory = null; - staxProcessors = null; - staxProcessor = null; - policyFactory = null; - assemblyFactory = null; - mapper = null; - } - - public void testReadComponentType() throws Exception { - ComponentTypeProcessor componentTypeProcessor = new ComponentTypeProcessor(assemblyFactory, policyFactory, staxProcessor); - InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType"); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - ComponentType componentType = componentTypeProcessor.read(reader); - assertNotNull(componentType); - - //new PrintUtil(System.out).print(componentType); - } - - public void testReadComposite() throws Exception { - CompositeProcessor compositeProcessor = new CompositeProcessor(assemblyFactory, policyFactory, mapper, staxProcessor); - InputStream is = getClass().getResourceAsStream("Calculator.composite"); - XMLStreamReader reader = inputFactory.createXMLStreamReader(is); - Composite composite = compositeProcessor.read(reader); - assertNotNull(composite); - - CompositeBuilderImpl compositeUtil = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, mapper, null); - compositeUtil.build(composite); - - //new PrintUtil(System.out).print(composite); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/WriteTestCase.java b/branches/sca-java-0.90/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/WriteTestCase.java deleted file mode 100644 index b686cbacaf..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/java/org/apache/tuscany/sca/binding/ws/xml/WriteTestCase.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.ws.xml; - -import java.io.ByteArrayOutputStream; -import java.io.InputStream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.xml.ComponentTypeProcessor; -import org.apache.tuscany.sca.assembly.xml.CompositeProcessor; -import org.apache.tuscany.sca.assembly.xml.ConstrainingTypeProcessor; -import org.apache.tuscany.sca.binding.ws.DefaultWebServiceBindingFactory; -import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.interfacedef.wsdl.DefaultWSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.introspect.DefaultWSDLInterfaceIntrospector; -import org.apache.tuscany.sca.interfacedef.wsdl.introspect.WSDLInterfaceIntrospector; -import org.apache.tuscany.sca.policy.DefaultPolicyFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; - -/** - * Test reading/write WSDL interfaces. - * - * @version $Rev$ $Date$ - */ -public class WriteTestCase extends TestCase { - - XMLInputFactory inputFactory; - DefaultStAXArtifactProcessorExtensionPoint staxProcessors; - ExtensibleStAXArtifactProcessor staxProcessor; - private AssemblyFactory factory; - private PolicyFactory policyFactory; - private InterfaceContractMapper mapper; - private WebServiceBindingFactory wsFactory; - private WSDLInterfaceIntrospector introspector; - private WSDLFactory wsdlFactory; - - public void setUp() throws Exception { - factory = new DefaultAssemblyFactory(); - policyFactory = new DefaultPolicyFactory(); - mapper = new InterfaceContractMapperImpl(); - inputFactory = XMLInputFactory.newInstance(); - staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(); - staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance()); - wsFactory = new DefaultWebServiceBindingFactory(); - introspector = new DefaultWSDLInterfaceIntrospector(wsdlFactory); - wsdlFactory = new DefaultWSDLFactory(); - - staxProcessors.addArtifactProcessor(new CompositeProcessor(factory, policyFactory, mapper, staxProcessor)); - staxProcessors.addArtifactProcessor(new ComponentTypeProcessor(factory, policyFactory, staxProcessor)); - staxProcessors.addArtifactProcessor(new ConstrainingTypeProcessor(factory, policyFactory, staxProcessor)); - - WebServiceBindingProcessor wsdlProcessor = new WebServiceBindingProcessor( - factory, policyFactory, wsFactory, - wsdlFactory, introspector); - staxProcessors.addArtifactProcessor(wsdlProcessor); - } - - public void tearDown() throws Exception { - inputFactory = null; - staxProcessors = null; - policyFactory = null; - factory = null; - mapper = null; - } - - public void testReadWriteComponentType() throws Exception { - InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType"); - ComponentType componentType = staxProcessor.read(is, ComponentType.class); - assertNotNull(componentType); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(componentType, bos); - } - - public void testReadWriteComposite() throws Exception { - InputStream is = getClass().getResourceAsStream("Calculator.composite"); - Composite composite = staxProcessor.read(is, Composite.class); - assertNotNull(composite); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - staxProcessor.write(composite, bos); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator.composite b/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator.composite deleted file mode 100644 index 957ef38753..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator.composite +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/CalculatorImpl.componentType b/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/CalculatorImpl.componentType deleted file mode 100644 index 01121f6771..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/CalculatorImpl.componentType +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/example.wsdl b/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/example.wsdl deleted file mode 100644 index 5e8e5dad0d..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/example.wsdl +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/invalid-stockquote.wsdl b/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/invalid-stockquote.wsdl deleted file mode 100644 index ad81fc7867..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/invalid-stockquote.wsdl +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/ipo.xsd b/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/ipo.xsd deleted file mode 100644 index 241ec15d36..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/ipo.xsd +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - International Purchase order schema for Example.com - Copyright 2000 Example.com. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/stockquote.wsdl b/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/stockquote.wsdl deleted file mode 100644 index 39cd5547d9..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/stockquote.wsdl +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.wsdl b/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.wsdl deleted file mode 100644 index 06bdc5510c..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.wsdl +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.xsd b/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.xsd deleted file mode 100644 index c2210f4a94..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test1.xsd +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test2.wsdl b/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test2.wsdl deleted file mode 100644 index 529b395fd5..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/test2.wsdl +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/unwrapped-stockquote.wsdl b/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/unwrapped-stockquote.wsdl deleted file mode 100644 index 666a7e4069..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/unwrapped-stockquote.wsdl +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/binding-ws/.checkstyle b/branches/sca-java-0.90/modules/binding-ws/.checkstyle deleted file mode 100644 index e3c216986d..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws/.checkstyle +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws/.pmd b/branches/sca-java-0.90/modules/binding-ws/.pmd deleted file mode 100644 index 2db10d6a6a..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws/.pmd +++ /dev/null @@ -1,20 +0,0 @@ - - -truefalse \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/binding-ws/.ruleset b/branches/sca-java-0.90/modules/binding-ws/.ruleset deleted file mode 100644 index ba9b5ce886..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws/DISCLAIMER b/branches/sca-java-0.90/modules/binding-ws/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/binding-ws/LICENSE b/branches/sca-java-0.90/modules/binding-ws/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/binding-ws/NOTICE b/branches/sca-java-0.90/modules/binding-ws/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/binding-ws/pom.xml b/branches/sca-java-0.90/modules/binding-ws/pom.xml deleted file mode 100644 index 46f5663a8b..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws/pom.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - tuscany-binding-ws - Apache Tuscany Web Service Binding Model - - - - org.apache.tuscany.sca - tuscany-assembly - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-interface-wsdl - 0.90-incubating-SNAPSHOT - - - - wsdl4j - wsdl4j - 1.6.2 - - - - - - - apache.ws.zone - Apache WS Zone Repository - http://ws.zones.apache.org/repository2 - - true - - - false - - - - - diff --git a/branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/DefaultWebServiceBindingFactory.java b/branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/DefaultWebServiceBindingFactory.java deleted file mode 100644 index 04f8ab0d3c..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/DefaultWebServiceBindingFactory.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.ws; - -import org.apache.tuscany.sca.binding.ws.impl.WebServiceBindingFactoryImpl; - -/** - * A factory for the WSDL model. - * - * @version $Rev$ $Date$ - */ -public class DefaultWebServiceBindingFactory extends WebServiceBindingFactoryImpl implements WebServiceBindingFactory { - -} diff --git a/branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBinding.java b/branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBinding.java deleted file mode 100644 index ecfd9cfbc7..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBinding.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.ws; - -import javax.wsdl.Port; -import javax.wsdl.Service; -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; - - -/** - * Represents a WebService binding. - * - * @version $Rev$ $Date$ - */ -public interface WebServiceBinding extends Binding { - - /** - * Sets the WSDL location. - * @param location the WSDL location - */ - void setLocation(String location); - - /** - * Returns the WSDL location - * @return the WSDL location - */ - String getLocation(); - - /** - * Returns the name of the WSDL service. - * - * @return the name of the WSDL service - */ - QName getServiceName(); - - /** - * Sets the name of the WSDL service. - * - * @param className the name of the WSDL service - */ - void setServiceName(QName serviceName); - - /** - * Returns the name of the WSDL port. - * - * @return the name of the WSDL port - */ - String getPortName(); - - /** - * Sets the name of the WSDL port. - * - * @param className the name of the WSDL port - */ - void setPortName(String portName); - - /** - * Returns the name of the WSDL binding. - * - * @return the name of the WSDL binding - */ - QName getBindingName(); - - /** - * Sets the name of the WSDL binding. - * - * @param className the name of the WSDL binding - */ - void setBindingName(QName bindingName); - - /** - * Returns the name of the WSDL endpoint. - * - * @return the name of the WSDL endpoint - */ - String getEndpointName(); - - /** - * Sets the name of the WSDL endpoint. - * - * @param className the name of the WSDL endpoint - */ - void setEndpointName(String endpointName); - - /** - * Returns the WSDL service - * @return the WSDL service - */ - Service getService(); - - /** - * Sets the WSDL service. - * @param service the WSDL service - */ - void setService(Service service); - - /** - * Returns the WSDL port - * @return the WSDL port - */ - Port getPort(); - - /** - * Sets the WSDL endpoint - * @param port the WSDL endpoint - */ - void setEndpoint(Port endpoint); - - /** - * Returns the WSDL endpoint - * @return the WSDL endpoint - */ - Port getEndpoint(); - - /** - * Sets the WSDL port - * @param port the WSDL port - */ - void setPort(Port port); - - /** - * Returns the WSDL binding. - * @return the WSDL binding - */ - javax.wsdl.Binding getBinding(); - - /** - * Sets the WSDL binding - * @param binding the WSDL binding - */ - void setBinding(javax.wsdl.Binding binding); - - /** - * Returns the WSDL binding. - * @return the WSDL binding - */ - WSDLDefinition getWSDLDefinition(); - - /** - * Sets the WSDL binding - * @param binding the WSDL binding - */ - void setDefinition(WSDLDefinition wsdlDefinition); - - /** - * Returns the WSDL namespace. - * @return the WSDL namespace - */ - String getNamespace(); - - /** - * Sets the WSDL namespace - * @param namspace the WSDL namspace - */ - void setNamespace(String namespace); - - /** - * Returns true if the model element is unresolved. - * - * @return true if the model element is unresolved. - */ - boolean isUnresolved(); - - /** - * Sets whether the model element is unresolved. - * - * @param unresolved whether the model element is unresolved - */ - void setUnresolved(boolean unresolved); - - InterfaceContract getBindingInterfaceContract(); - - void setBindingInterfaceContract(InterfaceContract bindingInterfaceContract); -} diff --git a/branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBindingFactory.java b/branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBindingFactory.java deleted file mode 100644 index 1ad38c69e4..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/WebServiceBindingFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.ws; - -/** - * Factory for the Web Service binding model. - * - * @version $Rev$ $Date$ - */ -public interface WebServiceBindingFactory { - - /** - * Creates a new WebService binding. - * - * @return a new WebService binding - */ - WebServiceBinding createWebServiceBinding(); - -} diff --git a/branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingFactoryImpl.java b/branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingFactoryImpl.java deleted file mode 100644 index 8902dd04ee..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingFactoryImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.binding.ws.impl; - -import org.apache.tuscany.sca.binding.ws.WebServiceBinding; -import org.apache.tuscany.sca.binding.ws.WebServiceBindingFactory; - -/** - * A factory for the WSDL model. - * - * @version $Rev$ $Date$ - */ -public abstract class WebServiceBindingFactoryImpl implements WebServiceBindingFactory { - - public WebServiceBinding createWebServiceBinding() { - return new WebServiceBindingImpl(); - } - -} diff --git a/branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.java b/branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.java deleted file mode 100644 index 910fb652a8..0000000000 --- a/branches/sca-java-0.90/modules/binding-ws/src/main/java/org/apache/tuscany/sca/binding/ws/impl/WebServiceBindingImpl.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.binding.ws.impl; - -import java.util.ArrayList; -import java.util.List; - -import javax.wsdl.Binding; -import javax.wsdl.Port; -import javax.wsdl.Service; -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.binding.ws.WebServiceBinding; -import org.apache.tuscany.sca.interfacedef.Interface; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; - -/** - * Represents a WebService binding. - * - * @version $Rev$ $Date$ - */ -public class WebServiceBindingImpl implements WebServiceBinding { - private String name; - private String uri; - private List policySets = new ArrayList(); - private List requiredIntents = new ArrayList(); - private boolean unresolved; - private List extensions = new ArrayList(); - - private String location; - private Binding binding; - private Service service; - private Port port; - private Port endpoint; - private QName bindingName; - private String portName; - private QName serviceName; - private String endpointName; - private WSDLDefinition wsdlDefinition; - private String wsdlNamespace; - private InterfaceContract bindingInterfaceContract; - - protected WebServiceBindingImpl() { - } - - public String getName() { - return name; - } - - public String getURI() { - return uri; - } - - public void setName(String name) { - this.name = name; - } - - public void setURI(String uri) { - this.uri = uri; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public List getPolicySets() { - return policySets; - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setUnresolved(boolean unresolved) { - this.unresolved = unresolved; - } - - public List getExtensions() { - return extensions; - } - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public Binding getBinding() { - return binding; - } - - public QName getBindingName() { - if (isUnresolved()) { - return bindingName; - } else if (binding != null) { - return binding.getQName(); - } else { - return null; - } - } - - public String getEndpointName() { - if (isUnresolved()) { - return endpointName; - } else if (endpoint != null) { - //TODO support WSDL 2.0 - return endpoint.getName(); - } else { - return null; - } - } - - public Port getEndpoint() { - return endpoint; - } - - public Port getPort() { - return port; - } - - public String getPortName() { - if (isUnresolved()) { - return portName; - } else if (port != null) { - return port.getName(); - } else { - return null; - } - } - - public Service getService() { - return service; - } - - public QName getServiceName() { - if (isUnresolved()) { - return serviceName; - } else if (service != null) { - return service.getQName(); - } else { - return null; - } - } - - public void setBinding(Binding binding) { - this.binding = binding; - } - - public void setBindingName(QName bindingName) { - if (!isUnresolved()) { - throw new IllegalStateException(); - } - this.bindingName = bindingName; - } - - public void setEndpoint(Port endpoint) { - this.endpoint = endpoint; - } - - public void setEndpointName(String endpointName) { - if (!isUnresolved()) { - throw new IllegalStateException(); - } - this.endpointName = endpointName; - } - - public void setPort(Port port) { - this.port = port; - } - - public void setPortName(String portName) { - if (!isUnresolved()) { - throw new IllegalStateException(); - } - this.portName = portName; - } - - public void setService(Service service) { - this.service = service; - } - - public void setServiceName(QName serviceName) { - if (!isUnresolved()) { - throw new IllegalStateException(); - } - this.serviceName = serviceName; - } - - public WSDLDefinition getWSDLDefinition() { - if (wsdlDefinition == null) { - Interface iface = bindingInterfaceContract.getInterface(); - if (iface instanceof WSDLInterface) { - wsdlDefinition = ((WSDLInterface) iface).getWsdlDefinition(); - } - } - return wsdlDefinition; - } - - public void setDefinition(WSDLDefinition wsdlDefinition) { - this.wsdlDefinition = wsdlDefinition; - } - - public String getNamespace() { - return wsdlNamespace; - } - - public void setNamespace(String namespace) { - this.wsdlNamespace = namespace; - } - - public InterfaceContract getBindingInterfaceContract() { - return bindingInterfaceContract; - } - - public void setBindingInterfaceContract(InterfaceContract bindingInterfaceContract) { - this.bindingInterfaceContract = bindingInterfaceContract; - } - -} diff --git a/branches/sca-java-0.90/modules/commonj-api/DISCLAIMER b/branches/sca-java-0.90/modules/commonj-api/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/commonj-api/LICENSE b/branches/sca-java-0.90/modules/commonj-api/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/commonj-api/NOTICE b/branches/sca-java-0.90/modules/commonj-api/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/commonj-api/pom.xml b/branches/sca-java-0.90/modules/commonj-api/pom.xml deleted file mode 100644 index cf8baa9123..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - org.apache.tuscany - commonj-api - 0.90-incubating-SNAPSHOT - Apache Tuscany Commonj API for Timer and Work Manager - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.4 - 1.4 - - - - install - - diff --git a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/CancelTimerListener.java b/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/CancelTimerListener.java deleted file mode 100644 index ba252e70dc..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/CancelTimerListener.java +++ /dev/null @@ -1,38 +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. - */ - -// -// This source code implements specifications defined by the BEA and IBM. -// For more information, see: -// http://dev2dev.bea.com/technologies/commonj/index.jsp -// or -// http://www.ibm.com/developerworks/library/j-commonj-sdowmt -// -// In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package commonj.timers; - -/** - * @version $Rev$ $Date$ - */ -public interface CancelTimerListener extends TimerListener { - - void timerCancel(Timer timer); - -} diff --git a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/StopTimerListener.java b/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/StopTimerListener.java deleted file mode 100644 index 92defc4bdc..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/StopTimerListener.java +++ /dev/null @@ -1,38 +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. - */ - -// -// This source code implements specifications defined by the BEA and IBM. -// For more information, see: -// http://dev2dev.bea.com/technologies/commonj/index.jsp -// or -// http://www.ibm.com/developerworks/library/j-commonj-sdowmt -// -// In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package commonj.timers; - -/** - * @version $Rev$ $Date$ - */ -public interface StopTimerListener extends TimerListener { - - void timerStop(Timer timer); - -} diff --git a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/Timer.java b/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/Timer.java deleted file mode 100644 index 0a5c3b65fb..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/Timer.java +++ /dev/null @@ -1,41 +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. - */ - -// -// This source code implements specifications defined by the BEA and IBM. -// For more information, see: -// http://dev2dev.bea.com/technologies/commonj/index.jsp -// or -// http://www.ibm.com/developerworks/library/j-commonj-sdowmt -// -// In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package commonj.timers; - -/** - * @version $Rev$ $Date$ - */ -public interface Timer { - - boolean cancel(); - long getPeriod(); - long getScheduledExecutionTime() throws IllegalStateException; - TimerListener getTimerListener(); - -} diff --git a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/TimerListener.java b/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/TimerListener.java deleted file mode 100644 index 6e3733b5f4..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/TimerListener.java +++ /dev/null @@ -1,38 +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. - */ - -// -// This source code implements specifications defined by the BEA and IBM. -// For more information, see: -// http://dev2dev.bea.com/technologies/commonj/index.jsp -// or -// http://www.ibm.com/developerworks/library/j-commonj-sdowmt -// -// In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package commonj.timers; - -/** - * @version $Rev$ $Date$ - */ -public interface TimerListener { - - void timerExpired(Timer timer); - -} diff --git a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/TimerManager.java b/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/TimerManager.java deleted file mode 100644 index c07b6478d5..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/timers/TimerManager.java +++ /dev/null @@ -1,79 +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. - */ - -// -// This source code implements specifications defined by the BEA and IBM. -// For more information, see: -// http://dev2dev.bea.com/technologies/commonj/index.jsp -// or -// http://www.ibm.com/developerworks/library/j-commonj-sdowmt -// -// In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package commonj.timers; - -import java.util.Date; - -/** - * @version $Rev$ $Date$ - */ -public interface TimerManager { - - static final long IMMEDIATE = 0; - static final long INDEFINITE = java.lang.Long.MAX_VALUE; - - boolean isStopped(); - - boolean isStopping(); - - boolean isSuspended() throws IllegalStateException; - - boolean isSuspending() throws IllegalStateException; - - void resume() throws IllegalStateException; - - Timer schedule(TimerListener listener, long delayInMillis) - throws IllegalStateException, IllegalArgumentException; - - Timer schedule(TimerListener listener, long delayInMillis, long repeatIntervalInMillis) - throws IllegalStateException, IllegalArgumentException; - - Timer schedule(TimerListener listener, Date scheduleDate) - throws IllegalStateException, IllegalArgumentException; - - Timer schedule(TimerListener listener, Date scheduleDate, long repeatIntervalInMillis) - throws IllegalStateException, IllegalArgumentException; - - Timer scheduleAtFixedRate(TimerListener listener, long delayInMillis, long repeatIntervalInMillis) - throws IllegalStateException, IllegalArgumentException; - - Timer scheduleAtFixedRate(TimerListener listener, Date scheduleDate, long repeatIntervalInMillis) - throws IllegalStateException, IllegalArgumentException; - - void stop() throws IllegalStateException; - - void suspend() throws IllegalStateException; - - boolean waitForStop(long timeOut) - throws InterruptedException, IllegalArgumentException; - - boolean waitForSuspend(long timOut) - throws InterruptedException, IllegalStateException, IllegalArgumentException; - -} diff --git a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/RemoteWorkItem.java b/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/RemoteWorkItem.java deleted file mode 100644 index f079dce312..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/RemoteWorkItem.java +++ /dev/null @@ -1,39 +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. - */ - -// -// This source code implements specifications defined by the BEA and IBM. -// For more information, see: -// http://dev2dev.bea.com/technologies/commonj/index.jsp -// or -// http://www.ibm.com/developerworks/library/j-commonj-sdowmt -// -// In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package commonj.work; - -/** - * @version $Rev$ $Date$ - */ -public interface RemoteWorkItem extends WorkItem { - - WorkManager getPinnedWorkManager(); - void release(); - -} diff --git a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/Work.java b/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/Work.java deleted file mode 100644 index 1071fe4a2e..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/Work.java +++ /dev/null @@ -1,39 +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. - */ - -// -// This source code implements specifications defined by the BEA and IBM. -// For more information, see: -// http://dev2dev.bea.com/technologies/commonj/index.jsp -// or -// http://www.ibm.com/developerworks/library/j-commonj-sdowmt -// -// In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package commonj.work; - -/** - * @version $Rev$ $Date$ - */ -public interface Work extends Runnable { - - boolean isDaemon(); - void release(); - -} diff --git a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkCompletedException.java b/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkCompletedException.java deleted file mode 100644 index 21786c4b99..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkCompletedException.java +++ /dev/null @@ -1,73 +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. - */ - -// -// This source code implements specifications defined by the BEA and IBM. -// For more information, see: -// http://dev2dev.bea.com/technologies/commonj/index.jsp -// or -// http://www.ibm.com/developerworks/library/j-commonj-sdowmt -// -// In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package commonj.work; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * @version $Rev$ $Date$ - */ -public class WorkCompletedException extends WorkException { - private static final long serialVersionUID = 1L; - - private final List exceptionList; - - public WorkCompletedException() { - super(); - exceptionList = Collections.EMPTY_LIST; - } - public WorkCompletedException(String message) { - super(message); - exceptionList = Collections.EMPTY_LIST; - } - public WorkCompletedException(String message, Throwable cause) { - super(message, cause); - exceptionList = Collections.singletonList(cause); - } - public WorkCompletedException(Throwable cause) { - super(cause); - exceptionList = Collections.singletonList(cause); - } - public WorkCompletedException(String message, List list) { - super(message); - if ((list != null) && (list.size() > 0)) { - initCause((Throwable) list.get(0)); - exceptionList = Collections.unmodifiableList(new ArrayList(list)); - } else { - exceptionList = Collections.EMPTY_LIST; - } - } - - public List getExceptionList() { - return exceptionList; - } - -} diff --git a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkEvent.java b/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkEvent.java deleted file mode 100644 index 9a7814b860..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkEvent.java +++ /dev/null @@ -1,45 +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. - */ - -// -// This source code implements specifications defined by the BEA and IBM. -// For more information, see: -// http://dev2dev.bea.com/technologies/commonj/index.jsp -// or -// http://www.ibm.com/developerworks/library/j-commonj-sdowmt -// -// In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package commonj.work; - -/** - * @version $Rev$ $Date$ - */ -public interface WorkEvent { - - static final int WORK_ACCEPTED = 1; - static final int WORK_REJECTED = 2; - static final int WORK_STARTED = 3; - static final int WORK_COMPLETED = 4; - - WorkException getException(); - int getType(); - WorkItem getWorkItem(); - -} diff --git a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkException.java b/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkException.java deleted file mode 100644 index 3d24ec1055..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkException.java +++ /dev/null @@ -1,50 +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. - */ - -// -// This source code implements specifications defined by the BEA and IBM. -// For more information, see: -// http://dev2dev.bea.com/technologies/commonj/index.jsp -// or -// http://www.ibm.com/developerworks/library/j-commonj-sdowmt -// -// In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package commonj.work; - -/** - * @version $Rev$ $Date$ - */ -public class WorkException extends Exception { - private static final long serialVersionUID = 1L; - - public WorkException() { - super(); - } - public WorkException(String message) { - super(message); - } - public WorkException(String message, Throwable cause) { - super(message, cause); - } - public WorkException(Throwable cause) { - super(cause); - } - -} diff --git a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkItem.java b/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkItem.java deleted file mode 100644 index 6b8d3185a1..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkItem.java +++ /dev/null @@ -1,39 +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. - */ - -// -// This source code implements specifications defined by the BEA and IBM. -// For more information, see: -// http://dev2dev.bea.com/technologies/commonj/index.jsp -// or -// http://www.ibm.com/developerworks/library/j-commonj-sdowmt -// -// In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package commonj.work; - -/** - * @version $Rev$ $Date$ - */ -public interface WorkItem extends Comparable { - - Work getResult() throws WorkException; - int getStatus(); - -} diff --git a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkListener.java b/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkListener.java deleted file mode 100644 index 9b523f7321..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkListener.java +++ /dev/null @@ -1,44 +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. - */ - -// -// This source code implements specifications defined by the BEA and IBM. -// For more information, see: -// http://dev2dev.bea.com/technologies/commonj/index.jsp -// or -// http://www.ibm.com/developerworks/library/j-commonj-sdowmt -// -// In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package commonj.work; - -/** - * @version $Rev$ $Date$ - */ -public interface WorkListener { - - static long IMMEDIATE = 0; - static long INDEFINITE = java.lang.Long.MAX_VALUE; - - void workAccepted(WorkEvent event); - void workCompleted(WorkEvent event); - void workRejected(WorkEvent event); - void workStarted(WorkEvent event); - -} diff --git a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkManager.java b/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkManager.java deleted file mode 100644 index 2c4167d24c..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkManager.java +++ /dev/null @@ -1,51 +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. - */ - -// -// This source code implements specifications defined by the BEA and IBM. -// For more information, see: -// http://dev2dev.bea.com/technologies/commonj/index.jsp -// or -// http://www.ibm.com/developerworks/library/j-commonj-sdowmt -// -// In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package commonj.work; - -import java.util.Collection; - -/** - * @version $Rev$ $Date$ - */ -public interface WorkManager { - - static final long IMMEDIATE = 0; - static final long INDEFINITE = java.lang.Long.MAX_VALUE; - - WorkItem schedule(Work work) throws WorkException, IllegalArgumentException; - - WorkItem schedule(Work work, WorkListener listener) throws WorkException, IllegalArgumentException; - - boolean waitForAll(Collection workItems, long timeout) - throws InterruptedException, IllegalArgumentException; - - Collection waitForAny(Collection workItems, long timeout) - throws InterruptedException, IllegalArgumentException; - -} diff --git a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkRejectedException.java b/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkRejectedException.java deleted file mode 100644 index cee8ea588a..0000000000 --- a/branches/sca-java-0.90/modules/commonj-api/src/main/java/commonj/work/WorkRejectedException.java +++ /dev/null @@ -1,50 +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. - */ - -// -// This source code implements specifications defined by the BEA and IBM. -// For more information, see: -// http://dev2dev.bea.com/technologies/commonj/index.jsp -// or -// http://www.ibm.com/developerworks/library/j-commonj-sdowmt -// -// In order to remain compliant with the specification -// DO NOT add / change / or delete method signatures! -// - -package commonj.work; - -/** - * @version $Rev$ $Date$ - */ -public class WorkRejectedException extends WorkException { - private static final long serialVersionUID = 1L; - - public WorkRejectedException() { - super(); - } - public WorkRejectedException(String message) { - super(message); - } - public WorkRejectedException(String message, Throwable cause) { - super(message, cause); - } - public WorkRejectedException(Throwable cause) { - super(cause); - } - -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/.checkstyle b/branches/sca-java-0.90/modules/contribution-impl/.checkstyle deleted file mode 100644 index ace5fe6f53..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/.checkstyle +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/branches/sca-java-0.90/modules/contribution-impl/.pmd b/branches/sca-java-0.90/modules/contribution-impl/.pmd deleted file mode 100644 index 84af2f4d5d..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/.pmd +++ /dev/null @@ -1,20 +0,0 @@ - - -true diff --git a/branches/sca-java-0.90/modules/contribution-impl/.ruleset b/branches/sca-java-0.90/modules/contribution-impl/.ruleset deleted file mode 100644 index ac8671859d..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/contribution-impl/DISCLAIMER b/branches/sca-java-0.90/modules/contribution-impl/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/contribution-impl/LICENSE b/branches/sca-java-0.90/modules/contribution-impl/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/contribution-impl/NOTICE b/branches/sca-java-0.90/modules/contribution-impl/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/contribution-impl/pom.xml b/branches/sca-java-0.90/modules/contribution-impl/pom.xml deleted file mode 100644 index 9dbc9bb569..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - tuscany-contribution-impl - Apache Tuscany SCA Contribution Service Implementation - - - - org.apache.tuscany.sca - tuscany-contribution - 0.90-incubating-SNAPSHOT - - - - org.codehaus.woodstox - wstx-asl - 3.2.0 - runtime - - - diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java deleted file mode 100644 index daf9f2289f..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ArtifactImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.impl; - -import org.apache.tuscany.sca.contribution.Artifact; - - -/** - * Base Artifact interface to accomodate common properties between Contribution and Deployed Artifact - * - * @version $Rev$ $Date$ - */ -public abstract class ArtifactImpl implements Artifact { - private String uri; - private String location; - - protected ArtifactImpl() { - } - - public String getLocation() { - return this.location; - } - - public void setLocation(String location) { - this.location = location; - } - - public String getURI() { - return this.uri; - } - - public void setURI(String uri) { - this.uri = uri; - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionExportImpl.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionExportImpl.java deleted file mode 100644 index 90bde0f67e..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionExportImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.impl; - -import org.apache.tuscany.sca.contribution.ContributionExport; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; - -/** - * The representation of an export for the contribution - * - * @version $Rev$ $Date$ - */ -public class ContributionExportImpl implements ContributionExport { - private String namespace; // The namespace to be imported - private ModelResolver modelResolver; - - protected ContributionExportImpl() { - } - - public String getNamespace() { - return namespace; - } - - public void setNamespace(String namespace) { - this.namespace = namespace; - } - - public ModelResolver getModelResolver() { - return modelResolver; - } - - public void setModelResolver(ModelResolver modelResolver) { - this.modelResolver = modelResolver; - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java deleted file mode 100644 index a349939a0e..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionFactoryImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.impl; - -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.ContributionExport; -import org.apache.tuscany.sca.contribution.ContributionFactory; -import org.apache.tuscany.sca.contribution.ContributionImport; -import org.apache.tuscany.sca.contribution.DeployedArtifact; - - -/** - * Contribution model object factory - * - * @version $Rev$ $Date$ - */ -public class ContributionFactoryImpl implements ContributionFactory { - - public Contribution createContribution() { - return new ContributionImpl(); - } - - public DeployedArtifact createDeployedArtifact() { - return new DeployedArtifactImpl(); - } - - public ContributionImport createContributionImport() { - return new ContributionImportImpl(); - } - - public ContributionExport createContributionExport() { - return new ContributionExportImpl(); - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java deleted file mode 100644 index 8d246eaf1c..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.ContributionExport; -import org.apache.tuscany.sca.contribution.ContributionImport; -import org.apache.tuscany.sca.contribution.DeployedArtifact; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; - -/** - * The representation of a deployed contribution - * - * @version $Rev: 531146 $ $Date: 2007-04-21 22:40:50 -0700 (Sat, 21 Apr 2007) $ - */ -public class ContributionImpl extends ArtifactImpl implements Contribution { - private List exports = new ArrayList(); - private List imports = new ArrayList(); - private List deployables = new ArrayList(); - private ModelResolver modelResolver; - - /** - * A list of artifacts in the contribution - */ - private List artifacts = new ArrayList(); - - protected ContributionImpl() { - } - - public List getExports() { - return exports; - } - - public List getImports() { - return imports; - } - - public List getDeployables() { - return deployables; - } - - public List getArtifacts() { - return artifacts; - } - - public ModelResolver getModelResolver() { - return modelResolver; - } - - public void setModelResolver(ModelResolver modelResolver) { - this.modelResolver = modelResolver; - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImportImpl.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImportImpl.java deleted file mode 100644 index 3f241ff3d0..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/ContributionImportImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.impl; - -import org.apache.tuscany.sca.contribution.ContributionImport; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; - -/** - * The representation of an import for the contribution - * - * @version $Rev: 527398 $ $Date: 2007-04-10 23:43:31 -0700 (Tue, 10 Apr 2007) $ - */ -public class ContributionImportImpl implements ContributionImport { - private String namespace; // The namespace to be imported - private String location; // Optional location to hint the where it should be imported - private ModelResolver modelResolver; - - protected ContributionImportImpl() { - } - - public String getLocation() { - return location; - } - - public void setLocation(String location) { - this.location = location; - } - - public String getNamespace() { - return namespace; - } - - public void setNamespace(String namespace) { - this.namespace = namespace; - } - - public ModelResolver getModelResolver() { - return modelResolver; - } - - public void setModelResolver(ModelResolver modelResolver) { - this.modelResolver = modelResolver; - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/DeployedArtifactImpl.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/DeployedArtifactImpl.java deleted file mode 100644 index 1d9bb04114..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/impl/DeployedArtifactImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.impl; - -import org.apache.tuscany.sca.contribution.DeployedArtifact; - -/** - * Representation of a deployed artifact - * - * @version $Rev: 527398 $ $Date: 2007-04-10 23:43:31 -0700 (Tue, 10 Apr 2007) $ - */ -public class DeployedArtifactImpl extends ArtifactImpl implements DeployedArtifact { - private Object modelObject; - - protected DeployedArtifactImpl() { - super(); - } - - public Object getModel() { - return modelObject; - } - - public void setModel(Object modelObject) { - this.modelObject = modelObject; - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/FolderContributionProcessor.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/FolderContributionProcessor.java deleted file mode 100644 index 5e22363f41..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/FolderContributionProcessor.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.processor.impl; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.contribution.ContentType; -import org.apache.tuscany.sca.contribution.processor.PackageProcessor; -import org.apache.tuscany.sca.contribution.service.ContributionException; -import org.apache.tuscany.sca.contribution.service.util.FileHelper; - -/** - * Folder contribution package processor - * - * @version $Rev$ $Date$ - */ -public class FolderContributionProcessor implements PackageProcessor { - /** - * Package-type that this package processor can handle - */ - public static final String PACKAGE_TYPE = ContentType.FOLDER; - - public FolderContributionProcessor() { - } - - public String getPackageType() { - return PACKAGE_TYPE; - } - - /** - * Recursively traverse a root directory - * - * @param fileList - * @param file - * @throws IOException - */ - private void traverse(List fileList, File file, File root) throws IOException { - if (file.isFile()) { - fileList.add(root.toURI().relativize(file.toURI())); - } else if (file.isDirectory()) { - // FIXME: Maybe we should externalize it as a property - // Regular expression to exclude .xxx files - File[] files = file.listFiles(FileHelper.getFileFilter("[^\u002e].*", true)); - for (int i = 0; i < files.length; i++) { - traverse(fileList, files[i], root); - } - } - } - - public URL getArtifactURL(URL sourceURL, URI artifact) throws MalformedURLException { - return new URL(sourceURL, artifact.toString()); - } - - /** - * Get a list of artifact URI from the folder - * - * @return The list of artifact URI for the folder - * @throws IOException - */ - public List getArtifacts(URL packageSourceURL, InputStream inputStream) throws ContributionException, - IOException { - if (packageSourceURL == null) { - throw new IllegalArgumentException("Invalid null package source URL."); - } - - List artifacts = new ArrayList(); - - // Assume the root is a jar file - File rootFolder; - - try { - rootFolder = new File(packageSourceURL.toURI()); - if (rootFolder.isDirectory()) { - if (!rootFolder.exists()) { - throw new InvalidFolderContributionException(rootFolder.getAbsolutePath()); - } - - this.traverse(artifacts, rootFolder, rootFolder); - } - - } catch (URISyntaxException e) { - throw new InvalidFolderContributionURIException(packageSourceURL.toExternalForm(), e); - } - - return artifacts; - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/InvalidFolderContributionException.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/InvalidFolderContributionException.java deleted file mode 100644 index 6dbab56553..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/InvalidFolderContributionException.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.processor.impl; - -import org.apache.tuscany.sca.contribution.service.ContributionException; - -/** - * Exception that indicates that the supplied XML Document invalid. - * - */ -public class InvalidFolderContributionException extends ContributionException { - - /** - * - */ - private static final long serialVersionUID = 1564255850052593282L; - - protected InvalidFolderContributionException(String componentDefinitionLocatoin) { - super(componentDefinitionLocatoin); - } - - protected InvalidFolderContributionException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/InvalidFolderContributionURIException.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/InvalidFolderContributionURIException.java deleted file mode 100644 index 8022834438..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/InvalidFolderContributionURIException.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.processor.impl; - -import org.apache.tuscany.sca.contribution.service.ContributionException; - -/** - * Exception that indicates that the supplied XML Document invalid. - * - */ -public class InvalidFolderContributionURIException extends ContributionException { - - /** - * - */ - private static final long serialVersionUID = 1564255850052593282L; - - protected InvalidFolderContributionURIException(String componentDefinitionLocatoin) { - super(componentDefinitionLocatoin); - } - - protected InvalidFolderContributionURIException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/JarContributionProcessor.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/JarContributionProcessor.java deleted file mode 100644 index 4ffec693d0..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/processor/impl/JarContributionProcessor.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.processor.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.jar.JarEntry; -import java.util.jar.JarInputStream; - -import org.apache.tuscany.sca.contribution.ContentType; -import org.apache.tuscany.sca.contribution.processor.PackageProcessor; -import org.apache.tuscany.sca.contribution.service.ContributionException; - -/** - * Jar Contribution package processor - * - * @version $Rev$ $Date$ - */ -public class JarContributionProcessor implements PackageProcessor { - /** - * Package-type that this package processor can handle - */ - public static final String PACKAGE_TYPE = ContentType.JAR; - - public JarContributionProcessor() { - } - - public String getPackageType() { - return PACKAGE_TYPE; - } - - public URL getArtifactURL(URL sourceURL, URI artifact) throws MalformedURLException { - if (sourceURL.toString().startsWith("jar:")) { - return new URL(sourceURL, artifact.toString()); - } else { - return new URL("jar:" + sourceURL.toExternalForm() + "!/" + artifact); - } - } - - public List getArtifacts(URL packageSourceURL, InputStream inputStream) throws ContributionException, - IOException { - if (packageSourceURL == null) { - throw new IllegalArgumentException("Invalid null package source URL."); - } - - if (inputStream == null) { - throw new IllegalArgumentException("Invalid null source inputstream."); - } - - List artifacts = new ArrayList(); - - // Assume the root is a jar file - JarInputStream jar = new JarInputStream(inputStream); - try { - while (true) { - JarEntry entry = jar.getNextJarEntry(); - if (entry == null) { - // EOF - break; - } - if (entry.isDirectory()) { - continue; - } - - // FIXME: Maybe we should externalize the filter as a property - if (!entry.getName().startsWith(".")) { - artifacts.add(URI.create(entry.getName())); - } - } - } finally { - jar.close(); - } - return artifacts; - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/resolver/impl/ModelResolverImpl.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/resolver/impl/ModelResolverImpl.java deleted file mode 100644 index ffc82b908f..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/resolver/impl/ModelResolverImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.resolver.impl; - -import java.lang.ref.WeakReference; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.sca.contribution.resolver.ClassReference; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; - -/** - * A default implementation of an artifact resolver, based on a map. - * - * @version $Rev$ $Date$ - */ -public class ModelResolverImpl implements ModelResolver { - private static final long serialVersionUID = -7826976465762296634L; - - private Map map = new HashMap(); - - private WeakReference classLoader; - - public ModelResolverImpl(ClassLoader classLoader) { - this.classLoader = new WeakReference(classLoader); - } - - public T resolveModel(Class modelClass, T unresolved) { - Object resolved = map.get(unresolved); - if (resolved != null) { - - // Return the resolved object - return modelClass.cast(resolved); - - } else if (unresolved instanceof ClassReference) { - - // Load a class on demand - ClassReference classReference = (ClassReference)unresolved; - Class clazz; - try { - clazz = Class.forName(classReference.getClassName(), true, classLoader.get()); - } catch (ClassNotFoundException e) { - - // Return the unresolved object - return unresolved; - } - - // Store a new ClassReference wrappering the loaded class - resolved = new ClassReference(clazz); - map.put(resolved, resolved); - - // Return the resolved ClassReference - return modelClass.cast(resolved); - - } else { - - // Return the unresolved object - return unresolved; - } - } - - public void addModel(Object resolved) { - map.put(resolved, resolved); - } - - public Object removeModel(Object resolved) { - return map.remove(resolved); - } - -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ArtifactTypeDescriberImpl.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ArtifactTypeDescriberImpl.java deleted file mode 100644 index 174a09a0c6..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ArtifactTypeDescriberImpl.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.service.impl; - -import java.io.IOException; -import java.net.URL; -import java.net.URLConnection; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.sca.contribution.ContentType; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.service.TypeDescriber; -import org.apache.tuscany.sca.contribution.service.util.FileHelper; - -/** - * Implementation of the content describer for files - * - * @version $Rev$ $Date$ - */ -public class ArtifactTypeDescriberImpl implements TypeDescriber { - private final Map contentTypeRegistry = new HashMap(); - - public ArtifactTypeDescriberImpl() { - super(); - init(); - } - - /** - * Initialize contentType registry with know types based on known file extensions - */ - private void init() { - contentTypeRegistry.put("COMPOSITE", ContentType.COMPOSITE); - contentTypeRegistry.put("SCDL", ContentType.COMPOSITE); - contentTypeRegistry.put("WSDL", ContentType.WSDL); - contentTypeRegistry.put("JAR", ContentType.JAR); - } - - protected String resolveContentyTypeByExtension(URL resourceURL) { - String artifactExtension = FileHelper.getExtension(resourceURL.getPath()); - if (artifactExtension == null) { - return null; - } - return contentTypeRegistry.get(artifactExtension.toUpperCase()); - } - - /** - * Build contentType for a specific resource. We first check if the file is - * a supported one (looking into our registry based on resource extension) - * If not found, we try to check file contentType Or we return - * defaultContentType provided - * - * @param resourceURL The artifact url - * @param defaultContentType The default content type if we can't find the correc one - * @return The content type - */ - public String getType(URL resourceURL, String defaultContentType) { - URLConnection connection = null; - String contentType = defaultContentType; - - if (resourceURL.getProtocol().equals("file") && FileHelper.toFile(resourceURL).isDirectory()) { - // Special case : contribution is a folder - contentType = ContentType.FOLDER; - } else if (resourceURL.toExternalForm().endsWith(Contribution.SCA_CONTRIBUTION_META) - || resourceURL.toExternalForm().endsWith(Contribution.SCA_CONTRIBUTION_GENERATED_META)) { - // Special case : contribution metadata - contentType = ContentType.CONTRIBUTION_METADATA; - } else { - contentType = resolveContentyTypeByExtension(resourceURL); - if (contentType == null) { - try { - connection = resourceURL.openConnection(); - contentType = connection.getContentType(); - - if (contentType == null || contentType.equals("content/unknown")) { - // here we couldn't figure out from our registry or from URL and it's not a special file - // return defaultContentType if provided - contentType = defaultContentType; - } - } catch (IOException io) { - // could not access artifact, just ignore and we will return - // null contentType - } - } - } - return contentType == null ? defaultContentType : contentType; - } - -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionMetadataLoaderImpl.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionMetadataLoaderImpl.java deleted file mode 100644 index a089756308..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionMetadataLoaderImpl.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.service.impl; - -import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.ContributionExport; -import org.apache.tuscany.sca.contribution.ContributionFactory; -import org.apache.tuscany.sca.contribution.ContributionImport; -import org.apache.tuscany.sca.contribution.service.ContributionMetadataLoader; -import org.apache.tuscany.sca.contribution.service.ContributionMetadataLoaderException; - -/** - * Loader that handles contribution metadata files - * - * @version $Rev: 515261 $ $Date: 2007-03-06 11:22:46 -0800 (Tue, 06 Mar 2007) $ - */ -public class ContributionMetadataLoaderImpl implements ContributionMetadataLoader { - private static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0"; - private static final String TARGET_NAMESPACE = "targetNamespace"; - - private static final QName CONTRIBUTION = new QName(SCA10_NS, "contribution"); - private static final QName DEPLOYABLE = new QName(SCA10_NS, "deployable"); - private static final QName IMPORT = new QName(SCA10_NS, "import"); - private static final QName EXPORT = new QName(SCA10_NS, "export"); - - private final AssemblyFactory assemblyFactory; - private final ContributionFactory contributionFactory; - - public ContributionMetadataLoaderImpl(AssemblyFactory assemblyFactory, ContributionFactory contributionFactory) { - super(); - this.assemblyFactory = assemblyFactory; - this.contributionFactory = contributionFactory; - } - - public QName getXMLType() { - return CONTRIBUTION; - } - - public void load(Contribution contribution, XMLStreamReader reader) throws XMLStreamException, ContributionMetadataLoaderException { - String targetNameSpaceURI = null; - - while (true) { - int event = reader.next(); - switch (event) { - case START_ELEMENT: - QName element = reader.getName(); - if (CONTRIBUTION.equals(element)) { - targetNameSpaceURI = reader.getAttributeValue(null, TARGET_NAMESPACE); - } else if (DEPLOYABLE.equals(element)) { - String name = reader.getAttributeValue(null, "composite"); - if (name == null) { - throw new InvalidValueException("Attribute 'composite' is missing"); - } - QName compositeName = null; - - int index = name.indexOf(':'); - if (index != -1) { - String prefix = name.substring(0, index); - String localPart = name.substring(index + 1); - String ns = reader.getNamespaceContext().getNamespaceURI(prefix); - if (ns == null) { - throw new InvalidValueException("Invalid prefix: " + prefix); - } - compositeName = new QName(targetNameSpaceURI, localPart, prefix); - } else { - String prefix = ""; - String localPart = name; - compositeName = new QName(targetNameSpaceURI, localPart, prefix); - } - - Composite composite = assemblyFactory.createComposite(); - composite.setName(compositeName); - composite.setUnresolved(true); - - contribution.getDeployables().add(composite); - } else if (IMPORT.equals(element)) { - String ns = reader.getAttributeValue(null, "namespace"); - if (ns == null) { - throw new InvalidValueException("Attribute 'namespace' is missing"); - } - String location = reader.getAttributeValue(null, "location"); - ContributionImport contributionImport = this.contributionFactory.createContributionImport(); - if (location != null) { - contributionImport.setLocation(location); - } - contributionImport.setNamespace(ns); - contribution.getImports().add(contributionImport); - } else if (EXPORT.equals(element)) { - String ns = reader.getAttributeValue(null, "namespace"); - if (ns == null) { - throw new InvalidValueException("Attribute 'namespace' is missing"); - } - ContributionExport contributionExport = this.contributionFactory.createContributionExport(); - contributionExport.setNamespace(ns); - contribution.getExports().add(contributionExport); - } - break; - case XMLStreamConstants.END_ELEMENT: - if (CONTRIBUTION.equals(reader.getName())) { - return; - } - break; - - } - } - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionRepositoryImpl.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionRepositoryImpl.java deleted file mode 100644 index e2dc89782d..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionRepositoryImpl.java +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.service.impl; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.contribution.service.ContributionRepository; -import org.apache.tuscany.sca.contribution.service.util.FileHelper; -import org.apache.tuscany.sca.contribution.service.util.IOHelper; - -/** - * The default implementation of ContributionRepository - * - * @version $Rev$ $Date$ - */ -public class ContributionRepositoryImpl implements ContributionRepository { - private static final String NS = "http://tuscany.apache.org/xmlns/1.0-SNAPSHOT"; - private static final String DOMAIN_INDEX_FILENAME = "sca-domain.xml"; - private final File rootFile; - private Map contributionMap = new HashMap(); - - private URI domain; - private XMLInputFactory factory; - - /** - * Constructor with repository root - * - * @param repository - */ - public ContributionRepositoryImpl(final String repository) throws IOException { - String root = repository; - if (repository == null) { - root = AccessController.doPrivileged(new PrivilegedAction() { - public String run() { - // Default to /.tuscany/domains/local/ - String userHome = System.getProperty("user.home"); - String slash = File.separator; - return userHome + slash + ".tuscany" + slash + "domains" + slash + "local" + slash; - } - }); - } - this.rootFile = new File(root); - this.domain = rootFile.toURI(); - FileHelper.forceMkdir(rootFile); - if (!rootFile.exists() || !rootFile.isDirectory() || !rootFile.canRead()) { - throw new IOException("The root is not a directory: " + repository); - } - factory = XMLInputFactory.newInstance("javax.xml.stream.XMLInputFactory", getClass().getClassLoader()); - } - - public URI getDomain() { - return domain; - } - - /** - * Resolve contribution location in the repository -> root repository / - * contribution file -> contribution group id / artifact id / version - * - * @param contribution - * @return - */ - private File mapToFile(URL sourceURL) { - String fileName = FileHelper.toFile(sourceURL).getName(); - return new File(rootFile, "contributions" + File.separator + fileName); - } - - /** - * Write a specific source inputstream to a file on disk - * - * @param source contents of the file to be written to disk - * @param target file to be written - * @throws IOException - */ - public static void copy(InputStream source, File target) throws IOException { - BufferedOutputStream out = null; - BufferedInputStream in = null; - - try { - out = new BufferedOutputStream(new FileOutputStream(target)); - in = new BufferedInputStream(source); - IOHelper.copy(in, out); - } finally { - IOHelper.closeQuietly(out); - IOHelper.closeQuietly(in); - } - } - - public URL store(String contribution, URL sourceURL, InputStream contributionStream) throws IOException { - // where the file should be stored in the repository - File location = mapToFile(sourceURL); - FileHelper.forceMkdir(location.getParentFile()); - - copy(contributionStream, location); - - // add contribution to repositoryContent - URL contributionURL = location.toURL(); - URI relative = rootFile.toURI().relativize(location.toURI()); - contributionMap.put(contribution, relative.toString()); - saveMap(); - - return contributionURL; - } - - public URL store(String contribution, URL sourceURL) throws IOException { - // where the file should be stored in the repository - File location = mapToFile(sourceURL); - File source = FileHelper.toFile(sourceURL); - if (source == null || source.isFile()) { - InputStream is = sourceURL.openStream(); - try { - return store(contribution, sourceURL, is); - } finally { - IOHelper.closeQuietly(is); - } - } - - FileHelper.forceMkdir(location); - FileHelper.copyDirectory(source, location); - - // add contribution to repositoryContent - URI relative = rootFile.toURI().relativize(location.toURI()); - contributionMap.put(contribution, relative.toString()); - saveMap(); - - return location.toURL(); - } - - public URL find(String contribution) { - if (contribution == null) { - return null; - } - String location = contributionMap.get(contribution); - if (location == null) { - return null; - } - try { - return new File(rootFile, location).toURL(); - } catch (MalformedURLException e) { - // Should not happen - throw new AssertionError(e); - } - } - - public void remove(String contribution) { - URL contributionURL = this.find(contribution); - if (contributionURL != null) { - // remove - try { - FileHelper.forceDelete(FileHelper.toFile(contributionURL)); - this.contributionMap.remove(contribution); - saveMap(); - } catch (IOException ioe) { - // handle file could not be removed - } - } - } - - public List list() { - return new ArrayList(contributionMap.keySet()); - } - - public void init() { - File domainFile = new File(rootFile, "sca-domain.xml"); - if (!domainFile.isFile()) { - return; - } - FileInputStream is; - try { - is = new FileInputStream(domainFile); - } catch (FileNotFoundException e) { - return; - } - try { - XMLStreamReader reader = factory.createXMLStreamReader(new InputStreamReader(is, "UTF-8")); - while (reader.hasNext()) { - switch (reader.getEventType()) { - case XMLStreamConstants.START_ELEMENT: - String name = reader.getName().getLocalPart(); - if ("domain".equals(name)) { - String uri = reader.getAttributeValue(null, "uri"); - if (uri != null) { - domain = URI.create(uri); - } - } - if ("contribution".equals(name)) { - String uri = reader.getAttributeValue(null, "uri"); - String location = reader.getAttributeValue(null, "location"); - contributionMap.put(uri, location); - } - break; - default: - break; - } - reader.next(); - } - } catch (Exception e) { - // Ignore - } finally { - IOHelper.closeQuietly(is); - } - } - - private void saveMap() { - File domainFile = new File(rootFile, DOMAIN_INDEX_FILENAME); - FileOutputStream os = null; - try { - os = new FileOutputStream(domainFile); - PrintWriter writer = new PrintWriter(new OutputStreamWriter(os, "UTF-8")); - writer.println(""); - writer.println(""); - for (Map.Entry e : contributionMap.entrySet()) { - writer.println(" "); - } - writer.println(""); - writer.flush(); - } catch (IOException e) { - throw new IllegalArgumentException(e); - } finally { - IOHelper.closeQuietly(os); - } - } - - public void destroy() { - } - -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionServiceImpl.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionServiceImpl.java deleted file mode 100644 index 196c9bc15a..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/ContributionServiceImpl.java +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.service.impl; - -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.ContributionFactory; -import org.apache.tuscany.sca.contribution.DeployedArtifact; -import org.apache.tuscany.sca.contribution.processor.PackageProcessor; -import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionException; -import org.apache.tuscany.sca.contribution.service.ContributionMetadataLoaderException; -import org.apache.tuscany.sca.contribution.service.ContributionRepository; -import org.apache.tuscany.sca.contribution.service.ContributionService; -import org.apache.tuscany.sca.contribution.service.util.IOHelper; - -/** - * Service interface that manages artifacts contributed to a Tuscany runtime. - * - * @version $Rev$ $Date$ - */ -public class ContributionServiceImpl implements ContributionService { - - /** - * Repository where contributions are stored. Usually set by injection. - */ - private ContributionRepository contributionRepository; - - /** - * Registry of available package processors. - */ - private PackageProcessor packageProcessor; - - /** - * Registry of available artifact processors - */ - - private URLArtifactProcessor artifactProcessor; - - /** - * xml factory used to create reader instance to load contribution metadata - */ - private XMLInputFactory xmlFactory; - - /** - * contribution metadata loader - */ - private ContributionMetadataLoaderImpl contributionLoader; - - /** - * Contribution registry This is a registry of processed Contributions indexed by URI - */ - private Map contributionRegistry = new ConcurrentHashMap(); - - /** - * Contribution model facotry - */ - private ContributionFactory contributionFactory; - - - public ContributionServiceImpl(ContributionRepository repository, - PackageProcessor packageProcessor, - URLArtifactProcessor artifactProcessor, - AssemblyFactory assemblyFactory, - ContributionFactory contributionFactory, - XMLInputFactory xmlFactory) { - super(); - this.contributionRepository = repository; - this.packageProcessor = packageProcessor; - this.artifactProcessor = artifactProcessor; - this.xmlFactory = xmlFactory; - - this.contributionFactory = contributionFactory; - this.contributionLoader = new ContributionMetadataLoaderImpl(assemblyFactory, contributionFactory); - } - - public Contribution contribute(String contributionURI, URL sourceURL, ModelResolver modelResolver, boolean storeInRepository) throws ContributionException, - IOException { - if (contributionURI == null) { - throw new IllegalArgumentException("URI for the contribution is null"); - } - if (sourceURL == null) { - throw new IllegalArgumentException("Source URL for the contribution is null"); - } - - return addContribution(contributionURI, sourceURL, null, modelResolver, storeInRepository); - } - - public Contribution contribute(String contributionURI, URL sourceURL, InputStream input, ModelResolver modelResolver) - throws ContributionException, IOException { - - return addContribution(contributionURI, sourceURL, input, modelResolver, true); - } - - private Contribution initializeContributionMetadata(URL sourceURL, ModelResolver modelResolver) throws ContributionException { - Contribution contributionMetadata = null; - URL contributionMetadataURL; - URL generatedContributionMetadataURL; - InputStream metadataStream = null; - - URL[] clUrls = {sourceURL}; - URLClassLoader cl = new URLClassLoader(clUrls); - - contributionMetadataURL = cl.getResource(Contribution.SCA_CONTRIBUTION_META); - generatedContributionMetadataURL = cl.getResource(Contribution.SCA_CONTRIBUTION_GENERATED_META); - - try { - contributionMetadata = this.contributionFactory.createContribution(); - contributionMetadata.setModelResolver(modelResolver); - if (contributionMetadataURL != null || generatedContributionMetadataURL != null) { - URL metadataURL = contributionMetadataURL != null ? contributionMetadataURL - : generatedContributionMetadataURL; - - try { - metadataStream = metadataURL.openStream(); - XMLStreamReader xmlReader = this.xmlFactory.createXMLStreamReader(metadataStream); - this.contributionLoader.load(contributionMetadata, xmlReader); - - } catch (IOException ioe) { - throw new InvalidContributionMetadataException(ioe.getMessage(), metadataURL.toExternalForm(), ioe); - } catch (XMLStreamException xmle) { - throw new InvalidContributionMetadataException(xmle.getMessage(), metadataURL.toExternalForm(), - xmle); - } catch (ContributionMetadataLoaderException le) { - throw new InvalidContributionMetadataException(le.getMessage(), metadataURL.toExternalForm(), le); - } - } - } finally { - IOHelper.closeQuietly(metadataStream); - metadataStream = null; - } - - if (contributionMetadata == null) { - contributionMetadata = this.contributionFactory.createContribution(); - } - - return contributionMetadata; - - } - - public Contribution getContribution(String id) { - return this.contributionRegistry.get(id); - } - - public void remove(String contribution) throws ContributionException { - this.contributionRegistry.remove(contribution); - } - - public void addDeploymentComposite(Contribution contribution, Composite composite) throws ContributionException { - DeployedArtifact artifact = this.contributionFactory.createDeployedArtifact(); - artifact.setURI(composite.getURI()); - artifact.setModel(composite); - - contribution.getArtifacts().add(artifact); - - contribution.getDeployables().add(composite); - } - - /** - * Utility/Helper methods for contribution service - */ - - /** - * Note: - * - * @param contributionURI ContributionID - * @param sourceURL contribution location - * @param contributionStream contribution content - * @param storeInRepository flag if we store the contribution into the - * repository or not - * @return the contribution model representing the contribution - * @throws IOException - * @throws DeploymentException - */ - private Contribution addContribution(String contributionURI, - URL sourceURL, - InputStream contributionStream, - ModelResolver modelResolver, - boolean storeInRepository) throws IOException, ContributionException { - - if (contributionStream == null && sourceURL == null) { - throw new IllegalArgumentException("The content of the contribution is null"); - } - - // store the contribution in the contribution repository - URL locationURL = sourceURL; - if (contributionRepository != null && storeInRepository) { - if (contributionStream == null) { - locationURL = contributionRepository.store(contributionURI, sourceURL); - } else { - locationURL = contributionRepository.store(contributionURI, sourceURL, contributionStream); - } - } - - Contribution contribution = initializeContributionMetadata(locationURL, modelResolver); - contribution.setURI(contributionURI.toString()); - contribution.setLocation(locationURL.toString()); - - List contributionArtifacts = null; - - //NOTE: if a contribution is stored on the repository - //the stream would be consumed at this point - if (storeInRepository || contributionStream == null) { - contributionStream = sourceURL.openStream(); - try { - // process the contribution - contributionArtifacts = this.packageProcessor.getArtifacts(locationURL, contributionStream); - } finally { - IOHelper.closeQuietly(contributionStream); - contributionStream = null; - } - } else { - // process the contribution - contributionArtifacts = this.packageProcessor.getArtifacts(locationURL, contributionStream); - } - - // Read all artifacts in the contribution - processReadPhase(contribution, contributionArtifacts); - - // Resolve them - processResolvePhase(contribution); - - // Add all composites under META-INF/sca-deployables to the - // list of deployables - String prefix = Contribution.SCA_CONTRIBUTION_DEPLOYABLES; - for (DeployedArtifact artifact : contribution.getArtifacts()) { - if (artifact.getModel() instanceof Composite) { - if (artifact.getURI().startsWith(prefix)) { - Composite composite = (Composite)artifact.getModel(); - if (!contribution.getDeployables().contains(composite)) { - contribution.getDeployables().add(composite); - } - } - } - } - - // store the contribution on the registry - this.contributionRegistry.put(contribution.getURI(), contribution); - - return contribution; - } - - /** - * This utility method process each artifact and delegates to proper - * artifactProcessor to read the model and generate the in-memory representation - * - * @param contribution - * @param artifacts - * @throws ContributionException - * @throws MalformedURLException - */ - private void processReadPhase(Contribution contribution, List artifacts) throws ContributionException, - MalformedURLException { - URL contributionURL = new URL(contribution.getLocation()); - for (URI a : artifacts) { - URL artifactURL = packageProcessor.getArtifactURL(new URL(contribution.getLocation()), a); - Object model = this.artifactProcessor.read(contributionURL, a, artifactURL); - - if (model != null) { - contribution.getModelResolver().addModel(model); - - DeployedArtifact artifact = this.contributionFactory.createDeployedArtifact(); - artifact.setURI(a.toString()); - artifact.setLocation(artifactURL.toString()); - artifact.setModel(model); - contribution.getArtifacts().add(artifact); - } - } - } - - /** - * This utility method process each artifact and delegates to proper - * artifactProcessor to resolve the model references - * - * @param contribution - * @throws ContributionException - */ - @SuppressWarnings("unchecked") - private void processResolvePhase(Contribution contribution) throws ContributionException { - // for each artifact that was processed on the contribution - for (DeployedArtifact artifact : contribution.getArtifacts()) { - // resolve the model object - if (artifact.getModel() != null) { - this.artifactProcessor.resolve(artifact.getModel(), contribution.getModelResolver()); - } - } - - //resolve deployables from contribution metadata - List resolvedDeployables = new ArrayList(); - for (Composite deployableComposite : contribution.getDeployables()) { - Composite resolvedDeployable = contribution.getModelResolver().resolveModel(Composite.class, deployableComposite); - resolvedDeployables.add(resolvedDeployable); - } - - contribution.getDeployables().clear(); - contribution.getDeployables().addAll(resolvedDeployables); - } - -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/InvalidContributionMetadataException.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/InvalidContributionMetadataException.java deleted file mode 100644 index a7e0e2f2f5..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/InvalidContributionMetadataException.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.service.impl; - -import org.apache.tuscany.sca.contribution.service.ContributionException; - -/** - * Exception that indicates that the supplied XML Document invalid. - * - * @version $Rev: 511466 $ $Date: 2007-02-25 00:45:22 -0800 (Sun, 25 Feb 2007) $ - */ -public class InvalidContributionMetadataException extends ContributionException { - - /** - * - */ - private static final long serialVersionUID = -3184477070625689942L; - - protected InvalidContributionMetadataException() { - } - - protected InvalidContributionMetadataException(String message) { - super(message); - } - - protected InvalidContributionMetadataException(String message, String identifier) { - super(message, identifier); - } - - protected InvalidContributionMetadataException(String message, Throwable cause) { - super(message, cause); - } - - protected InvalidContributionMetadataException(String message, String identifier, Throwable cause) { - super(message, identifier, cause); - } - - protected InvalidContributionMetadataException(Throwable cause) { - super(cause); - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/InvalidContributionURIException.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/InvalidContributionURIException.java deleted file mode 100644 index e3109e795b..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/InvalidContributionURIException.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.service.impl; - -import org.apache.tuscany.sca.contribution.service.ContributionException; - -/** - * Exception that indicates that the supplied contribution URI is invalid or inexistent. - * - * @version $Rev: 511466 $ $Date: 2007-02-25 00:45:22 -0800 (Sun, 25 Feb 2007) $ - */ -public class InvalidContributionURIException extends ContributionException { - - /** - * - */ - private static final long serialVersionUID = -3184477070625689942L; - - protected InvalidContributionURIException() { - } - - protected InvalidContributionURIException(String message) { - super(message); - } - - protected InvalidContributionURIException(String message, String identifier) { - super(message, identifier); - } - - protected InvalidContributionURIException(String message, Throwable cause) { - super(message, cause); - } - - protected InvalidContributionURIException(String message, String identifier, Throwable cause) { - super(message, identifier, cause); - } - - protected InvalidContributionURIException(Throwable cause) { - super(cause); - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/InvalidValueException.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/InvalidValueException.java deleted file mode 100644 index ce0fb59476..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/InvalidValueException.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.service.impl; - -import org.apache.tuscany.sca.contribution.service.ContributionMetadataLoaderException; - -/** - * Denotate invalid value found during parsing of the contribution metadata sidefile - * - * @version $Rev$ $Date$ - */ -public class InvalidValueException extends ContributionMetadataLoaderException { - /** - * - */ - private static final long serialVersionUID = -1447696740893397938L; - - public InvalidValueException(String message) { - super(message); - } - - public InvalidValueException(String message, Throwable cause) { - super(message, cause); - } - - public InvalidValueException(String message, String identifier, Throwable cause) { - super(message, identifier, cause); - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/PackageTypeDescriberImpl.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/PackageTypeDescriberImpl.java deleted file mode 100644 index 165c9d0616..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/impl/PackageTypeDescriberImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.service.impl; - -import java.io.IOException; -import java.net.URL; -import java.net.URLConnection; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.sca.contribution.ContentType; -import org.apache.tuscany.sca.contribution.service.TypeDescriber; -import org.apache.tuscany.sca.contribution.service.util.FileHelper; - -/** - * Implementation of the content describer for contribution packages - * - * @version $Rev$ $Date$ - */ -public class PackageTypeDescriberImpl implements TypeDescriber { - private final Map contentTypeRegistry = new HashMap(); - - public PackageTypeDescriberImpl() { - super(); - init(); - } - - /** - * Initialize contentType registry with know types based on known file extensions - */ - private void init() { - contentTypeRegistry.put("JAR", ContentType.JAR); - } - - protected String resolveContentyTypeByExtension(URL resourceURL) { - String artifactExtension = FileHelper.getExtension(resourceURL.getPath()); - if (artifactExtension == null) { - return null; - } - return contentTypeRegistry.get(artifactExtension.toUpperCase()); - } - - /** - * Build contentType for a specific resource. We first check if the file is - * a supported one (looking into our registry based on resource extension) - * If not found, we try to check file contentType Or we return - * defaultContentType provided - * - * @param resourceURL The artifact url - * @param defaultContentType The default content type if we can't find the correc one - * @return The content type - */ - public String getType(URL resourceURL, String defaultContentType) { - URLConnection connection = null; - String contentType = defaultContentType; - - if (resourceURL.getProtocol().equals("file") && FileHelper.toFile(resourceURL).isDirectory()) { - // Special case : contribution is a folder - contentType = ContentType.FOLDER; - } else { - contentType = resolveContentyTypeByExtension(resourceURL); - if (contentType == null) { - try { - connection = resourceURL.openConnection(); - contentType = connection.getContentType(); - - if (contentType == null || contentType.equals("content/unknown")) { - // here we couldn't figure out from our registry or from URL and it's not a special file - // return defaultContentType if provided - contentType = defaultContentType; - } - } catch (IOException io) { - // could not access artifact, just ignore and we will return - // null contentType - } - } - } - return contentType == null ? defaultContentType : contentType; - } - -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/util/FileHelper.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/util/FileHelper.java deleted file mode 100644 index bc63dca4a8..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/util/FileHelper.java +++ /dev/null @@ -1,704 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.service.util; - -import java.io.File; -import java.io.FileFilter; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.net.URL; -import java.util.regex.Pattern; - -public class FileHelper { - /** - * The extension separator character. - */ - private static final char EXTENSION_SEPARATOR = '.'; - - /** - * The Unix separator character. - */ - private static final char UNIX_SEPARATOR = '/'; - - /** - * The Windows separator character. - */ - private static final char WINDOWS_SEPARATOR = '\\'; - - protected FileHelper() { - } - - /** - * Returns the index of the last directory separator character. - *

- * This method will handle a file in either Unix or Windows format. The - * position of the last forward or backslash is returned. - *

- * The output will be the same irrespective of the machine that the code is - * running on. - * - * @param filename the filename to find the last path separator in, null - * returns -1 - * @return the index of the last separator character, or -1 if there is no - * such character - */ - public static int indexOfLastSeparator(String filename) { - if (filename == null) { - return -1; - } - int lastUnixPos = filename.lastIndexOf(UNIX_SEPARATOR); - int lastWindowsPos = filename.lastIndexOf(WINDOWS_SEPARATOR); - return Math.max(lastUnixPos, lastWindowsPos); - } - - /** - * Returns the index of the last extension separator character, which is a - * dot. - *

- * This method also checks that there is no directory separator after the - * last dot. To do this it uses {@link #indexOfLastSeparator(String)} which - * will handle a file in either Unix or Windows format. - *

- * The output will be the same irrespective of the machine that the code is - * running on. - * - * @param filename the filename to find the last path separator in, null - * returns -1 - * @return the index of the last separator character, or -1 if there is no - * such character - */ - public static int indexOfExtension(String filename) { - if (filename == null) { - return -1; - } - int extensionPos = filename.lastIndexOf(EXTENSION_SEPARATOR); - int lastSeparator = indexOfLastSeparator(filename); - return lastSeparator > extensionPos ? -1 : extensionPos; - } - - /** - * Gets the name minus the path from a full filename. - *

- * This method will handle a file in either Unix or Windows format. The text - * after the last forward or backslash is returned. - * - *

-     * a/b/c.txt --> c.txt
-     * a.txt     --> a.txt
-     * a/b/c     --> c
-     * a/b/c/    --> ""
-     * 
- * - *

- * The output will be the same irrespective of the machine that the code is - * running on. - * - * @param fileName the filename to query, null returns null - * @return the name of the file without the path, or an empty string if none - * exists - */ - public static String getName(String fileName) { - if (fileName == null) { - return null; - } - int index = indexOfLastSeparator(fileName); - return fileName.substring(index + 1); - } - - /** - * Gets the extension of a filename. - *

- * This method returns the textual part of the filename after the last dot. - * There must be no directory separator after the dot. - * - *

-     * foo.txt      --> "txt"
-     * a/b/c.jpg    --> "jpg"
-     * a/b.txt/c    --> ""
-     * a/b/c        --> ""
-     * 
- * - *

- * The output will be the same irrespective of the machine that the code is - * running on. - * - * @param filename the filename to retrieve the extension of. - * @return the extension of the file or an empty string if none exists. - */ - public static String getExtension(String filename) { - if (filename == null) { - return null; - } - int index = indexOfExtension(filename); - if (index == -1) { - return ""; - } else { - return filename.substring(index + 1); - } - } - - /** - * Make a directory, including any necessary but nonexistent parent - * directories. If there already exists a file with specified name or the - * directory cannot be created then an exception is thrown. - * - * @param directory directory to create, not null - * @throws NullPointerException if the directory is null - * @throws IOException if the directory cannot be created - */ - public static void forceMkdir(File directory) throws IOException { - if (directory.exists()) { - if (directory.isFile()) { - String message = - "File " + directory + " exists and is " + "not a directory. Unable to create directory."; - throw new IOException(message); - } - } else { - if (!directory.mkdirs()) { - String message = "Unable to create directory " + directory; - throw new IOException(message); - } - } - } - - /** - * Delete a file. If file is a directory, delete it and all sub-directories. - *

- * The difference between File.delete() and this method are: - *

    - *
  • A directory to be deleted does not have to be empty.
  • - *
  • You get exceptions when a file or directory cannot be deleted. - * (java.io.File methods returns a boolean)
  • - *
- * - * @param file file or directory to delete, not null - * @throws NullPointerException if the directory is null - * @throws IOException in case deletion is unsuccessful - */ - public static void forceDelete(File file) throws IOException { - if (file.isDirectory()) { - deleteDirectory(file); - } else { - if (!file.exists()) { - throw new FileNotFoundException("File does not exist: " + file); - } - if (!file.delete()) { - String message = "Unable to delete file: " + file; - throw new IOException(message); - } - } - } - - /** - * Convert from a URL to a File. - *

- * From version 1.1 this method will decode the URL. Syntax such as - * file:///my%20docs/file.txt will be correctly decoded to - * /my docs/file.txt. - * - * @param url the file URL to convert, null returns null - * @return the equivalent File object, or null - * if the URL's protocol is not file - * @throws IllegalArgumentException if the file is incorrectly encoded - */ - public static File toFile(URL url) { - if (url == null || !url.getProtocol().equals("file")) { - return null; - } else { - String filename = url.getFile().replace('/', File.separatorChar); - int pos = 0; - while ((pos = filename.indexOf('%', pos)) >= 0) { // NOPMD - if (pos + 2 < filename.length()) { - String hexStr = filename.substring(pos + 1, pos + 3); - char ch = (char)Integer.parseInt(hexStr, 16); - filename = filename.substring(0, pos) + ch + filename.substring(pos + 3); - } - } - return new File(filename); - } - } - - public static FileFilter getFileFilter(String regExp, boolean ignoreCase) { - return new RegExpFilter(regExp, ignoreCase); - } - - /** - * A regular-expression based resource filter - */ - public static class RegExpFilter implements FileFilter { - private Pattern pattern; - - public RegExpFilter(Pattern pattern) { - this.pattern = pattern; - } - - public RegExpFilter(String patternStr, boolean ignoreCase) { - this.pattern = Pattern.compile(patternStr, ignoreCase ? Pattern.CASE_INSENSITIVE : 0); - } - - public boolean accept(File file) { - return pattern.matcher(file.getName()).matches(); - } - - /** - * Convert wildcard into a regex pattern - * - * @param str - * @return - */ - public static RegExpFilter getWildcardFilter(String str, boolean ignoreCase) { - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < str.length(); i++) { - char ch = str.charAt(i); - if (ch == '?') { - buffer.append('.'); - } else if (ch == '*') { - buffer.append(".*"); - } else { - buffer.append(ch); - } - } - return new RegExpFilter(buffer.toString(), ignoreCase); - } - - } - - /** - * Clean a directory without deleting it. - * - * @param directory directory to clean - * @throws IOException in case cleaning is unsuccessful - */ - public static void cleanDirectory(File directory) throws IOException { - if (!directory.exists()) { - String message = directory + " does not exist"; - throw new IllegalArgumentException(message); - } - - if (!directory.isDirectory()) { - String message = directory + " is not a directory"; - throw new IllegalArgumentException(message); - } - - File[] files = directory.listFiles(); - if (files == null) { // null if security restricted - throw new IOException("Failed to list contents of " + directory); - } - - IOException exception = null; - for (int i = 0; i < files.length; i++) { - File file = files[i]; - try { - forceDelete(file); - } catch (IOException ioe) { - exception = ioe; - } - } - - if (null != exception) { - throw exception; - } - } - - /** - * Clean a directory without deleting it. - * - * @param directory directory to clean, must not be null - * @throws NullPointerException if the directory is null - * @throws IOException in case cleaning is unsuccessful - */ - private static void cleanDirectoryOnExit(File directory) throws IOException { - if (!directory.exists()) { - String message = directory + " does not exist"; - throw new IllegalArgumentException(message); - } - - if (!directory.isDirectory()) { - String message = directory + " is not a directory"; - throw new IllegalArgumentException(message); - } - - File[] files = directory.listFiles(); - if (files == null) { // null if security restricted - throw new IOException("Failed to list contents of " + directory); - } - - IOException exception = null; - for (int i = 0; i < files.length; i++) { - File file = files[i]; - try { - forceDeleteOnExit(file); - } catch (IOException ioe) { - exception = ioe; - } - } - - if (null != exception) { - throw exception; - } - } - - /** - * Copies a whole directory to a new location preserving the file dates. - *

- * This method copies the specified directory and all its child directories - * and files to the specified destination. The destination is the new - * location and name of the directory. - *

- * The destination directory is created if it does not exist. If the - * destination directory did exist, then this method merges the source with - * the destination, with the source taking precedence. - * - * @param srcDir an existing directory to copy, must not be - * null - * @param destDir the new directory, must not be null - * @throws NullPointerException if source or destination is - * null - * @throws IOException if source or destination is invalid - * @throws IOException if an IO error occurs during copying - * @since Commons IO 1.1 - */ - public static void copyDirectory(File srcDir, File destDir) throws IOException { - copyDirectory(srcDir, destDir, true); - } - - /** - * Copies a whole directory to a new location. - *

- * This method copies the contents of the specified source directory to - * within the specified destination directory. - *

- * The destination directory is created if it does not exist. If the - * destination directory did exist, then this method merges the source with - * the destination, with the source taking precedence. - * - * @param srcDir an existing directory to copy, must not be - * null - * @param destDir the new directory, must not be null - * @param preserveFileDate true if the file date of the copy should be the - * same as the original - * @throws NullPointerException if source or destination is - * null - * @throws IOException if source or destination is invalid - * @throws IOException if an IO error occurs during copying - * @since Commons IO 1.1 - */ - public static void copyDirectory(File srcDir, File destDir, boolean preserveFileDate) throws IOException { - if (srcDir == null) { - throw new NullPointerException("Source must not be null"); - } - if (destDir == null) { - throw new NullPointerException("Destination must not be null"); - } - if (!srcDir.exists()) { - throw new FileNotFoundException("Source '" + srcDir + "' does not exist"); - } - if (!srcDir.isDirectory()) { - throw new IOException("Source '" + srcDir + "' exists but is not a directory"); - } - if (srcDir.getCanonicalPath().equals(destDir.getCanonicalPath())) { - throw new IOException("Source '" + srcDir + "' and destination '" + destDir + "' are the same"); - } - doCopyDirectory(srcDir, destDir, preserveFileDate); - } - - // ----------------------------------------------------------------------- - /** - * Copies a directory to within another directory preserving the file dates. - *

- * This method copies the source directory and all its contents to a - * directory of the same name in the specified destination directory. - *

- * The destination directory is created if it does not exist. If the - * destination directory did exist, then this method merges the source with - * the destination, with the source taking precedence. - * - * @param srcDir an existing directory to copy, must not be - * null - * @param destDir the directory to place the copy in, must not be - * null - * @throws NullPointerException if source or destination is - * null - * @throws IOException if source or destination is invalid - * @throws IOException if an IO error occurs during copying - * @since Commons IO 1.2 - */ - public static void copyDirectoryToDirectory(File srcDir, File destDir) throws IOException { - if (srcDir == null) { - throw new NullPointerException("Source must not be null"); - } - if (!(srcDir.exists() && srcDir.isDirectory())) { - throw new IllegalArgumentException("Source '" + destDir + "' is not a directory"); - } - if (destDir == null) { - throw new NullPointerException("Destination must not be null"); - } - if (!(destDir.exists() && destDir.isDirectory())) { - throw new IllegalArgumentException("Destination '" + destDir + "' is not a directory"); - } - copyDirectory(srcDir, new File(destDir, srcDir.getName()), true); - } - - /** - * Copies a file to a new location preserving the file date. - *

- * This method copies the contents of the specified source file to the - * specified destination file. The directory holding the destination file is - * created if it does not exist. If the destination file exists, then this - * method will overwrite it. - * - * @param srcFile an existing file to copy, must not be null - * @param destFile the new file, must not be null - * @throws NullPointerException if source or destination is - * null - * @throws IOException if source or destination is invalid - * @throws IOException if an IO error occurs during copying - * @see #copyFileToDirectory(File, File) - */ - public static void copyFile(File srcFile, File destFile) throws IOException { - copyFile(srcFile, destFile, true); - } - - /** - * Copies a file to a new location. - *

- * This method copies the contents of the specified source file to the - * specified destination file. The directory holding the destination file is - * created if it does not exist. If the destination file exists, then this - * method will overwrite it. - * - * @param srcFile an existing file to copy, must not be null - * @param destFile the new file, must not be null - * @param preserveFileDate true if the file date of the copy should be the - * same as the original - * @throws NullPointerException if source or destination is - * null - * @throws IOException if source or destination is invalid - * @throws IOException if an IO error occurs during copying - * @see #copyFileToDirectory(File, File, boolean) - */ - public static void copyFile(File srcFile, File destFile, boolean preserveFileDate) throws IOException { - if (srcFile == null) { - throw new NullPointerException("Source must not be null"); - } - if (destFile == null) { - throw new NullPointerException("Destination must not be null"); - } - if (!srcFile.exists()) { - throw new FileNotFoundException("Source '" + srcFile + "' does not exist"); - } - if (srcFile.isDirectory()) { - throw new IOException("Source '" + srcFile + "' exists but is a directory"); - } - if (srcFile.getCanonicalPath().equals(destFile.getCanonicalPath())) { - throw new IOException("Source '" + srcFile + "' and destination '" + destFile + "' are the same"); - } - if (!(destFile.getParentFile() != null && destFile.getParentFile().exists())) { - if (!destFile.getParentFile().mkdirs()) { //NOPMD - throw new IOException("Destination '" + destFile + "' directory cannot be created"); - } - } - if (!(destFile.exists() && destFile.canWrite())) { - throw new IOException("Destination '" + destFile + "' exists but is read-only"); - } - doCopyFile(srcFile, destFile, preserveFileDate); - } - - // ----------------------------------------------------------------------- - /** - * Copies a file to a directory preserving the file date. - *

- * This method copies the contents of the specified source file to a file of - * the same name in the specified destination directory. The destination - * directory is created if it does not exist. If the destination file - * exists, then this method will overwrite it. - * - * @param srcFile an existing file to copy, must not be null - * @param destDir the directory to place the copy in, must not be - * null - * @throws NullPointerException if source or destination is null - * @throws IOException if source or destination is invalid - * @throws IOException if an IO error occurs during copying - * @see #copyFile(File, File, boolean) - */ - public static void copyFileToDirectory(File srcFile, File destDir) throws IOException { - copyFileToDirectory(srcFile, destDir, true); - } - - /** - * Copies a file to a directory optionally preserving the file date. - *

- * This method copies the contents of the specified source file to a file of - * the same name in the specified destination directory. The destination - * directory is created if it does not exist. If the destination file - * exists, then this method will overwrite it. - * - * @param srcFile an existing file to copy, must not be null - * @param destDir the directory to place the copy in, must not be - * null - * @param preserveFileDate true if the file date of the copy should be the - * same as the original - * @throws NullPointerException if source or destination is - * null - * @throws IOException if source or destination is invalid - * @throws IOException if an IO error occurs during copying - * @see #copyFile(File, File, boolean) - * @since Commons IO 1.3 - */ - public static void copyFileToDirectory(File srcFile, File destDir, boolean preserveFileDate) throws IOException { - if (destDir == null) { - throw new NullPointerException("Destination must not be null"); - } - if (!(destDir.exists() && destDir.isDirectory())) { - throw new IllegalArgumentException("Destination '" + destDir + "' is not a directory"); - } - copyFile(srcFile, new File(destDir, srcFile.getName()), preserveFileDate); - } - - // ----------------------------------------------------------------------- - /** - * Recursively delete a directory. - * - * @param directory directory to delete - * @throws IOException in case deletion is unsuccessful - */ - public static void deleteDirectory(File directory) throws IOException { - if (!directory.exists()) { - return; - } - - cleanDirectory(directory); - if (!directory.delete()) { - String message = "Unable to delete directory " + directory + "."; - throw new IOException(message); - } - } - - /** - * Recursively schedule directory for deletion on JVM exit. - * - * @param directory directory to delete, must not be null - * @throws NullPointerException if the directory is null - * @throws IOException in case deletion is unsuccessful - */ - private static void deleteDirectoryOnExit(File directory) throws IOException { - if (!directory.exists()) { - return; - } - - cleanDirectoryOnExit(directory); - directory.deleteOnExit(); - } - - /** - * Internal copy directory method. - * - * @param srcDir the validated source directory, must not be - * null - * @param destDir the validated destination directory, must not be - * null - * @param preserveFileDate whether to preserve the file date - * @throws IOException if an error occurs - * @since Commons IO 1.1 - */ - private static void doCopyDirectory(File srcDir, File destDir, boolean preserveFileDate) throws IOException { - if (destDir.exists()) { - if (!destDir.isDirectory()) { - throw new IOException("Destination '" + destDir + "' exists but is not a directory"); - } - } else { - if (!destDir.mkdirs()) { - throw new IOException("Destination '" + destDir + "' directory cannot be created"); - } - if (preserveFileDate) { - destDir.setLastModified(srcDir.lastModified()); - } - } - if (!destDir.canWrite()) { - throw new IOException("Destination '" + destDir + "' cannot be written to"); - } - // recurse - File[] files = srcDir.listFiles(); - if (files == null) { // null if security restricted - throw new IOException("Failed to list contents of " + srcDir); - } - for (int i = 0; i < files.length; i++) { - File copiedFile = new File(destDir, files[i].getName()); - if (files[i].isDirectory()) { - doCopyDirectory(files[i], copiedFile, preserveFileDate); - } else { - doCopyFile(files[i], copiedFile, preserveFileDate); - } - } - } - - /** - * Internal copy file method. - * - * @param srcFile the validated source file, must not be null - * @param destFile the validated destination file, must not be - * null - * @param preserveFileDate whether to preserve the file date - * @throws IOException if an error occurs - */ - private static void doCopyFile(File srcFile, File destFile, boolean preserveFileDate) throws IOException { - if (destFile.exists() && destFile.isDirectory()) { - throw new IOException("Destination '" + destFile + "' exists but is a directory"); - } - - FileInputStream input = new FileInputStream(srcFile); - try { - FileOutputStream output = new FileOutputStream(destFile); - try { - IOHelper.copy(input, output); - } finally { - IOHelper.closeQuietly(output); - } - } finally { - IOHelper.closeQuietly(input); - } - - if (srcFile.length() != destFile.length()) { - throw new IOException("Failed to copy full contents from '" + srcFile + "' to '" + destFile + "'"); - } - if (preserveFileDate) { - destFile.setLastModified(srcFile.lastModified()); - } - } - - /** - * Schedule a file to be deleted when JVM exits. If file is directory delete - * it and all sub-directories. - * - * @param file file or directory to delete, must not be null - * @throws NullPointerException if the file is null - * @throws IOException in case deletion is unsuccessful - */ - public static void forceDeleteOnExit(File file) throws IOException { - if (file.isDirectory()) { - deleteDirectoryOnExit(file); - } else { - file.deleteOnExit(); - } - } - -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/util/IOHelper.java b/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/util/IOHelper.java deleted file mode 100644 index f8ea93ae5e..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/main/java/org/apache/tuscany/sca/contribution/service/util/IOHelper.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.service.util; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.JarURLConnection; -import java.net.URL; -import java.util.jar.JarFile; - -public class IOHelper { - /** - * The default buffer size to use. - */ - private static final int DEFAULT_BUFFER_SIZE = 1024 * 4; - - protected IOHelper() { - - } - - /** - * Unconditionally close an InputStream. - *

- * Equivalent to {@link InputStream#close()}, except any exceptions will be ignored. - * This is typically used in finally blocks. - * - * @param input the InputStream to close, may be null or already closed - */ - public static void closeQuietly(InputStream input) { - try { - if (input != null) { - input.close(); - } - } catch (IOException ioe) { - // ignore - } - } - - /** - * Unconditionally close an OutputStream. - *

- * Equivalent to {@link OutputStream#close()}, except any exceptions will be ignored. - * This is typically used in finally blocks. - * - * @param output the OutputStream to close, may be null or already closed - */ - public static void closeQuietly(OutputStream output) { - try { - if (output != null) { - output.close(); - } - } catch (IOException ioe) { - // ignore - } - } - - /** - * Copy bytes from an InputStream to an - * OutputStream. - *

- * This method buffers the input internally, so there is no need to use a - * BufferedInputStream. - * - * @param input the InputStream to read from - * @param output the OutputStream to write to - * @return the number of bytes copied - * @throws NullPointerException if the input or output is null - * @throws IOException if an I/O error occurs - * @since Commons IO 1.1 - */ - public static int copy(InputStream input, OutputStream output) throws IOException { - byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; - int count = 0; - int n = 0; - while (-1 != (n = input.read(buffer))) { // NOPMD - output.write(buffer, 0, n); - count += n; - } - return count; - } - - public static InputStream getInputStream(URL url) throws IOException { - return new SafeURLInputStream(url); - } - - /** - * 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!/my.composite" We - * also need to turn off the JarFile cache. - * - * @see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4950148 - * - * @version $Rev$ $Date$ - */ - public static class SafeURLInputStream extends InputStream { - private JarFile jarFile; - private InputStream is; - - public SafeURLInputStream(URL url) throws IOException { - String protocol = url.getProtocol(); - if (protocol != null && (protocol.equals("jar"))) { - JarURLConnection connection = (JarURLConnection)url.openConnection(); - // We cannot use cache - connection.setUseCaches(false); - try { - is = connection.getInputStream(); - } catch (IOException e) { - throw e; - } - jarFile = connection.getJarFile(); - } else { - is = url.openStream(); - } - } - - public SafeURLInputStream(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/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/processor/FolderContributionPackageProcessorTestCase.java b/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/processor/FolderContributionPackageProcessorTestCase.java deleted file mode 100644 index 6a2f2ac3cc..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/processor/FolderContributionPackageProcessorTestCase.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.processor; - -import java.io.File; -import java.net.URI; -import java.util.List; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.contribution.processor.impl.FolderContributionProcessor; - -public class FolderContributionPackageProcessorTestCase extends TestCase { - private static final String FOLDER_CONTRIBUTION = "."; - - private File contributionRoot; - - protected void setUp() throws Exception { - super.setUp(); - this.contributionRoot = new File(FOLDER_CONTRIBUTION); - } - - public final void testProcessPackageArtifacts() throws Exception { - FolderContributionProcessor folderProcessor = new FolderContributionProcessor(); - - List artifacts = folderProcessor.getArtifacts(contributionRoot.toURL(), null); - assertNotNull(artifacts); - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/processor/JarContributionPackageProcessorTestCase.java b/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/processor/JarContributionPackageProcessorTestCase.java deleted file mode 100644 index 8765423dbe..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/processor/JarContributionPackageProcessorTestCase.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.processor; - -import java.io.InputStream; -import java.net.URI; -import java.net.URL; -import java.util.List; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.contribution.processor.impl.JarContributionProcessor; -import org.apache.tuscany.sca.contribution.service.util.IOHelper; - -public class JarContributionPackageProcessorTestCase extends TestCase { - private static final String JAR_CONTRIBUTION = "/repository/sample-calculator.jar"; - - protected void setUp() throws Exception { - super.setUp(); - } - - public final void testProcessPackageArtifacts() throws Exception { - JarContributionProcessor jarProcessor = new JarContributionProcessor(); - - URL jarURL = getClass().getResource(JAR_CONTRIBUTION); - InputStream jarStream = jarURL.openStream(); - List artifacts = null; - try { - artifacts = jarProcessor.getArtifacts(jarURL, jarStream); - } finally { - IOHelper.closeQuietly(jarStream); - } - - assertNotNull(artifacts); - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/resolver/ArtifactResolverTestCase.java b/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/resolver/ArtifactResolverTestCase.java deleted file mode 100644 index ef0fd892c2..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/resolver/ArtifactResolverTestCase.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.resolver; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.contribution.resolver.impl.ModelResolverImpl; - -/** - * Test DefaultArtifactResolver. - * - * @version $Rev$ $Date$ - */ -public class ArtifactResolverTestCase extends TestCase { - - private ModelResolver resolver; - - protected void setUp() throws Exception { - resolver = new ModelResolverImpl(getClass().getClassLoader()); - } - - protected void tearDown() throws Exception { - resolver = null; - } - - public void testResolved() { - Model a = new Model("a"); - resolver.addModel(a); - Model x = new Model("a"); - x = resolver.resolveModel(Model.class, x); - assertTrue(x == a); - } - - public void testUnresolved() { - Model x = new Model("a"); - Model y = resolver.resolveModel(Model.class, x); - assertTrue(x == y); - } - - public void testResolveClass() { - ClassReference ref = new ClassReference(getClass().getName()); - ClassReference clazz = resolver.resolveModel(ClassReference.class, ref); - assertTrue(clazz.getJavaClass() == getClass()); - } - - public void testUnresolvedClass() { - ClassReference ref = new ClassReference("NonExistentClass"); - ClassReference clazz = resolver.resolveModel(ClassReference.class, ref); - assertTrue(clazz.isUnresolved()); - assertTrue(clazz.getJavaClass() == null); - } - - - - class Model { - private String name; - - Model(String name) { - this.name = name; - } - - public int hashCode() { - return name.hashCode(); - } - - public boolean equals(Object obj) { - return name.equals(((Model)obj).name); - } - } - -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/ContentTypeDescriberImplTestCase.java b/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/ContentTypeDescriberImplTestCase.java deleted file mode 100644 index 4f924225ae..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/ContentTypeDescriberImplTestCase.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.services; - -import java.net.URL; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.contribution.ContentType; -import org.apache.tuscany.sca.contribution.service.impl.ArtifactTypeDescriberImpl; - -public class ContentTypeDescriberImplTestCase extends TestCase { - private ArtifactTypeDescriberImpl contentTypeDescriber; - - public void testResolveContentType() throws Exception { - URL artifactURL = getClass().getResource("/test.composite"); - assertEquals(ContentType.COMPOSITE, contentTypeDescriber.getType(artifactURL, null)); - } - - - public void testResolveUnknownContentType() throws Exception { - URL artifactURL = getClass().getResource("/test.ext"); - assertNull(contentTypeDescriber.getType(artifactURL, null)); - } - - public void testDefaultContentType() throws Exception { - URL artifactURL = getClass().getResource("/test.ext"); - assertEquals("application/vnd.tuscany.ext", - contentTypeDescriber.getType(artifactURL, "application/vnd.tuscany.ext")); - } - - protected void setUp() throws Exception { - super.setUp(); - contentTypeDescriber = new ArtifactTypeDescriberImpl(); - } - -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/ContributionMetadataLoaderTestCase.java b/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/ContributionMetadataLoaderTestCase.java deleted file mode 100644 index ac1d968f39..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/ContributionMetadataLoaderTestCase.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.services; - -import java.io.StringReader; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.ContributionFactory; -import org.apache.tuscany.sca.contribution.impl.ContributionFactoryImpl; -import org.apache.tuscany.sca.contribution.resolver.impl.ModelResolverImpl; -import org.apache.tuscany.sca.contribution.service.impl.ContributionMetadataLoaderImpl; -import org.apache.tuscany.sca.contribution.service.impl.InvalidValueException; - -/** - * @version $Rev$ $Date$ - */ -public class ContributionMetadataLoaderTestCase extends TestCase { - - private static final String VALID_XML = - "" - + "" - + "" - + "" - + "" - + "" - + ""; - - private static final String INVALID_XML = - "" - + "" - + "" - + "" - + "" - + "" - + ""; - - private XMLInputFactory xmlFactory; - - protected void setUp() throws Exception { - super.setUp(); - xmlFactory = XMLInputFactory.newInstance(); - } - - public void testLoad() throws Exception { - XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(VALID_XML)); - - ContributionFactory factory = new ContributionFactoryImpl(); - ContributionMetadataLoaderImpl loader = - new ContributionMetadataLoaderImpl(new DefaultAssemblyFactory(), factory); - Contribution contribution = factory.createContribution(); - contribution.setModelResolver(new ModelResolverImpl(getClass().getClassLoader())); - loader.load(contribution, reader); - assertNotNull(contribution); - assertEquals(1, contribution.getImports().size()); - assertEquals(1, contribution.getExports().size()); - assertEquals(2, contribution.getDeployables().size()); - } - - public void testLoadInvalid() throws Exception { - XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(INVALID_XML)); - ContributionFactory factory = new ContributionFactoryImpl(); - ContributionMetadataLoaderImpl loader = - new ContributionMetadataLoaderImpl(new DefaultAssemblyFactory(), factory); - Contribution contribution = factory.createContribution(); - contribution.setModelResolver(new ModelResolverImpl(getClass().getClassLoader())); - try { - loader.load(contribution, reader); - fail("InvalidException should have been thrown"); - } catch (InvalidValueException e) { - assertTrue(true); - } - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/ContributionRepositoryTestCase.java b/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/ContributionRepositoryTestCase.java deleted file mode 100644 index 98f69b9aa1..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/ContributionRepositoryTestCase.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.services; - -import java.io.File; -import java.io.InputStream; -import java.net.URL; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.contribution.service.impl.ContributionRepositoryImpl; -import org.apache.tuscany.sca.contribution.service.util.FileHelper; - -public class ContributionRepositoryTestCase extends TestCase { - private ContributionRepositoryImpl repository; - - protected void setUp() throws Exception { - super.setUp(); - // create repository (this should re-create the root directory) - this.repository = new ContributionRepositoryImpl("target/repository/"); - repository.init(); - } - - public void testStore() throws Exception { - String resourceLocation = "/repository/sample-calculator.jar"; - String contribution = "sample-calculator.jar"; - URL contributionLocation = getClass().getResource(resourceLocation); - InputStream contributionStream = getClass().getResourceAsStream(resourceLocation); - repository.store(contribution, contributionLocation, contributionStream); - - URL contributionURL = repository.find(contribution); - assertNotNull(contributionURL); - } - - public void testRemove() throws Exception { - String resourceLocation = "/repository/sample-calculator.jar"; - String contribution = "sample-calculator.jar"; - URL contributionLocation = getClass().getResource(resourceLocation); - InputStream contributionStream = getClass().getResourceAsStream(resourceLocation); - repository.store(contribution, contributionLocation, contributionStream); - - repository.remove(contribution); - URL contributionURL = repository.find(contribution); - assertNull(contributionURL); - } - - public void testList() throws Exception { - String resourceLocation = "/repository/sample-calculator.jar"; - String contribution = "sample-calculator.jar"; - URL contributionLocation = getClass().getResource(resourceLocation); - InputStream contributionStream = getClass().getResourceAsStream(resourceLocation); - repository.store(contribution, contributionLocation, contributionStream); - - assertEquals(1, repository.list().size()); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - FileHelper.deleteDirectory(new File("target/repository")); - } -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/PackageTypeDescriberImplTestCase.java b/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/PackageTypeDescriberImplTestCase.java deleted file mode 100644 index 7ee873b9a3..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/test/java/org/apache/tuscany/sca/contribution/services/PackageTypeDescriberImplTestCase.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.services; - -import java.net.URL; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.contribution.ContentType; -import org.apache.tuscany.sca.contribution.service.impl.PackageTypeDescriberImpl; - -public class PackageTypeDescriberImplTestCase extends TestCase { - private PackageTypeDescriberImpl packageTypeDescriber; - - public void testResolvePackageType() throws Exception { - URL artifactURL = getClass().getResource("/deployables/sample-calculator.jar"); - assertEquals(ContentType.JAR, this.packageTypeDescriber.getType(artifactURL, null)); - } - - public void testResolveUnknownPackageType() throws Exception { - URL artifactURL = getClass().getResource("/test.ext"); - assertNull(this.packageTypeDescriber.getType(artifactURL, null)); - } - - public void testDefaultPackageType() throws Exception { - URL artifactURL = getClass().getResource("/test.ext"); - assertEquals("application/vnd.tuscany.ext", - packageTypeDescriber.getType(artifactURL, "application/vnd.tuscany.ext")); - } - - protected void setUp() throws Exception { - super.setUp(); - packageTypeDescriber = new PackageTypeDescriberImpl(); - } - -} diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/test/resources/deployables/sample-calculator.jar b/branches/sca-java-0.90/modules/contribution-impl/src/test/resources/deployables/sample-calculator.jar deleted file mode 100644 index 0ca3a1b781..0000000000 Binary files a/branches/sca-java-0.90/modules/contribution-impl/src/test/resources/deployables/sample-calculator.jar and /dev/null differ diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/test/resources/repository/sample-calculator.jar b/branches/sca-java-0.90/modules/contribution-impl/src/test/resources/repository/sample-calculator.jar deleted file mode 100644 index 9c46c679d2..0000000000 Binary files a/branches/sca-java-0.90/modules/contribution-impl/src/test/resources/repository/sample-calculator.jar and /dev/null differ diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/test/resources/test.composite b/branches/sca-java-0.90/modules/contribution-impl/src/test/resources/test.composite deleted file mode 100644 index 1e09549194..0000000000 --- a/branches/sca-java-0.90/modules/contribution-impl/src/test/resources/test.composite +++ /dev/null @@ -1,22 +0,0 @@ - - - - This file just needs to exist - \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/contribution-impl/src/test/resources/test.ext b/branches/sca-java-0.90/modules/contribution-impl/src/test/resources/test.ext deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/branches/sca-java-0.90/modules/contribution/.checkstyle b/branches/sca-java-0.90/modules/contribution/.checkstyle deleted file mode 100644 index e3c216986d..0000000000 --- a/branches/sca-java-0.90/modules/contribution/.checkstyle +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/branches/sca-java-0.90/modules/contribution/.pmd b/branches/sca-java-0.90/modules/contribution/.pmd deleted file mode 100644 index 84af2f4d5d..0000000000 --- a/branches/sca-java-0.90/modules/contribution/.pmd +++ /dev/null @@ -1,20 +0,0 @@ - - -true diff --git a/branches/sca-java-0.90/modules/contribution/.ruleset b/branches/sca-java-0.90/modules/contribution/.ruleset deleted file mode 100644 index ac8671859d..0000000000 --- a/branches/sca-java-0.90/modules/contribution/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/contribution/DISCLAIMER b/branches/sca-java-0.90/modules/contribution/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/contribution/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/contribution/LICENSE b/branches/sca-java-0.90/modules/contribution/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/contribution/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/contribution/NOTICE b/branches/sca-java-0.90/modules/contribution/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/contribution/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/contribution/pom.xml b/branches/sca-java-0.90/modules/contribution/pom.xml deleted file mode 100644 index 9adccbb90c..0000000000 --- a/branches/sca-java-0.90/modules/contribution/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - tuscany-contribution - Apache Tuscany SCA Contribution Service - - - - org.apache.tuscany.sca - tuscany-assembly - 0.90-incubating-SNAPSHOT - - - - stax - stax-api - 1.0.1 - - - diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Artifact.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Artifact.java deleted file mode 100644 index c57054cfd0..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Artifact.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution; - - -/** - * Base Artifact interface to accomodate common properties between Contribution and Deployed Artifact - * - * @version $Rev$ $Date$ - */ -public interface Artifact { - /** - * Get the URI that unique identifies the artifact - * - * @return The artifact uri - */ - String getURI(); - - /** - * Set the URI that unique identifies the artifact - * - * @param uri The artifact uri - */ - void setURI(String uri); - - /** - * Get the URL location for the artifact - * - * @return The artifact location - */ - String getLocation(); - - /** - * Set the URL location for the artifact - * - * @param location The artifact location - */ - void setLocation(String location); - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContentType.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContentType.java deleted file mode 100644 index 2e9eb203ad..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContentType.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution; - -/** - * Identifies internal content types for contribution package and artifacts - * - * @version $Rev$ $Date$ - */ -public interface ContentType { - /** - * Java compressed contribution package - */ - String JAR = "application/x-compressed"; - /** - * Filesystem folder contribution package - */ - String FOLDER = "application/vnd.tuscany.folder"; - /** - * Contribution metadata file - */ - String CONTRIBUTION_METADATA = "application/vnd.tuscany.contribution.metadata"; - /** - * SCA Composite description file - */ - String COMPOSITE = "application/vnd.tuscany.composite"; - /** - * WSDL file - */ - String WSDL = "application/vnd.tuscany.wsdl"; - /** - * Java source/binary file - */ - String JAVA = "application/java-vm"; - /** - * Unkown contentType - */ - String UNKNOWN = "content/unknown"; -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Contribution.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Contribution.java deleted file mode 100644 index 4775fba4e4..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/Contribution.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution; - -import java.util.List; - -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; - -/** - * The representation of a deployed contribution - * - * @version $Rev$ $Date$ - */ -public interface Contribution extends Artifact { - /** - * Default location of contribution metadata in a contribution package - */ - String SCA_CONTRIBUTION_META = "META-INF/sca-contribution.xml"; - /** - * default location of a generated contribution metadata in a contribution package - */ - String SCA_CONTRIBUTION_GENERATED_META = "META-INF/sca-contribution-generated.xml"; - /** - * Default location of deployables in a contribution - */ - String SCA_CONTRIBUTION_DEPLOYABLES = "META-INF/sca-deployables/"; - - - /** - * Get a list of exports based on the Contribution metadata sidefile - * - * @return The list of exported artifacts from this contribution - */ - List getExports(); - - /** - * Get a list of imports based on the Contribution metadata sidefile - * - * @return The list of imported artifacts on this contribution - */ - List getImports(); - - /** - * Get a list of deployables for the contribution based on the contribution metadata sidefile - * - * @return The list of deployable composites - */ - List getDeployables(); - - /** - * Get a list of artifacts from the contribution - * - * @return The list of deployed artifacts for the contribution - */ - List getArtifacts(); - - /** - * Returns the model resolver for the models representing the artifacts - * visible in the scope of this contribution. - * - * @return The model resolver - */ - ModelResolver getModelResolver(); - - /** - * Sets the model resolver for the models representing the artifacts - * visible in the scope of this contribution. - * - * @param modelResolver The model resolver - */ - void setModelResolver(ModelResolver modelResolver); - -} \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionExport.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionExport.java deleted file mode 100644 index 914788a8c7..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionExport.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution; - -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; - -/** - * The representation of an export for the contribution - * - * @version $Rev$ $Date$ - */ -public interface ContributionExport { - - /** - * Get Namespace that identifies the export - * - * @return The exported namespace - */ - String getNamespace(); - - /** - * Set Namespace that identifies the export - * - * @param namespace The exported namespace - */ - void setNamespace(String namespace); - - /** - * Returns the model resolver for the models representing artifacts - * made available by this export. - * - * @return The model resolver - */ - ModelResolver getModelResolver(); - - /** - * Sets the model resolver for the models representing artifacts - * made available by this export. - * - * @param modelResolver - */ - void setModelResolver(ModelResolver modelResolver); - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionFactory.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionFactory.java deleted file mode 100644 index 8e1ce6e8ec..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionFactory.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution; - -/** - * Contribution model object factory - * - * @version $Rev$ $Date$ - */ -public interface ContributionFactory { - /** - * Create a contribution model object - * - * @return The new contribution model object - */ - Contribution createContribution(); - - /** - * Create a deployedArtifact model object - * - * @return The new deployedArtifact model object - */ - DeployedArtifact createDeployedArtifact(); - - /** - * Create a contribution import model - * - * @return The new ContributionImport model object - */ - ContributionImport createContributionImport(); - - /** - * Create a contribution import model - * - * @return The new ContributoinExport object - */ - ContributionExport createContributionExport(); -} \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionImport.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionImport.java deleted file mode 100644 index e42d65947b..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/ContributionImport.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution; - -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; - - -/** - * The representation of an import for the contribution - * - * @version $Rev$ $Date$ - */ -public interface ContributionImport { - - /** - * Get the location used to resolve the definitions for this import - * - * @return The import location - */ - String getLocation(); - - /** - * Set the location used to resolve the definitions for this import - * - * @param location The import location - */ - void setLocation(String location); - - /** - * Get Namespace that identifies the import - * - * @return The namespace - */ - String getNamespace(); - - /** - * Set Namespace that identifies the import - * - * @param namespace The namespace - */ - void setNamespace(String namespace); - - /** - * Returns the model resolver for the models representing artifacts - * made available by this import. - * - * @return The model resolver - */ - ModelResolver getModelResolver(); - - /** - * Sets the model resolver for the models representing artifacts - * made available by this import. - * - * @param modelResolver The model resolver - */ - void setModelResolver(ModelResolver modelResolver); -} \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DeployedArtifact.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DeployedArtifact.java deleted file mode 100644 index 4b0fb1cc08..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/DeployedArtifact.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution; - -/** - * Representation of a deployed artifact - * - * @version $Rev$ $Date$ - */ -public interface DeployedArtifact extends Artifact { - - /** - * Get the assembly model associated with this artifact - * - * @return The assembly model - */ - Object getModel(); - - /** - * Set the assembly model associated with this artifact - * - * @param modelObject The assembly model - */ - void setModel(Object modelObject); - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessor.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessor.java deleted file mode 100644 index 014c187733..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessor.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.processor; - -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; - -/** - * Interface for extensions that can process contributions. - * - * @version $Rev$ $Date$ - */ -public interface ArtifactProcessor { - - /** - * Resolve references from this model to other models. For example references - * from a composite to another one, or references from a composite to a WSDL - * model. - * - * @param model The model to resolve - * @param resolver The resolver to use to resolve referenced models - */ - void resolve(M model, ModelResolver resolver) throws ContributionResolveException; - - /** - * Returns the type of model handled by this artifact processor. - * - * @return The type of model handled by this artifact processor - */ - Class getModelType(); - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessorExtensionPoint.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessorExtensionPoint.java deleted file mode 100644 index 029df61f0f..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ArtifactProcessorExtensionPoint.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.processor; - -/** - * An extension point for artifact processors. - * - * @version $Rev$ $Date$ - */ -public interface ArtifactProcessorExtensionPoint

{ - - /** - * Add an artifact processor. - * - * @param artifactProcessor The artifact processor to add - */ - void addArtifactProcessor(P artifactProcessor); - - /** - * Remove an artifact processor. - * - * @param artifactProcessor The artifact processor to remove - */ - void removeArtifactProcessor(P artifactProcessor); - - /** - * Returns the processor associated with the given artifact type. - * - * @param artifactType An artifact type - * @return The processor associated with the given artifact type - */ - P getProcessor(Object artifactType); - - /** - * Returns the processor associated with the given model type. - * - * @param modelType A model type - * @return The processor associated with the given model type - */ - P getProcessor(Class modelType); - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionPostProcessor.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionPostProcessor.java deleted file mode 100644 index 5475fe3b06..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionPostProcessor.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.processor; - -import org.apache.tuscany.sca.contribution.Contribution; - -/** - * A processor invoked after the contribution is loaded - * - * @version $Rev$ $Date$ - */ -public interface ContributionPostProcessor { - - /** - * Visitor pattern to post process the contribution - * - * @param contribution The contribution to be post processed - */ - void visit(Contribution contribution); -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionPostProcessorExtensionPoint.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionPostProcessorExtensionPoint.java deleted file mode 100644 index 4aa866b6f2..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ContributionPostProcessorExtensionPoint.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.processor; - -/** - * An extension point for contribution post processor extensions. - * - * @version $Rev$ $Date$ - */ -public interface ContributionPostProcessorExtensionPoint { - - /** - * Add a ContributionPostProcessor - * - * @param processor The post processor - */ - void addPostProcessor(ContributionPostProcessor processor); - - /** - * Remove a ContributionPostProcessor - * - * @param processor The post processor - */ - void removePostProcessor(ContributionPostProcessor processor); -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultArtifactProcessorExtensionPoint.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultArtifactProcessorExtensionPoint.java deleted file mode 100644 index 1c2faf9503..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultArtifactProcessorExtensionPoint.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.processor; - -import java.util.HashMap; -import java.util.Map; - -/** - * The default implementation of an artifact processor registry. - * - * @version $Rev$ $Date$ - */ -abstract class DefaultArtifactProcessorExtensionPoint

{ - protected final Map processorsByArtifactType = new HashMap(); - protected final Map, P> processorsByModelType = new HashMap, P>(); - - /** - * Constructs a new loader registry. - */ - public DefaultArtifactProcessorExtensionPoint() { - } - - /** - * Returns the processor associated with the given artifact type. - * - * @param artifactType An artifact type - * @return The processor associated with the given artifact type - */ - public P getProcessor(Object artifactType) { - return processorsByArtifactType.get(artifactType); - } - - /** - * Returns the processor associated with the given model type. - * - * @param modelType A model type - * @return The processor associated with the given model type - */ - public P getProcessor(Class modelType) { - Class[] classes = modelType.getInterfaces(); - for (Class c : classes) { - P processor = processorsByModelType.get(c); - if (processor != null) { - return processor; - } - } - return processorsByModelType.get(modelType); - } - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultPackageProcessorExtensionPoint.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultPackageProcessorExtensionPoint.java deleted file mode 100644 index 15fb1d838f..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultPackageProcessorExtensionPoint.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.processor; - -import java.util.HashMap; -import java.util.Map; - -/** - * Default implementation of ContributionProcessorRegistry - * - * @version $Rev$ $Date$ - */ -public class DefaultPackageProcessorExtensionPoint implements PackageProcessorExtensionPoint { - - /** - * Processor registry - */ - private Map registry = new HashMap(); - - public DefaultPackageProcessorExtensionPoint() { - } - - public void addPackageProcessor(PackageProcessor processor) { - registry.put(processor.getPackageType(), processor); - } - - public void removePackageProcessor(PackageProcessor processor) { - registry.remove(processor.getPackageType()); - } - - public PackageProcessor getPackageProcessor(String contentType) { - return registry.get(contentType); - } -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java deleted file mode 100644 index 8b9333666c..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultStAXArtifactProcessorExtensionPoint.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.processor; - -/** - * The default implementation of an extension point for StAX artifact processors. - * - * @version $Rev$ $Date$ - */ -public class DefaultStAXArtifactProcessorExtensionPoint - extends DefaultArtifactProcessorExtensionPoint - implements StAXArtifactProcessorExtensionPoint { - - /** - * Constructs a new extension point. - */ - public DefaultStAXArtifactProcessorExtensionPoint() { - } - - public void addArtifactProcessor(StAXArtifactProcessor artifactProcessor) { - processorsByArtifactType.put((Object)artifactProcessor.getArtifactType(), artifactProcessor); - processorsByModelType.put(artifactProcessor.getModelType(), artifactProcessor); - } - - public void removeArtifactProcessor(StAXArtifactProcessor artifactProcessor) { - processorsByArtifactType.remove((Object)artifactProcessor.getArtifactType()); - processorsByModelType.remove(artifactProcessor.getModelType()); - } - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java deleted file mode 100644 index 47c81fd04d..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/DefaultURLArtifactProcessorExtensionPoint.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.processor; - -/** - * The default implementation of a StAX artifact processor registry. - * - * @version $Rev$ $Date$ - */ -public class DefaultURLArtifactProcessorExtensionPoint - extends DefaultArtifactProcessorExtensionPoint - implements URLArtifactProcessorExtensionPoint { - - /** - * Constructs a new extension point. - */ - public DefaultURLArtifactProcessorExtensionPoint() { - } - - public void addArtifactProcessor(URLArtifactProcessor artifactProcessor) { - processorsByArtifactType.put((Object)artifactProcessor.getArtifactType(), artifactProcessor); - processorsByModelType.put(artifactProcessor.getModelType(), artifactProcessor); - } - - public void removeArtifactProcessor(URLArtifactProcessor artifactProcessor) { - processorsByArtifactType.remove((Object)artifactProcessor.getArtifactType()); - processorsByModelType.remove(artifactProcessor.getModelType()); - } - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensiblePackageProcessor.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensiblePackageProcessor.java deleted file mode 100644 index ac8fd6f272..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensiblePackageProcessor.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.processor; - -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.util.List; - -import org.apache.tuscany.sca.contribution.service.ContributionException; -import org.apache.tuscany.sca.contribution.service.TypeDescriber; -import org.apache.tuscany.sca.contribution.service.UnsupportedContentTypeException; - -/** - * Default implementation of PackageProcessor. - * - * @version $Rev$ $Date$ - */ -public class ExtensiblePackageProcessor implements PackageProcessor { - - private PackageProcessorExtensionPoint processors; - - /** - * Helper method to describe contentType for each artifact - */ - private TypeDescriber packageTypeDescriber; - - public ExtensiblePackageProcessor(PackageProcessorExtensionPoint processors, TypeDescriber packageTypeDescriber) { - this.processors = processors; - this.packageTypeDescriber = packageTypeDescriber; - } - - public List getArtifacts(URL packageSourceURL, InputStream inputStream) - throws ContributionException, IOException { - String contentType = this.packageTypeDescriber.getType(packageSourceURL, null); - if (contentType == null) { - throw new UnsupportedContentTypeException("Unsupported contribution package", packageSourceURL.toString()); - } - - PackageProcessor packageProcessor = this.processors.getPackageProcessor(contentType); - if (packageProcessor == null) { - throw new UnsupportedContentTypeException(contentType, packageSourceURL.getPath()); - } - - return packageProcessor.getArtifacts(packageSourceURL, inputStream); - } - - public URL getArtifactURL(URL packageSourceURL, URI artifact) throws MalformedURLException { - String contentType = this.packageTypeDescriber.getType(packageSourceURL, null); - PackageProcessor packageProcessor = this.processors.getPackageProcessor(contentType); - return packageProcessor.getArtifactURL(packageSourceURL, artifact); - } - - public String getPackageType() { - return null; - } -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXArtifactProcessor.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXArtifactProcessor.java deleted file mode 100644 index 40575960f4..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleStAXArtifactProcessor.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.processor; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -import javax.xml.namespace.QName; -import javax.xml.stream.Location; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.contribution.service.ContributionWriteException; -import org.apache.tuscany.sca.contribution.service.UnrecognizedElementException; - -/** - * The default implementation of a StAX artifact processor registry. - * - * @version $Rev$ $Date$ - */ -public class ExtensibleStAXArtifactProcessor - implements StAXArtifactProcessor { - - private XMLInputFactory inputFactory; - private XMLOutputFactory outputFactory; - private StAXArtifactProcessorExtensionPoint processors; - - /** - * Constructs a new loader registry. - * @param inputFactory - * @param outputFactory - */ - public ExtensibleStAXArtifactProcessor(StAXArtifactProcessorExtensionPoint processors, XMLInputFactory inputFactory, XMLOutputFactory outputFactory) { - super(); - this.processors = processors; - this.inputFactory = inputFactory; - this.outputFactory = outputFactory; - this.outputFactory.setProperty("javax.xml.stream.isRepairingNamespaces", Boolean.TRUE); - } - - public Object read(XMLStreamReader source) throws ContributionReadException { - - // Delegate to the processor associated with the element qname - QName name = source.getName(); - StAXArtifactProcessor processor = (StAXArtifactProcessor)processors.getProcessor(name); - if (processor == null) { - return null; - } - try { - return processor.read(source); - } catch (XMLStreamException e) { - throw new ContributionReadException(e); - } - } - - @SuppressWarnings("unchecked") - public void write(Object model, XMLStreamWriter outputSource) throws ContributionWriteException { - - // Delegate to the processor associated with the model type - if (model != null) { - StAXArtifactProcessor processor = processors.getProcessor(model.getClass()); - if (processor != null) { - try { - processor.write(model, outputSource); - } catch (XMLStreamException e) { - throw new ContributionWriteException(e); - } - } - } - } - - @SuppressWarnings("unchecked") - public void resolve(Object model, ModelResolver resolver) throws ContributionResolveException { - - // Delegate to the processor associated with the model type - if (model != null) { - StAXArtifactProcessor processor = processors.getProcessor(model.getClass()); - if (processor != null) { - processor.resolve(model, resolver); - } - } - } - - /** - * Read a model from an input stream. - * @param is The artifact inputstream - * @param type Model type - * @return The model - * @throws ContributionReadException - */ - public MO read(InputStream is, Class type) throws ContributionReadException { - try { - XMLStreamReader reader; - try { - reader = inputFactory.createXMLStreamReader(is); - try { - reader.nextTag(); - QName name = reader.getName(); - Object mo = read(reader); - if (type.isInstance(mo)) { - return type.cast(mo); - } else { - UnrecognizedElementException e = new UnrecognizedElementException(name); - throw e; - } - } catch (ContributionReadException e) { - Location location = reader.getLocation(); - e.setLine(location.getLineNumber()); - e.setColumn(location.getColumnNumber()); - throw e; - } finally { - try { - reader.close(); - } catch (XMLStreamException e) { - // ignore - } - } - } finally { - try { - is.close(); - } catch (IOException e) { - // ignore - } - } - } catch (XMLStreamException e) { - ContributionReadException ce = new ContributionReadException(e); - throw ce; - } - } - - /** - * Write a model to an ouput stream. - * @param model - * @param os - * @throws ContributionWriteException - */ - public void write(Object model, OutputStream os) throws ContributionWriteException { - try { - XMLStreamWriter writer = outputFactory.createXMLStreamWriter(os); - write(model, writer); - writer.flush(); - writer.close(); - } catch (XMLStreamException e) { - throw new ContributionWriteException(e); - } - } - - public QName getArtifactType() { - return null; - } - - public Class getModelType() { - return null; - } -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java deleted file mode 100644 index 40917861da..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtensibleURLArtifactProcessor.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.processor; - -import java.net.URI; -import java.net.URL; - -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.contribution.service.UnrecognizedElementException; - -/** - * The default implementation of a URL artifact processor. - * - * @version $Rev$ $Date$ - */ -public class ExtensibleURLArtifactProcessor - implements URLArtifactProcessor { - - private URLArtifactProcessorExtensionPoint processors; - - /** - * Constructs a new URL artifact processor. - * - * @param processors - */ - public ExtensibleURLArtifactProcessor(URLArtifactProcessorExtensionPoint processors) { - this.processors = processors; - } - - @SuppressWarnings("unchecked") - public Object read(URL contributionURL, URI sourceURI, URL sourceURL) throws ContributionReadException { - URLArtifactProcessor processor = null; - - // Delegate to the processor associated with file extension - String extension = sourceURL.getFile(); - int extensionStart = extension.lastIndexOf('.'); - //handle files without extension (e.g NOTICE) - if (extensionStart > 0) { - extension = extension.substring(extensionStart); - processor = (URLArtifactProcessor)processors.getProcessor(extension); - } - if (processor == null) { - return null; - } - return processor.read(contributionURL, sourceURI, sourceURL); - } - - @SuppressWarnings("unchecked") - public void resolve(Object model, ModelResolver resolver) throws ContributionResolveException { - - // Delegate to the processor associated with the model type - if (model != null) { - URLArtifactProcessor processor = processors.getProcessor(model.getClass()); - if (processor != null) { - processor.resolve(model, resolver); - } - } - } - - public MO read(URL contributionURL, URI artifactURI, URL artifactUrl, Class type) - throws ContributionReadException { - Object mo = read(contributionURL, artifactURI, artifactUrl); - if (type.isInstance(mo)) { - return type.cast(mo); - } else { - UnrecognizedElementException e = new UnrecognizedElementException(null); - e.setResourceURI(artifactURI.toString()); - throw e; - } - } - - public String getArtifactType() { - return null; - } - - public Class getModelType() { - return null; - } - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/PackageProcessor.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/PackageProcessor.java deleted file mode 100644 index 28b268301f..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/PackageProcessor.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.processor; - -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.util.List; - -import org.apache.tuscany.sca.contribution.service.ContributionException; - -/** - * Contribution package processors - * These processors understand the internal format of the contribution and how to process the artifacts - * - * @version $Rev$ $Date$ - */ -public interface PackageProcessor { - - /** - * Returns the type of package supported by this package processor. - * - * @return the package type - */ - String getPackageType(); - - /** - * Retrieve a list of artifacts for the specific package type - * - * @param packageSourceURL Contribution package location URL - * @param inputStream Optional content of the package - * @return List of artifact URIs - * @throws ContributionException - * @throws IOException - */ - List getArtifacts(URL packageSourceURL, InputStream inputStream) throws ContributionException, IOException; - - /** - * Return the URL for an artifact in the package. - * This is needed in the case of special archives such as jar files that have special - * URL structure for internal artifacts - * - * @param packageSourceURL Contribution package location URL - * @param artifact The relative URI for the artifact - * @return The artifact URL - */ - URL getArtifactURL(URL packageSourceURL, URI artifact) throws MalformedURLException; - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/PackageProcessorExtensionPoint.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/PackageProcessorExtensionPoint.java deleted file mode 100644 index 27499b5847..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/PackageProcessorExtensionPoint.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.processor; - -/** - * An extension point for package processors - * - * @version $Rev$ $Date$ - */ -public interface PackageProcessorExtensionPoint { - - /** - * Register a PackageProcessor using the package type as the key - * - * @param processor The package processor - */ - void addPackageProcessor(PackageProcessor processor); - - /** - * Unregister a PackageProcessor - * - * @param processor The package processor - */ - void removePackageProcessor(PackageProcessor processor); - - /** - * Returns the PackageProcessor for the given package type. - * - * @param packageType The package type - * @return The package processor - */ - PackageProcessor getPackageProcessor(String packageType); - -} \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessor.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessor.java deleted file mode 100644 index 89c063a65e..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessor.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.processor; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionWriteException; - -/** - * An artifact processor that can read models from a StAX XMLStreamReader. - * - * @version $Rev$ $Date$ - */ -public interface StAXArtifactProcessor extends ArtifactProcessor { - - /** - * Reads a model from an input source. Examples of input sources are: a URI, a - * DOM node, an XML reader. - * - * @param inputSource The input source - * @return A model representation of the input. - */ - M read(XMLStreamReader inputSource) throws ContributionReadException, XMLStreamException; - - /** - * Writes a model to an ouput source. Examples of output sources are: a URI, a - * DOM node, an XML writer. - * - * @param model A model representing the source - * @param outputSource The output source - * @throws ContributionWriteException - * @throws XMLStreamException - */ - void write(M model, XMLStreamWriter outputSource) throws ContributionWriteException, XMLStreamException; - - /** - * Returns the type of artifact handled by this artifact processor. - * - * @return The type of artifact handled by this artifact processor - */ - QName getArtifactType(); -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessorExtensionPoint.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessorExtensionPoint.java deleted file mode 100644 index 9a6388119e..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/StAXArtifactProcessorExtensionPoint.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.processor; - -/** - * A registry for DOM artifact processors. - * - * @version $Rev$ $Date$ - */ -public interface StAXArtifactProcessorExtensionPoint extends - ArtifactProcessorExtensionPoint { - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessor.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessor.java deleted file mode 100644 index ca95036912..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessor.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.processor; - -import java.net.URI; -import java.net.URL; - -import org.apache.tuscany.sca.contribution.service.ContributionReadException; - -/** - * An artifact processor that can read models from an InputStream. - * - * @version $Rev$ $Date$ - */ -public interface URLArtifactProcessor extends ArtifactProcessor { - - /** - * Reads a model from an input source. Examples of input - * sources are: a URI, a DOM node, an XML reader. - * - * @param contributionURL Contribution location URL - * @param artifactURI Artifact URI - * @param artifactURL Artifact location URL - * @return A model representation of the input. - */ - M read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException; - - /** - * Returns the type of artifact handled by this artifact processor. - * - * @return The type of artifact handled by this artifact processor - */ - String getArtifactType(); - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessorExtensionPoint.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessorExtensionPoint.java deleted file mode 100644 index 95213f9dd1..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/URLArtifactProcessorExtensionPoint.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.processor; - -/** - * A registry for Stream artifact processors. - * - * @version $Rev$ $Date$ - */ -public interface URLArtifactProcessorExtensionPoint extends - ArtifactProcessorExtensionPoint { - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java deleted file mode 100644 index da216983ea..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ClassReference.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.resolver; - -import java.lang.ref.WeakReference; - -/** - * A weak reference to a class, which should be used to register classes - * with an ArtifactResolver and resolve these classes later. - * - * @version $Rev$ $Date$ - */ -public class ClassReference { - - private WeakReference clazz; - private String className; - - /** - * Constructs a new ClassReference. - * - * @param clazz The class reference - */ - public ClassReference(Class clazz) { - this.clazz = new WeakReference(clazz); - this.className = clazz.getName(); - } - - /** - * Constructs a new ClassReference. - * - * @param className The class name - */ - public ClassReference(String className) { - this.className = className; - } - - /** - * Get the referenced class. - * - * @return The referenced class - */ - public Class getJavaClass() { - if (clazz != null) { - return clazz.get(); - } else { - return null; - } - } - - /** - * Get the referenced class name. - * - * @return The class name - */ - public String getClassName() { - return className; - } - - /** - * Returns true if the class reference is unresolved. - * - * @return Wether or not the class has been resolved - */ - boolean isUnresolved() { - return clazz == null; - } - - @Override - public int hashCode() { - return className.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } else { - if (obj instanceof ClassReference) { - return className.equals(((ClassReference)obj).className); - } else { - return false; - } - } - } - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ModelResolver.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ModelResolver.java deleted file mode 100644 index 850f79fdea..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ModelResolver.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.resolver; - -/** - * SCA Assemblies reference many artifacts of a wide variety of types. These - * include: - *
    - *
  • Reference from one SCA composite to another SCA composite - *
  • Reference to PolicySet files - *
  • Reference to interface definition files, either WSDL or Java interfaces - *
  • Reference to XSD files - *
  • Reference to any of a wide variety of implementation artifact files, - * including Java classes, BPEL scripts, C++ DLLs and classes, PHP scripts - *
- * In the SCA assemblies, these various artifacts are referenced using either - * QNames or URIs that do not point to a specific entity. Resolution of these - * references to concrete artifacts is necessary as part of the operation of the - * SCA domain. - * - * @version $Rev$ $Date$ - */ -public interface ModelResolver { - - /** - * Resolve the model representing an artifact. - * - * @param modelClass the type of artifact - * @param unresolved the unresolved model - * @return the resolved model - */ - T resolveModel(Class modelClass, T unresolved); - - /** - * Add a resolved model. - * - * @param resolved The model - */ - void addModel(Object resolved); - - /** - * Remove a resolved model. - * - * @param resolved - * @return The removed model, or null if the model was not removed - */ - Object removeModel(Object resolved); - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/AbstractContributionException.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/AbstractContributionException.java deleted file mode 100644 index 7b58a9c2c3..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/AbstractContributionException.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.service; - -import java.io.PrintWriter; - -/** - * The root checked exception for the Contribution Service. - * - * @version $Rev: 508877 $ $Date: 2007-02-17 22:22:48 -0800 (Sat, 17 Feb 2007) $ - */ -public abstract class AbstractContributionException extends Exception { - private static final long serialVersionUID = -7847121698339635268L; - private final String identifier; - - /** - * Override constructor from Exception. - * - * @see Exception - */ - public AbstractContributionException() { - super(); - this.identifier = null; - } - - /** - * Override constructor from Exception. - * - * @param message passed to Exception - * @see Exception - */ - public AbstractContributionException(String message) { - super(message); - this.identifier = null; - } - - /** - * Override constructor from Exception. - * - * @param message passed to Exception - * @param identifier additional error information referred to in the error message - * @see Exception - */ - public AbstractContributionException(String message, String identifier) { - super(message); - this.identifier = identifier; - } - - /** - * Override constructor from Exception. - * - * @param message passed to Exception - * @param cause passed to Exception - * @see Exception - */ - public AbstractContributionException(String message, Throwable cause) { - super(message, cause); - this.identifier = null; - } - - /** - * Override constructor from Exception. - * - * @param message passed to Exception - * @param identifier additional error information referred to in the error message - * @param cause passed to Exception - * @see Exception - */ - public AbstractContributionException(String message, String identifier, Throwable cause) { - super(message, cause); - this.identifier = identifier; - } - - /** - * Override constructor from Exception. - * - * @param cause passed to Exception - * @see Exception - */ - public AbstractContributionException(Throwable cause) { - super(cause); - this.identifier = null; - } - - /** - * Returns a string representing additional error information referred to in the error message. - * - * @return additional error information - */ - public String getIdentifier() { - return identifier; - } - - public PrintWriter appendBaseMessage(PrintWriter writer) { - if (identifier == null) { - if (super.getMessage() == null) { - return writer; - } - return writer.append(super.getMessage()); - } - if (super.getMessage() != null) { - writer.append(super.getMessage()); - } - writer.append(" [").append(identifier).append(']'); - return writer; - } - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionException.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionException.java deleted file mode 100644 index 84dcdc19c5..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionException.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.service; - -/** - * Base class for exceptions raised by contribution services. - * - * @version $Rev: 519710 $ $Date: 2007-03-18 15:19:16 -0700 (Sun, 18 Mar 2007) $ - */ -public class ContributionException extends AbstractContributionException { - /** - * - */ - private static final long serialVersionUID = 4432880414927652578L; - - protected ContributionException() { - super(); - } - - protected ContributionException(String message) { - super(message); - } - - protected ContributionException(String message, String identifier) { - super(message, identifier); - } - - protected ContributionException(String message, Throwable cause) { - super(message, cause); - } - - protected ContributionException(String message, String identifier, Throwable cause) { - super(message, identifier, cause); - } - - public ContributionException(Throwable cause) { - super(cause); - } -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionMetadataLoader.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionMetadataLoader.java deleted file mode 100644 index e41b13a567..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionMetadataLoader.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.service; - -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.contribution.Contribution; - -/** - * Loader responsible to process the contribution metadata loader - * - * @version $Rev$ $Date$ - */ -public interface ContributionMetadataLoader { - /** - * Create the model object for Contribution Service metadata information - * - * @param contribution The contribution to populate with the proper values from the side file - * @param reader The XML stream reader positioned on the applicable START_ELEMENT - * @throws XMLStreamException - * @throws ContributionMetadataReadException - */ - void load(Contribution contribution, XMLStreamReader reader) throws XMLStreamException, ContributionMetadataLoaderException; -} \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionMetadataLoaderException.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionMetadataLoaderException.java deleted file mode 100644 index 7dd52c6c1a..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionMetadataLoaderException.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.service; - -/** - * Denotes an exception while processing the contribution metadata - * - * @version $Rev$ $Date$ - */ -public class ContributionMetadataLoaderException extends ContributionException { - private static final long serialVersionUID = 2442537028550702609L; - - public ContributionMetadataLoaderException() { - super(); - } - - public ContributionMetadataLoaderException(String message) { - super(message); - } - - public ContributionMetadataLoaderException(String message, String identifier) { - super(message, identifier); - } - - public ContributionMetadataLoaderException(String message, Throwable cause) { - super(message, cause); - } - - public ContributionMetadataLoaderException(String message, String identifier, Throwable cause) { - super(message, identifier, cause); - } - - public ContributionMetadataLoaderException(Throwable cause) { - super(cause); - } - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionReadException.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionReadException.java deleted file mode 100644 index f84fd98f0b..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionReadException.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.service; - -/** - * Denotes an exception while reading artifacts inside an SCA contribution. - * - * @version $Rev: 526268 $ $Date: 2007-04-06 13:13:26 -0700 (Fri, 06 Apr 2007) $ - */ -public class ContributionReadException extends ContributionException { - public static final int UNDEFINED = -1; - private static final long serialVersionUID = -7459051598906813461L; - private String resourceURI; - private int line = UNDEFINED; - private int column = UNDEFINED; - - public ContributionReadException(String message) { - super(message); - } - - public ContributionReadException(String message, Throwable cause) { - super(message, cause); - } - - public ContributionReadException(Throwable cause) { - super(cause); - } - - /** - * Returns the location of the resource that was being read. - * - * @return the location of the resource that was being read - */ - public String getResourceURI() { - return resourceURI; - } - - /** - * Sets the location of the resource that was being read. - * - * @param resourceURI the location of the resource that was being read - */ - public void setResourceURI(String resourceURI) { - this.resourceURI = resourceURI; - } - - /** - * Returns the line inside the resource that was being read. - * @return the line inside the resource that was being read - */ - public int getLine() { - return line; - } - - /** - * Sets the line inside the resource that was being read. - * @param line the line inside the resource that was being read - */ - public void setLine(int line) { - this.line = line; - } - - /** - * Returns the column inside the resource that was being read. - * @return the column inside the resource that was being read - */ - public int getColumn() { - return column; - } - - /** - * Sets the column inside the resource that was being read. - * @param column the column inside the resource that was being read - */ - public void setColumn(int column) { - this.column = column; - } -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionRepository.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionRepository.java deleted file mode 100644 index d4c69bede3..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionRepository.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.service; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.net.URL; -import java.util.List; - -/** - * Contribution repository - * - * @version $Rev$ $Date$ - */ -public interface ContributionRepository { - /** - * Get the URI of the SCA domain - * - * @return The domain URI - */ - URI getDomain(); - - /** - * Copies a contribution to the repository. - * - * @param contribution A URl pointing to the contribution being copied to - * the repository - * @param sourceURL url of the source. this would be used to calculate the right - * filename to be stored on the repository when a inputStream is being - * provided - * @param contributionStream InputStream with the content of the - * distribution - * @return A URL pointing to the content of the contribution in the - * repository - * @throws IOException - */ - URL store(String contribution, URL sourceURL, InputStream contributionStream) throws IOException; - /** - * Copy a contribution from the source URL to the repository - * - * @param contribution A URl pointing to the contribution being copied to - * the repository - * @param sourceURL url of the source. this would be used to calculate the right - * filename to be stored on the repository when a inputStream is being - * provided - * @return A URL pointing to the content of the contribution in the - * repository - * @throws IOException - */ - URL store(String contribution, URL sourceURL) throws IOException; - - /** - * Look up the contribution by URI - * - * @param contribution The URI of the contribution - * @return A URL pointing to the content of the contribution in the - * repository, it will be null if the contribution cannot be found - * in the repository - */ - URL find(String contribution); - - /** - * Remove a contribution from the repository - * - * @param contribution The URI of the contribution to be removed - */ - void remove(String contribution); - - /** - * Get list of URIs for all the contributions in the repository - * - * @return A list of contribution URIs - */ - List list(); -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionResolveException.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionResolveException.java deleted file mode 100644 index e9392f55eb..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionResolveException.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.service; - -/** - * Denotes a problem while resolving models inside an SCA contribution. - * - * @version $Rev: 526268 $ $Date: 2007-04-06 13:13:26 -0700 (Fri, 06 Apr 2007) $ - */ -public class ContributionResolveException extends ContributionException { - private static final long serialVersionUID = -7459051598906813461L; - - public ContributionResolveException(String message) { - super(message); - } - - public ContributionResolveException(String message, Throwable cause) { - super(message, cause); - } - - public ContributionResolveException(Throwable cause) { - super(cause); - } - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionRuntimeException.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionRuntimeException.java deleted file mode 100644 index 90dae0018c..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionRuntimeException.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.service; - -/** - * Base class for runtime exceptions raised by contribution services. - * - * @version $Rev: 526837 $ $Date: 2007-04-09 10:10:18 -0700 (Mon, 09 Apr 2007) $ - */ -public class ContributionRuntimeException extends RuntimeException { - private static final long serialVersionUID = 7711215366287498896L; - - protected ContributionRuntimeException() { - super(); - } - - protected ContributionRuntimeException(String message) { - super(message); - } - - protected ContributionRuntimeException(String message, Throwable cause) { - super(message, cause); - } - - public ContributionRuntimeException(Throwable cause) { - super(cause); - } -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionService.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionService.java deleted file mode 100644 index 1b21e60fbe..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionService.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.service; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; - -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; - -/** - * Service interface that manages artifacts contributed to a Tuscany runtime. - * - * @version $Rev: 527398 $ $Date: 2007-04-10 23:43:31 -0700 (Tue, 10 Apr 2007) $ - */ -public interface ContributionService { - /** - * Contribute an artifact to the SCA Domain. The type of the contribution is - * determined by the Content-Type of the resource or, if that is undefined, - * by some implementation-specific means (such as mapping an extension in - * the URL's path). - * - * @param contributionURI The URI that is used as the contribution unique ID. - * @param sourceURL The location of the resource containing the artifact - * @param modelResolver The model resolver to use to resolve models in the - * scope of this contribution - * @param storeInRepository Flag that identifies if you want to copy the - * contribution to the repository - * @return The contribution model representing the contribution - * @throws DeploymentException if there was a problem with the contribution - * @throws IOException if there was a problem reading the resource - */ - Contribution contribute(String contributionURI, URL sourceURL, ModelResolver modelResolver, boolean storeInRepository) throws ContributionException, - IOException; - - /** - * Contribute an artifact to the SCA Domain. - * - * @param contributionURI The URI that is used as the contribution unique ID. - * @param sourceURL The location of the resource containing the artifact. - * This is used to identify what name should be used when storing - * the contribution on the repository - * @param modelResolver The model resolver to use to resolve models in the - * scope of this contribution - * @param contributionContent A stream containing the resource being - * contributed; the stream will not be closed but the read - * position after the call is undefined - * @return The contribution model representing the contribution - * @throws DeploymentException if there was a problem with the contribution - * @throws IOException if there was a problem reading the stream - */ - Contribution contribute(String contributionURI, URL sourceURL, InputStream contributionContent, ModelResolver modelResolver) - throws ContributionException, IOException; - - /** - * Get the model for an installed contribution - * - * @param contribution The URI of an installed contribution - * @return The model for the contribution or null if there is no such - * contribution - */ - Contribution getContribution(String contribution); - - /** - * Adds or updates a deployment composite using a supplied composite - * ("composite by value" - a data structure, not an existing resource in the - * domain) to the contribution identified by a supplied contribution URI. - * The added or updated deployment composite is given a relative URI that - * matches the "name" attribute of the composite, with a ".composite" - * suffix. - * - * @param contribution The contribution to where - * @param composite - * @throws ContributionException - */ - void addDeploymentComposite(Contribution contribution, Composite composite) throws ContributionException; - - /** - * Remove a contribution from the SCA domain - * - * @param contribution The URI of the contribution - * @throws DeploymentException - */ - void remove(String contribution) throws ContributionException; - -} \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionWireException.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionWireException.java deleted file mode 100644 index 6d13a0dfb7..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionWireException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.service; - - -/** - * Denotes a problem while wiring models inside an SCA contribution. - * - * @version $Rev: 526268 $ $Date: 2007-04-06 13:13:26 -0700 (Fri, 06 Apr 2007) $ - */ -public class ContributionWireException extends ContributionException { - private static final long serialVersionUID = -7459051598906813461L; - - public ContributionWireException(String message) { - super(message); - } - - public ContributionWireException(String message, Throwable cause) { - super(message, cause); - } - - public ContributionWireException(Throwable cause) { - super(cause); - } - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionWriteException.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionWriteException.java deleted file mode 100644 index db078ebdf3..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/ContributionWriteException.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.service; - - -/** - * Denotes an exception while writing artifacts inside an SCA contribution. - * - * @version $Rev: 526268 $ $Date: 2007-04-06 13:13:26 -0700 (Fri, 06 Apr 2007) $ - */ -public class ContributionWriteException extends ContributionException { - private static final long serialVersionUID = -7459051598906813461L; - private String resourceURI; - - public ContributionWriteException(String message) { - super(message); - } - - public ContributionWriteException(String message, Throwable cause) { - super(message, cause); - } - - public ContributionWriteException(Throwable cause) { - super(cause); - } - - /** - * Returns the location of the resource that was being written. - * - * @return the location of the resource that was being written - */ - public String getResourceURI() { - return resourceURI; - } - - /** - * Sets the location of the resource that was being written. - * - * @param resourceURI the location of the resource that was being written - */ - public void setResourceURI(String resourceURI) { - this.resourceURI = resourceURI; - } - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/InvalidConfigurationException.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/InvalidConfigurationException.java deleted file mode 100644 index a3ff0072a1..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/InvalidConfigurationException.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.service; - -/** - * Denotes an invalid configuration artifact - * - * @version $Rev: 525638 $ $Date: 2007-04-04 16:36:03 -0700 (Wed, 04 Apr 2007) $ - */ -public class InvalidConfigurationException extends ContributionReadException { - private static final long serialVersionUID = -4312958640212000366L; - - public InvalidConfigurationException(String message, Throwable cause) { - super(message, cause); - } - -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/TypeDescriber.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/TypeDescriber.java deleted file mode 100644 index 46ad89fc78..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/TypeDescriber.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.contribution.service; - -import java.net.URL; - -/** - * Provide content type for a given resource - * - * @version $Rev: 526079 $ $Date: 2007-04-06 00:17:44 -0700 (Fri, 06 Apr 2007) $ - */ -public interface TypeDescriber { - /** - * Get the content type for the specified resource - * - * @param resourceURL The resource url - * @param defaultType The default content type - * @return The content type - */ - String getType(URL resourceURL, String defaultType); -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/UnrecognizedElementException.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/UnrecognizedElementException.java deleted file mode 100644 index 42d74e5e22..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/UnrecognizedElementException.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.service; - -import javax.xml.namespace.QName; - -/** - * Exception that indicates an element was encountered that could not be handled. - * - * @version $Rev: 525638 $ $Date: 2007-04-04 16:36:03 -0700 (Wed, 04 Apr 2007) $ - */ -public class UnrecognizedElementException extends ContributionReadException { - private static final long serialVersionUID = 2549543622209829032L; - private final QName element; - - /** - * Constructor that indicates which element could not be handled. - * @param element the element that could not be handled - */ - public UnrecognizedElementException(QName element) { - super("Unrecognized element: " + element.toString()); - this.element = element; - } - - /** - * Returns the element that could not be handled. - * @return the element that could not be handled. - */ - public QName getElement() { - return element; - } -} diff --git a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/UnsupportedContentTypeException.java b/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/UnsupportedContentTypeException.java deleted file mode 100644 index 737362eb97..0000000000 --- a/branches/sca-java-0.90/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/service/UnsupportedContentTypeException.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.contribution.service; - -/** - * Exception thrown to indicate that a Content-Type is not supported by this SCA Domain. - * The Content-Type value supplied will be returned as the message text for this exception. - * - * @version $Rev: 522653 $ $Date: 2007-03-26 15:30:21 -0700 (Mon, 26 Mar 2007) $ - */ -public class UnsupportedContentTypeException extends ContributionException { - private static final long serialVersionUID = -1831797280021355672L; - - /** - * Constructor specifying the Content-Type value that is not supported. - * - * @param contentType the type that is not supported - */ - public UnsupportedContentTypeException(String contentType) { - super(contentType); - } - - /** - * Constructor specifying the Content-Type value that is not supported - * and an identifier to use with this exception (typically the resource being processed). - * - * @param contentType the type that is not supported - * @param identifier an identifier for this exception - */ - public UnsupportedContentTypeException(String contentType, String identifier) { - super(contentType, identifier); - } -} diff --git a/branches/sca-java-0.90/modules/core-databinding/.checkstyle b/branches/sca-java-0.90/modules/core-databinding/.checkstyle deleted file mode 100644 index c7b30ffd5e..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/.checkstyle +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/branches/sca-java-0.90/modules/core-databinding/.pmd b/branches/sca-java-0.90/modules/core-databinding/.pmd deleted file mode 100644 index 2db10d6a6a..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/.pmd +++ /dev/null @@ -1,20 +0,0 @@ - - -truefalse \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/core-databinding/.ruleset b/branches/sca-java-0.90/modules/core-databinding/.ruleset deleted file mode 100644 index ba9b5ce886..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/core-databinding/DISCLAIMER b/branches/sca-java-0.90/modules/core-databinding/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/core-databinding/LICENSE b/branches/sca-java-0.90/modules/core-databinding/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/core-databinding/NOTICE b/branches/sca-java-0.90/modules/core-databinding/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/core-databinding/pom.xml b/branches/sca-java-0.90/modules/core-databinding/pom.xml deleted file mode 100644 index be77b02907..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/pom.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - 4.0.0 - org.apache.tuscany.sca - tuscany-core-databinding - jar - Apache Tuscany Core/DataBinding Integration - Apache Tuscany Core/DataBinding Integration - - - org.apache.tuscany.sca - tuscany-databinding - ${project.version} - compile - - - - org.apache.tuscany.sca - tuscany-core-spi - ${project.version} - compile - - - - org.apache.tuscany.sca - tuscany-interface-java-xml - ${project.version} - compile - - - - org.codehaus.woodstox - wstx-asl - runtime - 3.2.0 - - - - stax - stax-api - 1.0.1 - - - - - diff --git a/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/module/DataBindingModuleActivator.java b/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/module/DataBindingModuleActivator.java deleted file mode 100644 index 32666174b2..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/module/DataBindingModuleActivator.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.core.databinding.module; - -import org.apache.tuscany.core.databinding.processor.DataBindingJavaInterfaceProcessor; -import org.apache.tuscany.core.databinding.transformers.Exception2ExceptionTransformer; -import org.apache.tuscany.core.databinding.transformers.Input2InputTransformer; -import org.apache.tuscany.core.databinding.transformers.Output2OutputTransformer; -import org.apache.tuscany.core.databinding.wire.DataBindingRuntimeWireProcessor; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.ModuleActivator; -import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; -import org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint; -import org.apache.tuscany.sca.databinding.DefaultTransformerExtensionPoint; -import org.apache.tuscany.sca.databinding.TransformerExtensionPoint; -import org.apache.tuscany.sca.databinding.impl.MediatorImpl; -import org.apache.tuscany.sca.databinding.impl.Group2GroupTransformer; -import org.apache.tuscany.sca.databinding.javabeans.DOMNode2JavaBeanTransformer; -import org.apache.tuscany.sca.databinding.javabeans.JavaBean2DOMNodeTransformer; -import org.apache.tuscany.sca.databinding.javabeans.JavaBeansDataBinding; -import org.apache.tuscany.sca.databinding.xml.DOMDataBinding; -import org.apache.tuscany.sca.databinding.xml.InputSource2Node; -import org.apache.tuscany.sca.databinding.xml.InputSource2SAX; -import org.apache.tuscany.sca.databinding.xml.InputStream2Node; -import org.apache.tuscany.sca.databinding.xml.InputStream2SAX; -import org.apache.tuscany.sca.databinding.xml.Node2OutputStream; -import org.apache.tuscany.sca.databinding.xml.Node2String; -import org.apache.tuscany.sca.databinding.xml.Node2Writer; -import org.apache.tuscany.sca.databinding.xml.Node2XMLStreamReader; -import org.apache.tuscany.sca.databinding.xml.Reader2Node; -import org.apache.tuscany.sca.databinding.xml.Reader2SAX; -import org.apache.tuscany.sca.databinding.xml.SAX2DOMPipe; -import org.apache.tuscany.sca.databinding.xml.Source2ResultTransformer; -import org.apache.tuscany.sca.databinding.xml.StreamDataPipe; -import org.apache.tuscany.sca.databinding.xml.String2Node; -import org.apache.tuscany.sca.databinding.xml.String2SAX; -import org.apache.tuscany.sca.databinding.xml.String2XMLStreamReader; -import org.apache.tuscany.sca.databinding.xml.Writer2ReaderDataPipe; -import org.apache.tuscany.sca.databinding.xml.XMLGroupDataBinding; -import org.apache.tuscany.sca.databinding.xml.XMLStreamReader2Node; -import org.apache.tuscany.sca.databinding.xml.XMLStreamReader2SAX; -import org.apache.tuscany.sca.databinding.xml.XMLStreamReader2String; -import org.apache.tuscany.sca.databinding.xml.XMLStringDataBinding; -import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceIntrospectorExtensionPoint; -import org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint; - -/** - * @version $Rev$ $Date$ - */ -public class DataBindingModuleActivator implements ModuleActivator { - - private DataBindingExtensionPoint dataBindings; - private TransformerExtensionPoint transformers; - - public Object[] getExtensionPoints() { - dataBindings = new DefaultDataBindingExtensionPoint(); - transformers = new DefaultTransformerExtensionPoint(dataBindings); - return new Object[] { dataBindings, transformers }; - } - - public void start(ExtensionPointRegistry registry) { - MediatorImpl mediator = new MediatorImpl(dataBindings, transformers); - Input2InputTransformer input2InputTransformer = new Input2InputTransformer(); - input2InputTransformer.setMediator(mediator); - - Output2OutputTransformer output2OutputTransformer = new Output2OutputTransformer(); - output2OutputTransformer.setMediator(mediator); - - Exception2ExceptionTransformer exception2ExceptionTransformer = new Exception2ExceptionTransformer(); - exception2ExceptionTransformer.setMediator(mediator); - - transformers.addTransformer(input2InputTransformer); - transformers.addTransformer(output2OutputTransformer); - transformers.addTransformer(exception2ExceptionTransformer); - - JavaInterfaceIntrospectorExtensionPoint introspectors = registry - .getExtensionPoint(JavaInterfaceIntrospectorExtensionPoint.class); - introspectors.addInterfaceVisitor(new DataBindingJavaInterfaceProcessor(dataBindings)); - - RuntimeWireProcessorExtensionPoint wireProcessorExtensionPoint = registry - .getExtensionPoint(RuntimeWireProcessorExtensionPoint.class); - if (wireProcessorExtensionPoint != null) { - wireProcessorExtensionPoint.addWireProcessor(new DataBindingRuntimeWireProcessor(mediator)); - } - - DOMDataBinding domDataBinding = new DOMDataBinding(); - domDataBinding.setDataBindingRegistry(dataBindings); - dataBindings.addDataBinding(domDataBinding); - XMLStringDataBinding xmlStringDataBinding = new XMLStringDataBinding(); - xmlStringDataBinding.setDataBindingRegistry(dataBindings); - dataBindings.addDataBinding(xmlStringDataBinding); - XMLGroupDataBinding xmlGroupDataBinding = new XMLGroupDataBinding(); - xmlGroupDataBinding.setDataBindingRegistry(dataBindings); - dataBindings.addDataBinding(xmlGroupDataBinding); - JavaBeansDataBinding javaBeansDataBinding = new JavaBeansDataBinding(); - javaBeansDataBinding.setDataBindingRegistry(dataBindings); - dataBindings.addDataBinding(javaBeansDataBinding); - - Group2GroupTransformer group2GroupTransformer = new Group2GroupTransformer(); - group2GroupTransformer.setMediator(mediator); - transformers.addTransformer(group2GroupTransformer); - - transformers.addTransformer(new InputSource2Node()); - transformers.addTransformer(new InputSource2SAX()); - transformers.addTransformer(new InputStream2Node()); - transformers.addTransformer(new InputStream2SAX()); - - transformers.addTransformer(new DOMNode2JavaBeanTransformer()); - transformers.addTransformer(new Node2OutputStream()); - transformers.addTransformer(new Node2String()); - transformers.addTransformer(new Node2Writer()); - transformers.addTransformer(new Node2XMLStreamReader()); - - transformers.addTransformer(new JavaBean2DOMNodeTransformer()); - transformers.addTransformer(new Reader2Node()); - - transformers.addTransformer(new Reader2SAX()); - transformers.addTransformer(new SAX2DOMPipe()); - - transformers.addTransformer(new Source2ResultTransformer()); - transformers.addTransformer(new StreamDataPipe()); - transformers.addTransformer(new String2Node()); - transformers.addTransformer(new String2SAX()); - transformers.addTransformer(new String2XMLStreamReader()); - transformers.addTransformer(new Writer2ReaderDataPipe()); - - transformers.addTransformer(new XMLStreamReader2Node()); - transformers.addTransformer(new XMLStreamReader2SAX()); - transformers.addTransformer(new XMLStreamReader2String()); - } - - public void stop(ExtensionPointRegistry registry) { - } -} diff --git a/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/processor/DataBindingJavaInterfaceProcessor.java b/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/processor/DataBindingJavaInterfaceProcessor.java deleted file mode 100644 index b26846c682..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/processor/DataBindingJavaInterfaceProcessor.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.core.databinding.processor; - -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; -import org.apache.tuscany.sca.databinding.annotation.DataBinding; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.java.JavaInterface; -import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor; -import org.osoa.sca.annotations.Reference; - -/** - * The databinding annotation processor for java interfaces - * - * @version $Rev$ $Date$ - */ -public class DataBindingJavaInterfaceProcessor implements JavaInterfaceVisitor { - private DataBindingExtensionPoint dataBindingRegistry; - - public DataBindingJavaInterfaceProcessor(@Reference - DataBindingExtensionPoint dataBindingRegistry) { - super(); - this.dataBindingRegistry = dataBindingRegistry; - } - - public void visitInterface(JavaInterface javaInterface) throws InvalidInterfaceException { - if (!javaInterface.isRemotable()) { - return; - } - List operations = javaInterface.getOperations(); - processInterface(javaInterface, operations); - } - - private void introspectWrapperStyle(Operation operation) { - if (operation.isWrapperStyle()) { - return; - } - DataType outputType = operation.getOutputType(); - DataType> inputType = operation.getInputType(); - if (outputType == null || inputType == null) { - return; - } - if (inputType.getLogical().size() != 1) { - return; - } - DataType wrapperType = inputType.getLogical().get(0); - if (outputType.getDataBinding().equals(wrapperType.getDataBinding())) { - operation.setWrapperStyle(true); - operation.setDataBinding(outputType.getDataBinding()); - } - } - - private void processInterface(JavaInterface javaInterface, List operations) { - Class clazz = javaInterface.getJavaClass(); - DataBinding dataBinding = clazz.getAnnotation(DataBinding.class); - String dataBindingId = null; - boolean wrapperStyle = false; - if (dataBinding != null) { - dataBindingId = dataBinding.value(); - wrapperStyle = dataBinding.wrapperStyle(); - } - - Map opMap = new HashMap(); - for (Operation op : javaInterface.getOperations()) { - opMap.put(op.getName(), op); - if (dataBindingId != null) { - op.setDataBinding(dataBindingId); - op.setWrapperStyle(wrapperStyle); - } - } - for (Method method : clazz.getMethods()) { - Operation operation = opMap.get(method.getName()); - DataBinding methodDataBinding = clazz.getAnnotation(DataBinding.class); - if (methodDataBinding == null) { - methodDataBinding = dataBinding; - } - dataBindingId = null; - wrapperStyle = false; - if (dataBinding != null) { - dataBindingId = dataBinding.value(); - wrapperStyle = dataBinding.wrapperStyle(); - operation.setDataBinding(dataBindingId); - operation.setWrapperStyle(wrapperStyle); - } - - // FIXME: We need a better way to identify simple java types - for (org.apache.tuscany.sca.interfacedef.DataType d : operation.getInputType().getLogical()) { - if (d.getDataBinding() == null) { - d.setDataBinding(dataBindingId); - } - dataBindingRegistry.introspectType(d, method.getAnnotations()); - } - if (operation.getOutputType() != null) { - DataType d = operation.getOutputType(); - if (d.getDataBinding() == null) { - d.setDataBinding(dataBindingId); - } - dataBindingRegistry.introspectType(d, method.getAnnotations()); - } - for (org.apache.tuscany.sca.interfacedef.DataType d : operation.getFaultTypes()) { - if (d.getDataBinding() == null) { - d.setDataBinding(dataBindingId); - } - dataBindingRegistry.introspectType(d, method.getAnnotations()); - } - - // FIXME: Do we want to heuristically check the wrapper style? - // introspectWrapperStyle(operation); - } - } -} diff --git a/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/transformers/Exception2ExceptionTransformer.java b/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/transformers/Exception2ExceptionTransformer.java deleted file mode 100644 index 9711fe881a..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/transformers/Exception2ExceptionTransformer.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.core.databinding.transformers; - -import org.apache.tuscany.sca.databinding.DataBinding; -import org.apache.tuscany.sca.databinding.ExceptionHandler; -import org.apache.tuscany.sca.databinding.Mediator; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.Transformer; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -/** - * This is a special transformer to transform the exception from one IDL to the - * other one - */ -@Service(Transformer.class) -public class Exception2ExceptionTransformer extends BaseTransformer implements - PullTransformer { - - protected Mediator mediator; - - public Exception2ExceptionTransformer() { - super(); - } - - @Override - public String getSourceDataBinding() { - return DataBinding.IDL_FAULT; - } - - @Override - public String getTargetDataBinding() { - return DataBinding.IDL_FAULT; - } - - /** - * @param mediator the mediator to set - */ - @Reference - public void setMediator(Mediator mediator) { - this.mediator = mediator; - } - - /** - * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getSourceType() - */ - @Override - protected Class getSourceType() { - return Exception.class; - } - - /** - * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getTargetType() - */ - @Override - protected Class getTargetType() { - return Exception.class; - } - - /** - * @see org.apache.tuscany.sca.databinding.Transformer#getWeight() - */ - public int getWeight() { - return 10000; - } - - @SuppressWarnings("unchecked") - public Exception transform(Exception source, TransformationContext context) { - DataType sourceType = context.getSourceDataType(); - - DataType targetType = context.getTargetDataType(); - - ExceptionHandler exceptionHandler = getExceptionHandler(sourceType); - if (exceptionHandler == null) { - return source; - } - - Object sourceFaultInfo = exceptionHandler.getFaultInfo(source); - Object targetFaultInfo = - mediator.mediate(sourceFaultInfo, sourceType.getLogical(), targetType.getLogical(), context.getMetadata()); - - ExceptionHandler targetHandler = getExceptionHandler(targetType); - - if (targetHandler != null) { - Exception targetException = - targetHandler.createException(targetType, source.getMessage(), targetFaultInfo, source.getCause()); - return targetException; - } - - // FIXME - return source; - - } - - private ExceptionHandler getExceptionHandler(DataType targetType) { - DataType targetFaultType = (DataType)targetType.getLogical(); - DataBinding targetDataBinding = - mediator.getDataBindings().getDataBinding(targetFaultType.getDataBinding()); - if (targetDataBinding == null) { - return null; - } - ExceptionHandler targetHandler = targetDataBinding.getExceptionHandler(); - return targetHandler; - } -} diff --git a/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/transformers/Input2InputTransformer.java b/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/transformers/Input2InputTransformer.java deleted file mode 100644 index 3b4a189193..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/transformers/Input2InputTransformer.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.core.databinding.transformers; - -import java.util.List; - -import org.apache.tuscany.sca.databinding.DataBinding; -import org.apache.tuscany.sca.databinding.Mediator; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.Transformer; -import org.apache.tuscany.sca.databinding.WrapperHandler; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.ElementInfo; -import org.apache.tuscany.sca.interfacedef.util.WrapperInfo; -import org.apache.tuscany.sca.interfacedef.util.XMLType; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -/** - * This is a special transformer to transform the input from one IDL to the - * other one - */ -@Service(Transformer.class) -public class Input2InputTransformer extends BaseTransformer implements - PullTransformer { - - protected Mediator mediator; - - public Input2InputTransformer() { - super(); - } - - @Override - public String getSourceDataBinding() { - return DataBinding.IDL_INPUT; - } - - @Override - public String getTargetDataBinding() { - return DataBinding.IDL_INPUT; - } - - /** - * @param mediator the mediator to set - */ - @Reference - public void setMediator(Mediator mediator) { - this.mediator = mediator; - } - - /** - * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getSourceType() - */ - @Override - protected Class getSourceType() { - return Object[].class; - } - - /** - * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getTargetType() - */ - @Override - protected Class getTargetType() { - return Object[].class; - } - - /** - * @see org.apache.tuscany.sca.databinding.Transformer#getWeight() - */ - public int getWeight() { - return 10000; - } - - @SuppressWarnings("unchecked") - public Object[] transform(Object[] source, TransformationContext context) { - DataType> sourceType = context.getSourceDataType(); - Operation sourceOp = context.getSourceOperation(); - boolean sourceWrapped = sourceOp != null && sourceOp.isWrapperStyle(); - - WrapperHandler sourceWrapperHandler = null; - String sourceDataBinding = getDataBinding(sourceOp); - if (sourceWrapped) { - sourceWrapperHandler = getWrapperHandler(sourceDataBinding, true); - } - - DataType> targetType = context.getTargetDataType(); - Operation targetOp = (Operation)context.getTargetOperation(); - boolean targetWrapped = targetOp != null && targetOp.isWrapperStyle(); - WrapperHandler targetWrapperHandler = null; - String targetDataBinding = null; - if (targetWrapped) { - targetDataBinding = getDataBinding(targetOp); - targetWrapperHandler = getWrapperHandler(targetDataBinding, true); - } - - if ((!sourceWrapped) && targetWrapped) { - // Unwrapped --> Wrapped - WrapperInfo wrapper = targetOp.getWrapper(); - ElementInfo wrapperElement = wrapper.getInputWrapperElement(); - - // If the source can be wrapped, wrapped it first - if (sourceWrapperHandler != null) { - Object sourceWrapper = sourceWrapperHandler.create(wrapperElement, context); - for (int i = 0; i < source.length; i++) { - ElementInfo argElement = wrapper.getInputChildElements().get(i); - sourceWrapperHandler.setChild(sourceWrapper, i, argElement, source[0]); - } - } - Object targetWrapper = targetWrapperHandler.create(wrapperElement, context); - if (source == null) { - return new Object[] {targetWrapper}; - } - List argTypes = wrapper.getUnwrappedInputType().getLogical(); - - for (int i = 0; i < source.length; i++) { - ElementInfo argElement = wrapper.getInputChildElements().get(i); - DataType argType = argTypes.get(i); - Object child = source[i]; - child = mediator.mediate(source[i], sourceType.getLogical().get(i), argType, context.getMetadata()); - targetWrapperHandler.setChild(targetWrapper, i, argElement, child); - } - return new Object[] {targetWrapper}; - } else if (sourceWrapped && (!targetWrapped)) { - // Wrapped to Unwrapped - Object sourceWrapper = source[0]; - // List childElements = - // sourceOp.getWrapper().getInputChildElements(); - Object[] target = null; - - targetWrapperHandler = getWrapperHandler(targetDataBinding, false); - if (targetWrapperHandler != null) { - ElementInfo wrapperElement = sourceOp.getWrapper().getInputWrapperElement(); - // Object targetWrapper = - // targetWrapperHandler.create(wrapperElement, context); - DataType targetWrapperType = new DataTypeImpl(targetDataBinding, Object.class, - new XMLType(wrapperElement)); - Object targetWrapper = mediator.mediate(sourceWrapper, - sourceType.getLogical().get(0), - targetWrapperType, - context.getMetadata()); - target = targetWrapperHandler.getChildren(targetWrapper).toArray(); - } else { - Object[] sourceChildren = sourceWrapperHandler.getChildren(sourceWrapper).toArray(); - target = new Object[sourceChildren.length]; - for (int i = 0; i < sourceChildren.length; i++) { - DataType childType = sourceOp.getWrapper().getUnwrappedInputType().getLogical().get(i); - target[i] = mediator.mediate(sourceChildren[i], childType, targetType.getLogical().get(i), context - .getMetadata()); - } - } - return target; - } else { - // Assuming wrapper to wrapper conversion can be handled here as - // well - Object[] newArgs = new Object[source.length]; - for (int i = 0; i < source.length; i++) { - Object child = mediator.mediate(source[i], sourceType.getLogical().get(i), targetType.getLogical() - .get(i), context.getMetadata()); - newArgs[i] = child; - } - return newArgs; - } - } - - private WrapperHandler getWrapperHandler(String dataBindingId, boolean required) { - WrapperHandler wrapperHandler = null; - if (dataBindingId != null) { - DataBinding dataBinding = mediator.getDataBindings().getDataBinding(dataBindingId); - wrapperHandler = dataBinding == null ? null : dataBinding.getWrapperHandler(); - } - if (wrapperHandler == null && required) { - throw new TransformationException("No wrapper handler is provided for databinding: " + dataBindingId); - } - return wrapperHandler; - } - - private String getDataBinding(Operation operation) { - return operation.getDataBinding(); - } - -} diff --git a/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/transformers/Output2OutputTransformer.java b/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/transformers/Output2OutputTransformer.java deleted file mode 100644 index bf52cedbc2..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/transformers/Output2OutputTransformer.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.core.databinding.transformers; - -import java.util.List; - -import org.apache.tuscany.sca.databinding.DataBinding; -import org.apache.tuscany.sca.databinding.Mediator; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.Transformer; -import org.apache.tuscany.sca.databinding.WrapperHandler; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.ElementInfo; -import org.apache.tuscany.sca.interfacedef.util.WrapperInfo; -import org.apache.tuscany.sca.interfacedef.util.XMLType; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -/** - * This is a special transformer to transform the output from one IDL to the - * other one - */ -@Service(Transformer.class) -public class Output2OutputTransformer extends BaseTransformer implements - PullTransformer { - - protected Mediator mediator; - - /** - * @param wrapperHandler - */ - public Output2OutputTransformer() { - super(); - } - - /** - * @param mediator the mediator to set - */ - @Reference - public void setMediator(Mediator mediator) { - this.mediator = mediator; - } - - @Override - public String getSourceDataBinding() { - return DataBinding.IDL_OUTPUT; - } - - @Override - public String getTargetDataBinding() { - return DataBinding.IDL_OUTPUT; - } - - /** - * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getSourceType() - */ - @Override - protected Class getSourceType() { - return Object.class; - } - - /** - * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getTargetType() - */ - @Override - protected Class getTargetType() { - return Object.class; - } - - /** - * @see org.apache.tuscany.sca.databinding.Transformer#getWeight() - */ - public int getWeight() { - return 10; - } - - private String getDataBinding(Operation operation) { - return operation.getDataBinding(); - } - - private WrapperHandler getWrapperHandler(String dataBindingId, boolean required) { - WrapperHandler wrapperHandler = null; - if (dataBindingId != null) { - DataBinding dataBinding = mediator.getDataBindings().getDataBinding(dataBindingId); - wrapperHandler = dataBinding == null ? null : dataBinding.getWrapperHandler(); - } - if (wrapperHandler == null && required) { - throw new TransformationException("No wrapper handler is provided for databinding: " + dataBindingId); - } - return wrapperHandler; - } - - @SuppressWarnings("unchecked") - public Object transform(Object response, TransformationContext context) { - try { - DataType sourceType = context.getSourceDataType(); - Operation sourceOp = context.getSourceOperation(); - boolean sourceWrapped = sourceOp != null && sourceOp.isWrapperStyle(); - WrapperHandler sourceWrapperHandler = null; - if (sourceWrapped) { - sourceWrapperHandler = getWrapperHandler(getDataBinding(sourceOp), true); - } - - DataType targetType = context.getTargetDataType(); - Operation targetOp = context.getTargetOperation(); - boolean targetWrapped = targetOp != null && targetOp.isWrapperStyle(); - WrapperHandler targetWrapperHandler = null; - if (targetWrapped) { - targetWrapperHandler = getWrapperHandler(getDataBinding(targetOp), true); - } - - if ((!sourceWrapped) && targetWrapped) { - // Unwrapped --> Wrapped - WrapperInfo wrapper = targetOp.getWrapper(); - Object targetWrapper = targetWrapperHandler.create(wrapper.getOutputWrapperElement(), context); - - List childElements = wrapper.getOutputChildElements(); - if (childElements.isEmpty()) { - // void output - return targetWrapper; - } - ElementInfo argElement = childElements.get(0); - DataType argType = wrapper.getUnwrappedOutputType(); - Object child = response; - child = mediator.mediate(response, sourceType.getLogical(), argType, context.getMetadata()); - targetWrapperHandler.setChild(targetWrapper, 0, argElement, child); - return targetWrapper; - } else if (sourceWrapped && (!targetWrapped)) { - // Wrapped to Unwrapped - Object sourceWrapper = response; - List childElements = sourceOp.getWrapper().getOutputChildElements(); - if (childElements.isEmpty()) { - // The void output - return null; - } - targetWrapperHandler = getWrapperHandler(getDataBinding(targetOp), false); - if (targetWrapperHandler != null) { - ElementInfo wrapperElement = sourceOp.getWrapper().getInputWrapperElement(); - // Object targetWrapper = - // targetWrapperHandler.create(wrapperElement, context); - DataType targetWrapperType = new DataTypeImpl(targetType.getLogical() - .getDataBinding(), Object.class, new XMLType(wrapperElement)); - Object targetWrapper = mediator.mediate(sourceWrapper, - sourceType.getLogical(), - targetWrapperType, - context.getMetadata()); - return targetWrapperHandler.getChildren(targetWrapper).get(0); - } else { - Object child = sourceWrapperHandler.getChildren(sourceWrapper).get(0); - DataType childType = sourceOp.getWrapper().getUnwrappedOutputType(); - return mediator.mediate(child, childType, targetType.getLogical(), context.getMetadata()); - } - } else { - // FIXME: Do we want to handle wrapped to wrapped? - return mediator.mediate(response, sourceType.getLogical(), targetType.getLogical(), context - .getMetadata()); - } - } catch (Exception e) { - throw new TransformationException(e); - } - } - -} diff --git a/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/wire/DataBindingRuntimeWireProcessor.java b/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/wire/DataBindingRuntimeWireProcessor.java deleted file mode 100644 index feaf48f501..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/wire/DataBindingRuntimeWireProcessor.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.core.databinding.wire; - -import java.util.List; - -import org.apache.tuscany.sca.databinding.Mediator; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.runtime.RuntimeWire; -import org.apache.tuscany.sca.runtime.RuntimeWireProcessor; - -/** - * This processor is responsible to add an interceptor to invocation chain if - * the source and target operations have different databinding requirements - * - * @version $Rev$ $Date$ - */ -public class DataBindingRuntimeWireProcessor implements RuntimeWireProcessor { - private Mediator mediator; - - public DataBindingRuntimeWireProcessor(Mediator mediator) { - super(); - this.mediator = mediator; - } - - public boolean isTransformationRequired(DataType source, DataType target) { - if (source == target) { - return false; - } - String sourceDataBinding = source.getDataBinding(); - String targetDataBinding = target.getDataBinding(); - if (sourceDataBinding == targetDataBinding) { - return false; - } - if (sourceDataBinding == null || targetDataBinding == null) { - return true; - } - return !sourceDataBinding.equals(targetDataBinding); - } - - public boolean isTransformationRequired(Operation source, Operation target) { - if (source == target) { - return false; - } - - // Check output type - DataType sourceOutputType = source.getOutputType(); - DataType targetOutputType = target.getOutputType(); - - // Note the target output type is now the source for checking - // compatibility - if (isTransformationRequired(targetOutputType, sourceOutputType)) { - return true; - } - - List sourceInputType = source.getInputType().getLogical(); - List targetInputType = target.getInputType().getLogical(); - - int size = sourceInputType.size(); - for (int i = 0; i < size; i++) { - if (isTransformationRequired(sourceInputType.get(i), targetInputType.get(i))) { - return true; - } - } - - return false; - } - - private boolean isTransformationRequired(InterfaceContract sourceContract, - Operation sourceOperation, - InterfaceContract targetContract, - Operation targetOperation) { - if (targetContract == null) { - targetContract = sourceContract; - } - if (sourceContract == targetContract) { - return false; - } - return isTransformationRequired(sourceOperation, targetOperation); - } - - public void process(RuntimeWire wire) { - InterfaceContract sourceContract = wire.getSource().getInterfaceContract(); - InterfaceContract targetContract = wire.getTarget().getInterfaceContract(); - if (targetContract == null) { - targetContract = sourceContract; - } - if (sourceContract == targetContract) { - return; - } - List chains = wire.getInvocationChains(); - for (InvocationChain chain : chains) { - Operation sourceOperation = chain.getSourceOperation(); - Operation targetOperation = chain.getTargetOperation(); - - if (isTransformationRequired(sourceContract, sourceOperation, targetContract, targetOperation)) { - // Add the interceptor to the source side because multiple - // references can be wired - // to the same service - DataTransformationInteceptor interceptor = new DataTransformationInteceptor(wire, sourceOperation, - targetOperation); - interceptor.setMediator(mediator); - chain.addInterceptor(0, interceptor); - } - } - - // Object targetAddress = UriHelper.getBaseName(source.getUri()); - List callbackChains = wire.getCallbackInvocationChains(); - if (callbackChains == null) { - // callback chains could be null - return; - } - - for (InvocationChain chain : callbackChains) { - Operation sourceOperation = chain.getSourceOperation(); - Operation targetOperation = chain.getTargetOperation(); - if (isTransformationRequired(sourceContract, sourceOperation, targetContract, targetOperation)) { - - // Add the interceptor to the source side because multiple - // references can be wired - // to the same service - DataTransformationInteceptor interceptor = new DataTransformationInteceptor(wire, sourceOperation, - targetOperation); - interceptor.setMediator(mediator); - chain.addInterceptor(0, interceptor); - } - } - } - -} diff --git a/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/wire/DataTransformationInteceptor.java b/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/wire/DataTransformationInteceptor.java deleted file mode 100644 index 39bc6cf913..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/src/main/java/org/apache/tuscany/core/databinding/wire/DataTransformationInteceptor.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.core.databinding.wire; - -import java.lang.reflect.InvocationTargetException; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.sca.databinding.DataBinding; -import org.apache.tuscany.sca.databinding.ExceptionHandler; -import org.apache.tuscany.sca.databinding.Mediator; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.FaultException; -import org.apache.tuscany.sca.invocation.Interceptor; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.runtime.RuntimeWire; - -/** - * An interceptor to transform data accross databindings on the wire - * - * @version $Rev$ $Date$ - */ -public class DataTransformationInteceptor implements Interceptor { - private Invoker next; - - private Operation sourceOperation; - - private Operation targetOperation; - - private Mediator mediator; - - public DataTransformationInteceptor(RuntimeWire wire, - Operation sourceOperation, - Operation targetOperation) { - super(); - this.sourceOperation = sourceOperation; - this.targetOperation = targetOperation; - } - - public Invoker getNext() { - return next; - } - - public Message invoke(Message msg) { - Object input = transform(msg.getBody(), sourceOperation.getInputType(), targetOperation.getInputType(), false); - msg.setBody(input); - Message resultMsg = next.invoke(msg); - Object result = resultMsg.getBody(); - if (sourceOperation.isNonBlocking()) { - // Not to reset the message body - return resultMsg; - } - - // FIXME: Should we fix the Operation model so that getOutputType - // returns DataType>? - DataType targetType = - new DataTypeImpl(DataBinding.IDL_OUTPUT, Object.class, targetOperation.getOutputType()); - - DataType sourceType = - new DataTypeImpl(DataBinding.IDL_OUTPUT, Object.class, sourceOperation.getOutputType()); - - if (resultMsg.isFault()) { - - // FIXME: We need to figure out what fault type it is and then - // transform it - // back the source fault type - // throw new InvocationRuntimeException((Throwable) result); - - if ((result instanceof Exception) && !(result instanceof RuntimeException)) { - // FIXME: How to match fault data to a fault type for the - // operation? - - // If the result is from an InvocationTargetException look at - // the actual cause. - if (result instanceof InvocationTargetException) { - result = ((InvocationTargetException)result).getCause(); - } - DataType targetDataType = null; - for (DataType exType : targetOperation.getFaultTypes()) { - if (((Class)exType.getPhysical()).isInstance(result)) { - if (result instanceof FaultException) { - if (((FaultException)result).isMatchingType(exType.getLogical())) { - targetDataType = exType; - break; - } - } else { - targetDataType = exType; - break; - } - } - } - - if (targetDataType == null) { - // Not a business exception - return resultMsg; - } - - DataType targetFaultType = getFaultType(targetDataType); - if (targetFaultType == null) { - throw new TransformationException("Target fault type cannot be resolved"); - } - - // FIXME: How to match a source fault type to a target fault - // type? - DataType sourceDataType = null; - DataType sourceFaultType = null; - for (DataType exType : sourceOperation.getFaultTypes()) { - DataType faultType = getFaultType(exType); - // Match by the QName (XSD element) of the fault type - if (faultType != null && targetFaultType.getLogical().equals(faultType.getLogical())) { - sourceDataType = exType; - sourceFaultType = faultType; - break; - } - } - - if (sourceFaultType == null) { - throw new TransformationException("No matching source fault type is found"); - } - - Object newResult = - transformException(result, targetDataType, sourceDataType, targetFaultType, sourceFaultType); - if (newResult != result) { - resultMsg.setFaultBody(newResult); - } - } - - } else { - assert !(result instanceof Throwable) : "Expected messages that are not throwable " + result; - - Object newResult = transform(result, targetType, sourceType, true); - if (newResult != result) { - resultMsg.setBody(newResult); - } - } - - return resultMsg; - } - - private Object transform(Object source, DataType sourceType, DataType targetType, boolean isResponse) { - if (sourceType == targetType || (sourceType != null && sourceType.equals(targetType))) { - return source; - } - Map metadata = new HashMap(); - metadata.put("source.operation", isResponse? targetOperation: sourceOperation); - metadata.put("target.operation", isResponse? sourceOperation: targetOperation); - return mediator.mediate(source, sourceType, targetType, metadata); - } - - private DataType getFaultType(DataType exceptionType) { - // FIXME: We cannot assume the exception will have a databinding set - DataBinding targetDataBinding = - mediator.getDataBindings().getDataBinding(exceptionType.getDataBinding()); - if (targetDataBinding == null) { - return null; - } - ExceptionHandler targetHandler = targetDataBinding.getExceptionHandler(); - if (targetHandler == null) { - return null; - } - return targetHandler.getFaultType(exceptionType); - } - - /** - * @param source The source exception - * @param sourceExType The data type for the source exception - * @param targetExType The data type for the target exception - * @param sourceType The fault type for the source - * @param targetType The fault type for the target - * @return - */ - private Object transformException(Object source, - DataType sourceExType, - DataType targetExType, - DataType sourceType, - DataType targetType) { - if (sourceType == targetType || (sourceType != null && sourceType.equals(targetType))) { - return source; - } - Map metadata = new HashMap(); - metadata.put("source.operation", targetOperation); - metadata.put("target.operation", sourceOperation); - - DataType eSourceDataType = - new DataTypeImpl("idl:fault", sourceExType.getPhysical(), sourceType); - DataType eTargetDataType = - new DataTypeImpl("idl:fault", targetExType.getPhysical(), targetType); - - return mediator.mediate(source, eSourceDataType, eTargetDataType, metadata); - } - - public void setNext(Invoker next) { - this.next = next; - } - - /** - * @param mediator the mediator to set - */ - public void setMediator(Mediator mediator) { - this.mediator = mediator; - } - -} diff --git a/branches/sca-java-0.90/modules/core-databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-java-0.90/modules/core-databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator deleted file mode 100644 index 60f6de3b96..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# Implementation class for the ExtensionActivator -org.apache.tuscany.core.databinding.module.DataBindingModuleActivator diff --git a/branches/sca-java-0.90/modules/core-databinding/src/test/java/org/apache/tuscany/core/databinding/processor/DataBindingJavaInterfaceProcessorTestCase.java b/branches/sca-java-0.90/modules/core-databinding/src/test/java/org/apache/tuscany/core/databinding/processor/DataBindingJavaInterfaceProcessorTestCase.java deleted file mode 100644 index 1c521af842..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/src/test/java/org/apache/tuscany/core/databinding/processor/DataBindingJavaInterfaceProcessorTestCase.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.core.databinding.processor; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; -import org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint; -import org.apache.tuscany.sca.databinding.annotation.DataBinding; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.impl.OperationImpl; -import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory; -import org.apache.tuscany.sca.interfacedef.java.JavaInterface; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; -import org.osoa.sca.annotations.Remotable; -import org.w3c.dom.Node; - -/** - * - */ -public class DataBindingJavaInterfaceProcessorTestCase extends TestCase { - - /** - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - } - - /** - * @throws InvalidServiceContractException - */ - public final void testVisitInterface() throws InvalidInterfaceException { - DataBindingExtensionPoint registry = new DefaultDataBindingExtensionPoint(); - DataBindingJavaInterfaceProcessor processor = new DataBindingJavaInterfaceProcessor(registry); - JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory(); - - JavaInterface contract = javaFactory.createJavaInterface(); - contract.setJavaClass(MockInterface.class); - JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract(); - interfaceContract.setInterface(contract); - Operation operation = new OperationImpl("call"); - Operation operation1 = new OperationImpl("call1"); - contract.getOperations().add(operation); - contract.getOperations().add(operation1); - contract.setRemotable(true); - processor.visitInterface(contract); - // Assert.assertEquals("org.w3c.dom.Node", contract.getDataBinding()); - // Assert.assertEquals("org.w3c.dom.Node", - // contract.getOperations().get("call").getDataBinding()); - // Assert.assertEquals("xml:string", - // contract.getOperations().get("call1").getDataBinding()); - } - - @DataBinding("org.w3c.dom.Node") - @Remotable - public static interface MockInterface { - Node call(Node msg); - - @DataBinding("xml:string") - String call1(String msg); - } - -} diff --git a/branches/sca-java-0.90/modules/core-databinding/src/test/java/org/apache/tuscany/core/databinding/transformers/IDLTransformerTestCase.java.fixme b/branches/sca-java-0.90/modules/core-databinding/src/test/java/org/apache/tuscany/core/databinding/transformers/IDLTransformerTestCase.java.fixme deleted file mode 100644 index ecae54188c..0000000000 --- a/branches/sca-java-0.90/modules/core-databinding/src/test/java/org/apache/tuscany/core/databinding/transformers/IDLTransformerTestCase.java.fixme +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.core.databinding.transformers; - -import static org.apache.tuscany.spi.databinding.DataBinding.IDL_INPUT; -import static org.apache.tuscany.spi.databinding.DataBinding.IDL_OUTPUT; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import junit.framework.TestCase; - -import org.apache.tuscany.databinding.impl.DataBindingRegistryImpl; -import org.apache.tuscany.databinding.impl.MediatorImpl; -import org.apache.tuscany.databinding.impl.TransformationContextImpl; -import org.apache.tuscany.databinding.impl.TransformerRegistryImpl; -import org.apache.tuscany.databinding.javabeans.DOMNode2JavaBeanTransformer; -import org.apache.tuscany.databinding.javabeans.JavaBean2DOMNodeTransformer; -import org.apache.tuscany.databinding.xml.DOMDataBinding; -import org.apache.tuscany.databinding.xml.Node2String; -import org.apache.tuscany.databinding.xml.String2Node; -import org.apache.tuscany.interfacedef.DataType; -import org.apache.tuscany.interfacedef.Operation; -import org.apache.tuscany.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.interfacedef.impl.OperationImpl; -import org.apache.tuscany.interfacedef.util.ElementInfo; -import org.apache.tuscany.interfacedef.util.TypeInfo; -import org.apache.tuscany.interfacedef.util.WrapperInfo; -import org.apache.tuscany.interfacedef.util.XMLType; -import org.apache.tuscany.spi.databinding.DataBindingRegistry; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.extension.DOMHelper; -import org.apache.tuscany.spi.databinding.extension.SimpleTypeMapperExtension; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -public class IDLTransformerTestCase extends TestCase { - private static final String IPO_XML = "" + "" - + " " - + " Helen Zoe" - + " 47 Eden Street" - + " Cambridge" - + " CB1 1JR" - + " " - + " " - + " Robert Smith" - + " 8 Oak Avenue" - + " Old Town" - + " PA" - + " 95819" - + " " - + " " - + " " - + " Lapis necklace" - + " 1" - + " 99.95" - + " Want this for the holidays" - + " 1999-12-05" - + " " - + " " - + ""; - - private static final String URI_ORDER_XSD = "http://example.com/order.xsd"; - - /** - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - } - - public void testTransform() throws Exception { - List types0 = new ArrayList(); - DataType wrapperType = new DataTypeImpl(null, Object.class, - new XMLType(new QName(URI_ORDER_XSD, - "checkOrderStatus"), null)); - types0.add(wrapperType); - DataType> inputType0 = new DataTypeImpl>(IDL_INPUT, - Object[].class, types0); - - List types1 = new ArrayList(); - DataType customerIdType = new DataTypeImpl( - null, - Object.class, - new XMLType( - new QName(URI_ORDER_XSD, "customerId"), - null)); - DataType orderType = new DataTypeImpl(null, Object.class, - new XMLType(new QName(URI_ORDER_XSD, "order"), null)); - DataType flagType = new DataTypeImpl(null, Object.class, new XMLType(new QName(URI_ORDER_XSD, - "flag"), null)); - types1.add(customerIdType); - types1.add(orderType); - types1.add(flagType); - - DataType statusType = new DataTypeImpl(null, Object.class, - new XMLType(new QName(URI_ORDER_XSD, "status"), null)); - DataType responseType = new DataTypeImpl(null, Object.class, - new XMLType(new QName(URI_ORDER_XSD, - "checkOrderStatusResponse"), - null)); - - Operation op = new OperationImpl("checkOrderStatus"); - op.setInputType(inputType0); - op.setOutputType(responseType); -// op.setDataBinding(DOMDataBinding.NAME); -// -// inputType0.setOperation(op); - op.setWrapperStyle(true); - ElementInfo inputElement = new ElementInfo(new QName(URI_ORDER_XSD, "checkOrderStatus"), new TypeInfo(null, - false, - null)); -// wrapperType.setMetadata(ElementInfo.class.getName(), inputElement); - - ElementInfo customerId = new ElementInfo(new QName("", "customerId"), - SimpleTypeMapperExtension.XSD_SIMPLE_TYPES.get("string")); - ElementInfo order = new ElementInfo(new QName("", "order"), new TypeInfo(new QName(URI_ORDER_XSD), false, null)); - ElementInfo flag = new ElementInfo(new QName("", "flag"), SimpleTypeMapperExtension.XSD_SIMPLE_TYPES.get("int")); - -// customerIdType.setMetadata(ElementInfo.class.getName(), customerId); -// orderType.setMetadata(ElementInfo.class.getName(), order); -// flagType.setMetadata(ElementInfo.class.getName(), flag); -// -// customerIdType.setOperation(op); -// orderType.setOperation(op); -// flagType.setOperation(op); - - List inputElements = new ArrayList(); - inputElements.add(customerId); - inputElements.add(order); - inputElements.add(flag); - - ElementInfo statusElement = new ElementInfo(new QName("", "status"), SimpleTypeMapperExtension.XSD_SIMPLE_TYPES - .get("string")); - -// statusType.setMetadata(ElementInfo.class.getName(), statusElement); -// statusType.setOperation(op); - - List outputElements = new ArrayList(); - outputElements.add(statusElement); - - ElementInfo outputElement = new ElementInfo(new QName(URI_ORDER_XSD, "checkOrderStatusResponse"), - new TypeInfo(null, false, null)); - -// responseType.setMetadata(ElementInfo.class.getName(), inputElement); -// responseType.setOperation(op); - - WrapperInfo wrapperInfo = new WrapperInfo(DOMDataBinding.NAME, inputElement, outputElement, inputElements, - outputElements); - op.setWrapper(wrapperInfo); -// op.setDataBinding(DOMDataBinding.NAME); - - MediatorImpl m = new MediatorImpl(); - TransformerRegistryImpl tr = new TransformerRegistryImpl(); - tr.registerTransformer(new String2Node()); - tr.registerTransformer(new Node2String()); - tr.registerTransformer(new DOMNode2JavaBeanTransformer()); - tr.registerTransformer(new JavaBean2DOMNodeTransformer()); - m.setTransformerRegistry(tr); - DataBindingRegistry dataBindingRegistry = new DataBindingRegistryImpl(); - dataBindingRegistry.register(new DOMDataBinding()); - m.setDataBindingRegistry(dataBindingRegistry); - - Object[] source = new Object[] {"cust001", IPO_XML, Integer.valueOf(1)}; - Input2InputTransformer t = new Input2InputTransformer(); - t.setMediator(m); - - TransformationContext context = new TransformationContextImpl(); - context.setSourceOperation(op); - List> types = new ArrayList>(); - types.add(new DataTypeImpl(Object.class.getName(), String.class, String.class)); - types.add(new DataTypeImpl("java.lang.String", String.class, String.class)); - types.add(new DataTypeImpl(Object.class.getName(), int.class, int.class)); - DataType>> inputType1 = new DataTypeImpl>>(IDL_INPUT, Object[].class, - types); - context.setSourceDataType(inputType1); - context.setTargetDataType(op.getInputType()); - Object[] results = t.transform(source, context); - assertEquals(1, results.length); - assertTrue(results[0] instanceof Element); - Element element = (Element)results[0]; - assertEquals("http://example.com/order.xsd", element.getNamespaceURI()); - assertEquals("checkOrderStatus", element.getLocalName()); - - TransformationContext context1 = new TransformationContextImpl(); - DataType sourceType = new DataTypeImpl(IDL_OUTPUT, Object.class, op.getOutputType()); - - context1.setSourceDataType(sourceType); - DataType targetType = new DataTypeImpl(IDL_OUTPUT, Object.class, - new DataTypeImpl("java.lang.Object", - String.class, String.class)); - context1.setTargetDataType(targetType); - - Document factory = DOMHelper.newDocument(); - Element responseElement = factory - .createElementNS("http://example.com/order.wsdl", "p:checkOrderStatusResponse"); - Element status = factory.createElement("status"); - responseElement.appendChild(status); - status.appendChild(factory.createTextNode("shipped")); - Output2OutputTransformer t2 = new Output2OutputTransformer(); - t2.setMediator(m); - Object st = t2.transform(responseElement, context1); - assertEquals("shipped", st); - - } - -} diff --git a/branches/sca-java-0.90/modules/core-spi/.checkstyle b/branches/sca-java-0.90/modules/core-spi/.checkstyle deleted file mode 100644 index 3e57539570..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/.checkstyle +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/branches/sca-java-0.90/modules/core-spi/.pmd b/branches/sca-java-0.90/modules/core-spi/.pmd deleted file mode 100644 index 4abfdec2b5..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/.pmd +++ /dev/null @@ -1,20 +0,0 @@ - - -truefalse \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/core-spi/.ruleset b/branches/sca-java-0.90/modules/core-spi/.ruleset deleted file mode 100644 index 3886f07f2d..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/core-spi/DISCLAIMER b/branches/sca-java-0.90/modules/core-spi/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/core-spi/LICENSE b/branches/sca-java-0.90/modules/core-spi/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/core-spi/NOTICE b/branches/sca-java-0.90/modules/core-spi/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/core-spi/pom.xml b/branches/sca-java-0.90/modules/core-spi/pom.xml deleted file mode 100644 index 50e04075b9..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/pom.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - tuscany-core-spi - Apache Tuscany SCA Core SPI - - - - org.apache.tuscany.sca - sca-api - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-assembly - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-policy - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-interface - 0.90-incubating-SNAPSHOT - compile - - - - org.apache.tuscany.sca - tuscany-contribution - 0.90-incubating-SNAPSHOT - - - - stax - stax-api - 1.0.1 - - - - javax.servlet - servlet-api - 2.5 - provided - - - - org.codehaus.woodstox - wstx-asl - 3.2.0 - runtime - - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - package - package - - jar - - - - - true - true - Apache Tuscany is an effort undergoing incubation at the Apache Software Foundation(ASF) and sponsored by the Apache WS PMC. -
Apache Tuscany SCA Core SPI
-
Apache Tuscany SCA Core SPI
- ${basedir}/src/main/java${path.separator}${basedir}/target/generated/src/main/java -
-
-
-
- -
diff --git a/branches/sca-java-0.90/modules/core-spi/src/doc/Context Model.emx b/branches/sca-java-0.90/modules/core-spi/src/doc/Context Model.emx deleted file mode 100644 index 0445ea5a6b..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/doc/Context Model.emx +++ /dev/null @@ -1,673 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistry.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistry.java deleted file mode 100644 index 7a42300098..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistry.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core; - -import java.util.HashMap; -import java.util.Map; - - -/** - * Default implementation of a registry to hold all the Tuscany core extension - * points. As the point of contact for all extension artifacts this registry - * allows loaded extensions to find all other parts of the system and - * register themselves appropriately. - * - * @version $Rev$ $Date$ - */ -public class DefaultExtensionPointRegistry implements ExtensionPointRegistry { - private Map, Object> extensionPoints = new HashMap, Object>(); - - /** - * Add an extension point to the registry. This default implementation - * stores extensions against the interfaces that they implement. - * @param extensionPoint The instance of the extension point - */ - public void addExtensionPoint(Object extensionPoint) { - Class[] interfaces = extensionPoint.getClass().getInterfaces(); - for (int i = 0; i < interfaces.length; i++) { - extensionPoints.put(interfaces[i], extensionPoint); - } - } - - /** - * Get the extension point by the interface that it implements - * @param extensionPointType The lookup key (extension point interface) - * @return The instance of the extension point - */ - public T getExtensionPoint(Class extensionPointType) { - return extensionPointType.cast(extensionPoints.get(extensionPointType)); - } - - /** - * Remove an extension point based on the interface that it implements - * @param extensionPoint The extension point to remove - */ - public void removeExtensionPoint(Object extensionPoint) { - Class[] interfaces = extensionPoint.getClass().getInterfaces(); - for (int i = 0; i < interfaces.length; i++) { - extensionPoints.remove(interfaces[i]); - } - } - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/DefaultModelFactoryExtensionPoint.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/DefaultModelFactoryExtensionPoint.java deleted file mode 100644 index 6765a6c8f1..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/DefaultModelFactoryExtensionPoint.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core; - -import java.util.HashMap; - -/** - * Default implementation of a model factory extension point. - * - * @version $Rev$ $Date$ - */ -public class DefaultModelFactoryExtensionPoint implements ModelFactoryExtensionPoint { - - private HashMap, Object> factories = new HashMap, Object>(); - - /** - * Add a model factory extension. - * - * @param factory The factory to add - */ - public void addFactory(Object factory) { - Class[] interfaces = factory.getClass().getInterfaces(); - for (int i = 0; i T getFactory(Class factoryInterface) { - Object factory = factories.get(factoryInterface); - return factoryInterface.cast(factory); - } - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ExtensionPointRegistry.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ExtensionPointRegistry.java deleted file mode 100644 index 9609487080..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ExtensionPointRegistry.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core; - - -/** - * The registry for the Tuscany core extension points. As the point of contact - * for all extension artifacts this registry allows loaded extensions to find - * all other parts of the system and register themselves appropriately. - * - * @version $Rev$ $Date$ - */ -public interface ExtensionPointRegistry { - - /** - * Add an extension point to the registry - * @param extensionPoint The instance of the extension point - */ - void addExtensionPoint(Object extensionPoint); - - /** - * Get the extension point by the interface - * @param extensionPointType The lookup key (extension point interface) - * @return The instance of the extension point - */ - T getExtensionPoint(Class extensionPointType); - - /** - * Remove an extension point - * @param extensionPoint The extension point to remove - */ - void removeExtensionPoint(Object extensionPoint); -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModelFactoryExtensionPoint.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModelFactoryExtensionPoint.java deleted file mode 100644 index 64706c6efc..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModelFactoryExtensionPoint.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core; - -/** - * An extension point for model factories. Model factories are provided to - * abstract the classes that represent artifacts in the assembly model away - * from their creation mechanism. When the runtime needs to extend the model - * as it reads in contributed artifacts it looks up the factory for the - * artifact required in this registry - * - * @version $Rev$ $Date$ - */ -public interface ModelFactoryExtensionPoint { - - /** - * Add a model factory extension. - * - * @param factory The factory to add - */ - void addFactory(Object factory); - - /** - * Remove a model factory extension. - * - * @param factory The factory to remove - */ - void removeFactory(Object factory); - - /** - * Get a factory implementing the given interface. - * @param factoryInterface the lookup key (factory interface) - * @return The factory - */ - T getFactory(Class factoryInterface); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModuleActivator.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModuleActivator.java deleted file mode 100644 index 0244862309..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModuleActivator.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core; - - -/** - * ModuleActivator represents a module that plugs into the Tuscany system. Each - * module should provide an implementation of this interface and register the - * ModuleActivator implementation class by defining a file named - * - * "META-INF/services/org.apache.tuscany.spi.bootstrp.ModuleActivator" - * - * The content of the file is the class name of the ModuleActivator implementation. - * The implementation class must have a no-arg constructor. The same instance - * will be used to invoke all the methods during different phases of the module - * activation. Note that the start and stop methods defined by this interface - * take a reference to the Tuscany SCA runtime ExtensionPointRegistry. This - * gives the ModuleActivator the oppotunity to add extension points to the - * registry as it is requested to start up and remove them when it is requested - * to shut down. - * - * @version $Rev$ $Date$ - */ -public interface ModuleActivator { - /** - * Get a map of the extension points defined by this module. The key is the - * java interface to represent the extension point and the the value is the - * instance of the implementation of the interface. - * - * @return All the extension points defined by this module - */ - Object[] getExtensionPoints(); - - /** - * This method is invoked when the module is started by the Tuscany system. - * It can be used by this module to registr extensions against extension - * points. - * - * @param registry The extension point registry - */ - void start(ExtensionPointRegistry registry); - - /** - * This method is invoked when the module is stopped by the Tuscany system. - * It can be used by this module to unregister extensions against the - * extension points. - * - * @param registry The extension point registry - */ - void stop(ExtensionPointRegistry registry); -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/Event.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/Event.java deleted file mode 100644 index 6a0c44a404..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/Event.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.event; - -/** - * The base interface for events that are propagated in the runtime - * - * @version $$Rev$$ $$Date$$ - */ -public interface Event { - - /** - * Returns the source of the event - */ - Object getSource(); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/EventFilter.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/EventFilter.java deleted file mode 100644 index c116be921c..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/EventFilter.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.event; - -/** - * Evaluates whether a {@link RuntimeEventListener} is applicable to a given runtime event - * - * @version $$Rev$$ $$Date$$ - */ -public interface EventFilter { - - /** - * Performs the actual evaluation on an event - * @param event Returns true if the event matches implemented criteria - * @return Match result - */ - boolean match(Event event); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/EventPublisher.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/EventPublisher.java deleted file mode 100644 index b0debc36c4..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/EventPublisher.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.event; - -/** - * Publishes events in the runtime by accepting {@link Event} objects and - * forwarding them to all registered {@link RuntimeEventListener} objects. - * - * @version $$Rev$$ $$Date$$ - */ -public interface EventPublisher { - - /** - * Publish an event to all regisitered listeners - * @param object The event to publich - */ - void publish(Event object); - - /** - * Registers a listener to receive notifications for the context - * @param listener The listener to add - */ - void addListener(RuntimeEventListener listener); - - /** - * Registers a listener to receive notifications for the context - * @param filter The filter that will be applied before the lister is called - * @param listener The lister to add - */ - void addListener(EventFilter filter, RuntimeEventListener listener); - - - /** - * Removes a previously registered listener - * @param listener The listener to remove - */ - void removeListener(RuntimeEventListener listener); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/RuntimeEventListener.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/RuntimeEventListener.java deleted file mode 100644 index b34dceee62..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/RuntimeEventListener.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.event; - -import java.util.EventListener; - -/** - * Listeners observe events fired in the SCA runtime. - * - * @version $Rev$ $Date$ - */ -public interface RuntimeEventListener extends EventListener { - - /** - * Accepts and event and acts on it - * @param event The event to act on - */ - void onEvent(Event event); -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/TrueFilter.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/TrueFilter.java deleted file mode 100644 index ca0f4889a5..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/event/TrueFilter.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.event; - -/** - * An event filter that always returns a true condition - * - * @version $$Rev$$ $$Date$$ - */ -public class TrueFilter implements EventFilter { - - /** - * Performs the actual evaluation on an event. Always returns true - * in this case - * @param event The incoming event which is ignored - * @return true - */ - public boolean match(Event event) { - return true; - } -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Interceptor.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Interceptor.java deleted file mode 100644 index a5f221fc11..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Interceptor.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.invocation; - -/** - * Synchronous mediation associated with a client- or target- side wire. - * - * @version $Rev$ $Date$ - */ -public interface Interceptor extends Invoker { - - /** - * Sets the next invoker - * @param next The next invoker - */ - void setNext(Invoker next); - - /** - * Returns the next invoker or null - * @return The next Invoker - */ - Invoker getNext(); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvocationChain.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvocationChain.java deleted file mode 100644 index cd75d06ab3..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/InvocationChain.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.invocation; - -import org.apache.tuscany.sca.interfacedef.Operation; - -/** - * A wire consists of 1..n invocation chains associated with the operations of its source service contract. - *

- * Invocation chains may contain Interceptors that process invocations. - *

- * A Message is used to pass data associated with an invocation through the chain. - * - * @version $Rev$ $Date$ - */ -public interface InvocationChain { - /** - * Returns the target operation for this invocation chain. - * - * @return The target operation for this invocation chain - */ - Operation getTargetOperation(); - - /** - * Returns the source operation for this invocation chain. - * - * @return The source operation for this invocation chain - */ - Operation getSourceOperation(); - - /** - * Adds an interceptor to the chain - * - * @param interceptor The interceptor to add - */ - void addInterceptor(Interceptor interceptor); - - /** - * Adds an invoker to the chain - * - * @param invoker The invoker to add - */ - void addInvoker(Invoker invoker); - - /** - * Returns the first invoker in the chain. - * - * @return The first invoker in the chain - */ - Invoker getHeadInvoker(); - - /** - * Returns the last invoker in the chain. - * - * @return The last invoker in the chain - */ - Invoker getTailInvoker(); - - /** - * Adds an interceptor at the given position in the interceptor stack - * - * @param index The position in the interceptor stack to add the interceptor - * @param interceptor The interceptor to add - */ - void addInterceptor(int index, Interceptor interceptor); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Invoker.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Invoker.java deleted file mode 100644 index 2748bbed9a..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Invoker.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.invocation; - -/** - * Synchronous mediation associated with a client- or target- side wire. - * - * @version $Rev$ $Date$ - */ -public interface Invoker { - - /** - * Process a synchronous wire - * - * @param msg The request Message for the wire - * @return The response Message from the wire - */ - Message invoke(Message msg); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Message.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Message.java deleted file mode 100644 index ef23118e78..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/Message.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.invocation; - -import org.apache.tuscany.sca.interfacedef.ConversationSequence; -import org.apache.tuscany.sca.runtime.EndpointReference; - -/** - * Represents a request, response, or exception flowing through a wire - * - * @version $Rev $Date - */ -public interface Message { - - /** - * Returns the body of the message, which will be the payload or parameters associated with the wire - * @return The body of the message - */ - T getBody(); - - /** - * Sets the body of the message. - * @param body The body of the message - */ - void setBody(T body); - - /** - * Get the conversation id - * @return The conversation ID - */ - String getConversationID(); - - /** - * Set the conversation id - * @param conversationId The conversation ID - */ - void setConversationID(String conversationId); - - /** - * Get the end point reference of the source reference - * @return The end point reference of the reference originating the message - */ - EndpointReference getFrom(); - - /** - * Set the end point reference of the reference originating the message - * @param from The end point reference of the reference originating the message - */ - void setFrom(EndpointReference from); - - /** - * Get the end point reference of target service - * @return The end point reference of the service that the message targets - */ - EndpointReference getTo(); - - /** - * Set the end point reference of target service - * @param to The end point reference of the service that the message targets - */ - void setTo(EndpointReference to); - - /** - * Returns the id of the message - * @return The message Id - */ - Object getMessageID(); - - /** - * Sets the id of the message - * @param messageId The message ID - */ - void setMessageID(Object messageId); - - /** - * Returns the correlation id of the message or null if one is not available. Correlation ids are used by transports - * for message routing. - * @return The correlation Id - */ - Object getCorrelationID(); - - /** - * Sets the correlation id of the message. Correlation ids are used by transports for message routing. - * @param correlationId The correlation Id - */ - void setCorrelationID(Object correlationId); - - /** - * Determines if the message represents a fault/exception - * - * @return true If the message body is a fault object, false if the body is a normal payload - */ - boolean isFault(); - - /** - * Set the message body with a fault object. After this method is called, isFault() returns true. - * - * @param fault The fault object represents an exception - */ - void setFaultBody(T fault); - - /** - * Returns the conversational sequence the message is associated with, NONE, START, CONTINUE, or END on TargetInvoker} - * - * @return The conversational sequence the message is associated with - */ - ConversationSequence getConversationSequence(); - - /** - * Returns the conversational sequence the message is associated with, NONE, START, CONTINUE, or END - * - * @param sequence The conversational sequence - */ - void setConversationSequence(ConversationSequence sequence); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/MessageFactory.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/MessageFactory.java deleted file mode 100644 index c2a9c488b8..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/MessageFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.invocation; - - -/** - * A factory for messages - * - * @version $Rev $Date - */ -public interface MessageFactory { - - /** - * Creates a new message. - * - * @return The new message - */ - Message createMessage(); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/management/ManagementService.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/management/ManagementService.java deleted file mode 100644 index 3626e16425..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/management/ManagementService.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.management; - -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -/** - * Interface for the management service abstraction. The implementaion - * could be based on a variety of technologies including JMX, WSDM, - * SNMP etc. - * - * @version $Revision$ $Date$ - */ -public interface ManagementService { - - /** - * Registers a component for management. - * - * @param name Name of the component. - * @param component Component to be registered. - */ - void registerComponent(String name, RuntimeComponent component); -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java deleted file mode 100644 index 0f6a932c51..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BindingProviderFactory.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -/** - * A factory for creating the runtime artifacts that represent bindings. - * - * @version $Rev$ $Date$ - */ -public interface BindingProviderFactory extends ProviderFactory { - - /** - * Creates a new reference binding provider for the given component and - * reference. - * - * @param component The runtime component - * @param reference The reference on the runtime component - * @param binding The binding assembly model object - * @return The binding provider - */ - ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, - RuntimeComponentReference reference, - M binding); - - /** - * Creates a new service binding provider for the given component and - * service. - * - * @param component The runtime component - * @param service The service on the runtime component - * @param binding The binding assembly model object - * @return The binding provider - */ - ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, - RuntimeComponentService service, - M binding); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java deleted file mode 100644 index 1adb9287f1..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/DefaultProviderFactoryExtensionPoint.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import java.util.HashMap; -import java.util.Map; - -/** - * Default implementation of a provider factory extension point. - * - * @version $Rev$ $Date$ - */ -public class DefaultProviderFactoryExtensionPoint implements ProviderFactoryExtensionPoint { - - protected final Map, ProviderFactory> providerFactories = - new HashMap, ProviderFactory>(); - - /** - * The default constructor. Does nothing. - * - */ - public DefaultProviderFactoryExtensionPoint() { - } - - /** - * Add a provider factory. - * - * @param providerFactory The provider factory - */ - public void addProviderFactory(ProviderFactory providerFactory) { - providerFactories.put(providerFactory.getModelType(), providerFactory); - } - - /** - * Remove a provider factory. - * - * @param providerFactory The provider factory - */ - public void removeProviderFactory(ProviderFactory providerFactory) { - providerFactories.remove(providerFactory.getModelType()); - } - - /** - * Returns the provider factory associated with the given model type. - * @param modelType A model type - * @return The provider factory associated with the given model type - */ - public ProviderFactory getProviderFactory(Class modelType) { - Class[] classes = modelType.getInterfaces(); - for (Class c : classes) { - ProviderFactory factory = providerFactories.get(c); - if (factory != null) { - return factory; - } - } - return providerFactories.get(modelType); - } - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProvider.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProvider.java deleted file mode 100644 index a680277b99..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProvider.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -/** - * A component implementation can implement this interface in order to tie - * into the Tuscany runtime - * - * @version $Rev$ $Date$ - */ -public interface ImplementationProvider { - - /** - * This method will be invoked when the component implementation - * is activated. - */ - void start(); - - /** - * This method will be invoked when the component implementation - * is deactivated. - */ - void stop(); - - /** - * Create an invoker for the component implementation in the invocation - * chain. The invoker will be responsible for calling the implementation - * logic for the given component. - * - * @param service The component service - * @param operation The operation that the interceptor will handle - * @return An invoker that handles the invocation logic, null should be - * returned if no invoker is required - */ - Invoker createInvoker(RuntimeComponentService service, Operation operation); - - /** - * Create an invoker to call back to the given component - * @param operation The operation - * @return An invoker that handles the invocation logic, null should be - * returned if no invoker is required - */ - Invoker createCallbackInvoker(Operation operation); - - // InterfaceContract getImplementationInterfaceContract(RuntimeComponentService service); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProviderFactory.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProviderFactory.java deleted file mode 100644 index 6a37d1e951..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ImplementationProviderFactory.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -/** - * An interface for factories that create implementation providers. - * - * @version $Rev$ $Date$ - */ -public interface ImplementationProviderFactory extends ProviderFactory { - - /** - * Creates a new implementation provider for the given - * component. - * - * @param component The runtime component - * @param Implementation The implementation type - * @return The implementation provider - */ - ImplementationProvider createImplementationProvider(RuntimeComponent component, M Implementation); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactory.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactory.java deleted file mode 100644 index 2102806881..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -/** - * A factory for runtime providers. - * - * @version $Rev$ $Date$ - */ -public interface ProviderFactory { - - /** - * The model type that this factory creates providers for. - * - * @return the model type - */ - Class getModelType(); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactoryExtensionPoint.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactoryExtensionPoint.java deleted file mode 100644 index 5e781dd5b3..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ProviderFactoryExtensionPoint.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - - -/** - * An extension point for provider factories. Holds all of the provider - * factories from loaded extension points. Allows a provider factory - * to be located based on a given model type. Hence the runtime can - * generate runtime artifacts from the in memory assembly model. - * - * @version $Rev$ $Date$ - */ -public interface ProviderFactoryExtensionPoint { - - - /** - * Add a provider factory. - * - * @param providerFactory The provider factory - */ - void addProviderFactory(ProviderFactory providerFactory); - - /** - * Remove a provider factory. - * - * @param providerFactory The provider factory - */ - void removeProviderFactory(ProviderFactory providerFactory); - - /** - * Returns the provider factory associated with the given model type. - * @param modelType A model type - * @return The provider factory associated with the given model type - */ - ProviderFactory getProviderFactory(Class modelType); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProvider.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProvider.java deleted file mode 100644 index 4da4108168..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ReferenceBindingProvider.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; - -/** - * A reference binding implementation can options implement this - * interface to tie into the Tuscany SCA runtime - * - * @version $Rev$ $Date$ - */ -public interface ReferenceBindingProvider { - - /** - * This method will be invoked when the component reference binding is - * activated. - */ - void start(); - - /** - * This method will be invoked when the component reference binding is - * deactivated. - */ - void stop(); - - /** - * Create an invoker for the reference binding in the invocation chain. The - * invoker is responsible for making the outbound invocation over the - * binding protocol. - * - * @param operation The operation that the interceptor will handle - * @param isCallback A flag to tell if the operation is for the callback - * @return An invoker that handles the invocation logic, null should be - * returned if no invoker is required - */ - Invoker createInvoker(Operation operation, boolean isCallback); - - /** - * Get the effective interface contract imposed by the binding. For example, - * it will be interface contract introspected from the WSDL portType used by - * the endpoint for a WebService binding. - * - * @return The effective interface contract, if null is returned, the - * interface contract for the component reference will be used - */ - InterfaceContract getBindingInterfaceContract(); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProvider.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProvider.java deleted file mode 100644 index d2646d8d00..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/ServiceBindingProvider.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.provider; - -import org.apache.tuscany.sca.interfacedef.InterfaceContract; - -/** - * A service binding can optionally implement this interface to tie - * into the Tuscany SCA runtime - * - * @version $Rev$ $Date$ - */ -public interface ServiceBindingProvider { - /** - * This method will be invoked when the component service binding is - * activated. - */ - void start(); - - /** - * This method will be invoked when the component service binding is - * deactivated. - */ - void stop(); - - /** - * Get the effective interface contract imposed by the binding. For example, - * it will be interface contract introspected from the WSDL portType used by - * the endpoint for a WebService binding. - * - * @return The effective interface contract, if null is returned, the - * interface contract for the component service will be used - */ - InterfaceContract getBindingInterfaceContract(); -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultWireProcessorExtensionPoint.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultWireProcessorExtensionPoint.java deleted file mode 100644 index 851afee3c1..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/DefaultWireProcessorExtensionPoint.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.runtime; - -import java.util.ArrayList; -import java.util.List; - - -/** - * The default implementation of a WireProcessorExtensionPoint - * - * @version $Rev$ $Date$ - */ -public class DefaultWireProcessorExtensionPoint implements RuntimeWireProcessorExtensionPoint { - - /** - * The list of WireProcessors available to the runtime - */ - private final List processors = new ArrayList(); - - /** - * Registers a wire-processor in the runtime - * - * @param processor The processor to register - */ - public void addWireProcessor(RuntimeWireProcessor processor) { - processors.add(processor); - } - - /** - * De-registers a wire-processor in the runtime - * - * @param processor The processor to de-register - */ - public void removeWireProcessor(RuntimeWireProcessor processor) { - processors.remove(processor); - } - - /** - * Returns a list of registered wire-processors. - * - * @return The list of wire processors - */ - public List getWireProcessors() { - return processors; - } -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReference.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReference.java deleted file mode 100644 index 627180b2d1..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointReference.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Contract; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; - -/** - * The endpoint reference for a component service or reference - * - * @version $Rev$ $Date$ - */ -public interface EndpointReference { - /** - * Get the component for the endpoint - * @return The component, null of the EPR is for a non-SCA service - */ - RuntimeComponent getComponent(); - - /** - * Get the component service or reference for the endpoint - * @return The component service or reference, null if the EPR is for a non-SCA service - */ - Contract getContract(); - - /** - * Get the binding for the endpoint - * @return The binding - */ - Binding getBinding(); - - //FIXME Why do we need this? isn't the interface contract already on the Contract? - - /** - * Get the interface contract for the endpoint - * @return The interface contract - */ - InterfaceContract getInterfaceContract(); - - /** - * Get the URI for this endpoint - * @return The URI of the endpoint - */ - String getURI(); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponent.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponent.java deleted file mode 100644 index ddb5ae746c..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponent.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.provider.ImplementationProvider; -import org.osoa.sca.ComponentContext; - -/** - * The runtime component interface. Provides the bridge between the - * assembly model representation of a component and its runtime - * realization. - * - * @version $Rev$ $Date$ - */ -public interface RuntimeComponent extends Component, ComponentContext { - /** - * Set the implementation-specific configuration for this component - * @param implementationProvider The object that manages the component implementation - */ - void setImplementationProvider(ImplementationProvider implementationProvider); - - /** - * Get the implementation-specific configuation for this component - * @return The implementation provider for this component - */ - ImplementationProvider getImplementationProvider(); -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java deleted file mode 100644 index 18166d8c1d..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentReference.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import java.util.List; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; - -/** - * The runtime component reference. Provides the bridge between the - * assembly model representation of a component reference and its runtime - * realization - * - * @version $Rev$ $Date$ - */ -public interface RuntimeComponentReference extends ComponentReference { - - /** - * Get a list of runtime wires to the reference - * - * @return The list of wires - */ - List getRuntimeWires(); - - /** - * Get the runtime wire for the given binding - * @param binding The assembly model binding - * @return The runtime wire - */ - RuntimeWire getRuntimeWire(Binding binding); - - /** - * Returns the reference binding provider associated with this - * component reference and the given binding. - * - * @param binding The assembly model binding - * @return The runtime reference binding provider - */ - ReferenceBindingProvider getBindingProvider(Binding binding); - - /** - * Sets the reference binding provider associated with this - * component reference and the given binding. - * - * @param binding The assembly model binding - * @param bindingProvider The runtime reference binding provider - */ - void setBindingProvider(Binding binding, ReferenceBindingProvider bindingProvider); - - - /** - * Get the invoker for the given binding and operation - * @param binding The assembly model binding - * @param operation The assembly model operation - * @return The runtime Invoker - */ - Invoker getInvoker(Binding binding, Operation operation); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java deleted file mode 100644 index 19327321a6..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeComponentService.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import java.util.List; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; - -/** - * The runtime component service. Provides the bridge between the - * assembly model representation of a component service and its runtime - * realization - * - * @version $Rev$ $Date$ - */ -public interface RuntimeComponentService extends ComponentService { - - /** - * Get a list of runtime wires to the service - * - * @return The list of wires - */ - List getRuntimeWires(); - /** - * Get the runtime wire for the given binding - * @param binding The assembly model binding - * @return The runtime wire - */ - RuntimeWire getRuntimeWire(Binding binding); - - /** - * Get the callback wires assoicated with this service - * - * @return The list of runtime callback wires - */ - List getCallbackWires(); - - /** - * Returns the service binding provider associated with this - * component service and the given binding. - * - * @param binding The assembly model binding - * @return The runtime service binding provider - */ - ServiceBindingProvider getBindingProvider(Binding binding); - - /** - * Sets the service binding provider associated with this - * component service and the given binding. - * - * @param binding The assembly model binding - * @param bindingProvider The runtime service binding provider - */ - void setBindingProvider(Binding binding, ServiceBindingProvider bindingProvider); - - /** - * Get the invoker for the given binding and operation - * @param binding The assembly model binding - * @param operation The assembly model operation - * @return The runtime invoker - */ - Invoker getInvoker(Binding binding, Operation operation); - - /** - * Get the callback invoker for the given binding and operation - * @param binding The assembly model binding - * @param operation The assembly model operation - * @return The runtime callback invoker - */ - Invoker getCallbackInvoker(Binding binding, Operation operation); -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java deleted file mode 100644 index d6b56d822e..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWire.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.runtime; - -import java.util.List; - -import org.apache.tuscany.sca.invocation.InvocationChain; - -/** - * The runtime wire interface that connects a component reference to a - * component service (or an external service) over the selected binding - * - * @version $Rev$ $Date$ - */ -public interface RuntimeWire { - - /** - * Get the source of the wire - * - * @return The end point reference of the source - */ - EndpointReference getSource(); - - /** - * Get the target of the wire - * - * @return The end point reference of the target - */ - EndpointReference getTarget(); - - /** - * Returns the invocation chains for service operations associated with the - * wire - * - * @return the invocation chains for service operations associated with the - * wire - */ - List getInvocationChains(); - - /** - * Returns the invocation chains for callback service operations associated - * with the wire - * - * @return the invocation chains for callback service operations associated - * with the wire - */ - List getCallbackInvocationChains(); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java deleted file mode 100644 index fbb7aae467..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessor.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.runtime; - -/** - * Implementations are called after wires are decorated with policy and before they are connected. - * - * @version $Rev$ $Date$ - */ -public interface RuntimeWireProcessor { - - /** - * Process the runtime wire to add interceptors - * - * @param wire - */ - void process(RuntimeWire wire); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessorExtensionPoint.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessorExtensionPoint.java deleted file mode 100644 index 4b2c71b397..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/RuntimeWireProcessorExtensionPoint.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.runtime; - -import java.util.List; - -/** - * Acts as a delegating WireProcessorExtensionPoint, delegating - * processing of wires after policies have been applied and source and targets - * have been connected. - * - * @version $Rev$ $Date$ - */ -public interface RuntimeWireProcessorExtensionPoint { - - /** - * Registers a wire-processor in the runtime - * - * @param processor The processor to register - */ - void addWireProcessor(RuntimeWireProcessor processor); - - /** - * De-registers a wire-processor in the runtime - * - * @param processor The processor to de-register - */ - void removeWireProcessor(RuntimeWireProcessor processor); - - /** - * Returns a list of registered wire-processors. - * - * @return The list of wire processors - */ - List getWireProcessors(); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/DuplicateRecordException.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/DuplicateRecordException.java deleted file mode 100644 index 3cf82982dc..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/DuplicateRecordException.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.store; - -/** - * thrown when a record already exists during an insert operation - * - * @version $Rev$ $Date$ - */ -public class DuplicateRecordException extends StoreWriteException { - private static final long serialVersionUID = 3116253222569378447L; - - public DuplicateRecordException() { - super(); - } - - public DuplicateRecordException(String message, Throwable cause) { - super(message, cause); - } - - public DuplicateRecordException(String message) { - super(message); - } - - public DuplicateRecordException(Throwable cause) { - super(cause); - } - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/RecoveryListener.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/RecoveryListener.java deleted file mode 100644 index 9d965a3369..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/RecoveryListener.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.store; - -import java.util.UUID; - -/** - * Implementations receive callback events during a store recovery operation - * - * @version $Rev$ $Date$ - */ -public interface RecoveryListener { - - /** - * Signals the start of a recovery - */ - void onBegin(); - - /** - * Received when a record is recovered - * - * @param id - */ - void onRecord(UUID id); - - /** - * Signals the end of recovery - */ - void onEnd(); -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/Store.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/Store.java deleted file mode 100644 index b15cde066a..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/Store.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.store; - -import org.apache.tuscany.sca.event.EventPublisher; -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -/** - * Implementations provide a persistent store for runtime data such as conversational state. A persistent store could be - * implemented in a durable fashion using JDBC or a journaling system, or using a non-durable mechanism such as an - * in-memory map. - * - * @version $Rev$ $Date$ - */ -public interface Store extends EventPublisher { - - /* Used to indicate an the default expiration offset for records for the store */ - long DEFAULT_EXPIRATION_OFFSET = -1; - - /* Used to indicate an entry should not expire */ - long NEVER = -2; - - /** - * Adds the given record to the store. Implementations may choose different strategies for writing data such as - * write-through or write-behind. - * - * @param owner the instance owner - * @param id the unique id of the record - * @param object the object representing the data to write - * @param expiration the time in milliseconds when the entry expires - * @throws StoreWriteException if an error occurs during the write operation - */ - void insertRecord(RuntimeComponent owner, String id, Object object, long expiration) throws StoreWriteException; - - /** - * Updates a given record in the store, overwriting previous information. - * - * @param owner the instance owner - * @param id the unique id of the record - * @param object the object representing the data to write - * @param expiration the time in milliseconds when the entry expires - * @throws StoreWriteException - */ - void updateRecord(RuntimeComponent owner, String id, Object object, long expiration) throws StoreWriteException; - - /** - * Returns the deserialized object in the store corresponding to the given id - * - * @param owner the instance owner - * @param id the unique id of the record - * @return the deserialized object or null if one is not found - * @throws StoreReadException - */ - Object readRecord(RuntimeComponent owner, String id) throws StoreReadException; - - /** - * Removes a record from the store - * - * @param owner the instance owner - * @param id the unique id of the record - * @throws StoreWriteException - */ - void removeRecord(RuntimeComponent owner, String id) throws StoreWriteException; - - /** - * Removes all records from the store - * - * @throws StoreWriteException - */ - void removeRecords() throws StoreWriteException; - - /** - * Initiates a recovery operation, for example during restart after a crash - * - * @param listener the listener to receive recovery callback events - * @throws StoreReadException - */ - void recover(RecoveryListener listener) throws StoreReadException; - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreException.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreException.java deleted file mode 100644 index 647eba33aa..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreException.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.store; - - -/** - * Represents a generic exception thrown by a Store - * - * @version $Rev$ $Date$ - */ -public class StoreException extends Exception { - private static final long serialVersionUID = -319152147419962709L; - - public StoreException() { - super(); - } - - public StoreException(String message, Throwable cause) { - super(message, cause); - } - - public StoreException(String message) { - super(message); - } - - public StoreException(Throwable cause) { - super(cause); - } - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreExpirationEvent.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreExpirationEvent.java deleted file mode 100644 index 5c1a3ca79d..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreExpirationEvent.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.store; - -import org.apache.tuscany.sca.event.Event; -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -/** - * Fired when a store implementation expires a resource - * - * @version $Rev$ $Date$ - */ -public class StoreExpirationEvent implements Event { - private Object source; - private RuntimeComponent owner; - private Object instance; - - /** - * Constructor. - * - * @param source the source of the event - * @param owner the owner of the expiring object - * @param instance the expiring object - */ - public StoreExpirationEvent(Object source, RuntimeComponent owner, Object instance) { - assert source != null; - assert owner != null; - assert instance != null; - this.source = source; - this.owner = owner; - this.instance = instance; - } - - public Object getSource() { - return source; - } - - /** - * Returns the owner of the expiring object. - * - * @return the owner of the expiring object. - */ - public RuntimeComponent getOwner() { - return owner; - } - - /** - * Returns the expiring object. - * - * @return the expiring object. - */ - public Object getInstance() { - return instance; - } -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreMonitor.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreMonitor.java deleted file mode 100644 index 66bbae684d..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreMonitor.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.store; - - -/** - * A generic monintor interface for services to log events - * - * @version $Rev$ $Date$ - */ -public interface StoreMonitor { - - /** - * Signals the service has started - * - * @param msg - */ - void start(String msg); - - /** - * Signals the service has been shutdown - * - * @param msg - */ - void stop(String msg); - - /** - * Fired when recovery is started - */ - - void beginRecover(); - - /** - * Fired when recovery is completed - */ - - void endRecover(); - - /** - * Fired when a record is processed during recovery - * - * @param recordId the id of the record being recovered - */ - - void recover(Object recordId); - - /** - * Signals an error event - * - * @param e the error - */ - - void error(Throwable e); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreReadException.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreReadException.java deleted file mode 100644 index 3a563b9fb5..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreReadException.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.store; - -/** - * Thrown when an error occurs reading from persistent storage - * - * @version $Rev$ $Date$ - */ -public class StoreReadException extends StoreException { - private static final long serialVersionUID = -8624542082121467271L; - - public StoreReadException() { - super(); - } - - public StoreReadException(String message, Throwable cause) { - super(message, cause); - } - - public StoreReadException(String message) { - super(message); - } - - public StoreReadException(Throwable cause) { - super(cause); - } - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreWriteException.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreWriteException.java deleted file mode 100644 index ad55ce386b..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/store/StoreWriteException.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.store; - -/** - * Thrown when an error occurs writing to persistent storage - * - * @version $Rev$ $Date$ - */ -public class StoreWriteException extends StoreException { - private static final long serialVersionUID = 5539070473942048555L; - - public StoreWriteException() { - super(); - } - - public StoreWriteException(String message, Throwable cause) { - super(message, cause); - } - - public StoreWriteException(String message) { - super(message); - } - - public StoreWriteException(Throwable cause) { - super(cause); - } - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/NotificationListener.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/NotificationListener.java deleted file mode 100644 index 5701a04ed1..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/NotificationListener.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.work; - -/** - * A callback inyterface that can be optionally used for registering - * interest in status of asynchronously scheduled unit of work. - * - */ -public interface NotificationListener { - - /** - * Callback method when the unit of work is accepted. - * - * @param work Work that was accepted. - */ - void workAccepted(T work); - - /** - * Callback method when the unit of work is successfully completed. - * - * @param work Work that was succesfully completed. - */ - void workCompleted(T work); - - /** - * Callback when the unit of work is started. - * - * @param work Unit of work that was started. - */ - void workStarted(T work); - - /** - * Callback when the unit of work is rejected. - * - * @param work Unit of work that was rejected. - */ - void workRejected(T work); - - /** - * Callnack when the unit of work fails to complete. - * - * @param work Unit of work that failed to complete. - * @param error Error that caused the unit of work to fail. - */ - void workFailed(T work, Throwable error); - - - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkScheduler.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkScheduler.java deleted file mode 100644 index 99cb601107..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkScheduler.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.work; - -/** - * Defines the contract for scheduling asychronous units of work. - * - *

- * Units of work can be scheduled with an optional NotificationListener. - * If a notification listener is specified, the caller will be notified regarding the - * status of the work. The unit of work can either be completed, rejected or completed - * with an error. If the work completed with an error, the caller is notfied with the - * error details. - *

- * - */ -public interface WorkScheduler { - - /** - * Schedules a unit of work for future execution. The notification listener - * is used to register interest in callbacks regarding the status of the work. - * - * @param work The unit of work that needs to be asynchronously executed. - * @param listener Notification listener for callbacks. - */ - void scheduleWork(T work, NotificationListener listener); - - /** - * Schedules a unit of work for future execution. The notification listener - * is used to register interest in callbacks regarding the status of the work. - * - * @param work The unit of work that needs to be asynchronously executed. - */ - void scheduleWork(T work); - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkSchedulerException.java b/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkSchedulerException.java deleted file mode 100644 index f3d32e376b..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/main/java/org/apache/tuscany/sca/work/WorkSchedulerException.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.work; - - -/** - * Exception thrown by the work scheduler in case of unexpected exceptions. - * - * @version $Rev$ $Date$ - * - */ -@SuppressWarnings("serial") -public class WorkSchedulerException extends RuntimeException { - - public WorkSchedulerException() { - super(); - } - - public WorkSchedulerException(String message, Throwable cause) { - super(message, cause); - } - - public WorkSchedulerException(String message) { - super(message); - } - - public WorkSchedulerException(Throwable cause) { - super(cause); - } - -} diff --git a/branches/sca-java-0.90/modules/core-spi/src/test/resources/org/apache/tuscany/spi/util/stax/test.composite b/branches/sca-java-0.90/modules/core-spi/src/test/resources/org/apache/tuscany/spi/util/stax/test.composite deleted file mode 100644 index 337ec02f06..0000000000 --- a/branches/sca-java-0.90/modules/core-spi/src/test/resources/org/apache/tuscany/spi/util/stax/test.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - 123 - - - diff --git a/branches/sca-java-0.90/modules/core-spring/DISCLAIMER b/branches/sca-java-0.90/modules/core-spring/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/core-spring/LICENSE b/branches/sca-java-0.90/modules/core-spring/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/core-spring/NOTICE b/branches/sca-java-0.90/modules/core-spring/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/core-spring/pom.xml b/branches/sca-java-0.90/modules/core-spring/pom.xml deleted file mode 100644 index f59ca7691c..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/pom.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - tuscany-core-spring - Apache Tuscany SCA Spring-based Core Runtime - - - - - org.apache.tuscany.sca - tuscany-assembly - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-interface-java - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java - 0.90-incubating-SNAPSHOT - - - - org.springframework - spring-core - 2.0.3 - - - - org.springframework - spring-beans - 2.0.3 - - - - org.springframework - spring-context - 2.0.3 - - - - org.apache.tuscany.sca - sca-api - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-assembly-xml - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-interface-java-xml - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-xml - 0.90-incubating-SNAPSHOT - - - - diff --git a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanAssemblyFactory.java b/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanAssemblyFactory.java deleted file mode 100644 index 5b04d9e363..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanAssemblyFactory.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.assembly.impl; - -import org.apache.tuscany.sca.assembly.AbstractProperty; -import org.apache.tuscany.sca.assembly.AbstractReference; -import org.apache.tuscany.sca.assembly.AbstractService; -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Callback; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentProperty; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.ComponentType; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.CompositeReference; -import org.apache.tuscany.sca.assembly.CompositeService; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.SCABinding; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.assembly.Wire; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; - -/** - * An alternate implementation of the SCA assembly model factory that creates SCA - * assembly model objects backed by Spring bean definitions. - * - * @version $Rev$ $Date$ - */ -public class BeanAssemblyFactory implements AssemblyFactory { - - private AssemblyFactory defaultFactory; - private BeanDefinitionRegistry beanRegistry; - - public BeanAssemblyFactory(AssemblyFactory defaultFactory, BeanDefinitionRegistry beanRegistry) { - this.defaultFactory = defaultFactory; - this.beanRegistry = beanRegistry; - } - - public BeanAssemblyFactory(BeanDefinitionRegistry beanRegistry) { - this(new DefaultAssemblyFactory(), beanRegistry); - } - - public AbstractProperty createAbstractProperty() { - return defaultFactory.createAbstractProperty(); - } - - public AbstractReference createAbstractReference() { - return defaultFactory.createAbstractReference(); - } - - public AbstractService createAbstractService() { - return defaultFactory.createAbstractService(); - } - - public Callback createCallback() { - return defaultFactory.createCallback(); - } - - public Component createComponent() { - return new BeanComponentImpl(beanRegistry); - } - - public ComponentProperty createComponentProperty() { - return defaultFactory.createComponentProperty(); - } - - public ComponentReference createComponentReference() { - return defaultFactory.createComponentReference(); - } - - public ComponentService createComponentService() { - return defaultFactory.createComponentService(); - } - - public ComponentType createComponentType() { - return defaultFactory.createComponentType(); - } - - public Composite createComposite() { - return defaultFactory.createComposite(); - } - - public CompositeReference createCompositeReference() { - return defaultFactory.createCompositeReference(); - } - - public CompositeService createCompositeService() { - return defaultFactory.createCompositeService(); - } - - public ConstrainingType createConstrainingType() { - return defaultFactory.createConstrainingType(); - } - - public Property createProperty() { - return defaultFactory.createProperty(); - } - - public Reference createReference() { - return defaultFactory.createReference(); - } - - public Service createService() { - return defaultFactory.createService(); - } - - public Wire createWire() { - return defaultFactory.createWire(); - } - - public Operation createOperation() { - return defaultFactory.createOperation(); - } -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanComponentImpl.java b/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanComponentImpl.java deleted file mode 100644 index 85c5e7ec43..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanComponentImpl.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.assembly.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentProperty; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.assembly.Visitor; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; -import org.springframework.beans.factory.support.ChildBeanDefinition; - -/** - * An implementation of the SCA assembly Component interface backed by a Spring - * Bean definition. - * - * @version $Rev$ $Date$ - */ -public class BeanComponentImpl extends ChildBeanDefinition implements Component, Cloneable { - private static final long serialVersionUID = 1L; - - private ConstrainingType constrainingType; - private Implementation implementation; - private String name; - private String uri; - private List services = new ArrayList(); - private List requiredIntents = new ArrayList(); - private List policySets = new ArrayList(); - private List extensions = new ArrayList(); - private boolean unresolved = false; - private BeanDefinitionRegistry beanRegistry; - - protected BeanComponentImpl(BeanDefinitionRegistry beanRegistry) { - super((String)""); - this.beanRegistry = beanRegistry; - } - - @Override - public Object clone() throws CloneNotSupportedException { - BeanComponentImpl clone = (BeanComponentImpl)super.clone(); - - clone.getProperties().clear(); - for (ComponentProperty property: getProperties()) { - clone.getProperties().add((ComponentProperty)property.clone()); - } - clone.getReferences().clear(); - for (ComponentReference reference: getReferences()) { - clone.getReferences().add((ComponentReference)reference.clone()); - } - clone.getServices().clear(); - for (ComponentService service: getServices()) { - clone.getServices().add((ComponentService)service.clone()); - } - return clone; - } - - public String getParentName() { - //TODO find a better name for bean definitions representing component types - return String.valueOf(System.identityHashCode(implementation)); - } - - public ConstrainingType getConstrainingType() { - return constrainingType; - } - - public Implementation getImplementation() { - return implementation; - } - - public String getURI() { - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - - // Register this bean definition in the bean registry - this.beanRegistry.registerBeanDefinition(uri, this); - } - - public String getName() { - return name; - } - - //TODO use a better list implementation - private List properties = new ArrayList() { - private static final long serialVersionUID = 1L; - - // Add a property - public boolean add(ComponentProperty property) { - - // Add corresponding bean property value - getPropertyValues().addPropertyValue(property.getName(), property.getValue()); - - return super.add(property); - } - }; - - public List getProperties() { - return properties; - } - - //TODO use a better list implementation - private List references = new ArrayList() { - private static final long serialVersionUID = 1L; - - // Add a reference - public boolean add(ComponentReference reference) { - - // Add corresponding bean property value - if (!reference.getName().startsWith("$self$.")) { - BeanReferenceImpl beanReference = new BeanReferenceImpl(reference); - getPropertyValues().addPropertyValue(reference.getName(), beanReference); - } - return super.add(reference); - } - }; - - public List getReferences() { - return references; - } - - public List getServices() { - return services; - } - - public void setConstrainingType(ConstrainingType constrainingType) { - this.constrainingType = constrainingType; - } - - public void setImplementation(Implementation implementation) { - this.implementation = implementation; - } - - public void setName(String name) { - this.name = name; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public List getPolicySets() { - return policySets; - } - - public boolean isAutowire() { - return super.getAutowireMode() == AUTOWIRE_BY_TYPE; - } - - public void setAutowire(boolean autowire) { - super.setAutowireMode(autowire? AUTOWIRE_BY_TYPE:AUTOWIRE_NO); - } - - public List getExtensions() { - return extensions; - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setUnresolved(boolean undefined) { - this.unresolved = undefined; - } - - public boolean accept(Visitor visitor) { - if (!visitor.visit(this)) { - return false; - } - for (ComponentProperty property : properties) { - if (!visitor.visit(property)) { - return false; - } - } - for (ComponentReference reference : references) { - if (!visitor.visit(reference)) { - return false; - } - } - for (ComponentService service : services) { - if (!visitor.visit(service)) { - return false; - } - } - return true; - } -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanReferenceImpl.java b/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanReferenceImpl.java deleted file mode 100644 index bc139a3ef3..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/assembly/impl/BeanReferenceImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.assembly.impl; - -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.SCABinding; -import org.springframework.beans.factory.config.RuntimeBeanReference; - -/** - * An implementation of RuntimeBeanReference wrappering an SCA assembly Reference - * - * @version $Rev$ $Date$ - */ -public class BeanReferenceImpl extends RuntimeBeanReference { - private Reference reference; - - protected BeanReferenceImpl(Reference reference) { - super("temp"); - this.reference = reference; - } - - public String getBeanName() { - //TODO handle multiplicity - ComponentService componentService = reference.getTargets().get(0); - if (!componentService.isUnresolved()) { - SCABinding binding = componentService.getBinding(SCABinding.class); - return binding.getComponent().getURI(); - } else { - return null; - } - } - - public boolean equals(Object other) { - if (this != other) { - if (other instanceof RuntimeBeanReference) { - RuntimeBeanReference br = (RuntimeBeanReference) other; - return (getBeanName().equals(br.getBeanName()) && this.isToParent() == br.isToParent()); - } else - return false; - } else - return true; - } - - public int hashCode() { - return getBeanName().hashCode() * 29 + (this.isToParent() ? 1 : 0); - } - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/context/ModelResolverImpl.java b/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/context/ModelResolverImpl.java deleted file mode 100644 index ba2d5045f2..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/context/ModelResolverImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.spring.context; - -import java.lang.ref.WeakReference; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.sca.contribution.resolver.ClassReference; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; - - -/** - * A default implementation of an artifact resolver, based on a map. - * - * @version $Rev$ $Date$ - */ -public class ModelResolverImpl implements ModelResolver { - private static final long serialVersionUID = -7826976465762296634L; - - private Map map = new HashMap(); - - private WeakReference classLoader; - - public ModelResolverImpl(ClassLoader classLoader) { - this.classLoader = new WeakReference(classLoader); - } - - public T resolveModel(Class modelClass, T unresolved) { - Object resolved = map.get(unresolved); - if (resolved != null) { - - // Return the resolved object - return modelClass.cast(resolved); - - } else if (unresolved instanceof ClassReference) { - - // Load a class on demand - ClassReference classReference = (ClassReference)unresolved; - Class clazz; - try { - clazz = Class.forName(classReference.getClassName(), true, classLoader.get()); - } catch (ClassNotFoundException e) { - - // Return the unresolved object - return unresolved; - } - - // Store a new ClassReference wrappering the loaded class - resolved = new ClassReference(clazz); - map.put(resolved, resolved); - - // Return the resolved ClassReference - return modelClass.cast(resolved); - - } else { - - // Return the unresolved object - return unresolved; - } - } - - public void addModel(Object resolved) { - map.put(resolved, resolved); - } - - public Object removeModel(Object resolved) { - return map.remove(resolved); - } - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/context/SCADomainContext.java b/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/context/SCADomainContext.java deleted file mode 100644 index 24bc719e6a..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/context/SCADomainContext.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.context; - -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.assembly.DefaultSCABindingFactory; -import org.apache.tuscany.sca.assembly.SCABindingFactory; -import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException; -import org.apache.tuscany.sca.assembly.builder.CompositeBuilderMonitor; -import org.apache.tuscany.sca.assembly.builder.Problem; -import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl; -import org.apache.tuscany.sca.assembly.xml.ComponentTypeProcessor; -import org.apache.tuscany.sca.assembly.xml.CompositeProcessor; -import org.apache.tuscany.sca.assembly.xml.ConstrainingTypeProcessor; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.service.ContributionException; -import org.apache.tuscany.sca.core.spring.assembly.impl.BeanAssemblyFactory; -import org.apache.tuscany.sca.core.spring.implementation.java.impl.BeanJavaImplementationFactory; -import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory; -import org.apache.tuscany.sca.implementation.java.introspect.DefaultJavaClassIntrospectorExtensionPoint; -import org.apache.tuscany.sca.implementation.java.introspect.ExtensibleJavaClassIntrospector; -import org.apache.tuscany.sca.implementation.java.introspect.JavaClassIntrospector; -import org.apache.tuscany.sca.implementation.java.introspect.JavaClassIntrospectorExtensionPoint; -import org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.AllowsPassByReferenceProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.BaseJavaClassVisitor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.ConstructorProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.ContextProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.ConversationProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.DestroyProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.EagerInitProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.HeuristicPojoProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.InitProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.PolicyProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.PropertyProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.ReferenceProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.ResourceProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.ScopeProcessor; -import org.apache.tuscany.sca.implementation.java.introspect.impl.ServiceProcessor; -import org.apache.tuscany.sca.implementation.java.xml.JavaImplementationProcessor; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.interfacedef.java.DefaultJavaInterfaceFactory; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; -import org.apache.tuscany.sca.interfacedef.java.introspect.DefaultJavaInterfaceIntrospectorExtensionPoint; -import org.apache.tuscany.sca.interfacedef.java.introspect.ExtensibleJavaInterfaceIntrospector; -import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceIntrospector; -import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceIntrospectorExtensionPoint; -import org.apache.tuscany.sca.interfacedef.java.xml.JavaInterfaceProcessor; -import org.apache.tuscany.sca.policy.DefaultPolicyFactory; -import org.apache.tuscany.sca.policy.PolicyFactory; -import org.springframework.beans.factory.support.DefaultListableBeanFactory; - -/** - * A mini test runtime that uses the SCA assembly model variant implementation - * backed by Spring bean definitions. - * - * @version $Rev$ $Date$ - */ -public class SCADomainContext { - - private DefaultListableBeanFactory beanFactory; - - public SCADomainContext(String... compositeFiles) { - - // Create Spring bean factory - beanFactory = new DefaultListableBeanFactory(); - - // Create SCA assembly and SCA Java factories - AssemblyFactory assemblyFactory = new BeanAssemblyFactory(new DefaultAssemblyFactory(), beanFactory); - SCABindingFactory scaBindingFactory = new DefaultSCABindingFactory(); - PolicyFactory policyFactory = new DefaultPolicyFactory(); - InterfaceContractMapper interfaceContractMapper = new InterfaceContractMapperImpl(); - JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory(); - JavaInterfaceIntrospectorExtensionPoint interfaceVisitors = new DefaultJavaInterfaceIntrospectorExtensionPoint(); - JavaImplementationFactory javaImplementationFactory = new BeanJavaImplementationFactory(beanFactory); - JavaClassIntrospectorExtensionPoint classVisitors = new DefaultJavaClassIntrospectorExtensionPoint(); - - JavaInterfaceIntrospector interfaceIntrospector = new ExtensibleJavaInterfaceIntrospector(javaFactory, interfaceVisitors); - - BaseJavaClassVisitor[] extensions = new BaseJavaClassVisitor[] { - new ConstructorProcessor(assemblyFactory), - new AllowsPassByReferenceProcessor(assemblyFactory), - new ContextProcessor(assemblyFactory), - new ConversationProcessor(assemblyFactory), - new DestroyProcessor(assemblyFactory), - new EagerInitProcessor(assemblyFactory), - new InitProcessor(assemblyFactory), - new PropertyProcessor(assemblyFactory), - new ReferenceProcessor(assemblyFactory, javaFactory, interfaceIntrospector), - new ResourceProcessor(assemblyFactory), - new ScopeProcessor(assemblyFactory), - new ServiceProcessor(assemblyFactory, javaFactory, interfaceIntrospector), - new HeuristicPojoProcessor(assemblyFactory, javaFactory, interfaceIntrospector), - new PolicyProcessor(assemblyFactory, policyFactory) - }; - for (JavaClassVisitor e : extensions) { - classVisitors.addClassVisitor(e); - } - JavaClassIntrospector classIntrospector = new ExtensibleJavaClassIntrospector(classVisitors); - - // Populate ArtifactProcessor registry - DefaultStAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(); - ExtensibleStAXArtifactProcessor staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance()); - CompositeProcessor compositeProcessor = new CompositeProcessor(assemblyFactory, policyFactory, - interfaceContractMapper, staxProcessor); - staxProcessors.addArtifactProcessor(compositeProcessor); - staxProcessors.addArtifactProcessor(new ComponentTypeProcessor(assemblyFactory, policyFactory, staxProcessor)); - staxProcessors.addArtifactProcessor(new ConstrainingTypeProcessor(assemblyFactory, policyFactory, staxProcessor)); - staxProcessors.addArtifactProcessor(new JavaInterfaceProcessor(javaFactory, interfaceIntrospector)); - staxProcessors.addArtifactProcessor(new JavaImplementationProcessor(assemblyFactory, policyFactory, javaImplementationFactory, classIntrospector)); - - // Create a resolver - ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); - ModelResolverImpl resolver = new ModelResolverImpl(classLoader); - - try { - - // Read the composite files - List composites = new ArrayList(); - for (String compositeFile: compositeFiles) { - InputStream is = classLoader.getResourceAsStream(compositeFile); - Composite composite = staxProcessor.read(is, Composite.class); - resolver.addModel(composite); - composites.add(composite); - } - - for (Composite composite: composites) { - - // Resolve the composite - compositeProcessor.resolve(composite, resolver); - } - - // Wire the top level component's composite - buildComposite(composites.get(0), assemblyFactory, scaBindingFactory, interfaceContractMapper); - - } catch (ContributionException e) { - throw new RuntimeException(e); - } catch (CompositeBuilderException e) { - throw new RuntimeException(e); - } - } - - private void buildComposite(Composite composite, AssemblyFactory assemblyFactory, - SCABindingFactory scaBindingFactory, InterfaceContractMapper interfaceContractMapper) throws CompositeBuilderException { - - CompositeBuilderMonitor monitor = new CompositeBuilderMonitor() { - - public void problem(Problem problem) { - // Uncommenting the following two lines can be useful to detect - // and troubleshoot SCA assembly XML composite configuration - // problems. - - System.out.println("Composite assembly problem: " + problem.getMessage()); - } - }; - - // Configure and wire the composite - CompositeBuilderImpl compositeUtil = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, interfaceContractMapper, monitor); - compositeUtil.build(composite); - - } - - public B getService(Class businessInterface, String serviceName) { - Object bean = beanFactory.getBean(serviceName); - return businessInterface.cast(bean); - } - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanBaseJavaImplementationImpl.java b/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanBaseJavaImplementationImpl.java deleted file mode 100644 index 8a88ba28d9..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanBaseJavaImplementationImpl.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.implementation.java.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.assembly.ConstrainingType; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.implementation.java.BaseJavaImplementation; -import org.apache.tuscany.sca.policy.Intent; -import org.apache.tuscany.sca.policy.PolicySet; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; -import org.springframework.beans.factory.support.RootBeanDefinition; - -/** - * An implementation of the SCA assembly JavaImplementation interface backed by a Spring - * Bean definition. - * - * @version $Rev$ $Date$ - */ -public class BeanBaseJavaImplementationImpl extends RootBeanDefinition implements BaseJavaImplementation, Cloneable { - private static final long serialVersionUID = 1L; - - private List services = new ArrayList(); - private List requiredIntents = new ArrayList(); - private List policySets = new ArrayList(); - private ConstrainingType constrainingType; - private List extensions = new ArrayList(); - private boolean unresolved; - private BeanDefinitionRegistry beanRegistry; - private String uri; - - protected BeanBaseJavaImplementationImpl(BeanDefinitionRegistry beanRegistry) { - this.beanRegistry = beanRegistry; - - // Register this bean definition in the bean registry - //TODO find a better name for bean definitions representing component types - String name = String.valueOf(System.identityHashCode(this)); - this.beanRegistry.registerBeanDefinition(name, this); - } - - @Override - public Object clone() throws CloneNotSupportedException { - BeanBaseJavaImplementationImpl clone = (BeanBaseJavaImplementationImpl)super.clone(); - - clone.getServices().clear(); - for (Service service: getServices()) { - clone.getServices().add((Service)service.clone()); - } - clone.getReferences().clear(); - for (Reference reference: getReferences()) { - clone.getReferences().add((Reference)reference.clone()); - } - clone.getProperties().clear(); - for (Property property: getProperties()) { - clone.getProperties().add((Property)property.clone()); - } - return clone; - } - - public Class getJavaClass() { - return super.getBeanClass(); - } - - public String getName() { - return super.getBeanClassName(); - } - - public void setJavaClass(Class javaClass) { - super.setBeanClass(javaClass); - } - - public void setName(String className) { - super.setBeanClassName(className); - } - - public String getURI() { - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - } - - public ConstrainingType getConstrainingType() { - return constrainingType; - } - - //TODO use a better list implementation - private List properties = new ArrayList() { - private static final long serialVersionUID = 1L; - - // Add a property - public boolean add(Property property) { - - // Add corresponding bean property value - getPropertyValues().addPropertyValue(property.getName(), property.getValue()); - - return super.add(property); - } - }; - - public List getProperties() { - return properties; - } - - //TODO use a better list implementation - private List references = new ArrayList() { - private static final long serialVersionUID = 1L; - - // Add a reference - public boolean add(Reference reference) { - - // Add corresponding bean property value - String target; - if (!reference.getTargets().isEmpty()) { - //TODO handle multiplicity - target = reference.getTargets().get(0).getName(); - int i = target.indexOf('/'); - if (i != -1) - target = target.substring(0, i); - } else { - target = null; - } - getPropertyValues().addPropertyValue(reference.getName(), target); - - return super.add(reference); - } - }; - - public List getReferences() { - return references; - } - - public List getServices() { - return services; - } - - public void setConstrainingType(ConstrainingType constrainingType) { - this.constrainingType = constrainingType; - } - - public List getExtensions() { - return extensions; - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setUnresolved(boolean unresolved) { - this.unresolved = unresolved; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public List getPolicySets() { - return policySets; - } - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaImplementationFactory.java b/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaImplementationFactory.java deleted file mode 100644 index c9cd0f8892..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaImplementationFactory.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.implementation.java.impl; - -import org.apache.tuscany.sca.implementation.java.JavaImplementation; -import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; - -/** - * An alternate implementation of the SCA Java assembly model factory that creates SCA - * Java assembly model objects backed by Spring bean definitions. - * - * @version $Rev$ $Date$ - */ -public class BeanJavaImplementationFactory implements JavaImplementationFactory { - - private BeanDefinitionRegistry beanRegistry; - - public BeanJavaImplementationFactory(BeanDefinitionRegistry beanRegistry) { - this.beanRegistry = beanRegistry; - } - - public JavaImplementation createJavaImplementation() { - return new BeanJavaImplementationImpl(beanRegistry); - } - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaImplementationImpl.java b/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaImplementationImpl.java deleted file mode 100644 index 5d787d2fd2..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaImplementationImpl.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.implementation.java.impl; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Member; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sca.implementation.java.JavaImplementation; -import org.apache.tuscany.sca.implementation.java.impl.JavaConstructorImpl; -import org.apache.tuscany.sca.implementation.java.impl.JavaElementImpl; -import org.apache.tuscany.sca.implementation.java.impl.JavaResourceImpl; -import org.apache.tuscany.sca.implementation.java.impl.JavaScopeImpl; -import org.springframework.beans.factory.support.BeanDefinitionRegistry; - -/** - * An implementation of the SCA assembly JavaImplementation interface backed by a Spring - * Bean definition. - * - * @version $$Rev$$ $$Date$$ - */ -public class BeanJavaImplementationImpl extends BeanBaseJavaImplementationImpl implements JavaImplementation { - private static final long serialVersionUID = 6792198458193774178L; - - private JavaConstructorImpl constructorDefinition; - private Map constructors = new HashMap(); - private Method initMethod; - private Method destroyMethod; - private final Map resources = new HashMap(); - private final Map propertyMembers = new HashMap(); - private final Map referenceMembers = new HashMap(); - private final Map callbackMembers = new HashMap(); - private Member conversationIDMember; - private boolean eagerInit; - private boolean allowsPassByReference; - private List allowsPassByReferenceMethods = new ArrayList(); - private long maxAge = -1; - private long maxIdleTime = -1; - private JavaScopeImpl scope = JavaScopeImpl.STATELESS; - - protected BeanJavaImplementationImpl(BeanDefinitionRegistry beanRegistry) { - super(beanRegistry); - } - - public JavaConstructorImpl getConstructor() { - return constructorDefinition; - } - - public void setConstructor(JavaConstructorImpl definition) { - this.constructorDefinition = definition; - } - - public Method getInitMethod() { - return initMethod; - } - - public void setInitMethod(Method initMethod) { - this.initMethod = initMethod; - } - - public Method getDestroyMethod() { - return destroyMethod; - } - - public void setDestroyMethod(Method destroyMethod) { - this.destroyMethod = destroyMethod; - } - - public Map getResources() { - return resources; - } - - public Member getConversationIDMember() { - return this.conversationIDMember; - } - - public void setConversationIDMember(Member conversationIDMember) { - this.conversationIDMember = conversationIDMember; - } - - public boolean isAllowsPassByReference() { - return allowsPassByReference; - } - - public void setAllowsPassByReference(boolean allowsPassByReference) { - this.allowsPassByReference = allowsPassByReference; - } - - public List getAllowsPassByReferenceMethods() { - return allowsPassByReferenceMethods; - } - - public boolean isAllowsPassByReference(Method method) { - return allowsPassByReference || allowsPassByReferenceMethods.contains(method); - } - - public Map getConstructors() { - return constructors; - } - - public boolean isEagerInit() { - return eagerInit; - } - - public void setEagerInit(boolean eagerInit) { - this.eagerInit = eagerInit; - } - - public Map getCallbackMembers() { - return callbackMembers; - } - - public Map getPropertyMembers() { - return propertyMembers; - } - - public Map getReferenceMembers() { - return referenceMembers; - } - - public JavaScopeImpl getJavaScope() { - return scope; - } - - public void setJavaScope(JavaScopeImpl scope) { - this.scope = scope; - } - - public long getMaxAge() { - return maxAge; - } - - public void setMaxAge(long maxAge) { - this.maxAge = maxAge; - } - - public long getMaxIdleTime() { - return maxIdleTime; - } - - public void setMaxIdleTime(long maxIdleTime) { - this.maxIdleTime = maxIdleTime; - } -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceContractImpl.java b/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceContractImpl.java deleted file mode 100644 index 17a7e9084c..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceContractImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.spring.implementation.java.impl; - -import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceContractImpl; - -/** - * An implementation of a Java interface contract. - * - * @version $Rev$ $Date$ - */ -public class BeanJavaInterfaceContractImpl extends JavaInterfaceContractImpl { - - protected BeanJavaInterfaceContractImpl() { - } - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceFactory.java b/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceFactory.java deleted file mode 100644 index 6557d23f27..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.implementation.java.impl; - -import org.apache.tuscany.sca.interfacedef.java.JavaInterface; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; - -/** - * An alternate implementation of the SCA Java assembly model factory that creates SCA - * Java assembly model objects backed by Spring bean definitions. - * - * @version $Rev$ $Date$ - */ -public class BeanJavaInterfaceFactory implements JavaInterfaceFactory { - - public BeanJavaInterfaceFactory() { - } - - public JavaInterface createJavaInterface() { - return new BeanJavaInterfaceImpl(); - } - - public JavaInterfaceContract createJavaInterfaceContract() { - return new BeanJavaInterfaceContractImpl(); - } - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceImpl.java b/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceImpl.java deleted file mode 100644 index 3d2c4b3e4d..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/main/java/org/apache/tuscany/sca/core/spring/implementation/java/impl/BeanJavaInterfaceImpl.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring.implementation.java.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.java.JavaInterface; -import org.apache.tuscany.sca.policy.Intent; - -/** - * An alternate implementation of the SCA Java assembly model JavaInterface - * interface. - * - * @version $Rev$ $Date$ - */ -public class BeanJavaInterfaceImpl implements JavaInterface { - - private String className; - private Class javaClass; - private Class callbackClass; - private boolean conversational; - private boolean remotable; - List requiredIntents = new ArrayList(); - private List extensions = new ArrayList(); - private List operations = new ArrayList(); - private boolean unresolved = false; - - protected BeanJavaInterfaceImpl() { - } - - public String getName() { - if (isUnresolved()) { - return className; - } - else { - return javaClass.getName(); - } - } - - public void setName(String className) { - if (!isUnresolved()) - throw new IllegalStateException(); - this.className = className; - } - - public Class getJavaClass() { - return javaClass; - } - - public void setJavaClass(Class javaClass) { - this.javaClass = javaClass; - } - - public Class getCallbackClass() { - return callbackClass; - } - - public void setCallbackClass(Class callbackClass) { - this.callbackClass = callbackClass; - } - - public boolean isConversational() { - return conversational; - } - - public boolean isRemotable() { - return remotable; - } - - public void setConversational(boolean conversational) { - this.conversational = conversational; - } - - public void setRemotable(boolean local) { - this.remotable = local; - } - - public List getRequiredIntents() { - return requiredIntents; - } - - public List getExtensions() { - return extensions; - } - - public List getOperations() { - return operations; - } - - public boolean isUnresolved() { - return unresolved; - } - - public void setUnresolved(boolean undefined) { - this.unresolved = undefined; - } - - public void setDefaultDataBinding(String dataBinding) { - } -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/AddService.java b/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/AddService.java deleted file mode 100644 index 4eeb30a9c2..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/AddService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/AddServiceImpl.java b/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/AddServiceImpl.java deleted file mode 100644 index ea3e5341d5..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.osoa.sca.annotations.EagerInit; -import org.osoa.sca.annotations.Scope; - -/** - * An implementation of the Add service - */ -@Scope("COMPOSITE") -@EagerInit -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - return n1 + n2; - } - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/CalculatorClient.java b/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/CalculatorClient.java deleted file mode 100644 index 56e737e3ab..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.apache.tuscany.sca.core.spring.context.SCADomainContext; - -/** - * This client program shows how to create an SCA runtime, start it, locate the - * Calculator service and invoke it. - */ -public class CalculatorClient { - public static void main(String[] args) throws Exception { - - SCADomainContext context = new SCADomainContext("org/apache/tuscany/core/spring/Calculator.composite"); - - CalculatorService calculatorService = context.getService(CalculatorService.class, "CalculatorServiceComponent"); - - // Calculate - System.out.println("3 + 2=" + calculatorService.add(3, 2)); - System.out.println("3 - 2=" + calculatorService.subtract(3, 2)); - System.out.println("3 * 2=" + calculatorService.multiply(3, 2)); - System.out.println("3 / 2=" + calculatorService.divide(3, 2)); - - } -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/CalculatorService.java b/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/CalculatorService.java deleted file mode 100644 index c89043276e..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/CalculatorService.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Calculator service interface. - */ -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/CalculatorServiceImpl.java b/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index 11e8974657..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Scope; - -/** - * An implementation of the Calculator service. - */ -@Scope("COMPOSITE") -public class CalculatorServiceImpl implements CalculatorService { - - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - @Reference - public void setAddService(AddService addService) { - this.addService = addService; - } - - @Reference - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - @Reference - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - @Reference - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - public double add(double n1, double n2) { - return addService.add(n1, n2); - } - - public double subtract(double n1, double n2) { - return subtractService.subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return multiplyService.multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return divideService.divide(n1, n2); - } - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/DivideService.java b/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/DivideService.java deleted file mode 100644 index 131c5a8014..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/DivideService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/DivideServiceImpl.java b/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/DivideServiceImpl.java deleted file mode 100644 index 9c7e96a668..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.osoa.sca.annotations.Scope; - -/** - * An implementation of the Divide service. - */ -@Scope("COMPOSITE") -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - return n1 / n2; - } - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/MultiplyService.java b/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/MultiplyService.java deleted file mode 100644 index a917896aeb..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/MultiplyService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/MultiplyServiceImpl.java b/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index 4892481203..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.osoa.sca.annotations.Scope; - -/** - * An implementation of the Multiply service. - */ -@Scope("COMPOSITE") -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - return n1 * n2; - } - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/NestedCalculatorClient.java b/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/NestedCalculatorClient.java deleted file mode 100644 index 27430b7f5d..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/NestedCalculatorClient.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.apache.tuscany.sca.core.spring.context.SCADomainContext; - -/** - * This client program shows how to create an SCA runtime, start it, locate the - * Calculator service and invoke it. - */ -public class NestedCalculatorClient { - public static void main(String[] args) throws Exception { - - SCADomainContext context = new SCADomainContext( - "org/apache/tuscany/core/spring/OuterCalculator.composite", - "org/apache/tuscany/core/spring/InnerCalculator.composite", - "org/apache/tuscany/core/spring/InnerOperations.composite"); - - CalculatorService calculatorService = context.getService(CalculatorService.class, "CalculatorServiceComponent/CalculatorServiceComponent"); - - // Calculate - System.out.println("3 + 2=" + calculatorService.add(3, 2)); - System.out.println("3 - 2=" + calculatorService.subtract(3, 2)); - System.out.println("3 * 2=" + calculatorService.multiply(3, 2)); - System.out.println("3 / 2=" + calculatorService.divide(3, 2)); - - } -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/SubtractService.java b/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/SubtractService.java deleted file mode 100644 index e328f024ea..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/SubtractService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/SubtractServiceImpl.java b/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index ee1d7c3457..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.osoa.sca.annotations.Scope; - -/** - * An implementation of the subtract service. - */ -@Scope("COMPOSITE") -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - return n1 - n2; - } - -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/java/org/apache/tuscany/sca/core/spring/CalculatorTestCase.java b/branches/sca-java-0.90/modules/core-spring/src/test/java/org/apache/tuscany/sca/core/spring/CalculatorTestCase.java deleted file mode 100644 index 97a44258a8..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/java/org/apache/tuscany/sca/core/spring/CalculatorTestCase.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.core.spring.context.SCADomainContext; - -import calculator.CalculatorService; - -/** - * This shows how to test the Calculator service component. - */ -public class CalculatorTestCase extends TestCase { - - private SCADomainContext context; - private CalculatorService calculatorService; - - protected void setUp() throws Exception { - context = new SCADomainContext("org/apache/tuscany/sca/core/spring/Calculator.composite"); - - calculatorService = context.getService(CalculatorService.class, "CalculatorServiceComponent"); - } - - protected void tearDown() throws Exception { - context = null; - calculatorService = null; - } - - public void testCalculator() throws Exception { - // Calculate - assertEquals(calculatorService.add(3, 2), 5.0); - assertEquals(calculatorService.subtract(3, 2), 1.0); - assertEquals(calculatorService.multiply(3, 2), 6.0); - assertEquals(calculatorService.divide(3, 2), 1.5); - - } -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/java/org/apache/tuscany/sca/core/spring/NestedCalculatorTestCase.java b/branches/sca-java-0.90/modules/core-spring/src/test/java/org/apache/tuscany/sca/core/spring/NestedCalculatorTestCase.java deleted file mode 100644 index 5ef16a91d8..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/java/org/apache/tuscany/sca/core/spring/NestedCalculatorTestCase.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.spring; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.core.spring.context.SCADomainContext; - -import calculator.CalculatorService; - -/** - * This shows how to test the Calculator service component. - */ -public class NestedCalculatorTestCase extends TestCase { - - private SCADomainContext context; - private CalculatorService calculatorService; - - protected void setUp() throws Exception { - context = new SCADomainContext( - "org/apache/tuscany/sca/core/spring/OuterCalculator.composite", - "org/apache/tuscany/sca/core/spring/InnerCalculator.composite", - "org/apache/tuscany/sca/core/spring/InnerOperations.composite"); - - calculatorService = context.getService(CalculatorService.class, "CalculatorServiceComponent/InnerCalculatorServiceComponent"); - } - - protected void tearDown() throws Exception { - context = null; - calculatorService = null; - } - - public void testCalculator() throws Exception { - // Calculate - assertEquals(calculatorService.add(3, 2), 5.0); - assertEquals(calculatorService.subtract(3, 2), 1.0); - assertEquals(calculatorService.multiply(3, 2), 6.0); - assertEquals(calculatorService.divide(3, 2), 1.5); - - } -} diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/Calculator.composite b/branches/sca-java-0.90/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/Calculator.composite deleted file mode 100644 index 6d998ba035..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/Calculator.composite +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/InnerCalculator.composite b/branches/sca-java-0.90/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/InnerCalculator.composite deleted file mode 100644 index 8b043f2b4f..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/InnerCalculator.composite +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/InnerOperations.composite b/branches/sca-java-0.90/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/InnerOperations.composite deleted file mode 100644 index d7d1124050..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/InnerOperations.composite +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/OuterCalculator.composite b/branches/sca-java-0.90/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/OuterCalculator.composite deleted file mode 100644 index c2b6cced36..0000000000 --- a/branches/sca-java-0.90/modules/core-spring/src/test/resources/org/apache/tuscany/sca/core/spring/OuterCalculator.composite +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/core/.checkstyle b/branches/sca-java-0.90/modules/core/.checkstyle deleted file mode 100644 index 3e57539570..0000000000 --- a/branches/sca-java-0.90/modules/core/.checkstyle +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/branches/sca-java-0.90/modules/core/.pmd b/branches/sca-java-0.90/modules/core/.pmd deleted file mode 100644 index ffc4fe2bbb..0000000000 --- a/branches/sca-java-0.90/modules/core/.pmd +++ /dev/null @@ -1,20 +0,0 @@ - - -true diff --git a/branches/sca-java-0.90/modules/core/.ruleset b/branches/sca-java-0.90/modules/core/.ruleset deleted file mode 100644 index ba9b5ce886..0000000000 --- a/branches/sca-java-0.90/modules/core/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/core/DISCLAIMER b/branches/sca-java-0.90/modules/core/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/core/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/core/LICENSE b/branches/sca-java-0.90/modules/core/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/core/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/core/NOTICE b/branches/sca-java-0.90/modules/core/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/core/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/core/pom.xml b/branches/sca-java-0.90/modules/core/pom.xml deleted file mode 100644 index 0db49e7726..0000000000 --- a/branches/sca-java-0.90/modules/core/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - tuscany-core - Apache Tuscany SCA Core Runtime - - - - org.apache.tuscany.sca - tuscany-core-spi - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-contribution - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-interface-java - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany - commonj-api - 0.90-incubating-SNAPSHOT - - - - org.codehaus.woodstox - wstx-asl - 3.2.0 - runtime - - - - diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/CallableReferenceImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/CallableReferenceImpl.java deleted file mode 100644 index f0f0049056..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/CallableReferenceImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.component; - -import org.apache.tuscany.sca.factory.ObjectFactory; -import org.osoa.sca.CallableReference; -import org.osoa.sca.Conversation; - -/** - * Base class for implementations of service and callback references. - * - * @version $Rev$ $Date$ - * @param the type of the business interface - */ -public abstract class CallableReferenceImpl implements CallableReference { - private final Class businessInterface; - private final ObjectFactory factory; - - protected CallableReferenceImpl(Class businessInterface, ObjectFactory factory) { - this.businessInterface = businessInterface; - this.factory = factory; - } - - public B getService() { - return factory.getInstance(); - } - - public Class getBusinessInterface() { - return businessInterface; - } - - public boolean isConversational() { - return false; - } - - public Conversation getConversation() { - return null; - } - - public Object getCallbackID() { - return null; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/CallbackReferenceImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/CallbackReferenceImpl.java deleted file mode 100644 index 45a48730d3..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/CallbackReferenceImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.component; - -import org.apache.tuscany.sca.factory.ObjectFactory; - -/** - * Default implementation of a callback reference. - * - * @version $Rev$ $Date$ - * @param the type of the business interface - */ -public class CallbackReferenceImpl extends CallableReferenceImpl { - public CallbackReferenceImpl(Class businessInterface, ObjectFactory factory) { - super(businessInterface, factory); - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/ComponentContextImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/ComponentContextImpl.java deleted file mode 100644 index abcd17f505..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/ComponentContextImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.component; - -import org.osoa.sca.CallableReference; -import org.osoa.sca.ComponentContext; -import org.osoa.sca.RequestContext; -import org.osoa.sca.ServiceReference; -import org.osoa.sca.ServiceRuntimeException; - -/** - * Implementation of ComponentContext that delegates to a ComponentContextProvider. - * - * @version $Rev$ $Date$ - */ -public class ComponentContextImpl implements ComponentContext { - private final ComponentContextProvider component; - - public ComponentContextImpl(ComponentContextProvider component) { - this.component = component; - } - - public String getURI() { - try { - return component.getUri().toString(); - } catch (RuntimeException e) { - throw new ServiceRuntimeException(e.getMessage(), e); - } - } - - public > R cast(B target) throws IllegalArgumentException { - try { - return (R) component.cast(target); - } catch (RuntimeException e) { - throw new ServiceRuntimeException(e.getMessage(), e); - } - } - - public B getService(Class businessInterface, String referenceName) { - try { - return component.getService(businessInterface, referenceName); - } catch (RuntimeException e) { - throw new ServiceRuntimeException(e.getMessage(), e); - } - } - - public ServiceReference getServiceReference(Class businessInterface, String referenceName) { - try { - return component.getServiceReference(businessInterface, referenceName); - } catch (RuntimeException e) { - throw new ServiceRuntimeException(e.getMessage(), e); - } - } - - public B getProperty(Class type, String propertyName) { - try { - return component.getProperty(type, propertyName); - } catch (RuntimeException e) { - throw new ServiceRuntimeException(e.getMessage(), e); - } - } - - public ServiceReference createSelfReference(Class businessInterface) { - return getServiceReference(businessInterface, "$self$."); - // FIXME: How to get the ObjectFactory? - // ObjectFactory factory = ((AtomicComponent) component).createObjectFactory(); - // return new ServiceReferenceImpl(businessInterface, factory); - } - - public ServiceReference createSelfReference(Class businessInterface, String serviceName) { - return getServiceReference(businessInterface, "$self$."+serviceName); - } - - public RequestContext getRequestContext() { - return null; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/ComponentContextProvider.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/ComponentContextProvider.java deleted file mode 100644 index 3999d0d5b4..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/ComponentContextProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.component; - -import java.net.URI; - -import org.osoa.sca.CallableReference; -import org.osoa.sca.ComponentContext; -import org.osoa.sca.ServiceReference; - -/** - * Interface implemented by Component's that want to expose a ComponentContext. - * - * @version $Rev$ $Date$ - */ -public interface ComponentContextProvider { - ComponentContext getComponentContext(); - - URI getUri(); - - B getService(Class businessInterface, String referenceName); - - ServiceReference getServiceReference(Class businessInterface, String referenceName); - - B getProperty(Class type, String propertyName); - - > R cast(B target); -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/RequestContextImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/RequestContextImpl.java deleted file mode 100644 index 3a219b9cd9..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/RequestContextImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.component; - -import javax.security.auth.Subject; - -import org.osoa.sca.CallableReference; -import org.osoa.sca.RequestContext; -import org.osoa.sca.ServiceReference; - -/** - * @version $Rev$ $Date$ - */ -public class RequestContextImpl implements RequestContext { - - public RequestContextImpl() { - } - - public Subject getSecuritySubject() { - throw new UnsupportedOperationException(); - } - - public String getServiceName() { - throw new UnsupportedOperationException(); - } - - public ServiceReference getServiceReference() { - throw new UnsupportedOperationException(); - } - - public CB getCallback() { - throw new UnsupportedOperationException(); - } - - public CallableReference getCallbackReference() { - throw new UnsupportedOperationException(); - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/ServiceReferenceImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/ServiceReferenceImpl.java deleted file mode 100644 index e268f5750f..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/component/ServiceReferenceImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.component; - -import org.apache.tuscany.sca.factory.ObjectFactory; -import org.osoa.sca.ServiceReference; - -/** - * Default implementation of a ServiceReference. - * - * @version $Rev$ $Date$ - * @param the type of the business interface - */ -public class ServiceReferenceImpl extends CallableReferenceImpl implements ServiceReference { - public ServiceReferenceImpl(Class businessInterface, ObjectFactory factory) { - super(businessInterface, factory); - } - - public Object getConversationID() { - return null; - } - - public void setConversationID(Object conversationId) throws IllegalStateException { - } - - public void setCallbackID(Object callbackID) { - } - - public Object getCallback() { - return null; - } - - public void setCallback(Object callback) { - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/BaseEventPublisher.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/BaseEventPublisher.java deleted file mode 100644 index 517e5579a4..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/BaseEventPublisher.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.event; - -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArrayList; - -import org.apache.tuscany.sca.event.Event; -import org.apache.tuscany.sca.event.EventFilter; -import org.apache.tuscany.sca.event.EventPublisher; -import org.apache.tuscany.sca.event.RuntimeEventListener; -import org.apache.tuscany.sca.event.TrueFilter; - -/** - * Base implementation of an EventPublisher - * - * @version $Rev$ $Date$ - */ -public abstract class BaseEventPublisher implements EventPublisher { - protected static final EventFilter TRUE_FILTER = new TrueFilter(); - protected Map> listeners; - - public void addListener(RuntimeEventListener listener) { - addListener(TRUE_FILTER, listener); - } - - public void removeListener(RuntimeEventListener listener) { - assert listener != null : "Listener cannot be null"; - synchronized (getListeners()) { - for (List currentList : getListeners().values()) { - for (RuntimeEventListener current : currentList) { - if (current == listener) { - currentList.remove(current); - return; - } - } - } - } - } - - public void addListener(EventFilter filter, RuntimeEventListener listener) { - assert listener != null : "Listener cannot be null"; - synchronized (getListeners()) { - List list = getListeners().get(filter); - if (list == null) { - list = new CopyOnWriteArrayList(); - listeners.put(filter, list); - } - list.add(listener); - } - } - - public void publish(Event event) { - assert event != null : "Event object was null"; - for (Map.Entry> entry : getListeners().entrySet()) { - if (entry.getKey().match(event)) { - for (RuntimeEventListener listener : entry.getValue()) { - listener.onEvent(event); - } - } - } - } - - protected Map> getListeners() { - if (listeners == null) { - listeners = new ConcurrentHashMap>(); - } - return listeners; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/ComponentStart.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/ComponentStart.java deleted file mode 100644 index 8e90c953e5..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/ComponentStart.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.event; - -import java.net.URI; - -import org.apache.tuscany.sca.event.Event; - -/** - * Propagated when a component starts - * - * @version $$Rev$$ $$Date$$ - */ -public class ComponentStart implements Event { - - private Object source; - private URI uri; - - /** - * Creates a component start event - * - * @param source the source of the event - * @param componentURI the uri of the component being started - */ - public ComponentStart(Object source, URI componentURI) { - this.source = source; - this.uri = componentURI; - } - - public URI getComponentURI() { - return uri; - } - - public Object getSource() { - return source; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/ComponentStop.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/ComponentStop.java deleted file mode 100644 index d879182e14..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/ComponentStop.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.event; - -import java.net.URI; - -import org.apache.tuscany.sca.event.Event; - -/** - * Propagated when a component stops - * - * @version $$Rev$$ $$Date$$ - */ -public class ComponentStop implements Event { - - private Object source; - private URI uri; - - /** - * Creates a component stop event - * - * @param source the source of the event - * @param componentUri the composite component associated the component being stopped - */ - public ComponentStop(Object source, URI componentUri) { - this.source = source; - this.uri = componentUri; - } - - public URI getComponentURI() { - return uri; - } - - public Object getSource() { - return source; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/ConversationEnd.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/ConversationEnd.java deleted file mode 100644 index cd14710880..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/ConversationEnd.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.event; - -import org.apache.tuscany.sca.event.Event; - - - -/** - * Propagated when a conversation is expired - * - * @version $$Rev$$ $$Date$$ - */ -public class ConversationEnd implements Event { - - private Object source; - private Object id; - - /** - * Creates a new event - * - * @param source the source of the event - * @param id the id of the conversation being ended - */ - public ConversationEnd(Object source, Object id) { - this.source = source; - this.id = id; - } - - public Object getSource() { - return source; - } - - public Object getConversationID() { - return id; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/ConversationStart.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/ConversationStart.java deleted file mode 100644 index a4cc49204e..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/ConversationStart.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.event; - -import org.apache.tuscany.sca.event.Event; - - -/** - * Propagated when a conversation has started - * - * @version $$Rev$$ $$Date$$ - */ -public class ConversationStart implements Event { - - private Object source; - private Object id; - - /** - * Creates a new event - * - * @param source the source of the event - * @param id the id of the conversation being started - */ - public ConversationStart(Object source, Object id) { - this.source = source; - this.id = id; - } - - public Object getSource() { - return source; - } - - public Object getConversationID() { - return id; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/HttpSessionEnd.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/HttpSessionEnd.java deleted file mode 100644 index 4c3fd8b397..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/HttpSessionEnd.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.event; - -import org.apache.tuscany.sca.event.Event; - - - -/** - * Propagated when an HTTP-based session is expired - * - * @version $$Rev$$ $$Date$$ - */ -public class HttpSessionEnd implements Event { - - private Object source; - private Object id; - - /** - * Creates a new event - * - * @param source the source of the event - * @param id the id of the HTTP session being ended - */ - public HttpSessionEnd(Object source, Object id) { - this.source = source; - this.id = id; - } - - public Object getSource() { - return source; - } - - public Object getSessionID() { - return id; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/HttpSessionStart.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/HttpSessionStart.java deleted file mode 100644 index 67b922b99c..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/HttpSessionStart.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.event; - -import org.apache.tuscany.sca.event.Event; - - -/** - * Propagated when an HTTP-based session has started - * - * @version $$Rev$$ $$Date$$ - */ -public class HttpSessionStart implements Event { - - private Object source; - private Object id; - - /** - * Creates a new event - * - * @param source the source of the event - * @param id the id of the HTTP session being started - */ - public HttpSessionStart(Object source, Object id) { - this.source = source; - this.id = id; - } - - public Object getSource() { - return source; - } - - public Object getSessionID() { - return id; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/RequestEnd.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/RequestEnd.java deleted file mode 100644 index 8b5c512cf2..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/RequestEnd.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.event; - -import org.apache.tuscany.sca.event.Event; - -/** - * Propagated when a request completes or is ended - * - * @version $$Rev$$ $$Date$$ - */ -public class RequestEnd implements Event { - - private Object source; - - /** - * Creates a new event - * - * @param source the source of the event - */ - public RequestEnd(Object source) { - this.source = source; - } - - public Object getSource() { - return source; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/RequestStart.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/RequestStart.java deleted file mode 100644 index 974563b57c..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/event/RequestStart.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.event; - -import org.apache.tuscany.sca.event.Event; - -/** - * Propagated when a request is started in the runtime - * - * @version $$Rev$$ $$Date$$ - */ -public class RequestStart implements Event { - - private Object source; - - /** - * Creates a new event - * - * @param source the source of the event - */ - public RequestStart(Object source) { - this.source = source; - } - - public Object getSource() { - return source; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AbstractInvocationHandler.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AbstractInvocationHandler.java deleted file mode 100644 index 6c1f38e4c2..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/AbstractInvocationHandler.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.invocation; - -import java.util.UUID; - -import org.apache.tuscany.sca.interfacedef.ConversationSequence; -import org.apache.tuscany.sca.interfacedef.Interface; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.invocation.MessageFactory; -import org.apache.tuscany.sca.runtime.RuntimeWire; - -/** - * Base class for performing invocations on a wire. Subclasses are responsible for retrieving and supplying the - * appropriate chain, target invoker, and invocation arguments. - * - * @version $Rev$ $Date$ - */ -public abstract class AbstractInvocationHandler { - protected boolean conversational; - private boolean conversationStarted; - private MessageFactory messageFactory; - - protected AbstractInvocationHandler(MessageFactory messageFactory, boolean conversational) { - this.conversational = conversational; - this.messageFactory = messageFactory; - } - - protected Object invoke(InvocationChain chain, Object[] args, RuntimeWire wire) throws Throwable { - - Message msgContext = ThreadMessageContext.getMessageContext(); - Message msg = messageFactory.createMessage(); - if (conversational) { - Object id = msgContext.getConversationID(); - if (id == null) { - String convIdFromThread = createConversationID(); - msg.setConversationID(convIdFromThread); - } - } - - Invoker headInvoker = chain.getHeadInvoker(); - msg.setCorrelationID(msgContext.getCorrelationID()); - Operation operation = chain.getTargetOperation(); - Interface contract = operation.getInterface(); - if (contract != null && contract.isConversational()) { - ConversationSequence sequence = chain.getTargetOperation().getConversationSequence(); - if (sequence == ConversationSequence.CONVERSATION_END) { - msg.setConversationSequence(ConversationSequence.CONVERSATION_END); - conversationStarted = false; - } else if (sequence == ConversationSequence.CONVERSATION_CONTINUE) { - if (conversationStarted) { - msg.setConversationSequence(ConversationSequence.CONVERSATION_CONTINUE); - } else { - conversationStarted = true; - msg.setConversationSequence(ConversationSequence.CONVERSATION_START); - } - } - } - msg.setBody(args); - msg.setFrom(wire.getSource()); - msg.setTo(wire.getTarget()); - ThreadMessageContext.setMessageContext(msg); - try { - // dispatch the wire down the chain and get the response - Message resp = headInvoker.invoke(msg); - Object body = resp.getBody(); - if (resp.isFault()) { - throw (Throwable)body; - } - return body; - } finally { - ThreadMessageContext.setMessageContext(msgContext); - } - } - - /** - * Creates a new conversational id - * - * @return the conversational id - */ - private String createConversationID() { - return UUID.randomUUID().toString(); - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackInterfaceInterceptor.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackInterfaceInterceptor.java deleted file mode 100644 index 219dc55536..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackInterfaceInterceptor.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.invocation; - -import org.apache.tuscany.sca.invocation.Interceptor; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.Message; -import org.osoa.sca.NoRegisteredCallbackException; - -/** - * An interceptor applied to the forward direction of a wire that ensures the callback target implements the required - * service contract. This is required as callback targets may be set dynamically by service implementations. - * - * @version $Rev$ $Date$ - */ -public class CallbackInterfaceInterceptor implements Interceptor { - private boolean invokingServiceImplements; - private Invoker next; - - public CallbackInterfaceInterceptor(boolean invokingServiceImplements) { - this.invokingServiceImplements = invokingServiceImplements; - } - - public Message invoke(Message msg) { - // TODO check in the context if a callback object is set, if so invoke next since the setCallback will - // perform the check - if (!invokingServiceImplements) { - throw new NoRegisteredCallbackException("Callback target does not implement the callback interface"); - } - return next.invoke(msg); - } - - public void setNext(Invoker next) { - this.next = next; - } - - public Invoker getNext() { - return next; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackWireObjectFactory.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackWireObjectFactory.java deleted file mode 100644 index dae4ed708b..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackWireObjectFactory.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.invocation; - -import java.util.List; - -import org.apache.tuscany.sca.factory.ObjectCreationException; -import org.apache.tuscany.sca.factory.ObjectFactory; -import org.apache.tuscany.sca.runtime.RuntimeWire; - -/** - * Returns proxy instance for a wire callback - * - * @version $Rev$ $Date$ - */ -public class CallbackWireObjectFactory implements ObjectFactory { - private ProxyFactory proxyFactory; - private Class interfaze; - private List wires; - - public CallbackWireObjectFactory(Class interfaze, ProxyFactory proxyService, List wires) { - this.interfaze = interfaze; - this.proxyFactory = proxyService; - this.wires = wires; - } - - public Object getInstance() throws ObjectCreationException { - return proxyFactory.createCallbackProxy(interfaze, wires); - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleWireProcessor.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleWireProcessor.java deleted file mode 100644 index 934f2f7aa0..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ExtensibleWireProcessor.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.invocation; - -import org.apache.tuscany.sca.runtime.RuntimeWire; -import org.apache.tuscany.sca.runtime.RuntimeWireProcessor; -import org.apache.tuscany.sca.runtime.RuntimeWireProcessorExtensionPoint; - -/** - * The default implementation of an extensible WireProcessor - * - * @version $Rev$ $Date$ - */ -public class ExtensibleWireProcessor implements RuntimeWireProcessor { - - private RuntimeWireProcessorExtensionPoint processors; - - public ExtensibleWireProcessor(RuntimeWireProcessorExtensionPoint processors) { - this.processors = processors; - } - - public void process(RuntimeWire wire) { - for (RuntimeWireProcessor processor : processors.getWireProcessors()) { - processor.process(wire); - } - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/InvocationChainImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/InvocationChainImpl.java deleted file mode 100644 index e04148e374..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/InvocationChainImpl.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.invocation; - -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Interceptor; -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.invocation.Invoker; - -/** - * Default implementation of an invocation chain - * - * @version $Rev$ $Date$ - */ -public class InvocationChainImpl implements InvocationChain { - private Operation sourceOperation; - private Operation targetOperation; - private Invoker invokerChainHead; - private Invoker invokerChainTail; - - public InvocationChainImpl(Operation operation) { - assert operation != null; - this.targetOperation = operation; - this.sourceOperation = operation; - } - - public InvocationChainImpl(Operation sourceOperation, Operation targetOperation) { - assert sourceOperation != null; - assert targetOperation != null; - this.targetOperation = targetOperation; - this.sourceOperation = sourceOperation; - } - - public Operation getTargetOperation() { - return targetOperation; - } - - public void addInterceptor(Interceptor interceptor) { - if (invokerChainHead == null) { - invokerChainHead = interceptor; - } else { - if (invokerChainHead instanceof Interceptor) { - ((Interceptor)invokerChainTail).setNext(interceptor); - } - } - invokerChainTail = interceptor; - } - - public void addInvoker(Invoker invoker) { - if (invokerChainHead == null) { - invokerChainHead = invoker; - } else { - if (invokerChainTail instanceof Interceptor) { - ((Interceptor)invokerChainTail).setNext(invoker); - } - } - invokerChainTail = invoker; - } - - public Invoker getHeadInvoker() { - return invokerChainHead; - } - - public Invoker getTailInvoker() { - return invokerChainTail; - } - - /** - * @return the sourceOperation - */ - public Operation getSourceOperation() { - return sourceOperation; - } - - /** - * @param sourceOperation the sourceOperation to set - */ - public void setSourceOperation(Operation sourceOperation) { - this.sourceOperation = sourceOperation; - } - - public void addInterceptor(int index, Interceptor interceptor) { - int i = 0; - Invoker next = invokerChainHead; - Invoker prev = null; - while (next != null && i < index) { - prev = next; - if (next instanceof Interceptor) { - next = ((Interceptor)next).getNext(); - i++; - } else { - throw new ArrayIndexOutOfBoundsException(index); - } - } - if (i == index) { - if (prev != null) { - ((Interceptor)prev).setNext(interceptor); - } else { - invokerChainHead = interceptor; - } - interceptor.setNext(next); - if (next == null) { - invokerChainTail = interceptor; - } - } else { - throw new ArrayIndexOutOfBoundsException(index); - } - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKCallbackInvocationHandler.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKCallbackInvocationHandler.java deleted file mode 100644 index 5a028e6e22..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKCallbackInvocationHandler.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.invocation; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.IdentityHashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil; -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.invocation.MessageFactory; -import org.apache.tuscany.sca.runtime.EndpointReference; -import org.apache.tuscany.sca.runtime.RuntimeWire; -import org.osoa.sca.NoRegisteredCallbackException; - -/** - * Responsible for dispatching to a callback through a wire.

TODO cache - * target invoker - * - * @version $Rev$ $Date$ - */ -public class JDKCallbackInvocationHandler extends AbstractInvocationHandler implements InvocationHandler { - private static final long serialVersionUID = -3350283555825935609L; - private transient Map wires; - - /** - * Constructor used for deserialization only - */ - public JDKCallbackInvocationHandler(MessageFactory messageFactory) { - super(messageFactory, false); - wires = new HashMap(); - } - - public JDKCallbackInvocationHandler(MessageFactory messageFactory, List wireList) { - super(messageFactory, false); - this.wires = new HashMap(); - for (RuntimeWire wire : wireList) { - wires.put(wire.getSource().getURI(), wire); - } - } - - @SuppressWarnings( {"unchecked"}) - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - if (method.getParameterTypes().length == 0 && "toString".equals(method.getName())) { - return "[Proxy - " + Integer.toHexString(hashCode()) + "]"; - } else if (method.getDeclaringClass().equals(Object.class) && "equals".equals(method.getName())) { - // TODO implement - throw new UnsupportedOperationException(); - } else if (Object.class.equals(method.getDeclaringClass()) && "hashCode".equals(method.getName())) { - return hashCode(); - // TODO beter hash algorithm - } - EndpointReference from = ThreadMessageContext.getMessageContext().getFrom(); - RuntimeWire wire = wires.get(from.getURI()); - assert wire != null; - List chains = wire.getCallbackInvocationChains(); - IdentityHashMap map = new IdentityHashMap(); - for (InvocationChain chain : chains) { - map.put(chain.getTargetOperation(), chain); - } - Operation operation = JavaInterfaceUtil.findOperation(method, map.keySet()); - InvocationChain chain = map.get(operation); - try { - return invoke(chain, args, wire); - } catch (InvocationTargetException e) { - Throwable t = e.getCause(); - if (t instanceof NoRegisteredCallbackException) { - throw t; - } - throw e; - } - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java deleted file mode 100644 index c22481cb73..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKInvocationHandler.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.invocation; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; -import java.util.List; - -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.invocation.MessageFactory; -import org.apache.tuscany.sca.runtime.RuntimeWire; - -/** - * @version $Rev$ $Date$ - */ -public class JDKInvocationHandler extends AbstractInvocationHandler implements InvocationHandler { - // private Class proxyInterface; - private RuntimeWire wire; - - public JDKInvocationHandler(MessageFactory messageFactory, Class proxyInterface, RuntimeWire wire) { - super(messageFactory, false); - this.wire = wire; - init(proxyInterface, wire); - } - - private void init(Class interfaze, RuntimeWire wire) { - InterfaceContract contract = wire.getSource().getInterfaceContract(); - this.conversational = contract.getInterface().isConversational(); - } - - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - if (method.getParameterTypes().length == 0 && "toString".equals(method.getName())) { - return "[Proxy - " + Integer.toHexString(hashCode()) + "]"; - } else if (method.getDeclaringClass().equals(Object.class) && "equals".equals(method.getName())) { - Object obj = args[0]; - if (obj == null) { - return false; - } - if (!Proxy.isProxyClass(obj.getClass())) { - return false; - } - return equals(Proxy.getInvocationHandler(obj)); - } else if (Object.class.equals(method.getDeclaringClass()) && "hashCode".equals(method.getName())) { - return hashCode(); - } - InvocationChain chain = getInvocationChain(method); - if (chain == null) { - throw new IllegalArgumentException("No matching opeeration is found: " + method); - } - - // send the invocation down the wire - Object result = invoke(chain, args, wire); - - return result; - } - - /** - * Determines if the given operation matches the given method - * - * @return true if the operation matches, false if does not - */ - private static boolean match(Operation operation, Method method) { - Class[] params = method.getParameterTypes(); - DataType> inputType = operation.getInputType(); - List types = inputType.getLogical(); - boolean matched = true; - if (types.size() == params.length && method.getName().equals(operation.getName())) { - for (int i = 0; i < params.length; i++) { - Class clazz = params[i]; - if (!clazz.equals(operation.getInputType().getLogical().get(i).getPhysical())) { - matched = false; - } - } - } else { - matched = false; - } - return matched; - - } - - private InvocationChain getInvocationChain(Method method) { - for (InvocationChain chain : wire.getInvocationChains()) { - Operation operation = chain.getSourceOperation(); - if (match(operation, method)) { - return chain; - } - } - return null; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKProxyService.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKProxyService.java deleted file mode 100644 index 371f9bedb8..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/JDKProxyService.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.invocation; - -import java.lang.reflect.Proxy; -import java.util.List; - -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.impl.InterfaceContractMapperImpl; -import org.apache.tuscany.sca.invocation.MessageFactory; -import org.apache.tuscany.sca.runtime.RuntimeWire; -import org.osoa.sca.CallableReference; - -/** - * the default implementation of a wire service that uses JDK dynamic proxies - * - * @version $$Rev$$ $$Date: 2007-04-11 18:59:43 -0700 (Wed, 11 Apr - * 2007) $$ - */ -public class JDKProxyService implements ProxyFactory { - protected InterfaceContractMapper contractMapper; - private MessageFactory messageFactory; - - public JDKProxyService() { - this(new MessageFactoryImpl(), new InterfaceContractMapperImpl()); - } - - public JDKProxyService(MessageFactory messageFactory, InterfaceContractMapper mapper) { - this.contractMapper = mapper; - this.messageFactory = messageFactory; - } - - public T createProxy(Class interfaze, RuntimeWire wire) throws ProxyCreationException { - assert interfaze != null; - assert wire != null; - JDKInvocationHandler handler = new JDKInvocationHandler(messageFactory, interfaze, wire); - ClassLoader cl = interfaze.getClassLoader(); - return interfaze.cast(Proxy.newProxyInstance(cl, new Class[] {interfaze}, handler)); - } - - public Object createCallbackProxy(Class interfaze, List wires) throws ProxyCreationException { - ClassLoader cl = interfaze.getClassLoader(); - JDKCallbackInvocationHandler handler = new JDKCallbackInvocationHandler(messageFactory, wires); - return interfaze.cast(Proxy.newProxyInstance(cl, new Class[] {interfaze}, handler)); - } - - public > R cast(B target) throws IllegalArgumentException { - throw new UnsupportedOperationException(); - - // InvocationHandler handler = Proxy.getInvocationHandler(target); - // if (handler instanceof JDKInvocationHandler) { - // // TODO return a ServiceReference - // throw new UnsupportedOperationException(); - // } else if (handler instanceof JDKCallbackInvocationHandler) { - // // TODO return a CallbackReference - // throw new UnsupportedOperationException(); - // } else { - // throw new IllegalArgumentException("Not a Tuscany SCA proxy"); - // } - - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/MessageFactoryImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/MessageFactoryImpl.java deleted file mode 100644 index 6e182a6a14..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/MessageFactoryImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.invocation; - -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.invocation.MessageFactory; - -/** - * Implementation of MessageFactory. - * - * @version $Rev$ $Date$ - */ -public class MessageFactoryImpl implements MessageFactory { - - public Message createMessage() { - return new MessageImpl(); - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/MessageImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/MessageImpl.java deleted file mode 100644 index a1b2963cf5..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/MessageImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.invocation; - -import org.apache.tuscany.sca.interfacedef.ConversationSequence; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.runtime.EndpointReference; - -/** - * The default implementation of a message flowed through a wire during an invocation - * - * @version $Rev $Date - */ -public class MessageImpl implements Message { - private Object body; - private Object messageID; - private Object correlationID; - private boolean isFault; - private ConversationSequence conversationSequence; - private String conversationId; - - private EndpointReference from; - private EndpointReference to; - - public MessageImpl(String conversationId, ConversationSequence conversationSequence, Object body) { - this.conversationId = conversationId; - this.conversationSequence = conversationSequence; - this.body = body; - } - - public MessageImpl() { - } - - @SuppressWarnings("unchecked") - public T getBody() { - return (T) body; - } - - public void setBody(T body) { - this.isFault = false; - this.body = body; - } - - public String getConversationID() { - return conversationId; - } - - public void setConversationID(String conversationId) { - this.conversationId = conversationId; - } - - public ConversationSequence getConversationSequence() { - return conversationSequence; - } - - public void setConversationSequence(ConversationSequence conversationSequence) { - this.conversationSequence = conversationSequence; - } - - public Object getMessageID() { - return messageID; - } - - public void setMessageID(Object messageId) { - this.messageID = messageId; - } - - public Object getCorrelationID() { - return correlationID; - } - - public void setCorrelationID(Object correlationId) { - this.correlationID = correlationId; - } - - public boolean isFault() { - return isFault; - } - - public void setFaultBody(Object fault) { - this.isFault = true; - this.body = fault; - } - - public EndpointReference getFrom() { - return from; - } - - public void setFrom(EndpointReference from) { - this.from = from; - } - - public EndpointReference getTo() { - return to; - } - - public void setTo(EndpointReference to) { - this.to = to; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NoMethodForOperationException.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NoMethodForOperationException.java deleted file mode 100644 index cbeedc086d..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NoMethodForOperationException.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.invocation; - - -/** - * Thrown when an {@link org.apache.tuscany.sca.factory.model.Operation} cannot be mapped to a method on an interface - * @version $Rev$ $Date$ - */ -public class NoMethodForOperationException extends ProxyCreationException { - private static final long serialVersionUID = 5116536602309483679L; - - public NoMethodForOperationException() { - } - - public NoMethodForOperationException(String message) { - super(message); - } - - public NoMethodForOperationException(String message, Throwable cause) { - super(message, cause); - } - - public NoMethodForOperationException(Throwable cause) { - super(cause); - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java deleted file mode 100644 index be6f364271..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/NonBlockingInterceptor.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.invocation; - -import java.util.LinkedList; - -import org.apache.tuscany.sca.interfacedef.ConversationSequence; -import org.apache.tuscany.sca.invocation.Interceptor; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.runtime.EndpointReference; -import org.apache.tuscany.sca.runtime.RuntimeWire; -import org.apache.tuscany.sca.work.WorkScheduler; -import org.osoa.sca.ServiceRuntimeException; - -/** - * Adds non-blocking behavior to an invocation chain - * - * @version $$Rev$$ $$Date$$ - */ -public class NonBlockingInterceptor implements Interceptor { - - private static final Message RESPONSE = new ImmutableMessage(); - - private WorkScheduler workScheduler; - private Invoker next; - - public NonBlockingInterceptor(WorkScheduler workScheduler) { - this.workScheduler = workScheduler; - } - - public NonBlockingInterceptor(WorkScheduler workScheduler, Interceptor next) { - this.workScheduler = workScheduler; - this.next = next; - } - - public Message invoke(final Message msg) { - // Retrieve conversation id to transfer to new thread - // Notice that we cannot clear the conversation id from the current thread - final String conversationID = ThreadMessageContext.getMessageContext().getConversationID(); - // Schedule the invocation of the next interceptor in a new Work instance - try { - workScheduler.scheduleWork(new Runnable() { - public void run() { - msg.setCorrelationID(null); - // if we got a conversation id, transfer it to new thread - if (conversationID != null) { - msg.setConversationID(conversationID); - } - Message context = ThreadMessageContext.setMessageContext(msg); - try { - next.invoke(msg); - } finally { - ThreadMessageContext.setMessageContext(context); - } - } - }); - } catch (Exception e) { - throw new ServiceRuntimeException(e); - } - return RESPONSE; - } - - public Invoker getNext() { - return next; - } - - public void setNext(Invoker next) { - this.next = next; - } - - /** - * A dummy message passed back on an invocation - */ - private static class ImmutableMessage implements Message { - - public String getConversationID() { - return null; - } - - public RuntimeWire getWire() { - return null; - } - - public void setConversationID(String conversationId) { - throw new UnsupportedOperationException(); - } - - public void setWire(RuntimeWire wire) { - throw new UnsupportedOperationException(); - } - - @SuppressWarnings("unchecked") - public Object getBody() { - return null; - } - - public void setBody(Object body) { - if (body != null) { - throw new UnsupportedOperationException(); - } - } - - public void setCallbackWires(LinkedList wires) { - - } - - public Object getMessageID() { - return null; - } - - public void setMessageID(Object messageId) { - throw new UnsupportedOperationException(); - } - - public Object getCorrelationID() { - return null; - } - - public void setCorrelationID(Object correlationId) { - throw new UnsupportedOperationException(); - } - - public boolean isFault() { - return false; - } - - public void setFaultBody(Object fault) { - throw new UnsupportedOperationException(); - } - - public void setConversationSequence(ConversationSequence sequence) { - throw new UnsupportedOperationException(); - } - - public ConversationSequence getConversationSequence() { - return null; - } - - public EndpointReference getFrom() { - return null; - } - - public EndpointReference getTo() { - return null; - } - - public void setFrom(EndpointReference from) { - throw new UnsupportedOperationException(); - } - - public void setTo(EndpointReference to) { - throw new UnsupportedOperationException(); - } - - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyCreationException.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyCreationException.java deleted file mode 100644 index 4900ae9a7e..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyCreationException.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.invocation; - -import org.apache.tuscany.sca.factory.ObjectCreationException; - - -/** - * Denotes an error creating a proxy - * - * @version $$Rev$$ $$Date$$ - */ -public class ProxyCreationException extends ObjectCreationException { - private static final long serialVersionUID = 8002454344828513781L; - - 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/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyFactory.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyFactory.java deleted file mode 100644 index 381844ffc5..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ProxyFactory.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.invocation; - -import java.util.List; - -import org.apache.tuscany.sca.runtime.RuntimeWire; -import org.osoa.sca.CallableReference; - -/** - * Creates proxies that implement Java interfaces and invocation handlers for fronting wires - * - * @version $$Rev$$ $$Date$$ - */ - -public interface ProxyFactory { - - /** - * Creates a Java proxy for the given wire - * - * @param interfaze the interface the proxy implements - * @param wire the wire to proxy @return the proxy - * @throws ProxyCreationException - */ - T createProxy(Class interfaze, RuntimeWire wire) throws ProxyCreationException; - - /** - * Creates a Java proxy for the service contract callback - * - * @param interfaze the interface the proxy should implement - * @return the proxy - * @throws ProxyCreationException - */ - Object createCallbackProxy(Class interfaze, List wires) throws ProxyCreationException; - - /** - * Cast a proxy to a CallableReference. - * - * @param target a proxy generated by this implementation - * @return a CallableReference (or subclass) equivalent to this prozy - * @throws IllegalArgumentException if the object supplied is not a proxy - */ - > R cast(B target) throws IllegalArgumentException; - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java deleted file mode 100644 index 52bea91341..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.invocation; - -import org.apache.tuscany.sca.invocation.Message; - -/** - * Class for tunneling a WorkContext through the invocation of a user class. - * - * @version $Rev$ $Date$ - */ -public final class ThreadMessageContext { - - private static final ThreadLocal CONTEXT = new ThreadLocal() { - protected synchronized Message initialValue() { - return new MessageImpl(); - } - }; - - private ThreadMessageContext() { - } - - /** - * Set the WorkContext for the current thread. - * The current work context is returned and must be restored after the invocation is complete. - * Typical usage would be: - *

-     *   WorkContext old = PojoWorkContextTunnel.setThreadWorkContext(newContext);
-     *   try {
-     *      ... invoke user code ...
-     *   } finally {
-     *     PojoWorkContextTunnel.setThreadWorkContext(old);
-     *   }
-     * 
- * @param context - * @return the current work context for the thread; this must be restored after the invocation is made - */ - public static Message setMessageContext(Message context) { - Message old = CONTEXT.get(); - CONTEXT.set(context); - return old; - } - - /** - * Returns the WorkContext for the current thread. - * - * @return the WorkContext for the current thread - */ - public static Message getMessageContext() { - return CONTEXT.get(); - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/WireObjectFactory.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/WireObjectFactory.java deleted file mode 100644 index e6e41e8f85..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/WireObjectFactory.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.invocation; - -import org.apache.tuscany.sca.factory.ObjectCreationException; -import org.apache.tuscany.sca.factory.ObjectFactory; -import org.apache.tuscany.sca.runtime.RuntimeWire; - -/** - * Uses a wire to return an object instance - * - * @version $Rev$ $Date$ - */ -public class WireObjectFactory implements ObjectFactory { - private Class interfaze; - private RuntimeWire wire; - private ProxyFactory proxyService; - private boolean optimizable; - - /** - * Constructor. - * - * @param interfaze the interface to inject on the client - * @param wire the backing wire - * @param proxyService the wire service to create the proxy - * @throws NoMethodForOperationException - */ - public WireObjectFactory(Class interfaze, RuntimeWire wire, ProxyFactory proxyService) - throws NoMethodForOperationException { - this.interfaze = interfaze; - this.wire = wire; - this.proxyService = proxyService; - } - - public T getInstance() throws ObjectCreationException { - return interfaze.cast(proxyService.createProxy(interfaze, wire)); - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/ActivationException.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/ActivationException.java deleted file mode 100644 index 987a8288b0..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/ActivationException.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.runtime; - - -/** - * Denotes an error starting the runtime - * - * @version $Rev$ $Date$ - */ -public class ActivationException extends Exception { - private static final long serialVersionUID = 8612661660934426123L; - - public ActivationException(String message) { - super(message); - } - - public ActivationException(Throwable cause) { - super(cause); - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/CompositeActivator.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/CompositeActivator.java deleted file mode 100644 index a390fdebfe..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/CompositeActivator.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.runtime; - -import org.apache.tuscany.sca.assembly.Composite; - -/** - * Start/stop a composite - * - * @version $Rev$ $Date$ - */ -public interface CompositeActivator { - - /** - * Activate a composite - * @param composite - */ - void activate(Composite composite) throws ActivationException; - - /** - * Stop a composite - * @param composite - */ - void deactivate(Composite composite) throws ActivationException; - - /** - * Start a composite - * @param composite - */ - void start(Composite composite) throws ActivationException; - - /** - * Stop a composite - * @param composite - */ - void stop(Composite composite) throws ActivationException; - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/CompositeActivatorImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/CompositeActivatorImpl.java deleted file mode 100644 index 5308c6e0f9..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/CompositeActivatorImpl.java +++ /dev/null @@ -1,597 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.runtime; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.assembly.SCABinding; -import org.apache.tuscany.sca.assembly.SCABindingFactory; -import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException; -import org.apache.tuscany.sca.assembly.builder.CompositeBuilderMonitor; -import org.apache.tuscany.sca.assembly.builder.Problem; -import org.apache.tuscany.sca.assembly.builder.impl.CompositeBuilderImpl; -import org.apache.tuscany.sca.core.invocation.InvocationChainImpl; -import org.apache.tuscany.sca.core.invocation.NonBlockingInterceptor; -import org.apache.tuscany.sca.interfacedef.IncompatibleInterfaceContractException; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.provider.BindingProviderFactory; -import org.apache.tuscany.sca.provider.ImplementationProvider; -import org.apache.tuscany.sca.provider.ImplementationProviderFactory; -import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.runtime.EndpointReference; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; -import org.apache.tuscany.sca.runtime.RuntimeWire; -import org.apache.tuscany.sca.runtime.RuntimeWireProcessor; -import org.apache.tuscany.sca.scope.ScopeRegistry; -import org.apache.tuscany.sca.scope.ScopedRuntimeComponent; -import org.apache.tuscany.sca.work.WorkScheduler; - -/** - * @version $Rev$ $Date$ - */ -public class CompositeActivatorImpl implements CompositeActivator { - - private final AssemblyFactory assemblyFactory; - private final SCABindingFactory scaBindingFactory; - private final InterfaceContractMapper interfaceContractMapper; - private final ScopeRegistry scopeRegistry; - private final WorkScheduler workScheduler; - private final RuntimeWireProcessor wireProcessor; - private final ProviderFactoryExtensionPoint providerFactories; - - /** - * @param assemblyFactory - * @param interfaceContractMapper - * @param workContext - * @param workScheduler - * @param wirePostProcessorRegistry - */ - public CompositeActivatorImpl(AssemblyFactory assemblyFactory, - SCABindingFactory scaBindingFactory, - InterfaceContractMapper interfaceContractMapper, - ScopeRegistry scopeRegistry, - WorkScheduler workScheduler, - RuntimeWireProcessor wireProcessor, - ProviderFactoryExtensionPoint providerFactories) { - super(); - this.assemblyFactory = assemblyFactory; - this.scaBindingFactory = scaBindingFactory; - this.interfaceContractMapper = interfaceContractMapper; - this.scopeRegistry = scopeRegistry; - this.workScheduler = workScheduler; - this.wireProcessor = wireProcessor; - this.providerFactories = providerFactories; - } - - /** - * Configure a composite - * - * @param composite - * @throws IncompatibleInterfaceContractException - */ - @SuppressWarnings("unchecked") - protected void configureComposite(Composite composite) throws IncompatibleInterfaceContractException { - for (Component component : composite.getComponents()) { - - for (ComponentService service : component.getServices()) { - for (Binding binding : service.getBindings()) { - BindingProviderFactory providerFactory = (BindingProviderFactory)providerFactories - .getProviderFactory(binding.getClass()); - if (providerFactory != null) { - ServiceBindingProvider bindingProvider = providerFactory - .createServiceBindingProvider((RuntimeComponent)component, - (RuntimeComponentService)service, - binding); - if (bindingProvider != null) { - ((RuntimeComponentService)service).setBindingProvider(binding, bindingProvider); - } - } else { - throw new IllegalStateException("Provider factory not found for class: " + binding.getClass() - .getName()); - } - } - } - for (ComponentReference reference : component.getReferences()) { - for (Binding binding : reference.getBindings()) { - BindingProviderFactory providerFactory = (BindingProviderFactory)providerFactories - .getProviderFactory(binding.getClass()); - if (providerFactory != null) { - ReferenceBindingProvider bindingProvider = providerFactory - .createReferenceBindingProvider((RuntimeComponent)component, - (RuntimeComponentReference)reference, - binding); - if (bindingProvider != null) { - ((RuntimeComponentReference)reference).setBindingProvider(binding, bindingProvider); - } - } else { - throw new IllegalStateException("Provider factory not found for class: " + binding.getClass() - .getName()); - } - } - } - - Implementation implementation = component.getImplementation(); - if (implementation instanceof Composite) { - configureComposite((Composite)implementation); - } else if (implementation != null) { - ImplementationProviderFactory providerFactory = (ImplementationProviderFactory)providerFactories - .getProviderFactory(implementation.getClass()); - if (providerFactory != null) { - ImplementationProvider implementationProvider = providerFactory - .createImplementationProvider((RuntimeComponent)component, implementation); - if (implementationProvider != null) { - ((RuntimeComponent)component).setImplementationProvider(implementationProvider); - } - } else { - throw new IllegalStateException("Provider factory not found for class: " + implementation - .getClass().getName()); - } - setScopeContainer(component); - } - } - } - - /** - * Start a composite - */ - protected void startComposite(Composite composite) { - for (Component component : composite.getComponents()) { - - for (ComponentService service : component.getServices()) { - for (Binding binding : service.getBindings()) { - ServiceBindingProvider bindingProvider = ((RuntimeComponentService)service) - .getBindingProvider(binding); - if (bindingProvider != null) { - bindingProvider.start(); - } - } - } - for (ComponentReference reference : component.getReferences()) { - for (Binding binding : reference.getBindings()) { - ReferenceBindingProvider bindingProvider = ((RuntimeComponentReference)reference) - .getBindingProvider(binding); - if (bindingProvider != null) { - bindingProvider.start(); - } - } - } - - Implementation implementation = component.getImplementation(); - if (implementation instanceof Composite) { - startComposite((Composite)implementation); - } else { - ImplementationProvider implementationProvider = ((RuntimeComponent)component) - .getImplementationProvider(); - if (implementationProvider != null) { - implementationProvider.start(); - } - } - - if (component instanceof ScopedRuntimeComponent) { - ScopedRuntimeComponent runtimeComponent = (ScopedRuntimeComponent)component; - if (runtimeComponent.getScopeContainer() != null) { - runtimeComponent.getScopeContainer().start(); - } - } - - } - } - - public void stop(Composite composite) { - for (Component component : composite.getComponents()) { - - for (ComponentService service : component.getServices()) { - for (Binding binding : service.getBindings()) { - ServiceBindingProvider bindingProvider = ((RuntimeComponentService)service) - .getBindingProvider(binding); - if (bindingProvider != null) { - bindingProvider.stop(); - } - } - } - for (ComponentReference reference : component.getReferences()) { - for (Binding binding : reference.getBindings()) { - ReferenceBindingProvider bindingProvider = ((RuntimeComponentReference)reference) - .getBindingProvider(binding); - if (bindingProvider != null) { - bindingProvider.stop(); - } - } - } - Implementation implementation = component.getImplementation(); - if (implementation instanceof Composite) { - stop((Composite)implementation); - } else { - ImplementationProvider implementationProvider = ((RuntimeComponent)component) - .getImplementationProvider(); - if (implementationProvider != null) { - implementationProvider.stop(); - } - } - - if (component instanceof ScopedRuntimeComponent) { - ScopedRuntimeComponent runtimeComponent = (ScopedRuntimeComponent)component; - if (runtimeComponent.getScopeContainer() != null) { - runtimeComponent.getScopeContainer().stop(); - } - } - - } - - } - - /** - * Create runtime wires for the composite - * - * @param composite - * @throws IncompatibleInterfaceContractException - */ - protected void createRuntimeWires(Composite composite) throws IncompatibleInterfaceContractException { - for (Component component : composite.getComponents()) { - Implementation implementation = component.getImplementation(); - if (implementation instanceof Composite) { - // Recursively create runtime wires - createRuntimeWires((Composite)implementation); - } else { - // Create outbound wires for the component references - for (ComponentReference reference : component.getReferences()) { - for (Binding binding : reference.getBindings()) { - createWires(component, reference, binding); - } - } - // Create inbound wires for the component services - for (ComponentService service : component.getServices()) { - for (Binding binding : service.getBindings()) { - createWires(component, service, binding); - } - } - } - } - } - - /** - * Get the effective interface contract for a reference binding - * - * @param reference - * @param binding - * @return - */ - private InterfaceContract getInterfaceContract(ComponentReference reference, Binding binding) { - InterfaceContract interfaceContract = reference.getInterfaceContract(); - ReferenceBindingProvider provider = ((RuntimeComponentReference)reference).getBindingProvider(binding); - if (provider != null) { - InterfaceContract bindingContract = provider.getBindingInterfaceContract(); - if (bindingContract != null) { - interfaceContract = bindingContract; - } - } - return interfaceContract; - } - - /** - * Create the runtime wires for a reference binding - * - * @param component - * @param reference - * @param binding - */ - private void createWires(Component component, ComponentReference reference, Binding binding) { - if (!(reference instanceof RuntimeComponentReference)) { - return; - } - RuntimeComponentReference runtimeRef = (RuntimeComponentReference)reference; - InterfaceContract bindingContract = getInterfaceContract(reference, binding); - - if (!(binding instanceof SCABinding)) { - InterfaceContract sourceContract = reference.getInterfaceContract(); - - // Component Reference --> External Service - EndpointReference wireSource = new EndpointReferenceImpl((RuntimeComponent)component, - (RuntimeComponentReference)reference, binding, - sourceContract); - - EndpointReference wireTarget = new EndpointReferenceImpl(null, null, binding, bindingContract); - RuntimeWire wire = new RuntimeWireImpl(wireSource, wireTarget); - - for (Operation operation : sourceContract.getInterface().getOperations()) { - Operation targetOperation = interfaceContractMapper.map(bindingContract.getInterface(), operation); - InvocationChain chain = new InvocationChainImpl(operation, targetOperation); - if (operation.isNonBlocking()) { - chain.addInterceptor(new NonBlockingInterceptor(workScheduler)); - } - addBindingInterceptor(component, reference, binding, chain, operation, false); - wire.getInvocationChains().add(chain); - } - if (sourceContract.getCallbackInterface() != null) { - for (Operation operation : sourceContract.getCallbackInterface().getOperations()) { - Operation targetOperation = interfaceContractMapper.map(bindingContract.getCallbackInterface(), - operation); - InvocationChain chain = new InvocationChainImpl(operation, targetOperation); - if (operation.isNonBlocking()) { - chain.addInterceptor(new NonBlockingInterceptor(workScheduler)); - } - addBindingInterceptor(component, reference, binding, chain, operation, true); - wire.getCallbackInvocationChains().add(chain); - } - } - runtimeRef.getRuntimeWires().add(wire); - wireProcessor.process(wire); - } - for (ComponentService service : reference.getTargets()) { - Component target = null; - SCABinding scaBinding = service.getBinding(SCABinding.class); - if (scaBinding != null) { - target = scaBinding.getComponent(); - } - - // FIXME: [rfeng] Ignore unresolved services - if (service.isUnresolved()) { - continue; - } - - // FIXME: [rfeng] We might need a better way to get the impl interface contract - InterfaceContract targetContract = service.getService().getInterfaceContract(); - - EndpointReference wireSource = new EndpointReferenceImpl((RuntimeComponent)component, - (RuntimeComponentReference)reference, binding, - bindingContract); - - EndpointReference wireTarget = new EndpointReferenceImpl((RuntimeComponent)target, - (RuntimeComponentService)service, binding, - targetContract); - - RuntimeWire wire = new RuntimeWireImpl(wireSource, wireTarget); - - for (Operation operation : bindingContract.getInterface().getOperations()) { - Operation targetOperation = interfaceContractMapper.map(targetContract.getInterface(), operation); - InvocationChain chain = new InvocationChainImpl(operation, targetOperation); - if (operation.isNonBlocking()) { - chain.addInterceptor(new NonBlockingInterceptor(workScheduler)); - } - addBindingInterceptor(component, reference, binding, chain, operation, false); - if (target != null) { - addImplementationInterceptor(target, service, chain, targetOperation, false); - } - wire.getInvocationChains().add(chain); - } - if (bindingContract.getCallbackInterface() != null) { - if (reference.getName().startsWith("$self$.")) { - // No callback is needed - continue; - } - for (Operation operation : bindingContract.getCallbackInterface().getOperations()) { - Operation targetOperation = interfaceContractMapper.map(targetContract.getCallbackInterface(), - operation); - InvocationChain chain = new InvocationChainImpl(operation, targetOperation); - if (operation.isNonBlocking()) { - chain.addInterceptor(new NonBlockingInterceptor(workScheduler)); - } - addBindingInterceptor(component, reference, binding, chain, operation, true); - addImplementationInterceptor(component, null, chain, targetOperation, true); - wire.getCallbackInvocationChains().add(chain); - } - } - - runtimeRef.getRuntimeWires().add(wire); - if (!wire.getCallbackInvocationChains().isEmpty()) { - if (wire.getTarget().getContract() != null) { - ((RuntimeComponentService) wire.getTarget().getContract()).getCallbackWires().add(wire); - } - } - wireProcessor.process(wire); - } - } - - /** - * Get the effective interface contract for the service binding - * - * @param service - * @param binding - * @return - */ - private InterfaceContract getInterfaceContract(ComponentService service, Binding binding) { - InterfaceContract interfaceContract = service.getInterfaceContract(); - - ServiceBindingProvider provider = ((RuntimeComponentService)service).getBindingProvider(binding); - if (provider != null) { - InterfaceContract bindingContract = provider.getBindingInterfaceContract(); - if (bindingContract != null) { - interfaceContract = bindingContract; - } - } - return interfaceContract; - } - - /** - * Create runtime wires for a service binding - * - * @param component - * @param service - * @param binding - */ - private void createWires(Component component, ComponentService service, Binding binding) { - if (!(service instanceof RuntimeComponentService)) { - return; - } - RuntimeComponentService runtimeService = (RuntimeComponentService)service; - - // FIXME: [rfeng] We might need a better way to get the impl interface contract - InterfaceContract targetContract = service.getService().getInterfaceContract(); - - InterfaceContract sourceContract = getInterfaceContract(service, binding); - - EndpointReference wireSource = new EndpointReferenceImpl(null, null, binding, sourceContract); - - EndpointReference wireTarget = new EndpointReferenceImpl((RuntimeComponent)component, - (RuntimeComponentService)service, binding, - targetContract); - - RuntimeWire wire = new RuntimeWireImpl(wireSource, wireTarget); - - for (Operation operation : sourceContract.getInterface().getOperations()) { - Operation targetOperation = interfaceContractMapper.map(targetContract.getInterface(), operation); - InvocationChain chain = new InvocationChainImpl(operation, targetOperation); - /* lresende */ - if (operation.isNonBlocking()) { - chain.addInterceptor(new NonBlockingInterceptor(workScheduler)); - } - - addImplementationInterceptor(component, service, chain, targetOperation, false); - wire.getInvocationChains().add(chain); - } - // if (sourceContract.getCallbackInterface() != null) { - // for (Operation operation : - // sourceContract.getCallbackInterface().getOperations()) { - // Operation targetOperation = - // interfaceContractMapper.map(targetContract.getCallbackInterface(), - // operation); - // InvocationChain chain = new InvocationChainImpl(operation, - // targetOperation); - // if (operation.isNonBlocking()) { - // chain.addInterceptor(new NonBlockingInterceptor(workScheduler, - // workContext)); - // } - // addImplementationInterceptor(component, service, chain, operation, - // true); - // wire.getCallbackInvocationChains().add(chain); - // } - // } - - runtimeService.getRuntimeWires().add(wire); - wireProcessor.process(wire); - } - - /** - * Add the interceptor for a component implementation - * - * @param component - * @param service - * @param chain - * @param operation - * @param isCallback - */ - private void addImplementationInterceptor(Component component, - ComponentService service, - InvocationChain chain, - Operation operation, - boolean isCallback) { - ImplementationProvider provider = ((RuntimeComponent)component).getImplementationProvider(); - if (provider != null) { - Invoker invoker = null; - if (!isCallback) { - invoker = provider.createInvoker((RuntimeComponentService)service, operation); - } else { - invoker = provider.createCallbackInvoker(operation); - } - chain.addInvoker(invoker); - } - } - - /** - * Add the interceptor for a binding - * - * @param component - * @param reference - * @param binding - * @param chain - * @param operation - * @param isCallback - */ - private void addBindingInterceptor(Component component, - ComponentReference reference, - Binding binding, - InvocationChain chain, - Operation operation, - boolean isCallback) { - ReferenceBindingProvider provider = ((RuntimeComponentReference)reference).getBindingProvider(binding); - if (provider != null) { - Invoker invoker = provider.createInvoker(operation, isCallback); - if (invoker != null) { - chain.addInvoker(invoker); - } - } - } - - private void setScopeContainer(Component component) { - if (!(component instanceof ScopedRuntimeComponent)) { - return; - } - ScopedRuntimeComponent runtimeComponent = (ScopedRuntimeComponent)component; - runtimeComponent.setScopeContainer(scopeRegistry.getScopeContainer(runtimeComponent)); - } - - protected void buildComposite(Composite composite) throws CompositeBuilderException { - - CompositeBuilderMonitor monitor = new CompositeBuilderMonitor() { - - public void problem(Problem problem) { - // Uncommenting the following two lines can be useful to detect - // and troubleshoot SCA assembly XML composite configuration - // problems. - - System.out.println("Composite assembly problem: " + problem.getMessage()); - } - }; - - CompositeBuilderImpl builder = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, interfaceContractMapper, monitor); - - builder.build(composite); - - // if (!problems.isEmpty()) { - // throw new VariantRuntimeException(new RuntimeException("Problems in - // the composite...")); - // } - } - - public void activate(Composite composite) throws ActivationException { - try { - buildComposite(composite); - configureComposite(composite); - createRuntimeWires(composite); - } catch (Exception e) { - throw new ActivationException(e); - } - } - - public void deactivate(Composite composite) throws ActivationException { - } - - public void start(Composite composite) throws ActivationException { - try { - startComposite(composite); - } catch (Exception e) { - throw new ActivationException(e); - } - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/EndpointReferenceImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/EndpointReferenceImpl.java deleted file mode 100644 index 233f81ccae..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/EndpointReferenceImpl.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.runtime; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Contract; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.runtime.EndpointReference; -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -/** - * @version $Rev$ $Date$ - */ -public class EndpointReferenceImpl implements EndpointReference { - private RuntimeComponent component; - private Contract contract; - private Binding binding; - private InterfaceContract interfaceContract; - private String uri; - - /** - * @param component - * @param contract - * @param binding - * @param interfaceContract - */ - public EndpointReferenceImpl(RuntimeComponent component, - Contract contract, - Binding binding, - InterfaceContract interfaceContract) { - super(); - this.component = component; - this.contract = contract; - this.binding = binding; - this.interfaceContract = interfaceContract; - this.uri = binding.getURI(); - } - - /** - * @param uri - */ - public EndpointReferenceImpl(String uri) { - super(); - this.uri = uri; - } - - public Binding getBinding() { - return binding; - } - - public void setBinding(Binding binding) { - this.binding = binding; - } - - public RuntimeComponent getComponent() { - return component; - } - - public void setComponent(RuntimeComponent component) { - this.component = component; - } - - public Contract getContract() { - return contract; - } - - public void setContract(Contract contract) { - this.contract = contract; - } - - public InterfaceContract getInterfaceContract() { - return interfaceContract; - } - - public void setInterfaceContract(InterfaceContract interfaceContract) { - this.interfaceContract = interfaceContract; - } - - public String getURI() { - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - } - - @Override - public int hashCode() { - final int PRIME = 31; - int result = 1; - result = PRIME * result + ((uri == null) ? 0 : uri.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - final EndpointReferenceImpl other = (EndpointReferenceImpl)obj; - if (uri == null) { - if (other.uri != null) - return false; - } else if (!uri.equals(other.uri)) - return false; - return true; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeAssemblyFactory.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeAssemblyFactory.java deleted file mode 100644 index ec0cdadde6..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeAssemblyFactory.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.runtime; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.core.invocation.ProxyFactory; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; - -/** - * @version $Rev$ $Date$ - */ -public class RuntimeAssemblyFactory extends DefaultAssemblyFactory implements AssemblyFactory { - private final ProxyFactory proxyFactory; - private final InterfaceContractMapper interfaceContractMapper; - - /** - * @param proxyFactory - */ - public RuntimeAssemblyFactory(InterfaceContractMapper interfaceContractMapper, ProxyFactory proxyFactory) { - super(); - this.proxyFactory = proxyFactory; - this.interfaceContractMapper = interfaceContractMapper; - } - - @Override - public Component createComponent() { - return new RuntimeComponentImpl(proxyFactory); - } - - @Override - public ComponentReference createComponentReference() { - return new RuntimeComponentReferenceImpl(interfaceContractMapper); - } - - @Override - public ComponentService createComponentService() { - return new RuntimeComponentServiceImpl(interfaceContractMapper); - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentImpl.java deleted file mode 100644 index aacce904b5..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentImpl.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.runtime; - -import java.util.List; - -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.Property; -import org.apache.tuscany.sca.assembly.impl.ComponentImpl; -import org.apache.tuscany.sca.core.component.ServiceReferenceImpl; -import org.apache.tuscany.sca.core.invocation.ProxyFactory; -import org.apache.tuscany.sca.core.invocation.WireObjectFactory; -import org.apache.tuscany.sca.provider.ImplementationProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeWire; -import org.apache.tuscany.sca.scope.ScopeContainer; -import org.apache.tuscany.sca.scope.ScopedRuntimeComponent; -import org.osoa.sca.CallableReference; -import org.osoa.sca.RequestContext; -import org.osoa.sca.ServiceReference; - -/** - * @version $Rev$ $Date$ - */ -public class RuntimeComponentImpl extends ComponentImpl implements RuntimeComponent, ScopedRuntimeComponent { - public static final String SELF_REFERENCE_PREFIX = "$self$."; - protected ImplementationProvider implementationProvider; - protected ProxyFactory proxyService; - protected ScopeContainer scopeContainer; - - /** - * @param proxyService - */ - public RuntimeComponentImpl(ProxyFactory proxyService) { - super(); - this.proxyService = proxyService; - } - - public ServiceReference createSelfReference(Class businessInterface) { - return getServiceReference(businessInterface, SELF_REFERENCE_PREFIX); - } - - public ServiceReference createSelfReference(Class businessInterface, String serviceName) { - return getServiceReference(businessInterface, SELF_REFERENCE_PREFIX + serviceName); - } - - public B getProperty(Class type, String propertyName) { - for (Property p : getProperties()) { - if (p.getName().equals(propertyName)) { - // FIXME: Need to use the property object factory to create the - // instance - return null; - } - } - return null; - } - - public RequestContext getRequestContext() { - return null; - } - - public B getService(Class businessInterface, String referenceName) { - List refs = getReferences(); - for (ComponentReference ref : refs) { - if (ref.getName().equals(referenceName)) { - RuntimeComponentReference attachPoint = (RuntimeComponentReference)ref; - RuntimeWire wire = attachPoint.getRuntimeWires().get(0); - return proxyService.createProxy(businessInterface, wire); - } - } - return null; - } - - public ServiceReference getServiceReference(Class businessInterface, String referenceName) { - List references = getReferences(); - for (ComponentReference reference : references) { - if (reference.getName().equals(referenceName) || referenceName.equals("$self$.") - && reference.getName().startsWith(referenceName)) { - RuntimeComponentReference attachPoint = (RuntimeComponentReference)reference; - RuntimeWire wire = attachPoint.getRuntimeWires().get(0); - WireObjectFactory factory = new WireObjectFactory(businessInterface, wire, proxyService); - return new ServiceReferenceImpl(businessInterface, factory); - } - } - return null; - - } - - @SuppressWarnings("unchecked") - public > R cast(B target) throws IllegalArgumentException { - Object ref = proxyService.cast(target); - return (R)ref; - } - - public ImplementationProvider getImplementationProvider() { - return implementationProvider; - } - - public void setImplementationProvider(ImplementationProvider provider) { - this.implementationProvider = provider; - } - - public ScopeContainer getScopeContainer() { - return scopeContainer; - } - - public void setScopeContainer(ScopeContainer scopeContainer) { - this.scopeContainer = scopeContainer; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentReferenceImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentReferenceImpl.java deleted file mode 100644 index 128ae29b81..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentReferenceImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.runtime; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.impl.ComponentReferenceImpl; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeWire; - -public class RuntimeComponentReferenceImpl extends ComponentReferenceImpl implements RuntimeComponentReference { - private List wires = new ArrayList(); - private Map bindingProviders = new HashMap(); - private InterfaceContractMapper mapper; - - public RuntimeComponentReferenceImpl(InterfaceContractMapper mapper) { - super(); - this.mapper = mapper; - } - - public void addRuntimeWire(RuntimeWire wire) { - wires.add(wire); - } - - public List getRuntimeWires() { - return wires; - } - - public RuntimeWire getRuntimeWire(Binding binding) { - for (RuntimeWire wire : wires) { - if (wire.getSource().getBinding() == binding) { - return wire; - } - } - return null; - } - - public ReferenceBindingProvider getBindingProvider(Binding binding) { - return bindingProviders.get(binding); - } - - public void setBindingProvider(Binding binding, ReferenceBindingProvider bindingProvider) { - bindingProviders.put(binding, bindingProvider); - } - - public Invoker getInvoker(Binding binding, Operation operation) { - RuntimeWire wire = getRuntimeWire(binding); - if (wire == null) { - return null; - } - for (InvocationChain chain : wire.getInvocationChains()) { - Operation op = chain.getSourceOperation(); - if (mapper.isCompatible(operation, op, op.getInterface().isRemotable())) { - return chain.getHeadInvoker(); - } - } - return null; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentServiceImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentServiceImpl.java deleted file mode 100644 index 0bb8e2c457..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeComponentServiceImpl.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.runtime; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.impl.ComponentServiceImpl; -import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; -import org.apache.tuscany.sca.runtime.RuntimeWire; - -public class RuntimeComponentServiceImpl extends ComponentServiceImpl implements RuntimeComponentService { - private InterfaceContractMapper mapper; - - public RuntimeComponentServiceImpl(InterfaceContractMapper mapper) { - super(); - this.mapper = mapper; - } - - private List wires = new ArrayList(); - private List callbackWires = new ArrayList(); - private Map bindingProviders = new HashMap(); - - public void addRuntimeWire(RuntimeWire wire) { - wires.add(wire); - } - - public List getRuntimeWires() { - return wires; - } - - public RuntimeWire getRuntimeWire(Binding binding) { - for (RuntimeWire wire : wires) { - if (wire.getTarget().getBinding() == binding) { - return wire; - } - } - return null; - } - - public List getCallbackWires() { - return callbackWires; - } - - public void addCallbackWire(RuntimeWire callbackWire) { - this.callbackWires.add(callbackWire); - } - - public ServiceBindingProvider getBindingProvider(Binding binding) { - return bindingProviders.get(binding); - } - - public void setBindingProvider(Binding binding, ServiceBindingProvider bindingProvider) { - bindingProviders.put(binding, bindingProvider); - } - - public Invoker getInvoker(Binding binding, Operation operation) { - RuntimeWire wire = getRuntimeWire(binding); - if (wire == null) { - return null; - } - for (InvocationChain chain : wire.getInvocationChains()) { - Operation op = chain.getTargetOperation(); - if (mapper.isCompatible(operation, op, op.getInterface().isRemotable())) { - return chain.getHeadInvoker(); - } - } - return null; - } - - public Invoker getCallbackInvoker(Binding binding, Operation operation) { - for (RuntimeWire wire : callbackWires) { - if (wire.getTarget().getBinding() == binding) { - for (InvocationChain chain : wire.getCallbackInvocationChains()) { - Operation op = chain.getSourceOperation(); - if (mapper.isCompatible(operation, op, op.getInterface().isRemotable())) { - return chain.getHeadInvoker(); - } - } - } - } - return null; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeSCABindingProvider.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeSCABindingProvider.java deleted file mode 100644 index ad055731f3..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeSCABindingProvider.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.runtime; - -import org.apache.tuscany.sca.assembly.SCABinding; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; - -/** - * @version $Rev$ $Date$ - */ -public class RuntimeSCABindingProvider implements ReferenceBindingProvider { - - private RuntimeComponentReference reference; - - public RuntimeSCABindingProvider(RuntimeComponent component, RuntimeComponentReference reference, SCABinding binding) { - this.reference = reference; - } - - public InterfaceContract getBindingInterfaceContract() { - return reference.getInterfaceContract(); - } - - public Invoker createInvoker(Operation operation, boolean isCallback) { - return null; - } - - public void start() { - } - - public void stop() { - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeSCABindingProviderFactory.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeSCABindingProviderFactory.java deleted file mode 100644 index 06b7b3d40e..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeSCABindingProviderFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.runtime; - -import org.apache.tuscany.sca.assembly.SCABinding; -import org.apache.tuscany.sca.provider.BindingProviderFactory; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentReference; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -/** - * @version $Rev$ $Date$ - */ -public class RuntimeSCABindingProviderFactory implements BindingProviderFactory { - - public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, - RuntimeComponentReference reference, - SCABinding binding) { - return new RuntimeSCABindingProvider(component, reference, binding); - } - - public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, - RuntimeComponentService service, - SCABinding binding) { - return null; - } - - public Class getModelType() { - return SCABinding.class; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeWireImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeWireImpl.java deleted file mode 100644 index cdf7ec01c0..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/RuntimeWireImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.runtime; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.runtime.EndpointReference; -import org.apache.tuscany.sca.runtime.RuntimeWire; - -/** - * @version $Rev$ $Date$ - */ -public class RuntimeWireImpl implements RuntimeWire { - private EndpointReference wireSource; - private EndpointReference wireTarget; - - private final List chains = new ArrayList(); - private final List callbackChains = new ArrayList(); - - /** - * @param source - * @param target - */ - public RuntimeWireImpl(EndpointReference source, - EndpointReference target) { - super(); - this.wireSource = source; - this.wireTarget = target; - } - - public List getCallbackInvocationChains() { - return callbackChains; - } - - public List getInvocationChains() { - return chains; - } - - public EndpointReference getSource() { - return wireSource; - } - - public EndpointReference getTarget() { - return wireTarget; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainer.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainer.java deleted file mode 100644 index 1d776b729c..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainer.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.scope; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.tuscany.sca.event.Event; -import org.apache.tuscany.sca.provider.ImplementationProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.scope.AbstractLifecycle; -import org.apache.tuscany.sca.scope.InstanceWrapper; -import org.apache.tuscany.sca.scope.PersistenceException; -import org.apache.tuscany.sca.scope.Scope; -import org.apache.tuscany.sca.scope.ScopeContainer; -import org.apache.tuscany.sca.scope.ScopedImplementationProvider; -import org.apache.tuscany.sca.scope.TargetDestructionException; -import org.apache.tuscany.sca.scope.TargetResolutionException; - -/** - * Implements functionality common to scope contexts. - * - * @version $Rev$ $Date$ - */ -public abstract class AbstractScopeContainer extends AbstractLifecycle implements ScopeContainer { - protected Map> wrappers = new ConcurrentHashMap>(); - protected final Scope scope; - - protected RuntimeComponent component; - - public AbstractScopeContainer(Scope scope, RuntimeComponent component) { - this.scope = scope; - this.component = component; - } - - protected void checkInit() { - if (getLifecycleState() != RUNNING) { - throw new IllegalStateException("Scope container not running [" + getLifecycleState() + "]"); - } - } - - /** - * Creates a new physical instance of a component, wrapped in an - * InstanceWrapper. - * - * @param component the component whose instance should be created - * @return a wrapped instance that has been injected but not yet started - * @throws TargetResolutionException if there was a problem creating the - * instance - */ - protected InstanceWrapper createInstanceWrapper() throws TargetResolutionException { - ImplementationProvider implementationProvider = component.getImplementationProvider(); - if (implementationProvider instanceof ScopedImplementationProvider) { - return ((ScopedImplementationProvider)implementationProvider).createInstanceWrapper(); - } - return null; - } - - public InstanceWrapper getAssociatedWrapper(KEY contextId) throws TargetResolutionException { - return null; - } - - public Scope getScope() { - return scope; - } - - public InstanceWrapper getWrapper(KEY contextId) throws TargetResolutionException { - return wrappers.get(contextId); - } - - public void onEvent(Event event) { - } - - protected boolean isEagerInit() { - ImplementationProvider implementationProvider = ((RuntimeComponent)component).getImplementationProvider(); - if (implementationProvider instanceof ScopedImplementationProvider) { - return ((ScopedImplementationProvider)implementationProvider).isEagerInit(); - } - return false; - } - - public void remove() throws PersistenceException { - throw new UnsupportedOperationException("Scope does not support persistence"); - } - - public void returnWrapper(InstanceWrapper wrapper, KEY contextId) throws TargetDestructionException { - } - - public synchronized void start() { - int lifecycleState = getLifecycleState(); - if (lifecycleState != UNINITIALIZED && lifecycleState != STOPPED) { - throw new IllegalStateException("Scope must be in UNINITIALIZED or STOPPED state [" + lifecycleState + "]"); - } - setLifecycleState(RUNNING); - } - - public void startContext(KEY contextId) { - if(isEagerInit()) { - try { - getWrapper(contextId); - } catch (TargetResolutionException e) { - // - } - } - } - - public synchronized void stop() { - int lifecycleState = getLifecycleState(); - if (lifecycleState != RUNNING) { - throw new IllegalStateException("Scope in wrong state [" + lifecycleState + "]"); - } - setLifecycleState(STOPPED); - } - - public void stopContext(KEY contextId) { - wrappers.remove(contextId); - } - - public String toString() { - return "In state [" + super.toString() + ']'; - } - - public RuntimeComponent getComponent() { - return component; - } - - public void setComponent(RuntimeComponent component) { - this.component = component; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/CompositeScopeContainer.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/CompositeScopeContainer.java deleted file mode 100644 index 520d3ab48c..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/CompositeScopeContainer.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.scope; - -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.scope.InstanceWrapper; -import org.apache.tuscany.sca.scope.Scope; -import org.apache.tuscany.sca.scope.TargetNotFoundException; -import org.apache.tuscany.sca.scope.TargetResolutionException; - -/** - * A scope context which manages atomic component instances keyed by composite - * - * @version $Rev$ $Date$ - */ -public class CompositeScopeContainer extends AbstractScopeContainer { - private InstanceWrapper wrapper; - - public CompositeScopeContainer(RuntimeComponent component) { - super(Scope.COMPOSITE, component); - } - - public synchronized void stop() { - super.stop(); - wrapper = null; - } - - public InstanceWrapper getWrapper(KEY contextId) throws TargetResolutionException { - if (wrapper == null) { - wrapper = createInstanceWrapper(); - wrapper.start(); - } - return wrapper; - } - - public InstanceWrapper getAssociatedWrapper(KEY contextId) throws TargetResolutionException { - if (wrapper == null) { - throw new TargetNotFoundException(component.getURI()); - } - return wrapper; - } - - @Override - public synchronized void start() { - super.start(); - if(isEagerInit()) { - try { - getWrapper(null); - } catch (TargetResolutionException e) { - throw new IllegalStateException(e); - } - } - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/CompositeScopeContainerFactory.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/CompositeScopeContainerFactory.java deleted file mode 100644 index 7078903b8b..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/CompositeScopeContainerFactory.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.scope; - -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.scope.Scope; -import org.apache.tuscany.sca.scope.ScopeContainer; -import org.apache.tuscany.sca.scope.ScopeContainerFactory; - -/** - * @version $Rev$ $Date$ - */ -public class CompositeScopeContainerFactory implements ScopeContainerFactory { - - public ScopeContainer createScopeContainer(RuntimeComponent component) { - return new CompositeScopeContainer(component); - } - - public Scope getScope() { - return Scope.COMPOSITE; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainer.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainer.java deleted file mode 100644 index 61f7d51c29..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainer.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.scope; - -import org.apache.tuscany.sca.core.invocation.ThreadMessageContext; -import org.apache.tuscany.sca.event.Event; -import org.apache.tuscany.sca.event.RuntimeEventListener; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.scope.InstanceWrapper; -import org.apache.tuscany.sca.scope.PersistenceException; -import org.apache.tuscany.sca.scope.Scope; -import org.apache.tuscany.sca.scope.ScopeContainer; -import org.apache.tuscany.sca.scope.TargetDestructionException; -import org.apache.tuscany.sca.scope.TargetResolutionException; -import org.apache.tuscany.sca.store.Store; -import org.apache.tuscany.sca.store.StoreExpirationEvent; - -/** - * A scope context which manages atomic component instances keyed on a - * conversation session - * - * @version $Rev: 452655 $ $Date: 2006-10-03 18:09:02 -0400 (Tue, 03 Oct 2006) $ - */ -public class ConversationalScopeContainer extends AbstractScopeContainer implements ScopeContainer { - private final Store nonDurableStore; - - public ConversationalScopeContainer(Store store, RuntimeComponent component) { - super(Scope.CONVERSATION, component); - this.nonDurableStore = store; - if (store != null) { - store.addListener(new ExpirationListener()); - } - } - - public void onEvent(Event event) { - checkInit(); - } - - public synchronized void start() { - if (lifecycleState != UNINITIALIZED && lifecycleState != STOPPED) { - throw new IllegalStateException("Scope must be in UNINITIALIZED or STOPPED state [" + lifecycleState + "]"); - } - lifecycleState = RUNNING; - } - - public synchronized void stop() { - lifecycleState = STOPPED; - } - - public void persistNew(RuntimeComponent component, String id, Object instance, long expiration) - throws PersistenceException { - // try { - // nonDurableStore.insertRecord(component, id, instance, expiration); - // } catch (StoreWriteException e) { - // throw new PersistenceException(e); - // } - } - - public void persist(RuntimeComponent component, String id, Object instance, long expiration) - throws PersistenceException { - // try { - // nonDurableStore.updateRecord(component, id, instance, expiration); - // } catch (StoreWriteException e) { - // throw new PersistenceException(e); - // } - } - - public void remove(RuntimeComponent component) throws PersistenceException { - // String conversationId = getConversationId(); - // try { - // workContext.setCurrentAtomicComponent(component); - // // FIXME this should be an InstanceWrapper and shouldn't we stop it? - // Object instance = nonDurableStore.readRecord(component, - // conversationId); - // if (instance != null) { - // nonDurableStore.removeRecord(component, conversationId); - // } - // } catch (StoreReadException e) { - // throw new PersistenceException(e); - // } catch (StoreWriteException e) { - // throw new PersistenceException(e); - // } - } - - protected InstanceWrapper getInstanceWrapper(RuntimeComponent component, boolean create) - throws TargetResolutionException { - throw new UnsupportedOperationException("To be implemented"); - // String conversationId = getConversationId(); - // try { - // workContext.setCurrentAtomicComponent(component); - // InstanceWrapper wrapper = (InstanceWrapper) - // nonDurableStore.readRecord(component, conversationId); - // if (wrapper != null) { - // if (component.getMaxIdleTime() > 0) { - // // update expiration - // long expire = System.currentTimeMillis() + - // component.getMaxIdleTime(); - // nonDurableStore.updateRecord(component, conversationId, wrapper, - // expire); - // } - // } else if (create) { - // // FIXME should the store really be persisting the wrappers - // wrapper = component.createInstanceWrapper(); - // wrapper.start(); - // long expire = calculateExpiration(component); - // nonDurableStore.insertRecord(component, conversationId, wrapper, - // expire); - // } - // return wrapper; - // } catch (StoreReadException e) { - // throw new TargetResolutionException("Error retrieving target - // instance", e); - // } catch (StoreWriteException e) { - // throw new TargetResolutionException("Error persisting target - // instance", e); - // } finally { - // workContext.setCurrentAtomicComponent(null); - // } - } - - /** - * Returns the conversation id associated with the current invocation - * context - * - * @return the conversation id - */ - private String getConversationId() { - String conversationId = ThreadMessageContext.getMessageContext().getConversationID(); - assert conversationId != null; - return conversationId; - } - - // private long calculateExpiration(RuntimeComponent component) { - // if (component.getMaxAge() > 0) { - // long now = System.currentTimeMillis(); - // return now + component.getMaxAge(); - // } else if (component.getMaxIdleTime() > 0) { - // long now = System.currentTimeMillis(); - // return now + component.getMaxIdleTime(); - // } else { - // return Store.DEFAULT_EXPIRATION_OFFSET; - // } - // } - - /** - * Receives expiration events from the store and notifies the corresponding - * atomic component - */ - private static class ExpirationListener implements RuntimeEventListener { - - public ExpirationListener() { - } - - public void onEvent(Event event) { - if (event instanceof StoreExpirationEvent) { - StoreExpirationEvent expiration = (StoreExpirationEvent)event; - InstanceWrapper wrapper = (InstanceWrapper)expiration.getInstance(); - try { - wrapper.stop(); - } catch (TargetDestructionException e) { - // monitor.destructionError(e); - } - } - } - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainerFactory.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainerFactory.java deleted file mode 100644 index 4fdda90bc2..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ConversationalScopeContainerFactory.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.scope; - -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.scope.Scope; -import org.apache.tuscany.sca.scope.ScopeContainer; -import org.apache.tuscany.sca.scope.ScopeContainerFactory; -import org.apache.tuscany.sca.store.Store; - -/** - * @version $Rev$ $Date$ - */ -public class ConversationalScopeContainerFactory implements ScopeContainerFactory { - private Store store; - - public ConversationalScopeContainerFactory(Store store) { - super(); - this.store = store; - } - - public ScopeContainer createScopeContainer(RuntimeComponent component) { - return new ConversationalScopeContainer(store, component); - } - - public Scope getScope() { - return Scope.CONVERSATION; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/HttpSessionScopeContainer.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/HttpSessionScopeContainer.java deleted file mode 100644 index bcbf3cdf3c..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/HttpSessionScopeContainer.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.scope; - -import org.apache.tuscany.sca.core.event.HttpSessionEnd; -import org.apache.tuscany.sca.event.Event; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.scope.InstanceWrapper; -import org.apache.tuscany.sca.scope.Scope; -import org.apache.tuscany.sca.scope.TargetResolutionException; - -/** - * A scope context which manages atomic component instances keyed on HTTP - * session - * - * @version $Rev$ $Date$ - */ -public class HttpSessionScopeContainer extends AbstractScopeContainer { - - public HttpSessionScopeContainer(RuntimeComponent component) { - super(Scope.SESSION, component); - } - - public void onEvent(Event event) { - checkInit(); - if (event instanceof HttpSessionEnd) { - Object key = ((HttpSessionEnd)event).getSessionID(); - // FIXME: Remove the session id - } - } - - public synchronized void start() { - if (lifecycleState != UNINITIALIZED && lifecycleState != STOPPED) { - throw new IllegalStateException("Scope must be in UNINITIALIZED or STOPPED state [" + lifecycleState + "]"); - } - lifecycleState = RUNNING; - } - - public synchronized void stop() { - lifecycleState = STOPPED; - } - - protected InstanceWrapper getInstanceWrapper(boolean create) throws TargetResolutionException { -// Object key = workContext.getIdentifier(Scope.SESSION); - // FIXME: Need to fix this - Object key ="http-session-id"; - assert key != null : "HTTP session key not bound in work context"; - InstanceWrapper ctx = wrappers.get(key); - if (ctx == null && !create) { - return null; - } - if (ctx == null) { - ctx = super.createInstanceWrapper(); - ctx.start(); - wrappers.put(key, ctx); - } - return ctx; - } - - @Override - public InstanceWrapper getWrapper(Object contextId) throws TargetResolutionException { - return getInstanceWrapper(true); - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/HttpSessionScopeContainerFactory.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/HttpSessionScopeContainerFactory.java deleted file mode 100644 index e275bb56b9..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/HttpSessionScopeContainerFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.scope; - -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.scope.Scope; -import org.apache.tuscany.sca.scope.ScopeContainer; -import org.apache.tuscany.sca.scope.ScopeContainerFactory; - -/** - * @version $Rev$ $Date$ - */ -public class HttpSessionScopeContainerFactory implements ScopeContainerFactory { - - public HttpSessionScopeContainerFactory() { - super(); - } - - public ScopeContainer createScopeContainer(RuntimeComponent component) { - return new HttpSessionScopeContainer(component); - } - - public Scope getScope() { - return Scope.SESSION; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/RequestScopeContainer.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/RequestScopeContainer.java deleted file mode 100644 index aaafb4603c..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/RequestScopeContainer.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.scope; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.tuscany.sca.core.event.RequestEnd; -import org.apache.tuscany.sca.event.Event; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.scope.InstanceWrapper; -import org.apache.tuscany.sca.scope.Scope; -import org.apache.tuscany.sca.scope.TargetResolutionException; - -/** - * A scope context which manages atomic component instances keyed on the current - * request context - * - * @version $Rev$ $Date$ - */ -public class RequestScopeContainer extends AbstractScopeContainer { - private final Map contexts; - - public RequestScopeContainer(RuntimeComponent component) { - super(Scope.REQUEST, component); - contexts = new ConcurrentHashMap(); - } - - public void onEvent(Event event) { - checkInit(); - if (event instanceof RequestEnd) { - // shutdownInstances(Thread.currentThread()); - } - } - - public synchronized void start() { - if (lifecycleState != UNINITIALIZED && lifecycleState != STOPPED) { - throw new IllegalStateException("Scope must be in UNINITIALIZED or STOPPED state [" + lifecycleState + "]"); - } - lifecycleState = RUNNING; - } - - public synchronized void stop() { - contexts.clear(); - // synchronized (destroyQueues) { - // destroyQueues.clear(); - // } - lifecycleState = STOPPED; - } - - protected InstanceWrapper getInstanceWrapper(boolean create) throws TargetResolutionException { - InstanceWrapper ctx = wrappers.get(Thread.currentThread()); - if (ctx == null && !create) { - return null; - } - if (ctx == null) { - ctx = super.createInstanceWrapper(); - ctx.start(); - wrappers.put(Thread.currentThread(), ctx); - } - return ctx; - } - - @Override - public InstanceWrapper getWrapper(Thread contextId) throws TargetResolutionException { - return getInstanceWrapper(true); - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/RequestScopeContainerFactory.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/RequestScopeContainerFactory.java deleted file mode 100644 index 3851637220..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/RequestScopeContainerFactory.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.scope; - -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.scope.Scope; -import org.apache.tuscany.sca.scope.ScopeContainer; -import org.apache.tuscany.sca.scope.ScopeContainerFactory; - -/** - * @version $Rev$ $Date$ - */ -public class RequestScopeContainerFactory implements ScopeContainerFactory { - - public ScopeContainer createScopeContainer(RuntimeComponent component) { - return new RequestScopeContainer(component); - } - - public Scope getScope() { - return Scope.REQUEST; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeRegistryImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeRegistryImpl.java deleted file mode 100644 index 774c1edf37..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/ScopeRegistryImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.scope; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.tuscany.sca.provider.ImplementationProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.scope.Scope; -import org.apache.tuscany.sca.scope.ScopeContainer; -import org.apache.tuscany.sca.scope.ScopeContainerFactory; -import org.apache.tuscany.sca.scope.ScopeRegistry; -import org.apache.tuscany.sca.scope.ScopedImplementationProvider; -import org.apache.tuscany.sca.scope.ScopedRuntimeComponent; - -/** - * The default implementation of a scope registry - * - * @version $Rev$ $Date$ - */ -public class ScopeRegistryImpl implements ScopeRegistry { - private final Map scopeCache = new ConcurrentHashMap(); - - public void register(ScopeContainerFactory factory) { - scopeCache.put(factory.getScope(), factory); - } - - public ScopeContainer getScopeContainer(RuntimeComponent runtimeComponent) { - if (!(runtimeComponent instanceof ScopedRuntimeComponent)) { - return null; - } - ScopedRuntimeComponent component = (ScopedRuntimeComponent)runtimeComponent; - if (component.getScopeContainer() != null) { - return component.getScopeContainer(); - } - ImplementationProvider implementationProvider = component.getImplementationProvider(); - if (implementationProvider instanceof ScopedImplementationProvider) { - ScopedImplementationProvider provider = (ScopedImplementationProvider)implementationProvider; - Scope scope = provider.getScope(); - if (scope == null) { - scope = Scope.STATELESS; - } - ScopeContainerFactory factory = scopeCache.get(scope); - ScopeContainer container = factory.createScopeContainer(component); - component.setScopeContainer(container); - return container; - } - return null; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/StatelessScopeContainer.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/StatelessScopeContainer.java deleted file mode 100644 index dd481fa062..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/StatelessScopeContainer.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.scope; - -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.scope.InstanceWrapper; -import org.apache.tuscany.sca.scope.Scope; -import org.apache.tuscany.sca.scope.TargetDestructionException; -import org.apache.tuscany.sca.scope.TargetResolutionException; - -/** - * A scope context which manages stateless atomic component instances in a non-pooled fashion. - * - * @version $Rev$ $Date$ - */ -public class StatelessScopeContainer extends AbstractScopeContainer { - - public StatelessScopeContainer(RuntimeComponent component) { - super(Scope.STATELESS, component); - } - - public InstanceWrapper getWrapper(KEY contextId) - throws TargetResolutionException { - InstanceWrapper ctx = createInstanceWrapper(); - ctx.start(); - return ctx; - } - - public InstanceWrapper getAssociatedWrapper(KEY contextId) - throws TargetResolutionException { - throw new UnsupportedOperationException(); - } - - public void returnWrapper(InstanceWrapper wrapper, KEY contextId) - throws TargetDestructionException { - wrapper.stop(); - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/StatelessScopeContainerFactory.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/StatelessScopeContainerFactory.java deleted file mode 100644 index e0eff710e9..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/scope/StatelessScopeContainerFactory.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.scope; - -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.scope.Scope; -import org.apache.tuscany.sca.scope.ScopeContainer; -import org.apache.tuscany.sca.scope.ScopeContainerFactory; - -/** - * @version $Rev$ $Date$ - */ -public class StatelessScopeContainerFactory implements ScopeContainerFactory { - - public ScopeContainer createScopeContainer(RuntimeComponent component) { - return new StatelessScopeContainer(component); - } - - public Scope getScope() { - return Scope.STATELESS; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/store/MemoryStore.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/store/MemoryStore.java deleted file mode 100644 index 5b838116c5..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/store/MemoryStore.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.store; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; - -import org.apache.tuscany.sca.core.event.BaseEventPublisher; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.store.DuplicateRecordException; -import org.apache.tuscany.sca.store.RecoveryListener; -import org.apache.tuscany.sca.store.Store; -import org.apache.tuscany.sca.store.StoreExpirationEvent; -import org.apache.tuscany.sca.store.StoreMonitor; -import org.apache.tuscany.sca.store.StoreWriteException; -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.EagerInit; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Service; - -/** - * Implements a non-durable, non-transactional store using a simple in-memory map - * - * @version $Rev$ $Date$ - */ -@Service(Store.class) -@EagerInit -public class MemoryStore extends BaseEventPublisher implements Store { - private Map> store; - // TODO integrate with a core threading scheme - private ScheduledExecutorService scheduler; - private long reaperInterval = 300000; - private StoreMonitor monitor; - private long defaultExpirationOffset = 600000; // 10 minutes - - public MemoryStore(StoreMonitor monitor) { - this.monitor = monitor; - this.store = new ConcurrentHashMap>(); - this.scheduler = Executors.newSingleThreadScheduledExecutor(); - } - - /** - * Returns the maximum default expiration offset for records in the store - * - * @return the maximum default expiration offset for records in the store - */ - public long getDefaultExpirationOffset() { - return defaultExpirationOffset; - } - - /** - * Sets the maximum default expiration offset for records in the store - */ - @Property - public void setDefaultExpirationOffset(long defaultExpirationOffset) { - this.defaultExpirationOffset = defaultExpirationOffset; - } - - /** - * Sets the interval for expired entry scanning to be performed - */ - @Property - public void setReaperInterval(long reaperInterval) { - this.reaperInterval = reaperInterval; - } - - public long getReaperInterval() { - return reaperInterval; - } - - @Init - public void init() { - scheduler.scheduleWithFixedDelay(new Reaper(), reaperInterval, reaperInterval, TimeUnit.MILLISECONDS); - monitor.start("In-memory store started"); - } - - @Destroy - public void destroy() { - scheduler.shutdown(); - monitor.stop("In-memory store stopped"); - } - - public void insertRecord(RuntimeComponent owner, String id, Object object, long expiration) throws StoreWriteException { - Map map = store.get(owner); - if (map == null) { - map = new ConcurrentHashMap(); - store.put(owner, map); - } - if (map.containsKey(id)) { - throw new DuplicateRecordException("Duplicate record: " + owner.getURI() +" : " + id); - } - map.put(id, new Record(object, expiration)); - } - - public void updateRecord(RuntimeComponent owner, String id, Object object, long expiration) throws StoreWriteException { - Map map = store.get(owner); - if (map == null) { - throw new StoreWriteException("Record not found: " + owner.getURI() +" : " + id); - } - Record record = map.get(id); - if (record == null) { - throw new StoreWriteException("Record not found: " + owner.getURI() +" : " + id); - } - record.data = object; - } - - public Object readRecord(RuntimeComponent owner, String id) { - Map map = store.get(owner); - if (map == null) { - return null; - } - Record record = map.get(id); - if (record != null) { - return record.data; - } - return null; - } - - public void removeRecords() { - store.clear(); - } - - public void removeRecord(RuntimeComponent owner, String id) throws StoreWriteException { - Map map = store.get(owner); - if (map == null) { - throw new StoreWriteException("Owner not found: " + owner.getURI() +" : " + id); - } - if (map.remove(id) == null) { - throw new StoreWriteException("Owner not found: " + owner.getURI() +" : " + id); - } - } - - public void recover(RecoveryListener listener) { - throw new UnsupportedOperationException(); - } - - private class Record { - private Object data; - private long expiration = NEVER; - - public Record(Object data, long expiration) { - this.data = data; - this.expiration = expiration; - } - - public Object getData() { - return data; - } - - public long getExpiration() { - return expiration; - } - } - - private class Reaper implements Runnable { - - public void run() { - long now = System.currentTimeMillis(); - for (Map.Entry> entries : store.entrySet()) { - for (Map.Entry entry : entries.getValue().entrySet()) { - final long expiration = entry.getValue().expiration; - if (expiration != NEVER && now >= expiration) { - RuntimeComponent owner = entries.getKey(); - Object instance = entry.getValue().getData(); - // notify listeners of the expiration - StoreExpirationEvent event = new StoreExpirationEvent(this, owner, instance); - publish(event); - entries.getValue().remove(entry.getKey()); - } - } - } - } - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/util/IOHelper.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/util/IOHelper.java deleted file mode 100644 index 2058397fb0..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/util/IOHelper.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.util; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.JarURLConnection; -import java.net.URL; -import java.util.jar.JarFile; - -public class IOHelper { - /** - * The default buffer size to use. - */ - private static final int DEFAULT_BUFFER_SIZE = 1024 * 4; - - protected IOHelper() { - - } - - /** - * Unconditionally close an InputStream. - *

- * Equivalent to {@link InputStream#close()}, except any exceptions will be ignored. - * This is typically used in finally blocks. - * - * @param input the InputStream to close, may be null or already closed - */ - public static void closeQuietly(InputStream input) { - try { - if (input != null) { - input.close(); - } - } catch (IOException ioe) { - // ignore - } - } - - /** - * Unconditionally close an OutputStream. - *

- * Equivalent to {@link OutputStream#close()}, except any exceptions will be ignored. - * This is typically used in finally blocks. - * - * @param output the OutputStream to close, may be null or already closed - */ - public static void closeQuietly(OutputStream output) { - try { - if (output != null) { - output.close(); - } - } catch (IOException ioe) { - // ignore - } - } - - /** - * Copy bytes from an InputStream to an - * OutputStream. - *

- * This method buffers the input internally, so there is no need to use a - * BufferedInputStream. - * - * @param input the InputStream to read from - * @param output the OutputStream to write to - * @return the number of bytes copied - * @throws NullPointerException if the input or output is null - * @throws IOException if an I/O error occurs - * @since Commons IO 1.1 - */ - public static int copy(InputStream input, OutputStream output) throws IOException { - byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; - int count = 0; - int n = 0; - while (-1 != (n = input.read(buffer))) { // NOPMD - output.write(buffer, 0, n); - count += n; - } - return count; - } - - public static InputStream getInputStream(URL url) throws IOException { - return new SafeURLInputStream(url); - } - - /** - * 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!/my.composite" We - * also need to turn off the JarFile cache. - * - * @see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4950148 - * - * @version $Rev$ $Date$ - */ - public static class SafeURLInputStream extends InputStream { - private JarFile jarFile; - private InputStream is; - - public SafeURLInputStream(URL url) throws IOException { - String protocol = url.getProtocol(); - if (protocol != null && (protocol.equals("jar"))) { - JarURLConnection connection = (JarURLConnection)url.openConnection(); - // We cannot use cache - connection.setUseCaches(false); - try { - is = connection.getInputStream(); - } catch (IOException e) { - throw e; - } - jarFile = connection.getJarFile(); - } else { - is = url.openStream(); - } - } - - public SafeURLInputStream(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/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237Work.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237Work.java deleted file mode 100644 index 6fe883157f..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237Work.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core.work; - -/* - * JCA work wrapper. - */ -public class Jsr237Work implements commonj.work.Work { - - // Work that is being executed. - private T work; - - /* - * Initializes the work instance. - */ - public Jsr237Work(T work) { - this.work = work; - } - - /* - * Returns the completed work. - */ - public T getWork() { - return work; - } - - /* - * Release the work. - */ - public void release() { - } - - /* - * Work attributes are not daemon. - */ - public boolean isDaemon() { - return false; - } - - /* - * Runs the work. - */ - public void run() { - work.run(); - } -} \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java deleted file mode 100644 index c8a5dd7afe..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/Jsr237WorkScheduler.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.work; - -import org.apache.tuscany.sca.work.NotificationListener; -import org.apache.tuscany.sca.work.WorkScheduler; -import org.apache.tuscany.sca.work.WorkSchedulerException; - -import commonj.work.WorkEvent; -import commonj.work.WorkException; -import commonj.work.WorkListener; -import commonj.work.WorkManager; -import commonj.work.WorkRejectedException; - -/** - * A work scheduler implementation based on a JSR 237 work manager. - *

- *

- * This needs a JSR 237 work manager implementation available for scheduling work. Instances can be configured with a - * work manager implementation that is injected in. It is the responsibility of the runtime environment to make a work - * manager implementaion available. For example, if the managed environment supports work manager the runtime can use - * the appropriate lookup mechanism to inject the work manager implementation.

- */ -public class Jsr237WorkScheduler implements WorkScheduler { - - /** - * Underlying JSR-237 work manager - */ - private WorkManager jsr237WorkManager; - - /** - * Initializes the JSR 237 work manager. - * - * @param jsr237WorkManager JSR 237 work manager. - */ - public Jsr237WorkScheduler(WorkManager jsr237WorkManager) { - if (jsr237WorkManager == null) { - throw new IllegalArgumentException("Work manager cannot be null"); - } - this.jsr237WorkManager = jsr237WorkManager; - } - - /** - * Schedules a unit of work for future execution. The notification listener is used to register interest in - * callbacks regarding the status of the work. - * - * @param work The unit of work that needs to be asynchronously executed. - */ - public void scheduleWork(T work) { - scheduleWork(work, null); - } - - /** - * Schedules a unit of work for future execution. The notification listener is used to register interest in - * callbacks regarding the status of the work. - * - * @param work The unit of work that needs to be asynchronously executed. - * @param listener Notification listener for callbacks. - */ - public void scheduleWork(T work, NotificationListener listener) { - - if (work == null) { - throw new IllegalArgumentException("Work cannot be null"); - } - - Jsr237Work jsr237Work = new Jsr237Work(work); - try { - if (listener == null) { - jsr237WorkManager.schedule(jsr237Work); - } else { - Jsr237WorkListener jsr237WorkListener = new Jsr237WorkListener(listener, work); - jsr237WorkManager.schedule(jsr237Work, jsr237WorkListener); - } - } catch (WorkRejectedException ex) { - if (listener != null) { - listener.workRejected(work); - } else { - throw new WorkSchedulerException(ex); - } - } catch (WorkException ex) { - throw new WorkSchedulerException(ex); - } - - } - - /* - * Worklistener for keeping track of work status callbacks. - * - */ - private class Jsr237WorkListener implements WorkListener { - - // Notification listener - private NotificationListener listener; - - // Work - private T work; - - /* - * Initializes the notification listener. - */ - public Jsr237WorkListener(NotificationListener listener, T work) { - this.listener = listener; - this.work = work; - } - - /* - * Callback when the work is accepted. - */ - public void workAccepted(WorkEvent workEvent) { - T work = getWork(); - listener.workAccepted(work); - } - - /* - * Callback when the work is rejected. - */ - public void workRejected(WorkEvent workEvent) { - T work = getWork(); - listener.workRejected(work); - } - - /* - * Callback when the work is started. - */ - public void workStarted(WorkEvent workEvent) { - T work = getWork(); - listener.workStarted(work); - } - - /* - * Callback when the work is completed. - */ - public void workCompleted(WorkEvent workEvent) { - T work = getWork(); - Exception exception = workEvent.getException(); - if (exception != null) { - listener.workFailed(work, exception); - } else { - listener.workCompleted(work); - } - } - - /* - * Gets the underlying work from the work event. - */ - private T getWork() { - return work; - } - - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManager.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManager.java deleted file mode 100644 index 0bc6f1b336..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/ThreadPoolWorkManager.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.work; - -import java.rmi.server.UID; -import java.util.Collection; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.RejectedExecutionException; - -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Property; - -import commonj.work.Work; -import commonj.work.WorkEvent; -import commonj.work.WorkException; -import commonj.work.WorkItem; -import commonj.work.WorkListener; -import commonj.work.WorkManager; -import commonj.work.WorkRejectedException; - -/** - * A thread-pool based implementation for the JSR-237 work manager. - *

- *

- * This implementation supports only local work. - *

- * TODO Elaborate the implementation.

- */ -public class ThreadPoolWorkManager implements WorkManager { - - // Map of work items currently handled by the work manager - private Map workItems = new ConcurrentHashMap(); - - // Thread-pool - private ExecutorService executor; - - /** - * Initializes the thread-pool. - * - * @param threadPoolSize Thread-pool size. - */ - public ThreadPoolWorkManager(@Property(name = "poolSize") int threadPoolSize) { - executor = Executors.newFixedThreadPool(threadPoolSize); - } - - /** - * Schedules a unit of work asynchronously. - * - * @param work Work that needs to be scheduled. - * @return Work Work item representing the asynchronous work - */ - public WorkItem schedule(Work work) throws WorkException { - return schedule(work, null); - } - - /** - * Schedules a unit of work asynchronously. - * - * @param work Work that needs to be scheduled. - * @param workListener Work listener for callbacks. - * @return Work Work item representing the asynchronous work - */ - public WorkItem schedule(Work work, WorkListener workListener) throws WorkRejectedException { - - WorkItemImpl workItem = new WorkItemImpl(new UID().toString(), work); - if (workListener != null) { - workItems.put(workItem, workListener); - } - workAccepted(workItem, work); - if (scheduleWork(work, workItem)) { - return workItem; - } else { - workItem.setStatus(WorkEvent.WORK_REJECTED); - if (workListener != null) { - workListener.workRejected(new WorkEventImpl(workItem)); - } - throw new WorkRejectedException("Unable to schedule work"); - } - } - - /** - * Wait for all the specified units of work to finish. - * - * @param works Units of the work that need to finish. - * @param timeout Timeout for waiting for the units of work to finish. - */ - public boolean waitForAll(Collection works, long timeout) { - throw new UnsupportedOperationException("waitForAll not supported"); - } - - /** - * Wait for any of the specified units of work to finish. - * - * @param works Units of the work that need to finish. - * @param timeout Timeout for waiting for the units of work to finish. - */ - public Collection waitForAny(Collection works, long timeout) { - throw new UnsupportedOperationException("waitForAny not supported"); - } - - /** - * Method provided for subclasses to indicate a work accptance. - * - * @param workItem Work item representing the work that was accepted. - * @param work Work that was accepted. - */ - private void workAccepted(final WorkItemImpl workItem, final Work work) { - WorkListener listener = workItems.get(workItem); - if (listener != null) { - workItem.setStatus(WorkEvent.WORK_ACCEPTED); - WorkEvent event = new WorkEventImpl(workItem); - listener.workAccepted(event); - } - } - - /* - * Method to indicate a work start. - */ - private void workStarted(final WorkItemImpl workItem, final Work work) { - WorkListener listener = workItems.get(workItem); - if (listener != null) { - workItem.setStatus(WorkEvent.WORK_STARTED); - WorkEvent event = new WorkEventImpl(workItem); - listener.workStarted(event); - } - } - - /* - * Method to indicate a work completion. - */ - private void workCompleted(final WorkItemImpl workItem, final Work work) { - workCompleted(workItem, work, null); - } - - /* - * Method to indicate a work completion. - */ - private void workCompleted(final WorkItemImpl workItem, final Work work, final WorkException exception) { - WorkListener listener = workItems.get(workItem); - if (listener != null) { - workItem.setStatus(WorkEvent.WORK_COMPLETED); - workItem.setResult(work); - workItem.setException(exception); - WorkEvent event = new WorkEventImpl(workItem); - listener.workCompleted(event); - workItems.remove(workItem); - } - } - - /* - * Schedules the work using the threadpool. - */ - private boolean scheduleWork(final Work work, final WorkItemImpl workItem) { - try { - executor.execute(new DecoratingWork(workItem, work)); - return true; - } catch (RejectedExecutionException ex) { - return false; - } - } - - /* - * Class that decorates the original worker so that it can get callbacks when work is done. - */ - private final class DecoratingWork implements Runnable { - - // Work item for this work. - private WorkItemImpl workItem; - - // The original work. - private Work decoratedWork; - - /* - * Initializes the work item and underlying work. - */ - private DecoratingWork(final WorkItemImpl workItem, final Work decoratedWork) { - this.workItem = workItem; - this.decoratedWork = decoratedWork; - } - - /* - * Overrides the run method. - */ - public void run() { - workStarted(workItem, decoratedWork); - try { - decoratedWork.run(); - workCompleted(workItem, decoratedWork); - } catch (Throwable th) { - workCompleted(workItem, decoratedWork, new WorkException(th.getMessage(), th)); - } - } - - } - - @Destroy - public void destroy() { - executor.shutdown(); - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEventImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEventImpl.java deleted file mode 100644 index 62ebeea1fb..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkEventImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.work; - - -import commonj.work.WorkEvent; -import commonj.work.WorkException; -import commonj.work.WorkItem; - -/** - * Default immutable implementation of the WorkEvent class. - */ -class WorkEventImpl implements WorkEvent { - - // Work item for this event - private WorkItem workItem; - - // Exception if something has gone wrong - private WorkException exception; - - /** - * Instantiates the event. - * - * @param workItem Work item for this event. - */ - public WorkEventImpl(final WorkItemImpl workItem) { - this.workItem = workItem; - this.exception = workItem.getException(); - } - - /** - * Returns the work type based on whether the work was accepted, started, - * rejected or completed. - * - * @return Work type. - */ - public int getType() { - return workItem.getStatus(); - } - - /** - * Returns the work item associated with this work type. - * - * @return Work item. - */ - public WorkItem getWorkItem() { - return workItem; - } - - /** - * Returns the exception if the work completed with an exception. - * - * @return Work exception. - */ - public WorkException getException() { - return exception; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java deleted file mode 100644 index fae3f1aae3..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/core/work/WorkItemImpl.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.work; - -import commonj.work.Work; -import commonj.work.WorkException; -import commonj.work.WorkItem; - -/** - * An identity based immutable implementation of the WorkItem - * interface. - * - */ -class WorkItemImpl implements WorkItem { - - // Id scoped for the VM - private String id; - - // Status - private int status = -1; - - // Result - private Work result; - - // Original work - private Work originalWork; - - // Exception - private WorkException exception; - - /** - * Instantiates an id for this item. - * - * @param id of this work event. - */ - protected WorkItemImpl(final String id, final Work orginalWork) { - this.id = id; - this.originalWork = orginalWork; - } - - /** - * Returns the id. - * - * @return Id of this item. - */ - public String getId() { - return id; - } - - /** - * Returns the original work. - * - * @return Original work. - */ - public Work getOriginalWork() { - return originalWork; - } - - /** - * Returns the work result if the work completed. - * - * @return Work. - * @throws WorkException If the work completed with an exception. - */ - public Work getResult() throws WorkException { - return result; - } - - /** - * Sets the result. - * - * @param result Result. - */ - protected void setResult(final Work result) { - this.result = result; - } - - /** - * Returns the exception if work completed with an exception. - * - * @return Work exception. - */ - protected WorkException getException() { - return exception; - } - - /** - * Sets the exception. - * - * @param exception Exception. - */ - protected void setException(final WorkException exception) { - this.exception = exception; - } - - /** - * Returns the work type based on whether the work was accepted, started, - * rejected or completed. - * - * @return Work status. - */ - public int getStatus() { - return status; - } - - /** - * Sets the status. - * - * @param status Status. - */ - protected void setStatus(final int status) { - this.status = status; - } - - /** - * @see Object#hashCode() - */ - public int hashCode() { - return id.hashCode(); - } - - /** - * Indicates whether some other object is "equal to" this one. - * - * @param obj Object to be compared. - * @return true if this object is the same as the obj argument; false - * otherwise.. - */ - public boolean equals(final Object obj) { - return (obj != null) && (obj.getClass() == WorkItemImpl.class) && ((WorkItemImpl) obj).id.equals(id); - } - - /** - * Compares this object with the specified object for order. Returns a - * negative integer, zero, or a positive integer as this object is less - * than, equal to, or greater than the specified object. - * - * @param o Object to be compared. - * @return A negative integer, zero, or a positive integer as this object - * is less than, equal to, or greater than the specified object. - * @throws ClassCastException needs better documentation. - */ - public int compareTo(final Object o) { - if (o.getClass() != WorkItemImpl.class) { - throw new ClassCastException(o.getClass().getName()); - } else { - return ((WorkItemImpl) o).getId().compareTo(getId()); - } - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/factory/ObjectCreationException.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/factory/ObjectCreationException.java deleted file mode 100644 index 3432c61c76..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/factory/ObjectCreationException.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.factory; - - -/** - * Denotes an error creating a new object instance - * - * @version $Rev$ $Date$ - */ -public class ObjectCreationException extends RuntimeException { - private static final long serialVersionUID = -6423113430265944499L; - - public ObjectCreationException() { - super(); - } - - public ObjectCreationException(String message, Throwable cause) { - super(message, cause); - } - - public ObjectCreationException(String message) { - super(message); - } - - public ObjectCreationException(Throwable cause) { - super(cause); - } - -} - diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/factory/ObjectFactory.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/factory/ObjectFactory.java deleted file mode 100644 index c5e0dad4e7..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/factory/ObjectFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.factory; - -/** - * 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/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/factory/SingletonObjectFactory.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/factory/SingletonObjectFactory.java deleted file mode 100644 index 074a1121c9..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/factory/SingletonObjectFactory.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.factory; - - -/** - * Implementation of ObjectFactory that returns a single instance, typically an immutable type. - * - * @version $Rev$ $Date$ - */ -public class SingletonObjectFactory implements ObjectFactory { - private final T instance; - - public SingletonObjectFactory(T instance) { - this.instance = instance; - } - - public T getInstance() { - return instance; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/AbstractLifecycle.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/AbstractLifecycle.java deleted file mode 100644 index e5f88d91c6..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/AbstractLifecycle.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - -/** - * Base class providing a simple implementation of Lifecycle. - * - * @version $Rev$ $Date$ - */ -public abstract class AbstractLifecycle implements Lifecycle { - protected volatile int lifecycleState = UNINITIALIZED; - - public int getLifecycleState() { - return lifecycleState; - } - - /** - * Set the current state of the Lifecycle. - * - * @param lifecycleState the new state - */ - protected void setLifecycleState(int lifecycleState) { - this.lifecycleState = lifecycleState; - } - - public void start() { - setLifecycleState(RUNNING); - } - - public void stop() { - setLifecycleState(STOPPED); - } - - /** - * Returns the current lifecycle as a String (for example, "RUNNING"). - * - * @return the current lifecycle as a String - */ - public String toString() { - switch (lifecycleState) { - case Lifecycle.CONFIG_ERROR: - return "CONFIG_ERROR"; - case Lifecycle.ERROR: - return "ERROR"; - case Lifecycle.INITIALIZING: - return "INITIALIZING"; - case Lifecycle.INITIALIZED: - return "INITIALIZED"; - case Lifecycle.RUNNING: - return "RUNNING"; - case Lifecycle.STOPPING: - return "STOPPING"; - case Lifecycle.STOPPED: - return "STOPPED"; - case Lifecycle.UNINITIALIZED: - return "UNINITIALIZED"; - default: - return "UNKNOWN"; - } - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/CoreRuntimeException.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/CoreRuntimeException.java deleted file mode 100644 index ac3e51a982..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/CoreRuntimeException.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - - -/** - * The root exception for the runtime package. Exceptions occurring in the runtime are generally non-recoverable - * - * @version $Rev$ $Date$ - */ -public abstract class CoreRuntimeException extends RuntimeException { - - public CoreRuntimeException() { - super(); - } - - public CoreRuntimeException(String message, Throwable cause) { - super(message, cause); - } - - public CoreRuntimeException(String message) { - super(message); - } - - public CoreRuntimeException(Throwable cause) { - super(cause); - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/InstanceWrapper.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/InstanceWrapper.java deleted file mode 100644 index a952e2e72b..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/InstanceWrapper.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - - -/** - * Provides lifecycle management for an implementation instance associated with - * a component for use by the component's associated {@link org.apache.tuscany.sca.scope.ScopeContainer} - * - * @version $Rev$ $Date$ - */ -public interface InstanceWrapper { - - /** - * @return - */ - T getInstance(); - - /** - * @throws TargetInitializationException - */ - void start() throws TargetInitializationException; - - /** - * @throws TargetDestructionException - */ - void stop() throws TargetDestructionException; - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/Lifecycle.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/Lifecycle.java deleted file mode 100644 index 02075cad01..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/Lifecycle.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - -/** - * Implementations adhere to runtime lifecycle semantics - * - * @version $Rev$ $Date$ - */ -public interface Lifecycle { - /* A configuration error state */ - int CONFIG_ERROR = -1; - /* Has not been initialized */ - int UNINITIALIZED = 0; - /* In the process of being configured and initialized */ - int INITIALIZING = 1; - /* Instantiated and configured */ - int INITIALIZED = 2; - /* Configured and initialized */ - int RUNNING = 4; - /* In the process of being shutdown */ - int STOPPING = 5; - /* Has been shutdown and removed from the composite */ - int STOPPED = 6; - /* In an error state */ - int ERROR = 7; - - /** - * Returns the lifecycle state - * - * @see #UNINITIALIZED - * @see #INITIALIZING - * @see #INITIALIZED - * @see #RUNNING - * @see #STOPPING - * @see #STOPPED - */ - int getLifecycleState(); - - /** - * Starts the Lifecycle. - * - * @throws CoreRuntimeException - */ - void start() throws CoreRuntimeException; - - /** - * Stops the Lifecycle. - * - * @throws CoreRuntimeException - */ - void stop() throws CoreRuntimeException; -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/PersistenceException.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/PersistenceException.java deleted file mode 100644 index 54fba1ee03..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/PersistenceException.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - -/** - * Raised when an error persisting a component implementation instance is encountered - * - * @version $Rev$ $Date$ - */ -public class PersistenceException extends Exception { - private static final long serialVersionUID = -908468170919651248L; - - public PersistenceException() { - } - - public PersistenceException(String message) { - super(message); - } - - public PersistenceException(String message, Throwable cause) { - super(message, cause); - } - - public PersistenceException(Throwable cause) { - super(cause); - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/Scope.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/Scope.java deleted file mode 100644 index 9b3f208cb3..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/Scope.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - -/** - * The default implementation scopes supported by assemblies. - * - * @version $Rev$ $Date$ - */ -public class Scope { - public static final Scope STATELESS = new Scope("STATELESS"); - public static final Scope REQUEST = new Scope("REQUEST"); - public static final Scope SESSION = new Scope("SESSION"); - public static final Scope CONVERSATION = new Scope("CONVERSATION"); - public static final Scope COMPOSITE = new Scope("COMPOSITE"); - public static final Scope SYSTEM = new Scope("SYSTEM"); - public static final Scope UNDEFINED = new Scope("UNDEFINED"); - - private String scope; - - public Scope(String scope) { - this.scope = scope.toUpperCase().intern(); - } - - public String getScope() { - return scope; - } - - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final Scope scope1 = (Scope) o; - return !(scope != null ? scope != scope1.scope.intern() : scope1.scope != null); - } - - public int hashCode() { - return scope != null ? scope.hashCode() : 0; - } - - public String toString() { - return scope; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeContainer.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeContainer.java deleted file mode 100644 index 30482fae90..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeContainer.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - -import org.apache.tuscany.sca.event.RuntimeEventListener; -import org.apache.tuscany.sca.runtime.RuntimeComponent; - - -/** - * Manages the lifecycle and visibility of instances associated with a an {@link RuntimeComponent}. - * - * @version $Rev$ $Date$ - * @param the type of IDs that this container uses to identify its contexts. - * For example, for COMPOSITE scope this could be the URI of the composite component, - * or for HTTP Session scope it might be the HTTP session ID. - */ -public interface ScopeContainer extends Lifecycle, RuntimeEventListener { - - /** - * Returns the Scope that this container supports. - * - * @return the Scope that this container supports - */ - Scope getScope(); - - /** - * Start a new context with the supplied ID. - * - * @param contextId an ID that uniquely identifies the context. - */ - void startContext(KEY contextId); - - /** - * Stop the context with the supplied ID. - * - * @param contextId an ID that uniquely identifies the context. - */ - void stopContext(KEY contextId); - - /** - * Returns an instance wrapper associated with the current scope context, creating one if necessary - * @param contextId the id for the scope context - * - * @return the wrapper for the target instance - * @throws TargetResolutionException if there was a problem instantiating the target instance - */ - InstanceWrapper getWrapper(KEY contextId) throws TargetResolutionException; - - /** - * Returns an implementation instance associated with the current scope context. - * If no instance is found, a {@link TargetNotFoundException} is thrown. - * @param contextId the id for the scope context - * - * @return the wrapper for the target instance - * @throws TargetResolutionException if there was a problem instantiating the target instance - */ - InstanceWrapper getAssociatedWrapper(KEY contextId) - throws TargetResolutionException; - - /** - * Return a wrapper after use (for example, after invoking the instance). - * @param wrapper the wrapper for the target instance being returned - * @param contextId the id for the scope context - * - * @throws TargetDestructionException if there was a problem returning the target instance - */ - void returnWrapper(InstanceWrapper wrapper, KEY contextId) - throws TargetDestructionException; - - /** - * Removes a component implementation instance associated with the current context from persistent storage - * - * @param component the owning component - * @throws PersistenceException if there was a problem removing the instance - */ - void remove() throws PersistenceException; -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeContainerFactory.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeContainerFactory.java deleted file mode 100644 index b6acae7382..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeContainerFactory.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.scope; - -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -/** - * Factory to create ScopeContainer for components - * - * @version $Rev$ $Date$ - */ -public interface ScopeContainerFactory { - ScopeContainer createScopeContainer(RuntimeComponent component); - Scope getScope(); -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeIdentifier.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeIdentifier.java deleted file mode 100644 index 77e7d76842..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeIdentifier.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - -/** - * 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.sca.factory.component.WorkContext - */ -public interface ScopeIdentifier { - - /** - * Returns the scope id for the request. - */ - Object getIdentifier(); -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeNotFoundException.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeNotFoundException.java deleted file mode 100644 index 40a251c6f2..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeNotFoundException.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - -/** - * @version $Rev$ $Date$ - */ -public class ScopeNotFoundException extends Exception { - - private static final long serialVersionUID = -3447306764458851441L; - - public ScopeNotFoundException(String scope) { - super("Scope not found: " + scope); - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeRegistry.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeRegistry.java deleted file mode 100644 index f3319ee093..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopeRegistry.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - -import org.apache.tuscany.sca.runtime.RuntimeComponent; - - -/** - * Manages {@link ScopeContainer}s in the runtime - * - * @version $$Rev$$ $$Date$$ - */ -public interface ScopeRegistry { - - /** - * Returns the scope container for the given scope or null if one not found - * - * @param scope the scope - * @return the scope container for the given scope or null if one not found - */ - ScopeContainer getScopeContainer(RuntimeComponent component); - - /** - * @param factory - */ - void register(ScopeContainerFactory factory); -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopedImplementationProvider.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopedImplementationProvider.java deleted file mode 100644 index 8b9c50b070..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopedImplementationProvider.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.scope; - -import org.apache.tuscany.sca.provider.ImplementationProvider; - -/** - * A component implementation can implement this interface to provide scope - * management for the components - * - * @version $Rev$ $Date$ - */ -public interface ScopedImplementationProvider extends ImplementationProvider { - /** - * Get the scope for the component implementation - * - * @return The scope for the component implementation, if null is returned, - * STATELESS will be used - */ - Scope getScope(); - - /** - * Indicate if the component needs to be eagerly initialized - * - * @return true if the component is marked to be eagerly initialized, false - * otherwise - */ - boolean isEagerInit(); - - /** - * @return the maxAge - */ - long getMaxAge(); - - /** - * @return the maxIdleTime - */ - long getMaxIdleTime(); - - /** - * Create a wrapper for the component instance for the scope management - * - * @return A wrapper for the component instance - */ - InstanceWrapper createInstanceWrapper(); - -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopedRuntimeComponent.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopedRuntimeComponent.java deleted file mode 100644 index 6c33683bde..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/ScopedRuntimeComponent.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.scope; - -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -/** - * Scoped runtime component - * - * @version $Rev$ $Date$ - */ -public interface ScopedRuntimeComponent extends RuntimeComponent { - /** - * Set the associated scope container - * @param scopeContainer - */ - void setScopeContainer(ScopeContainer scopeContainer); - /** - * Get the assoicated scope container - * @return - */ - ScopeContainer getScopeContainer(); -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetDestructionException.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetDestructionException.java deleted file mode 100644 index 6b251295f5..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetDestructionException.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - -/** - * Denotes an error destroying a target - * - * @version $Rev$ $Date$ - */ -public class TargetDestructionException extends TargetResolutionException { - private static final long serialVersionUID = -6126684147851674709L; - - public TargetDestructionException() { - super(); - } - - public TargetDestructionException(String message, Throwable cause) { - super(message, cause); - } - - public TargetDestructionException(String message) { - super(message); - } - - public TargetDestructionException(Throwable cause) { - super(cause); - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetInitializationException.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetInitializationException.java deleted file mode 100644 index 17cd21967f..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetInitializationException.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - -/** - * Denotes an error initializing a target - * - * @version $Rev$ $Date$ - */ -public class TargetInitializationException extends TargetResolutionException { - private static final long serialVersionUID = -6228778208649752698L; - - public TargetInitializationException() { - super(); - } - - public TargetInitializationException(String message, Throwable cause) { - super(message, cause); - } - - public TargetInitializationException(String message) { - super(message); - } - - public TargetInitializationException(Throwable cause) { - super(cause); - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetInvocationException.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetInvocationException.java deleted file mode 100644 index f9bfa0a788..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetInvocationException.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - -/** - * Raised when an error is encountered during a target invocation - * - * @version $Rev$ $Date$ - */ -public class TargetInvocationException extends Exception { - - private static final long serialVersionUID = -6553427708442761743L; - - public TargetInvocationException() { - super(); - } - - public TargetInvocationException(String message, Throwable cause) { - super(message, cause); - } - - public TargetInvocationException(String message) { - super(message); - } - - public TargetInvocationException(Throwable cause) { - super(cause); - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetInvokerCreationException.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetInvokerCreationException.java deleted file mode 100644 index a20d030ee8..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetInvokerCreationException.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - -/** - * Denotes an error creating a target invoker - * - * @version $Rev$ $Date$ - * @Deprecated - */ -public abstract class TargetInvokerCreationException extends Exception { - - public TargetInvokerCreationException() { - super(); - } - - public TargetInvokerCreationException(String message, Throwable cause) { - super(message, cause); - } - - public TargetInvokerCreationException(String message) { - super(message); - } - - public TargetInvokerCreationException(Throwable cause) { - super(cause); - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetNotFoundException.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetNotFoundException.java deleted file mode 100644 index 4dd63f58f0..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetNotFoundException.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - -/** - * Thrown when a target of an operation cannot be found - * - * @version $$Rev$$ $$Date$$ - */ -public class TargetNotFoundException extends TargetResolutionException { - private static final long serialVersionUID = 5541830480658471186L; - - public TargetNotFoundException() { - super(); - } - - public TargetNotFoundException(String message, Throwable cause) { - super(message, cause); - } - - public TargetNotFoundException(String message) { - super(message); - } - - public TargetNotFoundException(Throwable cause) { - super(cause); - } -} diff --git a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetResolutionException.java b/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetResolutionException.java deleted file mode 100644 index 284ab8b6c7..0000000000 --- a/branches/sca-java-0.90/modules/core/src/main/java/org/apache/tuscany/sca/scope/TargetResolutionException.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - -/** - * Denotes an error retrieving a target instance - * - * @version $Rev$ $Date$ - */ -public class TargetResolutionException extends Exception { - private static final long serialVersionUID = 2912513650522019405L; - - public TargetResolutionException() { - super(); - } - - public TargetResolutionException(String message, Throwable cause) { - super(message, cause); - } - - public TargetResolutionException(String message) { - super(message); - } - - public TargetResolutionException(Throwable cause) { - super(cause); - } -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistryTestCase.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistryTestCase.java deleted file mode 100644 index 40a146e129..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistryTestCase.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.core; - -import junit.framework.TestCase; - -public class DefaultExtensionPointRegistryTestCase extends TestCase { - private ExtensionPointRegistry registry; - - protected void setUp() throws Exception { - super.setUp(); - registry = new DefaultExtensionPointRegistry(); - } - - public void testRegistry() { - MyRegistry service = new MyREgistryImpl(); - registry.addExtensionPoint(service); - assertSame(service, registry.getExtensionPoint(MyRegistry.class)); - registry.removeExtensionPoint(service); - assertNull(registry.getExtensionPoint(MyRegistry.class)); - } - - private static interface MyRegistry { - void doSomething(); - } - - private static class MyREgistryImpl implements MyRegistry { - - public void doSomething() { - } - - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/event/BaseEventPublisherTestCase.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/event/BaseEventPublisherTestCase.java deleted file mode 100644 index d2050523eb..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/event/BaseEventPublisherTestCase.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.event; - - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.event.Event; -import org.apache.tuscany.sca.event.EventFilter; -import org.apache.tuscany.sca.event.EventPublisher; -import org.apache.tuscany.sca.event.RuntimeEventListener; -import org.apache.tuscany.sca.event.TrueFilter; -import org.easymock.EasyMock; - -/** - * @version $Rev$ $Date$ - */ -public class BaseEventPublisherTestCase extends TestCase { - EventPublisher publisher; - - public void testFireListener() { - Event event = new TestEvent(); - RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class); - listener.onEvent(EasyMock.same(event)); - EasyMock.expectLastCall(); - EasyMock.replay(listener); - publisher.addListener(listener); - publisher.publish(event); - EasyMock.verify(listener); - } - - public void testRemoveListener() { - Event event = new TestEvent(); - RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class); - EasyMock.replay(listener); - publisher.addListener(listener); - publisher.removeListener(listener); - publisher.publish(event); - EasyMock.verify(listener); - } - - public void testFalseFilterListener() { - Event event = new TestEvent(); - RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class); - EasyMock.replay(listener); - publisher.addListener(new FalseFilter(), listener); - publisher.publish(event); - EasyMock.verify(listener); - } - - public void testTrueFilterListener() { - Event event = new TestEvent(); - RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class); - listener.onEvent(EasyMock.same(event)); - EasyMock.expectLastCall(); - EasyMock.replay(listener); - publisher.addListener(new TrueFilter(), listener); - publisher.publish(event); - EasyMock.verify(listener); - } - - protected void setUp() throws Exception { - super.setUp(); - publisher = new BaseEventPublisher() { - }; - } - - private class TestEvent implements Event { - public Object getSource() { - return null; - } - } - - private class FalseFilter implements EventFilter { - - public boolean match(Event event) { - return false; - } - } - - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/event/EventTestCase.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/event/EventTestCase.java deleted file mode 100644 index bf95d640c5..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/event/EventTestCase.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.event; - -import java.net.URI; - -import junit.framework.TestCase; - -/** - * @version $Rev$ $Date$ - */ -public class EventTestCase extends TestCase { - private URI uri = URI.create("foo"); - - public void testCompositeStart() { - ComponentStart event = new ComponentStart(this, uri); - assertEquals(uri, event.getComponentURI()); - } - - public void testCompositeStop() { - ComponentStop event = new ComponentStop(this, uri); - assertEquals(uri, event.getComponentURI()); - } - - public void testHttpSessionStart() { - Object id = new Object(); - HttpSessionStart event = new HttpSessionStart(this, id); - assertEquals(this, event.getSource()); - assertEquals(id, event.getSessionID()); - } - - public void testHttpSessionEnd() { - Object id = new Object(); - HttpSessionEnd event = new HttpSessionEnd(this, id); - assertEquals(this, event.getSource()); - assertEquals(id, event.getSessionID()); - } - - public void testRequestStart() { - RequestStart event = new RequestStart(this); - assertEquals(this, event.getSource()); - } - - public void testReequestEnd() { - RequestEnd event = new RequestEnd(this); - assertEquals(this, event.getSource()); - } - - - protected void setUp() throws Exception { - super.setUp(); - } -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/AsyncTarget.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/AsyncTarget.java deleted file mode 100644 index c30e19de88..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/AsyncTarget.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.OneWay; - -/** - * @version $Rev$ $Date$ - */ -public interface AsyncTarget { - @OneWay - void invoke(); - - int getCount(); -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BadContextPojo.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BadContextPojo.java deleted file mode 100644 index f9ae94f152..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BadContextPojo.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Context; - -public class BadContextPojo { - - @Context - String context; - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BadNamePojo.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BadNamePojo.java deleted file mode 100644 index c4074484b9..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BadNamePojo.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.ComponentName; - -public class BadNamePojo { - @ComponentName - private int name; -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BasicInterface.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BasicInterface.java deleted file mode 100644 index ca305b9ef0..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BasicInterface.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -/** - * @version $Rev$ $Date$ - */ -public interface BasicInterface { - String returnsProperty(); - - BasicInterface returnsReference(); - - int returnsInt(); -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BasicInterfaceImpl.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BasicInterfaceImpl.java deleted file mode 100644 index ea32d1f6b9..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/BasicInterfaceImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; - -/** - * @version $Rev$ $Date$ - */ -public class BasicInterfaceImpl implements BasicInterface { - - @Property - public String publicProperty; - - @Reference (required = false) - public BasicInterface publicReference; - - @Property - protected String protectedProperty; - - @Reference (required = false) - protected BasicInterface protectedReference; - - private String privateProperty; - - private BasicInterface privateReference; - - @Property - public void setPrivateProperty(String privateProperty) { - this.privateProperty = privateProperty; - } - - @Reference (required = false) - public void setPrivateReference(BasicInterface privateReference) { - this.privateReference = privateReference; - } - - public String returnsProperty() { - return privateProperty; - } - - public BasicInterface returnsReference() { - return privateReference; - } - - public int returnsInt() { - return 0; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeComponent.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeComponent.java deleted file mode 100644 index 6d320df145..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeComponent.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Scope; - -/** - * @version $Rev$ $Date$ - */ -@Scope("COMPOSITE") -public interface CompositeScopeComponent { - - //public boolean isInit(); -} - diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeComponentImpl.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeComponentImpl.java deleted file mode 100644 index 9ff289a502..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeComponentImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Scope; - - -/** - * @version $Rev$ $Date$ - */ -@Scope("COMPOSITE") -public class CompositeScopeComponentImpl implements - CompositeScopeComponent { - - private String foo; - - public void setFoo(String foo) { - this.foo = foo; - } - - public String getFoo() { - return foo; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeDestroyOnlyComponent.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeDestroyOnlyComponent.java deleted file mode 100644 index 832055a084..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeDestroyOnlyComponent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Destroy; - -public class CompositeScopeDestroyOnlyComponent extends CompositeScopeComponentImpl { - - boolean destroyed; - - public boolean isDestroyed() { - return destroyed; - } - - @Destroy - public void destroy() { - destroyed = true; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeInitDestroyComponent.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeInitDestroyComponent.java deleted file mode 100644 index e8b76e13c0..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeInitDestroyComponent.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Destroy; - -public class CompositeScopeInitDestroyComponent extends CompositeScopeInitOnlyComponent { - - boolean destroyed; - - public boolean isDestroyed() { - return destroyed; - } - - @Destroy - public void destroy() { - if (destroyed) { - throw new AssertionError("Destroy called more than once"); - } - destroyed = true; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeInitOnlyComponent.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeInitOnlyComponent.java deleted file mode 100644 index 057580be7a..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/CompositeScopeInitOnlyComponent.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Init; - -public class CompositeScopeInitOnlyComponent extends CompositeScopeComponentImpl { - - private boolean 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; - - public boolean isInitialized() { - return initialized; - } - - @Init - public void init() { - if (initialized) { - throw new AssertionError("Init called more than once"); - } - initialized = true; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeComponent.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeComponent.java deleted file mode 100644 index 79f48a57c5..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeComponent.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Scope; - -/** - * @version $Rev: 430937 $ $Date: 2006-08-11 21:17:56 -0400 (Fri, 11 Aug 2006) $ - */ -@Scope("CONVERSATION") -public interface ConversationalScopeComponent { - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeComponentImpl.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeComponentImpl.java deleted file mode 100644 index 5b42d92191..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeComponentImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Scope; - -/** - * @version $Rev: 430937 $ $Date: 2006-08-11 21:17:56 -0400 (Fri, 11 Aug 2006) $ - */ -@Scope("CONVERSATION") -public class ConversationalScopeComponentImpl implements ConversationalScopeComponent { - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeDestroyOnlyComponent.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeDestroyOnlyComponent.java deleted file mode 100644 index c64556e754..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeDestroyOnlyComponent.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Scope; - -@Scope("CONVERSATION") -public class ConversationalScopeDestroyOnlyComponent extends ConversationalScopeComponentImpl { - - boolean destroyed; - - public boolean isDestroyed() { - return destroyed; - } - - @Destroy - public void destroy() { - destroyed = true; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeInitDestroyComponent.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeInitDestroyComponent.java deleted file mode 100644 index 6f930ef750..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeInitDestroyComponent.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Scope; - -@Scope("CONVERSATION") -public class ConversationalScopeInitDestroyComponent - extends ConversationalScopeInitOnlyComponent { - - private boolean destroyed; - - public boolean isDestroyed() { - return destroyed; - } - - @Destroy - public void destroy() { - destroyed = true; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeInitOnlyComponent.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeInitOnlyComponent.java deleted file mode 100644 index 70733f4d99..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/ConversationalScopeInitOnlyComponent.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -@Scope("CONVERSATION") -public class ConversationalScopeInitOnlyComponent - extends ConversationalScopeComponentImpl { - - private boolean initialized; - - public boolean isInitialized() { - return initialized; - } - - @Init - public void init() { - initialized = true; - } -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderException.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderException.java deleted file mode 100644 index 4bb9cde958..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderException.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -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/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedDependentPojo.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedDependentPojo.java deleted file mode 100644 index df59029884..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedDependentPojo.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -/** - * @version $$Rev$$ $$Date$$ - */ -public interface OrderedDependentPojo extends OrderedInitPojo { - - OrderedInitPojo getPojo(); - - void setPojo(OrderedInitPojo pojo); -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedDependentPojoImpl.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedDependentPojoImpl.java deleted file mode 100644 index 1b51c2772d..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedDependentPojoImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -/** - * @version $$Rev$$ $$Date$$ - */ -public class OrderedDependentPojoImpl extends OrderedInitPojoImpl implements OrderedDependentPojo { - - private OrderedInitPojo pojo; - - public OrderedInitPojo getPojo() { - return pojo; - } - - public void setPojo(OrderedInitPojo pojo) { - this.pojo = pojo; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedEagerInitPojo.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedEagerInitPojo.java deleted file mode 100644 index 139086bf0d..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedEagerInitPojo.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.EagerInit; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -@Scope("COMPOSITE") -@EagerInit -public class OrderedEagerInitPojo { - - private static final 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/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedInitPojo.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedInitPojo.java deleted file mode 100644 index 1c3615fcd0..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedInitPojo.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -/** - * @version $$Rev$$ $$Date$$ - */ -public interface OrderedInitPojo { - int getNumberInstantiated(); - - int getInitOrder(); -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedInitPojoImpl.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedInitPojoImpl.java deleted file mode 100644 index b65ead9b19..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OrderedInitPojoImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -@Scope("COMPOSITE") -public class OrderedInitPojoImpl implements OrderedInitPojo { - - private static final Object LOCK = new Object(); - private static int numberInstantied; - private int initOrder; - - public OrderedInitPojoImpl() { - } - - @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/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OtherTarget.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OtherTarget.java deleted file mode 100644 index 963c31a4ca..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OtherTarget.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -/** - * Implementations are used in wiring tests - * - * @version $Rev$ $Date$ - */ -public interface OtherTarget { - - String getString(); - - void setString(String val); -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OtherTargetImpl.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OtherTargetImpl.java deleted file mode 100644 index 91ccc9e772..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/OtherTargetImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -/** - * A target used for testing wires with a different source and target interface - * - * @version $Rev$ $Date$ - */ -public class OtherTargetImpl implements OtherTarget { - - private String theString; - - public String getString() { - return theString; - } - - public void setString(String val) { - theString = val; - } - - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeComponent.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeComponent.java deleted file mode 100644 index 7d03c4372d..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeComponent.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Scope; - -/** - * @version $Rev$ $Date$ - */ -@Scope("REQUEST") -public interface RequestScopeComponent { - -} - diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeDestroyOnlyComponent.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeDestroyOnlyComponent.java deleted file mode 100644 index f94f071086..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeDestroyOnlyComponent.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Scope; - -@Scope("REQUEST") -public class RequestScopeDestroyOnlyComponent extends SessionScopeComponentImpl { - - boolean destroyed; - - public boolean isDestroyed() { - return destroyed; - } - - @Destroy - public void destroy() { - destroyed = true; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeInitDestroyComponent.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeInitDestroyComponent.java deleted file mode 100644 index f2de2d9afa..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeInitDestroyComponent.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.Scope; - -@Scope("REQUEST") -public class RequestScopeInitDestroyComponent extends SessionScopeInitOnlyComponent { - - boolean destroyed; - - public boolean isDestroyed() { - return destroyed; - } - - @Destroy - public void destroy() { - destroyed = true; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeInitOnlyComponent.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeInitOnlyComponent.java deleted file mode 100644 index 9bcef40834..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/RequestScopeInitOnlyComponent.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Init; -import org.osoa.sca.annotations.Scope; - -@Scope("REQUEST") -public class RequestScopeInitOnlyComponent extends SessionScopeComponentImpl { - - private boolean initialized; - - public boolean isInitialized() { - return initialized; - } - - @Init - public void init() { - initialized = true; - } - - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeComponent.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeComponent.java deleted file mode 100644 index 8318333feb..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeComponent.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Scope; - -/** - * @version $Rev$ $Date$ - */ -@Scope("SESSION") -public interface SessionScopeComponent { - -} - diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeComponentImpl.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeComponentImpl.java deleted file mode 100644 index 0494d587aa..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeComponentImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Scope; - -/** - * @version $Rev$ $Date$ - */ -@Scope("SESSION") -public class SessionScopeComponentImpl implements - SessionScopeComponent { - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeInitDestroyComponent.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeInitDestroyComponent.java deleted file mode 100644 index fdc11a80af..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeInitDestroyComponent.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Destroy; - -public class SessionScopeInitDestroyComponent extends SessionScopeInitOnlyComponent { - - private boolean destroyed; - - public boolean isDestroyed() { - return destroyed; - } - - @Destroy - public void destroy() { - destroyed = true; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeInitOnlyComponent.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeInitOnlyComponent.java deleted file mode 100644 index 4e849895f8..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SessionScopeInitOnlyComponent.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Init; - -public class SessionScopeInitOnlyComponent extends SessionScopeComponentImpl { - - private boolean initialized; - - public boolean isInitialized() { - return initialized; - } - - @Init - public void init() { - initialized = true; - } - - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SimpleTarget.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SimpleTarget.java deleted file mode 100644 index 44eb94260e..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SimpleTarget.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -public interface SimpleTarget { - - String hello(String message) throws Exception; - - String goodbye(String message) throws Exception; - - String echo(String message) throws Exception; - -} - diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SimpleTargetImpl.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SimpleTargetImpl.java deleted file mode 100644 index 662b21116a..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SimpleTargetImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -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/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/Source.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/Source.java deleted file mode 100644 index aa3b5be528..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/Source.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import java.util.List; - -/** - * Implementations are used in wiring tests - * - * @version $Rev$ $Date$ - */ -public interface Source { - - Target getTarget(); - - List getTargets(); - - List getTargetsThroughField(); - -} - diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SourceImpl.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SourceImpl.java deleted file mode 100644 index 81e39a9fe9..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/SourceImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import java.util.List; - -/** - * Mock system component implementation used in wiring tests - * - * @version $Rev$ $Date$ - */ -public class SourceImpl implements Source { - - private Target target; - private List targets; - private List targetsThroughField; - private Target[] targetsArray; - - public void setTarget(Target target) { - this.target = target; - } - - public Target getTarget() { - return target; - } - - public List getTargets() { - return targets; - } - - public void setTargets(List targets) { - this.targets = targets; - } - - public List getTargetsThroughField() { - return targetsThroughField; - } - - public Target[] getArrayOfTargets() { - return targetsArray; - } - - public void setArrayOfTargets(Target[] targets) { - targetsArray = targets; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/StatelessComponent.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/StatelessComponent.java deleted file mode 100644 index 89d0be7a53..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/StatelessComponent.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -import org.osoa.sca.annotations.Scope; - -/** - * @version $Rev$ $Date$ - */ -@Scope("STATELESS") -public interface StatelessComponent { - -} - diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/StatelessComponentImpl.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/StatelessComponentImpl.java deleted file mode 100644 index 28eb28e76d..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/StatelessComponentImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -/** - * @version $Rev$ $Date$ - */ -public class StatelessComponentImpl implements - StatelessComponent { - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/Target.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/Target.java deleted file mode 100644 index 5e85ed48b0..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/Target.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -/** - * Implementations are used in wiring tests - * - * @version $Rev$ $Date$ - */ -public interface Target { - - String getString(); - - void setString(String val); -} - diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/TargetImpl.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/TargetImpl.java deleted file mode 100644 index 169b38a8d0..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/mock/component/TargetImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.mock.component; - -/** - * Mock system component implementation used in wiring tests - * - * @version $Rev$ $Date$ - */ -public class TargetImpl implements Target { - - private String theString; - - public String getString() { - return theString; - } - - public void setString(String val) { - theString = val; - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainerTestCase.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainerTestCase.java deleted file mode 100644 index 5be8fe21b3..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/scope/AbstractScopeContainerTestCase.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.scope; - -import java.net.URI; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.scope.InstanceWrapper; -import org.apache.tuscany.sca.scope.ScopeContainer; -import org.apache.tuscany.sca.scope.ScopedImplementationProvider; -import org.easymock.EasyMock; -import org.easymock.IMocksControl; - -/** - * @version $Rev$ $Date$ - */ -public abstract class AbstractScopeContainerTestCase extends TestCase { - protected IMocksControl control; - protected ScopeContainer scopeContainer; - protected URI groupId; - protected KEY contextId; - protected RuntimeComponent component; - protected ScopedImplementation implementation; - protected InstanceWrapper wrapper; - - @SuppressWarnings("unchecked") - protected void setUp() throws Exception { - super.setUp(); - control = EasyMock.createStrictControl(); - component = control.createMock(RuntimeComponent.class); - wrapper = control.createMock(InstanceWrapper.class); - implementation = control.createMock(ScopedImplementation.class); - EasyMock.expect(component.getImplementation()).andReturn(implementation).anyTimes(); - } - - protected void preRegisterComponent() throws Exception { - scopeContainer.start(); - EasyMock.expect(implementation.isEagerInit()).andStubReturn(false); - } - - protected void expectCreateWrapper() throws Exception { - EasyMock.expect(implementation.createInstanceWrapper()).andReturn(wrapper); - wrapper.start(); - } - - protected static interface ScopedImplementation extends ScopedImplementationProvider, Implementation { - - } - - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/store/MemoryStoreTestCase.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/store/MemoryStoreTestCase.java deleted file mode 100644 index 2f5c182f45..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/store/MemoryStoreTestCase.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.store; - -import java.util.UUID; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.event.RuntimeEventListener; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.store.DuplicateRecordException; -import org.apache.tuscany.sca.store.Store; -import org.apache.tuscany.sca.store.StoreExpirationEvent; -import org.apache.tuscany.sca.store.StoreMonitor; -import org.easymock.EasyMock; -import org.easymock.IAnswer; - -/** - * @version $Rev$ $Date$ - */ -public class MemoryStoreTestCase extends TestCase { - private StoreMonitor monitor; - - public void testEviction() throws Exception { - MemoryStore store = new MemoryStore(monitor); - store.setReaperInterval(10); - store.init(); - RuntimeComponent component = EasyMock.createNiceMock(RuntimeComponent.class); - EasyMock.replay(component); - String id = UUID.randomUUID().toString(); - Object value = new Object(); - store.insertRecord(component, id, value, 1); - Thread.sleep(200); - assertNull(store.readRecord(component, id)); - store.destroy(); - } - - public void testNotifyOnEviction() throws Exception { - final CountDownLatch latch = new CountDownLatch(1); - RuntimeEventListener listener = EasyMock.createMock(RuntimeEventListener.class); - listener.onEvent(EasyMock.isA(StoreExpirationEvent.class)); - EasyMock.expectLastCall().andStubAnswer(new IAnswer() { - public Object answer() throws Throwable { - latch.countDown(); - return null; - } - }); - EasyMock.replay(listener); - MemoryStore store = new MemoryStore(monitor); - store.addListener(listener); - store.setReaperInterval(10); - store.init(); - RuntimeComponent component = EasyMock.createNiceMock(RuntimeComponent.class); - EasyMock.replay(component); - String id = UUID.randomUUID().toString(); - Object value = new Object(); - store.insertRecord(component, id, value, 1); - if (!latch.await(1000, TimeUnit.MILLISECONDS)) { - // failed to notify listener - fail(); - } - EasyMock.verify(listener); - } - - public void testNoEviction() throws Exception { - MemoryStore store = new MemoryStore(monitor); - store.setReaperInterval(10); - store.init(); - RuntimeComponent component = EasyMock.createNiceMock(RuntimeComponent.class); - EasyMock.replay(component); - String id = UUID.randomUUID().toString(); - Object value = new Object(); - store.insertRecord(component, id, value, Store.NEVER); - Thread.sleep(100); - assertNotNull(store.readRecord(component, id)); - store.destroy(); - } - - public void testInsertRecord() throws Exception { - MemoryStore store = new MemoryStore(monitor); - store.setReaperInterval(10); - store.init(); - RuntimeComponent component = EasyMock.createNiceMock(RuntimeComponent.class); - EasyMock.replay(component); - String id = UUID.randomUUID().toString(); - Object value = new Object(); - store.insertRecord(component, id, value, Store.NEVER); - store.destroy(); - } - - public void testInsertAlreadyExists() throws Exception { - MemoryStore store = new MemoryStore(monitor); - store.setReaperInterval(10); - store.init(); - RuntimeComponent component = EasyMock.createMock(RuntimeComponent.class); - EasyMock.expect(component.getURI()).andReturn("component"); - EasyMock.replay(component); - String id = UUID.randomUUID().toString(); - Object value = new Object(); - store.insertRecord(component, id, value, Store.NEVER); - try { - store.insertRecord(component, id, value, Store.NEVER); - fail(); - } catch (DuplicateRecordException e) { - //expected - } - store.destroy(); - } - - public void testUpdateRecord() throws Exception { - MemoryStore store = new MemoryStore(monitor); - store.setReaperInterval(10); - store.init(); - RuntimeComponent component = EasyMock.createNiceMock(RuntimeComponent.class); - EasyMock.replay(component); - String id = UUID.randomUUID().toString(); - Object value = new Object(); - Object newValue = new Object(); - - store.insertRecord(component, id, value, Store.NEVER); - store.updateRecord(component, id, newValue, 1L); - assertEquals(newValue, store.readRecord(component, id)); - store.destroy(); - } - - public void testDeleteRecord() throws Exception { - MemoryStore store = new MemoryStore(monitor); - store.setReaperInterval(10); - store.init(); - RuntimeComponent component = EasyMock.createNiceMock(RuntimeComponent.class); - EasyMock.replay(component); - String id = UUID.randomUUID().toString(); - Object value = new Object(); - - store.insertRecord(component, id, value, Store.NEVER); - store.removeRecord(component, id); - assertNull(store.readRecord(component, id)); - store.destroy(); - } - - protected void setUp() throws Exception { - super.setUp(); - monitor = EasyMock.createNiceMock(StoreMonitor.class); - EasyMock.replay(monitor); - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/CallbackInterfaceInterceptorTestCase.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/CallbackInterfaceInterceptorTestCase.java deleted file mode 100644 index 58503fd852..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/CallbackInterfaceInterceptorTestCase.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.wire; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.core.invocation.CallbackInterfaceInterceptor; -import org.apache.tuscany.sca.core.invocation.MessageFactoryImpl; -import org.apache.tuscany.sca.invocation.Interceptor; -import org.apache.tuscany.sca.invocation.Message; -import org.easymock.EasyMock; -import org.osoa.sca.NoRegisteredCallbackException; - -/** - * @version $Rev$ $Date$ - */ -public class CallbackInterfaceInterceptorTestCase extends TestCase { - - public void testImplements() { - CallbackInterfaceInterceptor interceptor = new CallbackInterfaceInterceptor(true); - Interceptor next = EasyMock.createMock(Interceptor.class); - EasyMock.expect(next.invoke(EasyMock.isA(Message.class))).andReturn(null); - EasyMock.replay(next); - interceptor.setNext(next); - interceptor.invoke(new MessageFactoryImpl().createMessage()); - EasyMock.verify(next); - } - - public void testDoesNotImplement() { - CallbackInterfaceInterceptor interceptor = new CallbackInterfaceInterceptor(false); - try { - interceptor.invoke(new MessageFactoryImpl().createMessage()); - fail(); - } catch (NoRegisteredCallbackException e) { - // expected - } - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/InvocationChainImplTestCase.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/InvocationChainImplTestCase.java deleted file mode 100644 index 83f7bdd887..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/InvocationChainImplTestCase.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.wire; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.core.invocation.InvocationChainImpl; -import org.apache.tuscany.sca.interfacedef.impl.OperationImpl; -import org.apache.tuscany.sca.invocation.Interceptor; -import org.apache.tuscany.sca.invocation.InvocationChain; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.Message; - -/** - * @version $Rev$ $Date$ - */ -public class InvocationChainImplTestCase extends TestCase { - - public void testInsertAtEnd() throws Exception { - InvocationChain chain = new InvocationChainImpl(new OperationImpl("foo")); - Interceptor inter2 = new MockInterceptor(); - Interceptor inter1 = new MockInterceptor(); - chain.addInterceptor(inter1); - chain.addInterceptor(inter2); - Interceptor head = (Interceptor)chain.getHeadInvoker(); - assertEquals(inter1, head); - assertEquals(inter2, head.getNext()); - assertEquals(inter2, chain.getTailInvoker()); - - } - - private class MockInterceptor implements Interceptor { - - private Invoker next; - - public Message invoke(Message msg) { - return null; - } - - public void setNext(Invoker next) { - this.next = next; - } - - public Invoker getNext() { - return next; - } - - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/NonBlockingInterceptorTestCase.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/NonBlockingInterceptorTestCase.java deleted file mode 100644 index c5f93edeb6..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/core/wire/NonBlockingInterceptorTestCase.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.core.wire; - -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.expectLastCall; -import static org.easymock.EasyMock.getCurrentArguments; -import static org.easymock.EasyMock.isA; -import static org.easymock.EasyMock.replay; -import static org.easymock.EasyMock.verify; -import junit.framework.TestCase; - -import org.apache.tuscany.sca.core.invocation.NonBlockingInterceptor; -import org.apache.tuscany.sca.core.invocation.ThreadMessageContext; -import org.apache.tuscany.sca.invocation.Interceptor; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.work.WorkScheduler; -import org.easymock.EasyMock; -import org.easymock.IAnswer; - -/** - * @version $Rev$ $Date$ - */ -public class NonBlockingInterceptorTestCase extends TestCase { - - public void testInvoke() throws Exception { - WorkScheduler scheduler = createMock(WorkScheduler.class); - scheduler.scheduleWork(isA(Runnable.class)); - expectLastCall().andStubAnswer(new IAnswer() { - public Object answer() throws Throwable { - Runnable runnable = (Runnable) getCurrentArguments()[0]; - runnable.run(); - return null; - } - }); - replay(scheduler); - Message context = createMock(Message.class); - String convID = "convID"; - EasyMock.expect(context.getConversationID()).andReturn(convID); - EasyMock.replay(context); - ThreadMessageContext.setMessageContext(context); - Message msg = createMock(Message.class); - msg.setCorrelationID(null); - msg.setConversationID(convID); - Interceptor next = EasyMock.createMock(Interceptor.class); - EasyMock.expect(next.invoke(EasyMock.eq(msg))).andReturn(msg); - EasyMock.replay(next); - EasyMock.replay(msg); - Interceptor interceptor = new NonBlockingInterceptor(scheduler, next); - interceptor.invoke(msg); - verify(context); - verify(next); - verify(msg); - } - -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/factory/AssertionTestCase.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/factory/AssertionTestCase.java deleted file mode 100644 index 77d0e01dc9..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/factory/AssertionTestCase.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.factory; - -import junit.framework.TestCase; - -/** - * @version $Rev$ $Date$ - */ -public class AssertionTestCase extends TestCase { - /** - * test case that confirms that JRE assertions are enabled - */ - public void testAssertionsAreEnabled() { - try { - assert false; - fail("assertions are not enabled"); - } catch (AssertionError e) { - // ok - } - } -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/factory/SingletonObjectFactoryTestCase.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/factory/SingletonObjectFactoryTestCase.java deleted file mode 100644 index 4d38c447ea..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/factory/SingletonObjectFactoryTestCase.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.factory; - -import junit.framework.TestCase; - -/** - * @version $Rev$ $Date$ - */ -public class SingletonObjectFactoryTestCase extends TestCase { - - public void testSingleton() throws Exception { - Object o = new Object(); - SingletonObjectFactory factory = new SingletonObjectFactory(o); - assertEquals(o, factory.getInstance()); - } -} diff --git a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java b/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java deleted file mode 100644 index 1b95c6ff63..0000000000 --- a/branches/sca-java-0.90/modules/core/src/test/java/org/apache/tuscany/sca/scope/ScopeTestCase.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.scope; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.scope.Scope; - -/** - * @version $Rev$ $Date$ - */ -public class ScopeTestCase extends TestCase { - - public void testEquals() throws Exception { - Scope scope = new Scope("COMPOSITE"); - assertTrue(scope.equals(Scope.COMPOSITE)); - } - - public void testEqualsNew() throws Exception { - Scope foo = new Scope("foo"); - Scope foo2 = new Scope("FOO"); - assertTrue(foo.equals(foo2)); - } - - public void testNotEquals() throws Exception { - Scope foo = new Scope("BAR"); - Scope foo2 = new Scope("FOO"); - assertFalse(foo.equals(foo2)); - } - - public void testNotEqualsDifferent() throws Exception { - Scope foo = new Scope("FOO"); - assertFalse(foo.equals(new Bar("FOO"))); - } - - public class Bar { - String scope; - - public Bar(String scope) { - this.scope = scope; - } - } - - -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/.ruleset b/branches/sca-java-0.90/modules/databinding-axiom/.ruleset deleted file mode 100644 index 27b9ab847c..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/.ruleset +++ /dev/null @@ -1,191 +0,0 @@ - - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding-axiom/DISCLAIMER b/branches/sca-java-0.90/modules/databinding-axiom/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/databinding-axiom/LICENSE b/branches/sca-java-0.90/modules/databinding-axiom/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/databinding-axiom/NOTICE b/branches/sca-java-0.90/modules/databinding-axiom/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/databinding-axiom/pom.xml b/branches/sca-java-0.90/modules/databinding-axiom/pom.xml deleted file mode 100755 index 923778d29f..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/pom.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - tuscany-databinding-axiom - Apache Tuscany Data Binding for Axiom - - - - org.apache.tuscany.sca - tuscany-core-spi - 0.90-incubating-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-databinding - 0.90-incubating-SNAPSHOT - - - - stax - stax-api - 1.0.1 - - - - org.apache.ws.commons.axiom - axiom-api - - - xerces - xercesImpl - - - 1.2.4 - - - - xerces - xercesImpl - 2.8.1 - runtime - - - - org.apache.ws.commons.axiom - axiom-impl - 1.2.4 - runtime - - - - commons-logging - commons-logging - 1.1 - runtime - - - - org.codehaus.woodstox - wstx-asl - 3.2.0 - runtime - - - - - diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java deleted file mode 100644 index 72fc90d187..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.axiom; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.sca.databinding.ExceptionHandler; -import org.apache.tuscany.sca.databinding.WrapperHandler; -import org.apache.tuscany.sca.databinding.impl.BaseDataBinding; - -/** - * DataBinding for AXIOM - */ -public class AxiomDataBinding extends BaseDataBinding { - - public static final String NAME = OMElement.class.getName(); - public static final String[] ALIASES = new String[] {"axiom"}; - - public AxiomDataBinding() { - super(NAME, ALIASES, OMElement.class); - } - - /** - * @see org.apache.tuscany.sca.databinding.impl.BaseDataBinding#getWrapperHandler() - */ - @Override - public WrapperHandler getWrapperHandler() { - return new OMElementWrapperHandler(); - } - - public Object copy(Object source) { - if ( OMElement.class.isAssignableFrom(source.getClass()) ) { - try { - OMElement sourceElement = (OMElement)source; - return sourceElement.cloneOMElement(); - } catch ( Exception e ) { - throw new IllegalArgumentException(e); - } - } - return super.copy(source); - } - - @Override - public ExceptionHandler getExceptionHandler() { - return new AxiomExceptionHandler(); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomExceptionHandler.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomExceptionHandler.java deleted file mode 100644 index dd4553fc6a..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomExceptionHandler.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.axiom; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.sca.databinding.ExceptionHandler; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.FaultException; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -/** - * AXIOM implementation of ExceptionHandler - * - * @version $Rev$ $Date$ - */ -public class AxiomExceptionHandler implements ExceptionHandler { - - public Exception createException(DataType exceptionType, String message, Object faultInfo, Throwable cause) { - return new FaultException(message, (OMElement)faultInfo, cause); - } - - public Object getFaultInfo(Exception exception) { - if (exception == null) { - return null; - } - FaultException faultException = (FaultException)exception; - return faultException.getFaultInfo(); - - } - - public DataType getFaultType(DataType exceptionType) { - if (FaultException.class == exceptionType.getPhysical()) { - XMLType type = XMLType.UNKNOWN; - if(exceptionType.getLogical() instanceof XMLType) { - type = (XMLType) exceptionType.getLogical(); - } - DataType faultType = new DataTypeImpl(AxiomDataBinding.NAME, OMElement.class, type); - return faultType; - } else { - return null; - } - } -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java deleted file mode 100644 index 28141cd144..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.axiom; - -import javax.xml.namespace.QName; - -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.OMFactory; -import org.apache.axiom.om.OMNamespace; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -/** - * Helper for AXIOM - * - * @version $Rev$ $Date$ - */ -public class AxiomHelper { - - private AxiomHelper() { - } - - /** - * @param context - * @param element - */ - public static void adjustElementName(TransformationContext context, OMElement element) { - if (context != null) { - DataType dataType = context.getTargetDataType(); - Object logical = dataType == null ? null : dataType.getLogical(); - if (!(logical instanceof XMLType)) { - return; - } - XMLType xmlType = (XMLType)logical; - if (xmlType.isElement() && !xmlType.getElementName().equals(element.getQName())) { - // TODO: Throw expection or switch to the new Element - OMFactory factory = OMAbstractFactory.getOMFactory(); - QName name = xmlType.getElementName(); - OMNamespace namespace = factory.createOMNamespace(name.getNamespaceURI(), name.getPrefix()); - element.setNamespace(namespace); - element.setLocalName(name.getLocalPart()); - } - } - } -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Object.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Object.java deleted file mode 100644 index 4d2bc2b4d6..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Object.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.axiom; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.sca.databinding.impl.SimpleType2JavaTransformer; - -/** - * Transformer to convert data from a simple java bject to OMElement - */ -public class OMElement2Object extends SimpleType2JavaTransformer { - - @Override - protected String getText(OMElement source) { - return source.getText(); - } - - public Class getSourceType() { - return OMElement.class; - } -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2String.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2String.java deleted file mode 100755 index 3eb5878de3..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2String.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.axiom; - -import java.io.StringWriter; - -import javax.xml.stream.XMLStreamException; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -/** - * Transformer to convert data from an OMElement to XML String - */ -public class OMElement2String extends BaseTransformer implements PullTransformer { - // private XmlOptions options; - - public String transform(OMElement source, TransformationContext context) { - try { - StringWriter writer = new StringWriter(); - source.serialize(writer); - return writer.toString(); - } catch (XMLStreamException e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return OMElement.class; - } - - public Class getTargetType() { - return String.class; - } - - public int getWeight() { - return 40; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2XMLStreamReader.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2XMLStreamReader.java deleted file mode 100755 index c72bee62e2..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2XMLStreamReader.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.axiom; - -import javax.xml.stream.XMLStreamReader; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -public class OMElement2XMLStreamReader extends BaseTransformer implements PullTransformer { - // private XmlOptions options; - - public XMLStreamReader transform(OMElement source, TransformationContext context) { - return source.getXMLStreamReader(); - } - - public Class getSourceType() { - return OMElement.class; - } - - public Class getTargetType() { - return XMLStreamReader.class; - } - - public int getWeight() { - return 10; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java deleted file mode 100644 index 91d00c4c79..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElementWrapperHandler.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.axiom; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.OMFactory; -import org.apache.axiom.om.OMNamespace; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.WrapperHandler; -import org.apache.tuscany.sca.interfacedef.util.ElementInfo; - -/** - * OMElement wrapper handler implementation - */ -public class OMElementWrapperHandler implements WrapperHandler { - - private OMFactory factory; - - public OMElementWrapperHandler() { - super(); - this.factory = OMAbstractFactory.getOMFactory(); - } - - public OMElement create(ElementInfo element, TransformationContext context) { - OMElement wrapper = factory.createOMElement(element.getQName(), null); - return wrapper; - } - - public void setChild(OMElement wrapper, int i, ElementInfo childElement, Object value) { - OMElement element = (OMElement)value; - QName elementName = childElement.getQName(); - OMNamespace namespace = factory.createOMNamespace(elementName.getNamespaceURI(), elementName.getPrefix()); - element.setNamespace(namespace); - element.setLocalName(childElement.getQName().getLocalPart()); - wrapper.addChild((OMElement)value); - } - - public List getChildren(OMElement wrapper) { - List elements = new ArrayList(); - for (Iterator i = wrapper.getChildElements(); i.hasNext();) { - elements.add(i.next()); - } - return elements; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Object2OMElement.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Object2OMElement.java deleted file mode 100644 index 50ac0ecae6..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Object2OMElement.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.axiom; - -import javax.xml.namespace.QName; - -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.OMFactory; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.impl.Java2SimpleTypeTransformer; - -/** - * Transformer to convert data from an simple OMElement to Java Object - */ -public class Object2OMElement extends Java2SimpleTypeTransformer { - - private OMFactory factory; - - public Object2OMElement() { - super(); - factory = OMAbstractFactory.getOMFactory(); - } - - protected OMElement createElement(QName element, String text, TransformationContext context) { - OMElement omElement = factory.createOMElement(element, null); - factory.createOMText(omElement, text); - return omElement; - } - - @Override - public Class getTargetType() { - return OMElement.class; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/String2OMElement.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/String2OMElement.java deleted file mode 100755 index b2549029f2..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/String2OMElement.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.axiom; - -import java.io.ByteArrayInputStream; - -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.impl.builder.StAXOMBuilder; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -public class String2OMElement extends BaseTransformer implements - PullTransformer { - - @SuppressWarnings("unchecked") - public OMElement transform(String source, TransformationContext context) { - try { - StAXOMBuilder builder = new StAXOMBuilder(new ByteArrayInputStream(source.getBytes())); - OMElement element = builder.getDocumentElement(); - AxiomHelper.adjustElementName(context, element); - return element; - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getTargetType() { - return OMElement.class; - } - - public Class getSourceType() { - return String.class; - } - - public int getWeight() { - return 40; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/XMLStreamReader2OMElement.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/XMLStreamReader2OMElement.java deleted file mode 100755 index ffb31aae0b..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/XMLStreamReader2OMElement.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.axiom; - -import javax.xml.stream.XMLStreamReader; - -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.impl.builder.StAXOMBuilder; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -public class XMLStreamReader2OMElement extends BaseTransformer implements - PullTransformer { - - public XMLStreamReader2OMElement() { - super(); - } - - public OMElement transform(XMLStreamReader source, TransformationContext context) { - try { - StAXOMBuilder builder = new StAXOMBuilder(source); - OMElement element = builder.getDocumentElement(); - AxiomHelper.adjustElementName(context, element); - return element; - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getTargetType() { - return OMElement.class; - } - - public Class getSourceType() { - return XMLStreamReader.class; - } - - public int getWeight() { - return 10; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/module/AxiomDataBindingModuleActivator.java b/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/module/AxiomDataBindingModuleActivator.java deleted file mode 100644 index 8dd3cb0f51..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/module/AxiomDataBindingModuleActivator.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.axiom.module; - -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.ModuleActivator; -import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; -import org.apache.tuscany.sca.databinding.TransformerExtensionPoint; -import org.apache.tuscany.sca.databinding.axiom.AxiomDataBinding; -import org.apache.tuscany.sca.databinding.axiom.OMElement2Object; -import org.apache.tuscany.sca.databinding.axiom.OMElement2String; -import org.apache.tuscany.sca.databinding.axiom.OMElement2XMLStreamReader; -import org.apache.tuscany.sca.databinding.axiom.Object2OMElement; -import org.apache.tuscany.sca.databinding.axiom.String2OMElement; -import org.apache.tuscany.sca.databinding.axiom.XMLStreamReader2OMElement; - -/** - * Module activator for AXIOM databinding - * - * @version $Rev$ $Date$ - */ -public class AxiomDataBindingModuleActivator implements ModuleActivator { - - public Object[] getExtensionPoints() { - return null; - } - - public void start(ExtensionPointRegistry registry) { - DataBindingExtensionPoint dataBindings = registry.getExtensionPoint(DataBindingExtensionPoint.class); - dataBindings.addDataBinding(new AxiomDataBinding()); - - TransformerExtensionPoint transformers = registry.getExtensionPoint(TransformerExtensionPoint.class); - transformers.addTransformer(new Object2OMElement()); - transformers.addTransformer(new OMElement2Object()); - transformers.addTransformer(new OMElement2String()); - transformers.addTransformer(new OMElement2XMLStreamReader()); - transformers.addTransformer(new String2OMElement()); - transformers.addTransformer(new XMLStreamReader2OMElement()); - } - - public void stop(ExtensionPointRegistry registry) { - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-java-0.90/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator deleted file mode 100644 index 394d11304d..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# Implementation class for the ExtensionActivator -org.apache.tuscany.sca.databinding.axiom.module.AxiomDataBindingModuleActivator \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/test/java/org/apache/tuscany/sca/databinding/axiom/AxiomExceptionHandlerTestCase.java b/branches/sca-java-0.90/modules/databinding-axiom/src/test/java/org/apache/tuscany/sca/databinding/axiom/AxiomExceptionHandlerTestCase.java deleted file mode 100644 index d75d729294..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/test/java/org/apache/tuscany/sca/databinding/axiom/AxiomExceptionHandlerTestCase.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.axiom; - -import java.io.StringReader; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.impl.builder.StAXOMBuilder; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.FaultException; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -/** - * Test case for SDOExceptionHandler - */ -public class AxiomExceptionHandlerTestCase extends TestCase { - private static final String IPO_XML = - "" + "" - + " " - + " Helen Zoe" - + " 47 Eden Street" - + " Cambridge" - + " CB1 1JR" - + " " - + " " - + " Robert Smith" - + " 8 Oak Avenue" - + " Old Town" - + " PA" - + " 95819" - + " " - + " " - + " " - + " Lapis necklace" - + " 1" - + " 99.95" - + " Want this for the holidays" - + " 1999-12-05" - + " " - + " " - + ""; - - private AxiomExceptionHandler handler; - private OMElement faultElement; - - /** - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - this.handler = new AxiomExceptionHandler(); - XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(IPO_XML)); - StAXOMBuilder builder = new StAXOMBuilder(reader); - faultElement = builder.getDocumentElement(); - } - - public void testGetFaultType() { - DataType dataType = handler.getFaultType(new DataTypeImpl(FaultException.class, null)); - assertEquals(OMElement.class, dataType.getPhysical()); - assertEquals(XMLType.UNKNOWN, dataType.getLogical()); - assertEquals(AxiomDataBinding.NAME, dataType.getDataBinding()); - dataType = handler.getFaultType(new DataTypeImpl(Exception.class, null)); - assertNull(dataType); - } - - public void testCreate() { - - Exception ex = handler.createException(null, "Order", faultElement, null); - assertTrue(ex instanceof FaultException); - FaultException exception = (FaultException)ex; - assertEquals("Order", exception.getMessage()); - assertSame(faultElement, exception.getFaultInfo()); - } - - public void testGetFaultInfo() { - FaultException exception = new FaultException("Order", faultElement, null); - Object faultInfo = handler.getFaultInfo(exception); - assertSame(faultElement, faultInfo); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/test/java/org/apache/tuscany/sca/databinding/axiom/OMElementTestCase.java b/branches/sca-java-0.90/modules/databinding-axiom/src/test/java/org/apache/tuscany/sca/databinding/axiom/OMElementTestCase.java deleted file mode 100755 index 7c04a98859..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/test/java/org/apache/tuscany/sca/databinding/axiom/OMElementTestCase.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.axiom; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.axiom.om.OMElement; - -public class OMElementTestCase extends TestCase { - private static final String IPO_XML = - "" + "" - + " " - + " Helen Zoe" - + " 47 Eden Street" - + " Cambridge" - + " CB1 1JR" - + " " - + " " - + " Robert Smith" - + " 8 Oak Avenue" - + " Old Town" - + " PA" - + " 95819" - + " " - + " " - + " " - + " Lapis necklace" - + " 1" - + " 99.95" - + " Want this for the holidays" - + " 1999-12-05" - + " " - + " " - + ""; - - public final void testStringTransform() { - String2OMElement t1 = new String2OMElement(); - OMElement element = t1.transform(IPO_XML, null); - OMElement2String t2 = new OMElement2String(); - String xml = t2.transform(element, null); - Assert.assertNotNull(xml); - Assert.assertNotNull(xml.indexOf("") != -1); - } - - public final void testStringTransform2() { - String str = - "Robert"; - String2OMElement t1 = new String2OMElement(); - OMElement element = t1.transform(str, null); - OMElement2String t2 = new OMElement2String(); - String xml = t2.transform(element, null); - Assert.assertNotNull(xml); - Assert.assertNotNull(xml.indexOf("") != -1); - } - - public final void testStAXTransform() { - String2OMElement t1 = new String2OMElement(); - OMElement element = t1.transform(IPO_XML, null); - - OMElement2XMLStreamReader t2 = new OMElement2XMLStreamReader(); - XMLStreamReader reader = t2.transform(element, null); - - XMLStreamReader2OMElement t3 = new XMLStreamReader2OMElement(); - OMElement element2 = t3.transform(reader, null); - - Assert.assertEquals(element2.getQName(), element.getQName()); - Assert.assertEquals(new QName("http://www.example.com/IPO", "purchaseOrder"), element2.getQName()); - } - - public final void testCopy() { - String2OMElement t1 = new String2OMElement(); - OMElement element = t1.transform(IPO_XML, null); - OMElement copy = (OMElement)new AxiomDataBinding().copy(element); - assertNotSame(element, copy); - assertEquals(new QName("http://www.example.com/IPO", "purchaseOrder"), copy.getQName()); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/test/resources/ipo.xml b/branches/sca-java-0.90/modules/databinding-axiom/src/test/resources/ipo.xml deleted file mode 100755 index df901d183d..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/test/resources/ipo.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - Helen Zoe - 47 Eden Street - Cambridge - CB1 1JR - - - - Robert Smith - 8 Oak Avenue - Old Town - PA - 95819 - - - - - Lapis necklace - 1 - 99.95 - Want this for the holidays - 1999-12-05 - - - - diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/test/resources/ipo.xsd b/branches/sca-java-0.90/modules/databinding-axiom/src/test/resources/ipo.xsd deleted file mode 100755 index af1e73172d..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/test/resources/ipo.xsd +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - International Purchase order schema for Example.com - Copyright 2000 Example.com. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding-axiom/src/test/resources/order.wsdl b/branches/sca-java-0.90/modules/databinding-axiom/src/test/resources/order.wsdl deleted file mode 100644 index a5ead60382..0000000000 --- a/branches/sca-java-0.90/modules/databinding-axiom/src/test/resources/order.wsdl +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/.ruleset b/branches/sca-java-0.90/modules/databinding-jaxb/.ruleset deleted file mode 100644 index 27b9ab847c..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/.ruleset +++ /dev/null @@ -1,191 +0,0 @@ - - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/DISCLAIMER b/branches/sca-java-0.90/modules/databinding-jaxb/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/LICENSE b/branches/sca-java-0.90/modules/databinding-jaxb/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/NOTICE b/branches/sca-java-0.90/modules/databinding-jaxb/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/pom.xml b/branches/sca-java-0.90/modules/databinding-jaxb/pom.xml deleted file mode 100755 index aebff2bd7e..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/pom.xml +++ /dev/null @@ -1,147 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - tuscany-databinding-jaxb - Apache Tuscany Data Binding for JAXB - - - - org.apache.tuscany.sca - tuscany-core-spi - 0.90-incubating-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-databinding - 0.90-incubating-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-interface-java-xml - 0.90-incubating-SNAPSHOT - - - javax.xml.bind - jaxb-api - 2.0 - - - - javax.xml.ws - jaxws-api - - 2.1 - - - - com.sun.xml.bind - jaxb-impl - 2.0.5 - runtime - - - - javax.xml.bind - jsr173_api - - - - - - - - - true - - java.net - java.net Maven 1.x Repository - https://maven-repository.dev.java.net/nonav/repository - legacy - - - - - - - true - - java.net - java.net Maven 1.x Repository - https://maven-repository.dev.java.net/repository - legacy - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.0 - - - add-test-source - generate-sources - - add-test-source - - - - target/jaxb-source - - - - - - - - com.sun.tools.xjc.maven2 - maven-jaxb-plugin - 1.1 - - - generate-jaxb - generate-sources - - generate - - - - - com.example.ipo.jaxb - ${project.build.directory}/jaxb-source - ${basedir}/src/test/resources - - ipo.xsd - - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2Node.java b/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2Node.java deleted file mode 100755 index c1d3c36076..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXB2Node.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.jaxb; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.Marshaller; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sca.databinding.impl.DOMHelper; -import org.w3c.dom.Document; -import org.w3c.dom.Node; - -public class JAXB2Node extends BaseTransformer implements PullTransformer { - - public Node transform(Object source, TransformationContext tContext) { - if (source == null) { - return null; - } - try { - JAXBContext context = JAXBContextHelper.createJAXBContext(tContext, true); - Marshaller marshaller = context.createMarshaller(); - // FIXME: The default Marshaller doesn't support - // marshaller.getNode() - Document document = DOMHelper.newDocument(); - JAXBElement jaxbElement = JAXBContextHelper.createJAXBElement(tContext.getSourceDataType(), source); - marshaller.marshal(jaxbElement, document); - return document; - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return Object.class; - } - - public Class getTargetType() { - return Node.class; - } - - public int getWeight() { - return 30; - } - - @Override - public String getSourceDataBinding() { - return JAXBDataBinding.NAME; - } -} diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java b/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java deleted file mode 100644 index 93a7a5da0f..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBContextHelper.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.jaxb; - -import java.beans.Introspector; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.JAXBException; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchema; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -public class JAXBContextHelper { - // TODO: Do we need to set them for source and target? - public static final String JAXB_CLASSES = "jaxb.classes"; - - public static final String JAXB_CONTEXT_PATH = "jaxb.contextPath"; - - private JAXBContextHelper() { - } - - public static JAXBContext createJAXBContext(TransformationContext tContext, boolean source) throws JAXBException { - if (tContext == null) - throw new TransformationException("JAXB context is not set for the transformation."); - - DataType bindingContext = source ? tContext.getSourceDataType() : tContext.getTargetDataType(); - // FIXME: We should check the context path or classes - // FIXME: What should we do if JAXB is an intermediate node? - - String contextPath = null; - JAXBContext context = null; - Class cls = bindingContext.getPhysical(); - if (cls.getPackage() != null) { - contextPath = cls.getPackage().getName(); - context = JAXBContext.newInstance(contextPath); - } - if (context == null) { - throw new TransformationException("JAXB context is not set for the transformation."); - } - return context; - } - - @SuppressWarnings("unchecked") - public static JAXBElement createJAXBElement(DataType dataType, Object value) { - if (value instanceof JAXBElement) { - return (JAXBElement)value; - } else { - Class type = (Class)dataType.getPhysical(); - Object logical = dataType.getLogical(); - QName elementName = JAXBDataBinding.ROOT_ELEMENT; - if (logical instanceof XMLType) { - XMLType xmlType = (XMLType)logical; - QName element = xmlType.getElementName(); - if (element != null) { - elementName = element; - } else { - /** - * Set the declared type to Object.class so that xsi:type - * will be produced - */ - type = Object.class; - } - } else { - type = Object.class; - } - return new JAXBElement(elementName, type, value); - } - } - - @SuppressWarnings("unchecked") - public static Object createReturnValue(DataType dataType, Object value) { - Class cls = getJavaType(dataType); - if (cls == JAXBElement.class) { - return createJAXBElement(dataType, value); - } else { - if (value instanceof JAXBElement) { - return ((JAXBElement)value).getValue(); - } else { - return value; - } - } - } - - public static Class getJavaType(DataType dataType) { - if (dataType == null) { - return null; - } - Type type = dataType.getPhysical(); - if (type instanceof Class) { - Class cls = (Class)type; - if (JAXBElement.class.isAssignableFrom(cls)) { - return null; - } else { - return cls; - } - } else if (type instanceof ParameterizedType) { - ParameterizedType pType = (ParameterizedType)type; - return (Class)pType.getRawType(); - } - return null; - } - - public static XMLType getXmlTypeName(Class javaType) { - String namespace = null; - String name = null; - Package pkg = javaType.getPackage(); - if (pkg != null) { - XmlSchema schema = pkg.getAnnotation(XmlSchema.class); - if (schema != null) { - namespace = schema.namespace(); - } - } - XmlType type = javaType.getAnnotation(XmlType.class); - if (type != null) { - String typeNamespace = type.namespace(); - String typeName = type.name(); - - if (typeNamespace.equals("##default") && typeName.equals("")) { - XmlRootElement rootElement = javaType.getAnnotation(XmlRootElement.class); - if (rootElement != null) { - namespace = rootElement.namespace(); - } else { - // FIXME: The namespace should be from the referencing - // property - namespace = null; - } - } else if (typeNamespace.equals("##default")) { - // namespace is from the package - } else { - namespace = typeNamespace; - } - - if (typeName.equals("##default")) { - name = Introspector.decapitalize(javaType.getSimpleName()); - } else { - name = typeName; - } - } else { - XmlEnum xmlEnum = javaType.getAnnotation(XmlEnum.class); - if (xmlEnum != null) { - name = Introspector.decapitalize(javaType.getSimpleName()); - } - } - if (name == null) { - return null; - } - return new XMLType(null, new QName(namespace, name)); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBinding.java b/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBinding.java deleted file mode 100644 index 9706ffdc21..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBDataBinding.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.jaxb; - -import java.lang.annotation.Annotation; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBElement; -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.databinding.ExceptionHandler; -import org.apache.tuscany.sca.databinding.impl.BaseDataBinding; -import org.apache.tuscany.sca.databinding.impl.DOMHelper; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.util.XMLType; -import org.w3c.dom.Document; - -/** - * JAXB DataBinding - */ -public class JAXBDataBinding extends BaseDataBinding { - public static final String NAME = JAXBElement.class.getName(); - public static final String[] ALIASES = new String[] {"jaxb"}; - - public static final String ROOT_NAMESPACE = "http://tuscany.apache.org/xmlns/sca/databinding/jaxb/1.0"; - public static final QName ROOT_ELEMENT = new QName(ROOT_NAMESPACE, "root"); - - public JAXBDataBinding() { - super(NAME, ALIASES, JAXBElement.class); - } - - @Override - public boolean introspect(DataType dataType, Annotation[] annotations) { - Object physical = dataType.getPhysical(); - if (!(physical instanceof Class)) { - return false; - } - Class javaType = (Class)physical; - if (JAXBElement.class.isAssignableFrom(javaType)) { - Type type = javaType.getGenericSuperclass(); - if (type instanceof ParameterizedType) { - ParameterizedType parameterizedType = ((ParameterizedType)type); - Type rawType = parameterizedType.getRawType(); - if (rawType == JAXBElement.class) { - Type actualType = parameterizedType.getActualTypeArguments()[0]; - if (actualType instanceof Class) { - XMLType xmlType = JAXBContextHelper.getXmlTypeName((Class)actualType); - dataType.setLogical(xmlType); - dataType.setDataBinding(getName()); - return true; - } - } - } - dataType.setLogical(XMLType.UNKNOWN); - dataType.setDataBinding(getName()); - return true; - } - - XMLType xmlType = JAXBContextHelper.getXmlTypeName(javaType); - if (xmlType == null) { - return false; - } - dataType.setLogical(xmlType); - dataType.setDataBinding(getName()); - return true; - } - - @SuppressWarnings("unchecked") - @Override - public Object copy(Object arg) { - try { - boolean isElement = false; - Class cls = arg.getClass(); - if (arg instanceof JAXBElement) { - isElement = true; - cls = ((JAXBElement)arg).getDeclaredType(); - } else { - arg = new JAXBElement(ROOT_ELEMENT, Object.class, arg); - } - JAXBContext context = JAXBContext.newInstance(cls); - Document doc = DOMHelper.newDocument(); - context.createMarshaller().marshal(arg, doc); - JAXBElement element = context.createUnmarshaller().unmarshal(doc, cls); - return isElement ? element : element.getValue(); - } catch (Exception e) { - throw new IllegalArgumentException(e); - } - } - - @Override - public ExceptionHandler getExceptionHandler() { - return new JAXBExceptionHandler(); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBExceptionHandler.java b/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBExceptionHandler.java deleted file mode 100644 index c2ca78e018..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBExceptionHandler.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.jaxb; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; - -import javax.xml.namespace.QName; -import javax.xml.ws.WebFault; - -import org.apache.tuscany.sca.databinding.ExceptionHandler; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -/** - * JAXB implementation of ExceptionHandler - * - * @version $Rev$ $Date$ - */ -public class JAXBExceptionHandler implements ExceptionHandler { - private static final Class[] EMPTY_CLASS_ARRAY = new Class[0]; - - /** - *
    - *
  • WrapperException(String message, FaultBean faultInfo)
    - * A constructor where WrapperException is replaced with the name of the - * generated wrapper exception and FaultBean is replaced by the name of the - * generated fault bean. - *
  • WrapperException(String message, FaultBean faultInfo, Throwable - * cause)
    - * A constructor whereWrapperException is replaced with the name of the - * generated wrapper exception and FaultBean is replaced by the name of the - * generated fault bean. The last argument, cause, may be used to convey - * protocol specific fault information - *
- */ - public Exception createException(DataType exceptionType, String message, Object faultInfo, Throwable cause) { - Class exceptionClass = (Class)exceptionType.getPhysical(); - DataType faultBeanType = exceptionType.getLogical(); - Class faultBeanClass = (Class)faultBeanType.getPhysical(); - try { - Constructor constructor = - exceptionClass.getConstructor(new Class[] {String.class, faultBeanClass, Throwable.class}); - return (Exception)constructor.newInstance(new Object[] {message, faultInfo, cause}); - } catch (Throwable e) { - throw new IllegalArgumentException(e); - } - } - - public Object getFaultInfo(Exception exception) { - if (exception == null) { - return null; - } - try { - Method method = exception.getClass().getMethod("getFaultInfo", EMPTY_CLASS_ARRAY); - return method.invoke(exception, (Object[])null); - } catch (Throwable e) { - throw new IllegalArgumentException(e); - } - } - - public DataType getFaultType(DataType exDataType) { - Class exceptionType = (Class) exDataType.getPhysical(); - WebFault webFault = exceptionType.getAnnotation(WebFault.class); - if (webFault == null) { - return null; - } else { - QName element = new QName(webFault.targetNamespace(), webFault.name()); - // TODO: Need to determine the fault bean class - // String faultBean = webFault.faultBean(); - Class faultBeanClass = null; - try { - Method method = exceptionType.getMethod("getFaultInfo", EMPTY_CLASS_ARRAY); - faultBeanClass = method.getReturnType(); - } catch (NoSuchMethodException e) { - faultBeanClass = null; - } - // The logical type of a fault is the QName of the element that the - // only part in - // the fault message references - DataType faultType = - new DataTypeImpl(JAXBDataBinding.NAME, faultBeanClass, new XMLType(element, null)); - // faultType.setMetadata(ElementInfo.class.getName(), new - // ElementInfo(element, null)); - return faultType; - } - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandler.java b/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandler.java deleted file mode 100644 index 528d6fd703..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXBWrapperHandler.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.jaxb; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.bind.annotation.XmlType; -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.WrapperHandler; -import org.apache.tuscany.sca.interfacedef.util.ElementInfo; - -/** - * JAXB WrapperHandler implementation - */ -public class JAXBWrapperHandler implements WrapperHandler> { - - public JAXBElement create(ElementInfo element, TransformationContext context) { - try { - // FIXME: How do we map the global element to a factory? - String packageName = null; - String factoryClassName = packageName + ".ObjectFactory"; - ClassLoader classLoader = context != null ? context.getClassLoader() : null; - if (classLoader == null) { - classLoader = Thread.currentThread().getContextClassLoader(); - } - Class factoryClass = Class.forName(factoryClassName, true, classLoader); - assert factoryClass.isAnnotationPresent(XmlRegistry.class); - Object factory = factoryClass.newInstance(); - QName elementName = element.getQName(); - Method method = null; - for (Method m : factoryClass.getMethods()) { - XmlElementDecl xmlElement = m.getAnnotation(XmlElementDecl.class); - QName name = new QName(xmlElement.namespace(), xmlElement.name()); - if (xmlElement != null && name.equals(elementName)) { - method = m; - break; - } - } - if (method != null) { - Class typeClass = method.getParameterTypes()[0]; - Object value = typeClass.newInstance(); - return (JAXBElement)method.invoke(factory, new Object[] {value}); - } else { - throw new TransformationException("ObjectFactory cannot be resolved."); - } - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public void setChild(JAXBElement wrapper, int i, ElementInfo childElement, Object value) { - Object wrapperValue = wrapper.getValue(); - Class wrapperClass = wrapperValue.getClass(); - - XmlType xmlType = wrapperClass.getAnnotation(XmlType.class); - String[] properties = xmlType.propOrder(); - String property = properties[i]; - - try { - for (Method m : wrapperClass.getMethods()) { - if (m.getName().equals("set" + capitalize(property))) { - m.invoke(wrapperValue, new Object[] {value}); - return; - } - } - } catch (Throwable e) { - throw new TransformationException(e); - } - } - - private static String capitalize(String name) { - char first = Character.toUpperCase(name.charAt(0)); - return first + name.substring(1); - } - - /** - * @see org.apache.tuscany.sca.databinding.WrapperHandler#getChildren(java.lang.Object) - */ - public List getChildren(JAXBElement wrapper) { - Object wrapperValue = wrapper.getValue(); - Class wrapperClass = wrapperValue.getClass(); - - XmlType xmlType = wrapperClass.getAnnotation(XmlType.class); - String[] properties = xmlType.propOrder(); - List elements = new ArrayList(); - for (String p : properties) { - try { - Method method = wrapperClass.getMethod("get" + capitalize(p), (Class[])null); - Object value = method.invoke(wrapperValue, (Object[])null); - elements.add(value); - } catch (Throwable e) { - throw new TransformationException(e); - } - } - return elements; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXWSJavaInterfaceProcessor.java b/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXWSJavaInterfaceProcessor.java deleted file mode 100644 index 60ed6f2f81..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/JAXWSJavaInterfaceProcessor.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.jaxb; - -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; - -import javax.jws.WebMethod; -import javax.jws.WebService; -import javax.xml.namespace.QName; -import javax.xml.ws.RequestWrapper; -import javax.xml.ws.ResponseWrapper; - -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.java.JavaInterface; -import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceVisitor; -import org.apache.tuscany.sca.interfacedef.util.ElementInfo; -import org.apache.tuscany.sca.interfacedef.util.WrapperInfo; - -/** - * The databinding annotation processor for java interfaces - * - * @version $Rev$ $Date$ - */ -public class JAXWSJavaInterfaceProcessor implements JavaInterfaceVisitor { - - public JAXWSJavaInterfaceProcessor() { - super(); - } - - public void visitInterface(JavaInterface contract) throws InvalidInterfaceException { - if (!contract.isRemotable()) { - return; - } - Class clazz = contract.getJavaClass(); - Map operations = new HashMap(); - for (Operation op : contract.getOperations()) { - operations.put(op.getName(), op); - } - for (Method method : clazz.getMethods()) { - Operation operation = operations.get(method.getName()); - - WebMethod webMethod = method.getAnnotation(WebMethod.class); - if (webMethod == null) { - return; - } - - String operationName = getValue(webMethod.operationName(), operation.getName()); - - RequestWrapper requestWrapper = method.getAnnotation(RequestWrapper.class); - ResponseWrapper responseWrapper = method.getAnnotation(ResponseWrapper.class); - if (requestWrapper == null) { - return; - } - - WebService webService = clazz.getAnnotation(WebService.class); - String tns = ""; - if (webService != null) { - tns = webService.targetNamespace(); - } - - String ns = getValue(requestWrapper.targetNamespace(), tns); - String name = getValue(requestWrapper.localName(), operationName); - QName inputWrapper = new QName(ns, name); - - ns = getValue(responseWrapper.targetNamespace(), tns); - name = getValue(responseWrapper.localName(), operationName + "Response"); - - QName outputWrapper = new QName(ns, name); - - WrapperInfo wrapperInfo = new WrapperInfo(JAXBDataBinding.NAME, new ElementInfo(inputWrapper, null), - new ElementInfo(outputWrapper, null), null, null); - operation.setWrapperStyle(true); - operation.setWrapper(wrapperInfo); - } - } - - private static String getValue(String value, String defaultValue) { - return "".equals(value) ? defaultValue : value; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java b/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java deleted file mode 100755 index 31beb344f1..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Node2JAXB.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.jaxb; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.w3c.dom.Node; - -public class Node2JAXB extends BaseTransformer implements PullTransformer { - - public Node2JAXB() { - super(); - } - - public Object transform(Node source, TransformationContext context) { - if (source == null) - return null; - try { - JAXBContext jaxbContext = JAXBContextHelper.createJAXBContext(context, false); - Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); - Object result = unmarshaller.unmarshal(source); - return JAXBContextHelper.createReturnValue(context.getTargetDataType(), result); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return Node.class; - } - - public Class getTargetType() { - return Object.class; - } - - public int getWeight() { - return 30; - } - - @Override - public String getTargetDataBinding() { - return JAXBDataBinding.NAME; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Reader2JAXB.java b/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Reader2JAXB.java deleted file mode 100644 index e0bb0e189c..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/Reader2JAXB.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.jaxb; - -import java.io.Reader; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; -import javax.xml.transform.stream.StreamSource; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -public class Reader2JAXB extends BaseTransformer implements - PullTransformer { - - public Object transform(final Reader source, final TransformationContext context) { - if (source == null) { - return null; - } - try { - JAXBContext jaxbContext = JAXBContextHelper.createJAXBContext(context, false); - Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); - StreamSource streamSource = new StreamSource(source); - Object result = unmarshaller.unmarshal(streamSource); - return JAXBContextHelper.createReturnValue(context.getTargetDataType(), result); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return Reader.class; - } - - public Class getTargetType() { - return Object.class; - } - - public int getWeight() { - return 30; - } - - @Override - public String getTargetDataBinding() { - return JAXBDataBinding.NAME; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLStreamReader2JAXB.java b/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLStreamReader2JAXB.java deleted file mode 100755 index 061f488a01..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/XMLStreamReader2JAXB.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.jaxb; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.Unmarshaller; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -public class XMLStreamReader2JAXB extends BaseTransformer implements - PullTransformer { - - public XMLStreamReader2JAXB() { - super(); - } - - public Object transform(XMLStreamReader source, TransformationContext context) { - if (source == null) { - return null; - } - try { - JAXBContext jaxbContext = JAXBContextHelper.createJAXBContext(context, false); - Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); - Object result = unmarshaller.unmarshal(source); - return JAXBContextHelper.createReturnValue(context.getTargetDataType(), result); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return XMLStreamReader.class; - } - - public Class getTargetType() { - return Object.class; - } - - public int getWeight() { - return 10; - } - - @Override - public String getTargetDataBinding() { - return JAXBDataBinding.NAME; - } -} diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/module/JAXBDataBindingModuleActivator.java b/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/module/JAXBDataBindingModuleActivator.java deleted file mode 100644 index 3e98bf652d..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/java/org/apache/tuscany/sca/databinding/jaxb/module/JAXBDataBindingModuleActivator.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.jaxb.module; - -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.ModuleActivator; -import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; -import org.apache.tuscany.sca.databinding.TransformerExtensionPoint; -import org.apache.tuscany.sca.databinding.jaxb.JAXB2Node; -import org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding; -import org.apache.tuscany.sca.databinding.jaxb.JAXWSJavaInterfaceProcessor; -import org.apache.tuscany.sca.databinding.jaxb.Node2JAXB; -import org.apache.tuscany.sca.databinding.jaxb.Reader2JAXB; -import org.apache.tuscany.sca.databinding.jaxb.XMLStreamReader2JAXB; -import org.apache.tuscany.sca.interfacedef.java.introspect.JavaInterfaceIntrospectorExtensionPoint; - -/** - * Module activator for JAXB databinding - * - * @version $Rev$ $Date$ - */ -public class JAXBDataBindingModuleActivator implements ModuleActivator { - - public Object[] getExtensionPoints() { - return null; - } - - public void start(ExtensionPointRegistry registry) { - DataBindingExtensionPoint dataBindings = registry.getExtensionPoint(DataBindingExtensionPoint.class); - dataBindings.addDataBinding(new JAXBDataBinding()); - - TransformerExtensionPoint transformers = registry.getExtensionPoint(TransformerExtensionPoint.class); - transformers.addTransformer(new JAXB2Node()); - transformers.addTransformer(new Node2JAXB()); - transformers.addTransformer(new Reader2JAXB()); - transformers.addTransformer(new XMLStreamReader2JAXB()); - - JavaInterfaceIntrospectorExtensionPoint introspectors = registry.getExtensionPoint(JavaInterfaceIntrospectorExtensionPoint.class); - introspectors.addInterfaceVisitor(new JAXWSJavaInterfaceProcessor()); - - } - - public void stop(ExtensionPointRegistry registry) { - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-java-0.90/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator deleted file mode 100644 index 2998cf93e0..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# Implementation class for the ExtensionActivator -org.apache.tuscany.sca.databinding.jaxb.module.JAXBDataBindingModuleActivator \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBDataBindingTestCase.java b/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBDataBindingTestCase.java deleted file mode 100644 index aa191c20b5..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBDataBindingTestCase.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.databinding.jaxb; - -import java.lang.annotation.Annotation; - -import javax.xml.bind.JAXBElement; -import javax.xml.namespace.QName; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -import com.example.ipo.jaxb.ObjectFactory; -import com.example.ipo.jaxb.PurchaseOrderType; -import com.example.ipo.jaxb.USAddress; -import com.example.ipo.jaxb.USState; - -/** - * - */ -public class JAXBDataBindingTestCase extends TestCase { - private JAXBDataBinding binding; - - /** - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - binding = new JAXBDataBinding(); - } - - /** - * Test method for - * {@link org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding#introspect(java.lang.Class, Annotation)}. - */ - public final void testIntrospect() { - DataType dataType = new DataTypeImpl(JAXBElement.class, null); - boolean yes = binding.introspect(dataType, null); - assertTrue(yes); - assertTrue(dataType.getDataBinding().equals(binding.getName())); - assertTrue(dataType.getPhysical() == JAXBElement.class && dataType.getLogical() == XMLType.UNKNOWN); - dataType = new DataTypeImpl(MockJAXBElement.class, null); - yes = binding.introspect(dataType, null); - assertTrue(yes); - assertEquals(MockJAXBElement.class, dataType.getPhysical()); - assertEquals(new QName("http://www.example.com/IPO", "PurchaseOrderType"), ((XMLType)dataType.getLogical()) - .getTypeName()); - dataType = new DataTypeImpl(USAddress.class, null); - yes = binding.introspect(dataType, null); - assertTrue(yes); - assertEquals(USAddress.class, dataType.getPhysical()); - assertEquals(new QName("http://www.example.com/IPO", "USAddress"), ((XMLType)dataType.getLogical()) - .getTypeName()); - dataType = new DataTypeImpl(USState.class, null); - yes = binding.introspect(dataType, null); - assertTrue(yes); - assertTrue(dataType.getDataBinding().equals(binding.getName())); - assertEquals(USState.class, dataType.getPhysical()); - assertEquals(new QName("http://www.example.com/IPO", "USState"), ((XMLType)dataType.getLogical()).getTypeName()); - - } - - private static class MockJAXBElement extends JAXBElement { - - private static final long serialVersionUID = -2767569071002707973L; - - /** - * @param elementName - * @param type - * @param value - */ - public MockJAXBElement(QName elementName, Class type, PurchaseOrderType value) { - super(elementName, type, value); - } - - } - - @SuppressWarnings("unchecked") - public void testCopy() { - ObjectFactory factory = new ObjectFactory(); - PurchaseOrderType poType = factory.createPurchaseOrderType(); - JAXBElement po = factory.createPurchaseOrder(poType); - JAXBElement copy = (JAXBElement)binding.copy(po); - assertEquals(new QName("http://www.example.com/IPO", "purchaseOrder"), copy.getName()); - } - - @SuppressWarnings("unchecked") - public void testCopyNonElement() { - ObjectFactory factory = new ObjectFactory(); - PurchaseOrderType poType = factory.createPurchaseOrderType(); - poType.setComment("Comment"); - PurchaseOrderType copy = (PurchaseOrderType)binding.copy(poType); - assertTrue(copy instanceof PurchaseOrderType); - assertEquals("Comment", ((PurchaseOrderType)copy).getComment()); - } - - @SuppressWarnings("unchecked") - public void testCopyNonRoot() { - ObjectFactory factory = new ObjectFactory(); - USAddress address = factory.createUSAddress(); - address.setCity("San Jose"); - USAddress copy = (USAddress)binding.copy(address); - assertTrue(copy instanceof USAddress); - assertEquals("San Jose", ((USAddress)copy).getCity()); - - } -} diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBExceptionHandlerTestCase.java b/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBExceptionHandlerTestCase.java deleted file mode 100644 index 5b85f9096d..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBExceptionHandlerTestCase.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.databinding.jaxb; - -import javax.xml.namespace.QName; - -import junit.framework.TestCase; - -import org.apache.tuscany.databinding.jaxb.fault.InvalidSymbolFault; -import org.apache.tuscany.databinding.jaxb.fault.InvalidSymbolFault_Exception; -import org.apache.tuscany.sca.databinding.jaxb.JAXBDataBinding; -import org.apache.tuscany.sca.databinding.jaxb.JAXBExceptionHandler; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -/** - * Test case for JAXBExceptionHandler - */ -public class JAXBExceptionHandlerTestCase extends TestCase { - private static final QName ELEMENT = new QName("http://www.example.com/stock", "InvalidSymbolFault"); - private JAXBExceptionHandler handler; - - /** - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - this.handler = new JAXBExceptionHandler(); - } - - public void testGetFaultType() { - DataType exType = new DataTypeImpl(InvalidSymbolFault_Exception.class, XMLType.UNKNOWN); - DataType dataType = handler.getFaultType(exType); - assertEquals(InvalidSymbolFault.class, dataType.getPhysical()); - assertEquals(ELEMENT, ((XMLType) dataType.getLogical()).getElementName()); - assertEquals(JAXBDataBinding.NAME, dataType.getDataBinding()); - } - - public void testCreate() { - DataType execType = new DataTypeImpl(InvalidSymbolFault_Exception.class, XMLType.UNKNOWN); - DataType faultType = handler.getFaultType(execType); - InvalidSymbolFault fault = new InvalidSymbolFault(); - fault.setMessage("ABC"); - fault.setSymbol("IBM0"); - DataType exType = new DataTypeImpl(InvalidSymbolFault_Exception.class, faultType); - Exception ex = handler.createException(exType, "Invalid symbol", fault, null); - assertTrue(ex instanceof InvalidSymbolFault_Exception); - InvalidSymbolFault_Exception exception = (InvalidSymbolFault_Exception)ex; - assertEquals("Invalid symbol", exception.getMessage()); - assertSame(fault, exception.getFaultInfo()); - } - - public void testGetFaultInfo() { - InvalidSymbolFault fault = new InvalidSymbolFault(); - fault.setMessage("ABC"); - fault.setSymbol("IBM0"); - InvalidSymbolFault_Exception exception = new InvalidSymbolFault_Exception("Invalid symbol", fault); - Object faultInfo = handler.getFaultInfo(exception); - assertSame(fault, faultInfo); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBTestCase.java b/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBTestCase.java deleted file mode 100755 index f1caf42fcf..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBTestCase.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.databinding.jaxb; - -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; - -import java.io.StringReader; - -import javax.xml.namespace.QName; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.jaxb.JAXB2Node; -import org.apache.tuscany.sca.databinding.jaxb.Node2JAXB; -import org.apache.tuscany.sca.databinding.jaxb.Reader2JAXB; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.XMLType; -import org.w3c.dom.Node; - -import com.example.ipo.jaxb.ObjectFactory; -import com.example.ipo.jaxb.PurchaseOrderType; - -public class JAXBTestCase extends TestCase { - private static final String IPO_XML = - "" + "" - + " " - + " Helen Zoe" - + " 47 Eden Street" - + " Cambridge" - + " CB1 1JR" - + " " - + " " - + " Robert Smith" - + " 8 Oak Avenue" - + " Old Town" - + " PA" - + " 95819" - + " " - + " " - + " " - + " Lapis necklace" - + " 1" - + " 99.95" - + " Want this for the holidays" - + " 1999-12-05" - + " " - + " " - + ""; - - private String contextPath = "com.example.ipo.jaxb"; - - protected void setUp() throws Exception { - super.setUp(); - } - - public void testTransform() throws Exception { - Reader2JAXB t0 = new Reader2JAXB(); - - DataType targetDataType = new DataTypeImpl(PurchaseOrderType.class, null); - - TransformationContext tContext = createMock(TransformationContext.class); - expect(tContext.getTargetDataType()).andReturn(targetDataType).anyTimes(); - replay(tContext); - - Object object1 = t0.transform(new StringReader(IPO_XML), tContext); - - DataType sourceDataType = new DataTypeImpl(PurchaseOrderType.class, null); - - TransformationContext tContext1 = createMock(TransformationContext.class); - expect(tContext1.getSourceDataType()).andReturn(sourceDataType).anyTimes(); - replay(tContext1); - - JAXB2Node t1 = new JAXB2Node(); - Node node = t1.transform(object1, tContext1); - - Assert.assertNotNull(node); - - Node2JAXB t2 = new Node2JAXB(); - Object object2 = t2.transform(node, tContext); - Assert.assertNotNull(object2); - - } - - public void testTransform2() throws Exception { - Reader2JAXB t0 = new Reader2JAXB(); - - QName root = new QName("http://www.example.com/IPO", "purchaseOrder"); - DataType targetDataType = new DataTypeImpl(PurchaseOrderType.class, new XMLType(root, null)); - // targetDataType.setMetadata(JAXBContextHelper.JAXB_CONTEXT_PATH, contextPath); - - TransformationContext tContext = createMock(TransformationContext.class); - expect(tContext.getTargetDataType()).andReturn(targetDataType).anyTimes(); - replay(tContext); - - Object object1 = t0.transform(new StringReader(IPO_XML), tContext); - - DataType sourceDataType = new DataTypeImpl(PurchaseOrderType.class, new XMLType(root, null)); - // sourceDataType.setMetadata(JAXBContextHelper.JAXB_CONTEXT_PATH, contextPath); - - TransformationContext tContext1 = createMock(TransformationContext.class); - expect(tContext1.getSourceDataType()).andReturn(sourceDataType).anyTimes(); - replay(tContext1); - - JAXB2Node t1 = new JAXB2Node(); - Node node = t1.transform(object1, tContext1); - - Assert.assertNotNull(node); - - Node2JAXB t2 = new Node2JAXB(); - Object object2 = t2.transform(node, tContext); - Assert.assertNotNull(object2); - - } - - public void testTransform3() throws Exception { - - DataType sourceDataType = new DataTypeImpl(PurchaseOrderType.class, null); - - TransformationContext tContext1 = createMock(TransformationContext.class); - expect(tContext1.getSourceDataType()).andReturn(sourceDataType).anyTimes(); - replay(tContext1); - - JAXB2Node t1 = new JAXB2Node(); - PurchaseOrderType po = new ObjectFactory().createPurchaseOrderType(); - Node node = t1.transform(po, tContext1); - - Assert.assertNotNull(node); - - } - - protected void tearDown() throws Exception { - super.tearDown(); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBWrapperHandlerTestCase.java b/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBWrapperHandlerTestCase.java deleted file mode 100644 index 355acd619c..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBWrapperHandlerTestCase.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.databinding.jaxb; - -import java.util.List; - -import javax.xml.bind.JAXBElement; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.databinding.jaxb.JAXBWrapperHandler; - -import com.example.ipo.jaxb.ObjectFactory; -import com.example.ipo.jaxb.PurchaseOrderType; - -/** - * Test case for JAXBExceptionHandler - */ -public class JAXBWrapperHandlerTestCase extends TestCase { - // private static final QName ELEMENT = new QName("http://www.example.com/IPO", "purchaseOrder"); - private JAXBWrapperHandler handler; - - /** - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - this.handler = new JAXBWrapperHandler(); - } - - public void testCreate() { - // ElementInfo element = new ElementInfo(ELEMENT, null); - // JAXBElement jaxbElement = handler.create(element, null); - } - - public void testSetChild() { - ObjectFactory factory = new ObjectFactory(); - PurchaseOrderType po = factory.createPurchaseOrderType(); - JAXBElement wrapper = factory.createPurchaseOrder(po); - handler.setChild(wrapper, 2, null, "Comment"); - } - - public void testGetChildren() { - ObjectFactory factory = new ObjectFactory(); - PurchaseOrderType po = factory.createPurchaseOrderType(); - po.setComment("Comment"); - JAXBElement wrapper = factory.createPurchaseOrder(po); - List children = handler.getChildren(wrapper); - assertNotNull(children); - assertEquals(4, children.size()); - assertEquals("Comment", children.get(2)); - assertNull(children.get(0)); - } -} diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault.java b/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault.java deleted file mode 100644 index fd21d72337..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.databinding.jaxb.fault; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -/** - *

- * Java class for anonymous complex type. - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = {"message", "symbol"}) -@XmlRootElement(name = "InvalidSymbolFault") -public class InvalidSymbolFault { - - @XmlElement(required = true) - protected String message; - @XmlElement(required = true) - protected String symbol; - - /** - * Gets the value of the message property. - * - * @return possible object is {@link String } - */ - public String getMessage() { - return message; - } - - /** - * Sets the value of the message property. - * - * @param value allowed object is {@link String } - */ - public void setMessage(String value) { - this.message = value; - } - - /** - * Gets the value of the symbol property. - * - * @return possible object is {@link String } - */ - public String getSymbol() { - return symbol; - } - - /** - * Sets the value of the symbol property. - * - * @param value allowed object is {@link String } - */ - public void setSymbol(String value) { - this.symbol = value; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault_Exception.java b/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault_Exception.java deleted file mode 100644 index 19ce1dca23..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault_Exception.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.databinding.jaxb.fault; - -import javax.xml.ws.WebFault; - -/** - * This class was generated by the JAXWS SI. JAX-WS RI 2.1-02/02/2007 09:55 - * AM(vivekp)-FCS Generated source version: 2.1 - */ -@WebFault(name = "InvalidSymbolFault", targetNamespace = "http://www.example.com/stock") -public class InvalidSymbolFault_Exception extends Exception { - - /** - * Java type that goes as soapenv:Fault detail element. - */ - private InvalidSymbolFault faultInfo; - - /** - * @param faultInfo - * @param message - */ - public InvalidSymbolFault_Exception(String message, InvalidSymbolFault faultInfo) { - super(message); - this.faultInfo = faultInfo; - } - - /** - * @param faultInfo - * @param message - * @param cause - */ - public InvalidSymbolFault_Exception(String message, InvalidSymbolFault faultInfo, Throwable cause) { - super(message, cause); - this.faultInfo = faultInfo; - } - - /** - * @return returns fault bean: - * org.apache.tuscany.sca.test.exceptions.impl.jaxb.InvalidSymbolFault - */ - public InvalidSymbolFault getFaultInfo() { - return faultInfo; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-jaxb/src/test/resources/ipo.xsd b/branches/sca-java-0.90/modules/databinding-jaxb/src/test/resources/ipo.xsd deleted file mode 100755 index 241ec15d36..0000000000 --- a/branches/sca-java-0.90/modules/databinding-jaxb/src/test/resources/ipo.xsd +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - International Purchase order schema for Example.com - Copyright 2000 Example.com. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/.checkstyle b/branches/sca-java-0.90/modules/databinding-sdo-axiom/.checkstyle deleted file mode 100644 index c7b30ffd5e..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/.checkstyle +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/.ruleset b/branches/sca-java-0.90/modules/databinding-sdo-axiom/.ruleset deleted file mode 100644 index 27b9ab847c..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/.ruleset +++ /dev/null @@ -1,191 +0,0 @@ - - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/DISCLAIMER b/branches/sca-java-0.90/modules/databinding-sdo-axiom/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/LICENSE b/branches/sca-java-0.90/modules/databinding-sdo-axiom/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/NOTICE b/branches/sca-java-0.90/modules/databinding-sdo-axiom/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/pom.xml b/branches/sca-java-0.90/modules/databinding-sdo-axiom/pom.xml deleted file mode 100644 index ea9ad42d54..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/pom.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - tuscany-databinding-sdo-axiom - Apache Tuscany Data Binding for SDO/AXIOM - - - - org.apache.tuscany.sca - tuscany-databinding - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-databinding-sdo - 0.90-incubating-SNAPSHOT - - - - org.apache.ws.commons.axiom - axiom-api - 1.2.4 - - - xerces - xercesImpl - - - - - - org.apache.ws.commons.axiom - axiom-impl - 1.2.4 - runtime - - - - xerces - xercesImpl - 2.8.1 - runtime - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.0 - - - add-test-source - generate-sources - - add-test-source - - - - target/sdo-source - - - - - - - org.apache.tuscany.sdo - tuscany-sdo-plugin - 1.0-incubating-beta1 - - - generate-po-sdo - generate-test-sources - - ${basedir}/src/test/resources/ipo.xsd - com.example.ipo.sdo - true - true - true - - - generate - - - - generate-stock-sdo - generate-test-sources - - ${basedir}/src/test/resources/stock.xsd - com.example.stock.sdo - Stock - true - true - true - - - generate - - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/DataObject2OMElement.java b/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/DataObject2OMElement.java deleted file mode 100644 index 4060fd8e5b..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/DataObject2OMElement.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.sdo2om; - -import static org.apache.tuscany.sca.databinding.sdo.SDODataBinding.ROOT_ELEMENT; - -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.OMFactory; -import org.apache.axiom.om.OMNamespace; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sca.databinding.sdo.SDOContextHelper; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.HelperContext; -import commonj.sdo.helper.XMLDocument; - -/** - * SDO DataObject --> AXIOM OMElement transformer - * - * @version $Rev$ $Date$ - */ -public class DataObject2OMElement extends BaseTransformer implements - PullTransformer { - - public OMElement transform(DataObject source, TransformationContext context) { - HelperContext helperContext = SDOContextHelper.getHelperContext(context); - OMFactory factory = OMAbstractFactory.getOMFactory(); - - OMNamespace namespace = null; - String localName = ROOT_ELEMENT.getLocalPart(); - if (context != null) { - DataType dataType = context.getTargetDataType(); - Object logical = dataType == null ? null : dataType.getLogical(); - if (logical instanceof XMLType) { - XMLType xmlType = (XMLType)logical; - if (xmlType.isElement()) { - namespace = factory.createOMNamespace(xmlType.getElementName().getNamespaceURI(), xmlType - .getElementName().getPrefix()); - localName = xmlType.getElementName().getLocalPart(); - } - } - } - if (namespace == null) { - namespace = factory.createOMNamespace(ROOT_ELEMENT.getNamespaceURI(), ROOT_ELEMENT.getPrefix()); - } - - XMLDocument document = helperContext.getXMLHelper().createDocument(source, - namespace.getNamespaceURI(), - localName); - SDODataSource dataSource = new SDODataSource(document, helperContext); - OMElement element = factory.createOMElement(dataSource, localName, namespace); - return element; - } - - public Class getSourceType() { - return DataObject.class; - } - - public Class getTargetType() { - return OMElement.class; - } - - public int getWeight() { - return 10; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/DataObjectSerializer.java b/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/DataObjectSerializer.java deleted file mode 100644 index 4301ba09e3..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/DataObjectSerializer.java +++ /dev/null @@ -1,427 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo2om; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.NamespaceContext; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sdo.impl.AttributeImpl; -import org.apache.tuscany.sdo.impl.ReferenceImpl; -import org.apache.tuscany.sdo.util.SDOUtil; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.util.ExtendedMetaData; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.Sequence; -import commonj.sdo.Type; -import commonj.sdo.helper.HelperContext; -import commonj.sdo.helper.XMLDocument; -import commonj.sdo.helper.XSDHelper; - -public class DataObjectSerializer { - private static final String ELEMENT_TEXT = "Text Element"; - - // static final String ELEMENT_TEXT = "Element Text"; - private static final QName XSI_TYPE_QNAME = new QName("http://www.w3.org/2001/XMLSchema-instance", "type", "xsi"); - - private Map declaredNamespaceMap = new HashMap(); - - private NameSpaceContextImpl namespaceContext = new NameSpaceContextImpl(); - - private DataObject rootDataObject; - - private String rootElementName; - - private String rootElementURI; - - private XMLStreamWriter xmlWriter; - - private XSDHelper xsdHelper; - - public DataObjectSerializer(DataObject rootObject, - XMLStreamWriter xmlWriter, - HelperContext helperCtx, - TransformationContext context) { - this.xmlWriter = xmlWriter; - this.rootDataObject = rootObject; - this.xsdHelper = helperCtx.getXSDHelper(); - this.rootElementName = xsdHelper.getLocalName(rootObject.getType()); - this.rootElementURI = rootDataObject.getType().getURI(); - - if (context != null) { - DataType dataType = context.getTargetDataType(); - Object targetQName = dataType == null ? null : dataType.getLogical(); - if (targetQName instanceof QName) { - QName name = (QName)targetQName; - this.rootElementName = name.getLocalPart(); - this.rootElementURI = name.getNamespaceURI(); - } - } - - } - - // private void serializeNamespace(String prefix, String URI, - // XMLStreamWriter writer) throws XMLStreamException { - // String prefix1 = writer.getPrefix(URI); - // if (prefix1 == null) { - // writer.writeNamespace(prefix, URI); - // writer.setPrefix(prefix, URI); - // } - // } - - public DataObjectSerializer(XMLDocument sourceDocument, XMLStreamWriter xmlWriter, HelperContext helperCtx) { - this.xmlWriter = xmlWriter; - this.rootDataObject = sourceDocument.getRootObject(); - this.rootElementName = sourceDocument.getRootElementName(); - this.rootElementURI = sourceDocument.getRootElementURI(); - this.xsdHelper = helperCtx.getXSDHelper(); - } - - protected class NameSpaceContextImpl implements NamespaceContext { - private int counter; - - private Map prefixToNamespaceMapping = new HashMap(); - - public NameSpaceContextImpl() { - prefixToNamespaceMapping.put("xml", "http://www.w3.org/XML/1998/namespace"); - prefixToNamespaceMapping.put("xmlns", "http://www.w3.org/2000/xmlns/"); - prefixToNamespaceMapping.put("xsi", "http://www.w3.org/2001/XMLSchema-instance"); - } - - public synchronized QName createQName(String nsURI, String name) { - String prefix = nsURI != null ? (String)getPrefix(nsURI) : null; - if (prefix == null && nsURI != null && !nsURI.equals("")) { - prefix = "p" + (counter++); - } - if (prefix == null) { - prefix = ""; - } - if (nsURI != null) { - prefixToNamespaceMapping.put(prefix, nsURI); - declaredNamespaceMap.put(prefix, nsURI); - } - return new QName(nsURI, name, prefix); - } - - public String getNamespaceURI(String prefix) { - if (prefix == null) { - throw new IllegalArgumentException("Prefix is null"); - } - - String ns = (String)prefixToNamespaceMapping.get(prefix); - if (ns != null) { - return ns; - } else { - return null; - } - } - - public String getPrefix(String nsURI) { - if (nsURI == null) { - throw new IllegalArgumentException("Namespace is null"); - } - for (Iterator i = prefixToNamespaceMapping.entrySet().iterator(); i.hasNext();) { - Map.Entry entry = (Map.Entry)i.next(); - if (entry.getValue().equals(nsURI)) { - return (String)entry.getKey(); - } - } - return null; - } - - public Iterator getPrefixes(String nsURI) { - List prefixList = new ArrayList(); - for (Iterator i = prefixToNamespaceMapping.entrySet().iterator(); i.hasNext();) { - Map.Entry entry = (Map.Entry)i.next(); - if (entry.getValue().equals(nsURI)) { - prefixList.add(entry.getKey()); - } - } - return prefixList.iterator(); - } - - public void registerMapping(String prefix, String nsURI) { - prefixToNamespaceMapping.put(prefix, nsURI); - } - - public void removeMapping(String prefix) { - prefixToNamespaceMapping.remove(prefix); - } - } - - protected static class NameValuePair implements Map.Entry { - private Object key; - - private Object value; - - public NameValuePair(Object key, Object value) { - this.key = key; - this.value = value; - } - - public Object getKey() { - return key; - } - - public Object getValue() { - return value; - } - - public Object setValue(Object value) { - Object v = this.value; - this.value = value; - return v; - } - - } - - private static boolean isTransient(Property property, Object type) { - // HACK: We need some SDOUtil extension to understand a property is - // derived - EStructuralFeature feature = (EStructuralFeature)property; - if (ExtendedMetaData.INSTANCE.getGroup(feature) != null) { - return false; - } - feature = ExtendedMetaData.INSTANCE.getAffiliation((EClass)type, feature); - if (feature != null && feature != property) { - return false; - } - if (property instanceof ReferenceImpl) { - ReferenceImpl r = (ReferenceImpl)property; - if (r.isTransient()) { - return true; - } - EReference opposite = r.getEOpposite(); - if (opposite != null && opposite.isContainment()) { - return true; - } - } else if (property instanceof AttributeImpl) { - AttributeImpl a = (AttributeImpl)property; - if (a.isTransient()) { - return true; - } - EDataType d = (EDataType)a.getEType(); - if (!d.isSerializable()) { - return true; - } - } - return false; - } - - private void addListValue(List propertyList, - List children, - Property property, - List objList) throws XMLStreamException { - if (objList != null) { - for (int j = 0; j < objList.size(); j++) { - Object object = objList.get(j); - addSingleValue(propertyList, children, property, object); - } - } - } - - private void addProperty(List propertyList, - List children, - Property property, - Object value, - DataObject dataObject) throws XMLStreamException { - - if (property.isMany() && property.getContainingType().isOpen() && value instanceof Sequence) { - addSequenceValue(propertyList, children, (Sequence)value); - } else if (SDOUtil.isMany(property, dataObject) && value instanceof List) { - addListValue(propertyList, children, property, (List)value); - } else { - // Complex Type - addSingleValue(propertyList, children, property, value); - } - } - - private void addSequenceValue(List elements, List children, Sequence seq) - throws XMLStreamException { - if (seq != null && seq.size() > 0) { - for (int j = 0; j < seq.size(); j++) { - Object o = seq.getValue(j); - Property p = seq.getProperty(j); - addSingleValue(elements, children, p, o); - } - } - } - - private void addSingleValue(List propertyList, - List children, - Property property, - Object value) throws XMLStreamException { - String uri = xsdHelper.getNamespaceURI(property); - String name = xsdHelper.getLocalName(property); - QName qname = namespaceContext.createQName(uri, name); - Type propertyType = property.getType(); - - if (property.getName().equals("value") && uri == null && name.equals(":0")) { - propertyList.add(new NameValuePair(ELEMENT_TEXT, value.toString())); - } else if (value == null) { - NameValuePair entry = new NameValuePair(qname, null); - propertyList.add(entry); - } else if (propertyType.isDataType()) { - NameValuePair entry = new NameValuePair(qname, SDOUtil.convertToString(propertyType, value)); - propertyList.add(entry); - } else { - children.add((DataObject)value); - } - } - - private void registerNamespace(String prefix, String uri) { - if (!uri.equals(namespaceContext.getNamespaceURI(prefix))) { - namespaceContext.registerMapping(prefix, uri); - declaredNamespaceMap.put(prefix, uri); - } - } - - public void serialize() throws XMLStreamException { - xmlWriter.setNamespaceContext(namespaceContext); - writeDataObject(rootDataObject, rootElementName, rootElementURI); - xmlWriter.flush(); - } - - private void writeDataObject(DataObject obj, String elementName, String elementURI) throws XMLStreamException { - List elementList = new ArrayList(); - List children = new ArrayList(); - List attributes = new ArrayList(); - - String typeName; - QName realTypeName = null; - - if (elementName != null) { - realTypeName = namespaceContext.createQName(elementURI, elementName); - String typeQName = realTypeName.getPrefix() + ":" + realTypeName.getLocalPart(); - declaredNamespaceMap.put(realTypeName.getPrefix(), realTypeName.getNamespaceURI()); - attributes.add(new NameValuePair(XSI_TYPE_QNAME, typeQName)); - registerNamespace(XSI_TYPE_QNAME.getPrefix(), XSI_TYPE_QNAME.getNamespaceURI()); - } else { - - typeName = xsdHelper.getLocalName(obj.getContainmentProperty()); - realTypeName = namespaceContext.createQName(obj.getType().getURI(), typeName); - registerNamespace(realTypeName.getPrefix(), realTypeName.getNamespaceURI()); - } - - registerNamespace(realTypeName.getPrefix(), realTypeName.getNamespaceURI()); - - if (obj.getType().isSequenced()) { - Sequence sequence = obj.getSequence(); - for (int i = 0; i < sequence.size(); i++) { - Property property = sequence.getProperty(i); - Object value = sequence.getValue(i); - if (property == null) { - elementList.add(new NameValuePair(ELEMENT_TEXT, value)); - } else { - addProperty(elementList, children, property, value, obj); - } - } - - // Attributes are not in the sequence - List properties = obj.getInstanceProperties(); - for (Iterator i = properties.iterator(); i.hasNext();) { - Property property = (Property)i.next(); - if (xsdHelper.isAttribute(property) && obj.isSet(property) && !isTransient(property, obj.getType())) { - Object value = obj.get(property); - QName name = - namespaceContext.createQName(xsdHelper.getNamespaceURI(property), xsdHelper - .getLocalName(property)); - attributes.add(new NameValuePair(name, SDOUtil.convertToString(property.getType(), value))); - } - } - } else { - Iterator i = obj.getInstanceProperties().iterator(); - while (i.hasNext()) { - Property p = (Property)i.next(); - if (obj.isSet(p) && !isTransient(p, obj.getType())) { - Object value = obj.get(p); - if (xsdHelper.isAttribute(p)) { - QName name = - namespaceContext.createQName(xsdHelper.getNamespaceURI(p), xsdHelper.getLocalName(p)); - attributes.add(new NameValuePair(name, SDOUtil.convertToString(p.getType(), value))); - } else { - addProperty(elementList, children, p, value, obj); - } - } - } - } - - String prefix = realTypeName.getPrefix(); - String nameSpaceName = realTypeName.getNamespaceURI(); - - if (nameSpaceName != null) { - String writerPrefix = xmlWriter.getPrefix(nameSpaceName); - if (writerPrefix != null) { - xmlWriter.writeStartElement(nameSpaceName, realTypeName.getLocalPart()); - } else { - if (prefix != null) { - xmlWriter.writeStartElement(prefix, realTypeName.getLocalPart(), nameSpaceName); - xmlWriter.writeNamespace(prefix, nameSpaceName); - xmlWriter.setPrefix(prefix, nameSpaceName); - } else { - xmlWriter.writeStartElement(nameSpaceName, realTypeName.getLocalPart()); - xmlWriter.writeDefaultNamespace(nameSpaceName); - xmlWriter.setDefaultNamespace(nameSpaceName); - } - } - } else { - xmlWriter.writeStartElement(realTypeName.getLocalPart()); - } - - for (NameValuePair pair : attributes) { - QName name = (QName)pair.getKey(); - assert namespaceContext.getPrefix(name.getPrefix()).equals(name.getNamespaceURI()); - xmlWriter.writeAttribute(name.getPrefix(), name.getNamespaceURI(), name.getLocalPart(), (String)pair - .getValue()); - } - - for (NameValuePair pair : elementList) { - if (ELEMENT_TEXT.equals(pair.getKey().toString())) { - xmlWriter.writeCharacters((String)pair.getValue()); - } else { - QName name = (QName)pair.getKey(); - xmlWriter.writeStartElement(name.getPrefix(), name.getLocalPart(), name.getNamespaceURI()); - xmlWriter.writeCharacters((String)pair.getValue()); - xmlWriter.writeEndElement(); - } - } - - for (DataObject child : children) { - writeDataObject(child, null, null); - } - xmlWriter.writeEndElement(); - - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/SDODataSource.java b/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/SDODataSource.java deleted file mode 100644 index 96d0ee563c..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/SDODataSource.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo2om; - -import static org.apache.tuscany.sca.databinding.sdo.SDODataBinding.ROOT_ELEMENT; - -import java.io.IOException; -import java.io.OutputStream; -import java.io.Writer; - -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.axiom.om.OMDataSource; -import org.apache.axiom.om.OMOutputFormat; -import org.apache.axiom.om.impl.serialize.StreamingOMSerializer; -import org.apache.tuscany.sdo.helper.XMLStreamHelper; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.HelperContext; -import commonj.sdo.helper.XMLDocument; - -public class SDODataSource implements OMDataSource { - private HelperContext helperContext; - private XMLDocument sourceDocument; - - public SDODataSource(XMLDocument source, HelperContext helperContext) { - this.sourceDocument = source; - this.helperContext = helperContext; - } - - public SDODataSource(DataObject obj, HelperContext helperContext) { - this.helperContext = helperContext; - this.sourceDocument = - helperContext.getXMLHelper().createDocument(obj, - ROOT_ELEMENT.getNamespaceURI(), - ROOT_ELEMENT.getLocalPart()); - } - - public XMLStreamReader getReader() throws XMLStreamException { - XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(helperContext.getTypeHelper()); - return streamHelper.createXMLStreamReader(sourceDocument); - } - - public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException { - StreamingOMSerializer serializer = new StreamingOMSerializer(); - serializer.serialize(getReader(), xmlWriter); - } - - public void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException { - try { - helperContext.getXMLHelper().save(sourceDocument, output, null); - } catch (Exception e) { - throw new XMLStreamException(e); - } - } - - public void serialize(Writer writer, OMOutputFormat format) throws XMLStreamException { - try { - helperContext.getXMLHelper().save(sourceDocument, writer, null); - } catch (IOException e) { - throw new XMLStreamException(e); - } - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/XMLDocument2OMElement.java b/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/XMLDocument2OMElement.java deleted file mode 100644 index d6ae818f31..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/XMLDocument2OMElement.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.sdo2om; - -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.OMFactory; -import org.apache.axiom.om.OMNamespace; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sca.databinding.sdo.SDOContextHelper; - -import commonj.sdo.helper.HelperContext; -import commonj.sdo.helper.XMLDocument; - -/** - * SDO XMLDocument --> AXIOM OMElement transformer - * @version $Rev$ $Date$ - */ -public class XMLDocument2OMElement extends BaseTransformer implements - PullTransformer { - - public OMElement transform(XMLDocument source, TransformationContext context) { - HelperContext helperContext = SDOContextHelper.getHelperContext(context); - SDODataSource dataSource = new SDODataSource(source, helperContext); - OMFactory factory = OMAbstractFactory.getOMFactory(); - OMNamespace namespace = factory.createOMNamespace(source.getRootElementURI(), source.getRootElementName()); - OMElement element = factory.createOMElement(dataSource, source.getRootElementName(), namespace); - return element; - } - - public Class getSourceType() { - return XMLDocument.class; - } - - public Class getTargetType() { - return OMElement.class; - } - - public int getWeight() { - return 10; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/module/SDOAxiomModuleActivator.java b/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/module/SDOAxiomModuleActivator.java deleted file mode 100644 index dc9ecdafae..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/java/org/apache/tuscany/sca/databinding/sdo2om/module/SDOAxiomModuleActivator.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo2om.module; - -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.ModuleActivator; -import org.apache.tuscany.sca.databinding.TransformerExtensionPoint; -import org.apache.tuscany.sca.databinding.sdo2om.DataObject2OMElement; -import org.apache.tuscany.sca.databinding.sdo2om.XMLDocument2OMElement; - -/** - * Module activator for SDO/AXIOM databinding - * - * @version $Rev$ $Date$ - */ -public class SDOAxiomModuleActivator implements ModuleActivator { - - public Object[] getExtensionPoints() { - return null; - } - - public void start(ExtensionPointRegistry registry) { - TransformerExtensionPoint transformers = registry.getExtensionPoint(TransformerExtensionPoint.class); - transformers.addTransformer(new DataObject2OMElement()); - transformers.addTransformer(new XMLDocument2OMElement()); - } - - public void stop(ExtensionPointRegistry registry) { - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator deleted file mode 100644 index a16317431c..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# Implementation class for the ExtensionActivator -org.apache.tuscany.sca.databinding.sdo2om.module.SDOAxiomModuleActivator \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/DataObject2OMElementTestCase.java b/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/DataObject2OMElementTestCase.java deleted file mode 100644 index 9d32991bf9..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/DataObject2OMElementTestCase.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo2om; - -import javax.xml.stream.XMLStreamException; - -import junit.framework.Assert; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -import commonj.sdo.DataObject; - -/** - * - */ -public class DataObject2OMElementTestCase extends SDOTransformerTestCaseBase { - - @Override - protected DataType getSourceDataType() { - return new DataTypeImpl(DataObject.class.getName(), DataObject.class, new XMLType(ORDER_QNAME, null)); - } - - @Override - protected DataType getTargetDataType() { - return new DataTypeImpl(OMElement.class.getName(), OMElement.class, new XMLType(ORDER_QNAME, null)); - } - - public final void testTransform() throws XMLStreamException { - OMElement element = new DataObject2OMElement().transform(dataObject, context); - Assert.assertEquals(ORDER_QNAME.getNamespaceURI(), element.getNamespace().getNamespaceURI()); - Assert.assertEquals(ORDER_QNAME.getLocalPart(), element.getLocalName()); -// TODO: This fails with Axiom 1.2.4 -// StringWriter writer = new StringWriter(); -// element.serialize(writer); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/SDOTransformerTestCaseBase.java b/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/SDOTransformerTestCaseBase.java deleted file mode 100644 index 7485910db6..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/SDOTransformerTestCaseBase.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo2om; - -import javax.xml.namespace.QName; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.impl.TransformationContextImpl; -import org.apache.tuscany.sca.interfacedef.DataType; - -import com.example.ipo.sdo.PurchaseOrderType; -import com.example.ipo.sdo.SdoFactory; -import com.example.ipo.sdo.USAddress; -import commonj.sdo.DataObject; -import commonj.sdo.helper.HelperContext; -import commonj.sdo.impl.HelperProvider; - -/** - * The base class for SDO-related test cases - */ -public abstract class SDOTransformerTestCaseBase extends TestCase { - protected static final QName ORDER_QNAME = new QName("http://www.example.com/IPO", "purchaseOrder"); - - protected HelperContext helperContext; - protected String binding = DataObject.class.getName(); - protected TransformationContext context; - protected TransformationContext reversedContext; - protected DataObject dataObject; - - /** - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - helperContext = HelperProvider.getDefaultContext(); - SdoFactory.INSTANCE.register(helperContext); - - context = new TransformationContextImpl(); - context.setSourceDataType(getSourceDataType()); - context.setTargetDataType(getTargetDataType()); - - reversedContext = new TransformationContextImpl(); - reversedContext.setSourceDataType(getTargetDataType()); - reversedContext.setTargetDataType(getSourceDataType()); - - PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType(); - USAddress address = SdoFactory.INSTANCE.createUSAddress(); - address.setCity("San Jose"); - address.setStreet("123 ABC St"); - address.setState("CA"); - address.setStreet("95131"); - po.setBillTo(address); - dataObject = (DataObject) po; - } - - protected abstract DataType getSourceDataType(); - - protected abstract DataType getTargetDataType(); - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/XMLDocument2OMElementTestCase.java b/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/XMLDocument2OMElementTestCase.java deleted file mode 100644 index e141e27098..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/java/org/apache/tuscany/sca/databinding/sdo2om/XMLDocument2OMElementTestCase.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo2om; - -import java.io.StringWriter; - -import javax.xml.stream.XMLStreamException; - -import junit.framework.Assert; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -import commonj.sdo.helper.XMLDocument; - -/** - * - */ -public class XMLDocument2OMElementTestCase extends SDOTransformerTestCaseBase { - - @Override - protected DataType getSourceDataType() { - return new DataTypeImpl(XMLDocument.class.getName(), XMLDocument.class, new XMLType(ORDER_QNAME, null)); - } - - @Override - protected DataType getTargetDataType() { - return new DataTypeImpl(OMElement.class.getName(), OMElement.class, new XMLType(ORDER_QNAME, null)); - } - - public final void testTransform() throws XMLStreamException { - XMLDocument document = - helperContext.getXMLHelper().createDocument(dataObject, - ORDER_QNAME.getNamespaceURI(), - ORDER_QNAME.getLocalPart()); - OMElement element = new XMLDocument2OMElement().transform(document, context); - Assert.assertEquals(ORDER_QNAME.getNamespaceURI(), element.getNamespace().getNamespaceURI()); - Assert.assertEquals(ORDER_QNAME.getLocalPart(), element.getLocalName()); - StringWriter writer = new StringWriter(); - element.serialize(writer); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/resources/ipo.xsd b/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/resources/ipo.xsd deleted file mode 100644 index 241ec15d36..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/resources/ipo.xsd +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - International Purchase order schema for Example.com - Copyright 2000 Example.com. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/resources/stock.xsd b/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/resources/stock.xsd deleted file mode 100644 index a0a6717371..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo-axiom/src/test/resources/stock.xsd +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/databinding-sdo/.checkstyle b/branches/sca-java-0.90/modules/databinding-sdo/.checkstyle deleted file mode 100644 index c7b30ffd5e..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/.checkstyle +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding-sdo/.ruleset b/branches/sca-java-0.90/modules/databinding-sdo/.ruleset deleted file mode 100644 index 27b9ab847c..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/.ruleset +++ /dev/null @@ -1,191 +0,0 @@ - - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding-sdo/DISCLAIMER b/branches/sca-java-0.90/modules/databinding-sdo/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/databinding-sdo/LICENSE b/branches/sca-java-0.90/modules/databinding-sdo/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/databinding-sdo/NOTICE b/branches/sca-java-0.90/modules/databinding-sdo/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/databinding-sdo/pom.xml b/branches/sca-java-0.90/modules/databinding-sdo/pom.xml deleted file mode 100755 index 4a244a0a58..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/pom.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - tuscany-databinding-sdo - Apache Tuscany Data Binding for SDO - - - - org.apache.tuscany.sca - tuscany-core-spi - 0.90-incubating-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-databinding - 0.90-incubating-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-xml - 0.90-incubating-SNAPSHOT - - - org.apache.tuscany.sdo - tuscany-sdo-impl - 1.0-incubating-beta1 - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.0 - - - add-test-source - generate-sources - - add-test-source - - - - target/sdo-source - - - - - - - org.apache.tuscany.sdo - tuscany-sdo-plugin - 1.0-incubating-beta1 - - - generate-po-sdo - generate-sources - - ${basedir}/src/test/resources/ipo.xsd - com.example.ipo.sdo - true - true - true - - - generate - - - - generate-stock-sdo - generate-sources - - ${basedir}/src/test/resources/stock.xsd - com.example.stock.sdo - Stock - true - true - true - - - generate - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2String.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2String.java deleted file mode 100755 index 405de57ab3..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2String.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.sdo; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.HelperContext; -import commonj.sdo.helper.XMLHelper; - -public class DataObject2String extends BaseTransformer implements - PullTransformer { - - public String transform(DataObject source, TransformationContext context) { - try { - HelperContext helperContext = SDOContextHelper.getHelperContext(context); - XMLHelper xmlHelper = helperContext.getXMLHelper(); - QName elementName = SDOContextHelper.getElement(context.getSourceDataType()); - return xmlHelper.save(source, elementName.getNamespaceURI(), elementName.getLocalPart()); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return DataObject.class; - } - - public Class getTargetType() { - return String.class; - } - - public int getWeight() { - return 40; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReader.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReader.java deleted file mode 100755 index 5b258b5429..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReader.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.sdo; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sdo.helper.XMLStreamHelper; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.HelperContext; -import commonj.sdo.helper.XMLDocument; -import commonj.sdo.helper.XMLHelper; - -public class DataObject2XMLStreamReader extends BaseTransformer implements - PullTransformer { - - public XMLStreamReader transform(DataObject source, TransformationContext context) { - try { - HelperContext helperContext = SDOContextHelper.getHelperContext(context); - XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(helperContext.getTypeHelper()); - QName elementName = SDOContextHelper.getElement(context.getSourceDataType()); - XMLHelper xmlHelper = helperContext.getXMLHelper(); - XMLDocument document = - xmlHelper.createDocument(source, elementName.getNamespaceURI(), elementName.getLocalPart()); - return streamHelper.createXMLStreamReader(document); - } catch (XMLStreamException e) { - // TODO: Add context to the exception - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return DataObject.class; - } - - public Class getTargetType() { - return XMLStreamReader.class; - } - - public int getWeight() { - return 10; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DuplicateHelperContextException.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DuplicateHelperContextException.java deleted file mode 100644 index c83e93dc4e..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/DuplicateHelperContextException.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.sdo; - - -/** - * @version $Rev$ $Date$ - */ -public class DuplicateHelperContextException extends RuntimeException { - private static final long serialVersionUID = -5229624905543066038L; - - /** - * Constructor specifying message and the ID of the duplicate HelperContext. - * - * @param message exception message - * @param identifier the id of the HelperContext that is already present - */ - public DuplicateHelperContextException(String message) { - super(message); - } -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextProcessor.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextProcessor.java deleted file mode 100644 index 561e5f3b39..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextProcessor.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.sdo; - -import java.beans.Introspector; -import java.lang.reflect.Field; -import java.lang.reflect.Method; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.implementation.java.JavaImplementation; -import org.apache.tuscany.sca.implementation.java.impl.JavaElementImpl; -import org.apache.tuscany.sca.implementation.java.impl.JavaResourceImpl; -import org.apache.tuscany.sca.implementation.java.introspect.IntrospectionException; -import org.apache.tuscany.sca.implementation.java.introspect.impl.BaseJavaClassVisitor; - -import commonj.sdo.helper.HelperContext; - -/** - * Processes {@link @HelperContext} annotations on a component implementation - * and adds a {@link JavaMappedProperty} to the component type which will be - * used to inject the appropriate context - * - * @version $Rev$ $Date$ - */ -public class HelperContextProcessor extends BaseJavaClassVisitor { - private HelperContextRegistry registry; - - /** - * @param registry - */ - public HelperContextProcessor(AssemblyFactory assemblyFactory, HelperContextRegistry registry) { - super(assemblyFactory); - this.registry = registry; - } - - /** - * 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) { - if (!name.startsWith("set")) { - return name; - } - return Introspector.decapitalize(name.substring(3)); - } - - public void visitMethod(Method method, - JavaImplementation type) throws IntrospectionException { - if (!method.isAnnotationPresent(org.apache.tuscany.sca.databinding.sdo.api.HelperContext.class)) { - return; - } - if (method.getParameterTypes().length != 1) { - throw new IllegalArgumentException("HelperContext setter must have one parameter: " + method); - } - Class paramType = method.getParameterTypes()[0]; - if (HelperContext.class == paramType) { - String name = toPropertyName(method.getName()); - JavaResourceImpl resource = new JavaResourceImpl(new JavaElementImpl(method, 0)); -// resource.setObjectFactory(new HelperContextFactory(context.getComponentId())); - type.getResources().put(name, resource); - } - } - - public void visitField(Field field, - JavaImplementation type) throws IntrospectionException { - if (!field.isAnnotationPresent(org.apache.tuscany.sca.databinding.sdo.api.HelperContext.class)) { - return; - } - Class paramType = field.getType(); - if (HelperContext.class == paramType) { - String name = field.getName(); - JavaResourceImpl resource = new JavaResourceImpl(new JavaElementImpl(field)); -// resource.setObjectFactory(new HelperContextFactory(context.getComponentId())); - type.getResources().put(name, resource); - } - } - - /* - private class HelperContextFactory implements ObjectFactory { - private URI id; - - public HelperContextFactory(URI id) { - super(); - this.id = id; - } - - public HelperContext getInstance() throws ObjectCreationException { - return registry.getHelperContext(id); - } - - } - */ -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextRegistry.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextRegistry.java deleted file mode 100644 index 75d9d33cbb..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextRegistry.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo; - -import commonj.sdo.helper.HelperContext; - -/** - * A registry for SDO HelperContext - * - * @version $Rev$ $Date$ - */ -public interface HelperContextRegistry { - /** - * Register a HelperContext with the id - * - * @param id - * @param context - */ - void register(Object id, HelperContext context) throws DuplicateHelperContextException; - - /** - * Unregister the HelperContext - * - * @param id - */ - void unregister(Object id); - - /** - * Get the HelperContext associated with the id - * - * @param id The URI of the HelperContext - * @return - */ - HelperContext getHelperContext(Object id); -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextRegistryImpl.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextRegistryImpl.java deleted file mode 100644 index 429946f78d..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/HelperContextRegistryImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import commonj.sdo.helper.HelperContext; - -/** - * A registry for SDO HelperContext - * - * @version $Rev$ $Date$ - */ -public class HelperContextRegistryImpl implements HelperContextRegistry { - private final Map registry = new ConcurrentHashMap(); - - public synchronized void register(Object id, HelperContext context) { - if (registry.containsKey(id)) { - throw new DuplicateHelperContextException("Duplicate HelperContext: " + id); - } - registry.put(id, context); - } - - public void unregister(Object id) { - registry.remove(id); - } - - public HelperContext getHelperContext(Object id) { - return registry.get(id); - } -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDO.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDO.java deleted file mode 100644 index 30a3e1c3a9..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDO.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.impl.BaseImpl; - -import commonj.sdo.helper.HelperContext; - -/** - * The model object for import.sdo - * - * @version $Rev$ $Date$ - */ -public class ImportSDO extends BaseImpl { - public static final QName IMPORT_SDO = - new QName("http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0", "import.sdo"); - - private HelperContext helperContext; - private String factoryClassName; - private String schemaLocation; - - public ImportSDO(HelperContext helperContext) { - super(); - this.helperContext = helperContext; - setUnresolved(true); - } - - public HelperContext getHelperContext() { - return helperContext; - } - - /** - * @return the factoryClassName - */ - public String getFactoryClassName() { - return factoryClassName; - } - - /** - * @param factoryClassName the factoryClassName to set - */ - public void setFactoryClassName(String factoryClassName) { - this.factoryClassName = factoryClassName; - } - - /** - * @return the schemaLocation - */ - public String getSchemaLocation() { - return schemaLocation; - } - - /** - * @param schemaLocation the schemaLocation to set - */ - public void setSchemaLocation(String schemaLocation) { - this.schemaLocation = schemaLocation; - } -} \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessor.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessor.java deleted file mode 100755 index 87b6cb3e4a..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessor.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.sdo; - -import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; -import static org.apache.tuscany.sca.databinding.sdo.ImportSDO.IMPORT_SDO; - -import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.net.URI; -import java.net.URL; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.contribution.service.ContributionReadException; -import org.apache.tuscany.sca.contribution.service.ContributionResolveException; -import org.apache.tuscany.sca.contribution.service.ContributionWriteException; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.helper.HelperContext; -import commonj.sdo.helper.XSDHelper; -import commonj.sdo.impl.HelperProvider; - -/** - * Loader that handles <import.sdo> elements. - * - * @version $Rev$ $Date$ - */ -public class ImportSDOProcessor implements StAXArtifactProcessor { - private HelperContextRegistry helperContextRegistry; - - public ImportSDOProcessor(HelperContextRegistry helperContextRegistry) { - super(); - this.helperContextRegistry = helperContextRegistry; - } - - public QName getXMLType() { - return IMPORT_SDO; - } - - public ImportSDO read(XMLStreamReader reader) throws ContributionReadException { - assert IMPORT_SDO.equals(reader.getName()); - - HelperContext helperContext = null; - - // FIXME: [rfeng] How to get the enclosing composite? - int id = System.identityHashCode(reader); - // FIXME: [rfeng] How to associate the TypeHelper with deployment - // context? - synchronized (helperContextRegistry) { - helperContext = helperContextRegistry.getHelperContext(id); - if (helperContext == null) { - helperContext = SDOUtil.createHelperContext(); - helperContextRegistry.register(id, helperContext); - } - } - - ImportSDO importSDO = new ImportSDO(helperContext); - String factoryName = reader.getAttributeValue(null, "factory"); - if (factoryName != null) { - importSDO.setFactoryClassName(factoryName); - } - String location = reader.getAttributeValue(null, "location"); - if (location != null) { - importSDO.setSchemaLocation(location); - } - - // Skip to end element - try { - while (reader.hasNext()) { - if (reader.next() == END_ELEMENT && ImportSDO.IMPORT_SDO.equals(reader.getName())) { - break; - } - } - } catch (XMLStreamException e) { - throw new ContributionReadException(e); - } - return importSDO; - } - - private void importFactory(ImportSDO importSDO) throws ContributionResolveException { - String factoryName = importSDO.getFactoryClassName(); - if (factoryName != null) { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - try { - Class factoryClass = cl.loadClass(factoryName); - register(factoryClass, importSDO.getHelperContext()); - } catch (Exception e) { - throw new ContributionResolveException(e); - } - importSDO.setUnresolved(false); - } - } - - private static void register(Class factoryClass, HelperContext helperContext) throws Exception { - Field field = factoryClass.getField("INSTANCE"); - Object factory = field.get(null); - Method method = factory.getClass().getMethod("register", new Class[] {HelperContext.class}); - method.invoke(factory, new Object[] {helperContext}); - - // FIXME: How do we associate the application HelperContext with the one - // imported by the composite - HelperContext defaultContext = HelperProvider.getDefaultContext(); - method.invoke(factory, new Object[] {defaultContext}); - } - - private void importWSDL(ImportSDO importSDO) throws ContributionResolveException { - String location = importSDO.getSchemaLocation(); - if (location != null) { - try { - URL wsdlURL = null; - URI uri = URI.create(location); - if (uri.isAbsolute()) { - wsdlURL = uri.toURL(); - } - wsdlURL = Thread.currentThread().getContextClassLoader().getResource(location); - if (null == wsdlURL) { - ContributionResolveException loaderException = new ContributionResolveException( - "WSDL location error"); - throw loaderException; - } - InputStream xsdInputStream = wsdlURL.openStream(); - try { - XSDHelper xsdHelper = importSDO.getHelperContext().getXSDHelper(); - xsdHelper.define(xsdInputStream, wsdlURL.toExternalForm()); - } finally { - xsdInputStream.close(); - } - // FIXME: How do we associate the application HelperContext with - // the one - // imported by the composite - HelperContext defaultContext = HelperProvider.getDefaultContext(); - xsdInputStream = wsdlURL.openStream(); - try { - XSDHelper xsdHelper = defaultContext.getXSDHelper(); - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - xsdHelper.define(xsdInputStream, wsdlURL.toExternalForm()); - } finally { - xsdInputStream.close(); - } - } catch (IOException e) { - throw new ContributionResolveException(e); - } - importSDO.setUnresolved(false); - } - } - - public QName getArtifactType() { - return ImportSDO.IMPORT_SDO; - } - - public void write(ImportSDO model, XMLStreamWriter outputSource) throws ContributionWriteException { - // TODO Auto-generated method stub - - } - - public Class getModelType() { - return ImportSDO.class; - } - - public void resolve(ImportSDO importSDO, ModelResolver resolver) throws ContributionResolveException { - importFactory(importSDO); - importWSDL(importSDO); - if (!importSDO.isUnresolved()) { - resolver.addModel(importSDO); - } - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java deleted file mode 100644 index 78058a5969..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOContextHelper.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo; - -import java.awt.Component; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.util.XMLType; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.helper.HelperContext; -import commonj.sdo.impl.HelperProvider; - -/** - * Helper class to get TypeHelper from the context - */ -public final class SDOContextHelper { - private SDOContextHelper() { - } - - public static HelperContext getHelperContext(TransformationContext context) { - if (context == null || context.getMetadata() == null) { - return getDefaultHelperContext(); - } - HelperContext helperContext = null; - Component composite = (Component)context.getMetadata().get(Component.class); - if (composite != null) { - // SDOHelperContext sdoContext = - // (SDOHelperContext)composite.getExtensions().get(HelperContext.class.getName()); - // if (sdoContext != null) { - // helperContext = sdoContext.getHelperContext(); - // } - // AtomicComponent child = - // (AtomicComponent)composite.getSystemChild(HelperContext.class.getName()); - // try { - // helperContext = (HelperContext)child.getTargetInstance(); - // } catch (TargetResolutionException e) { - // helperContext = null; - // } - } - if (helperContext == null) { - return getDefaultHelperContext(); - } else { - return helperContext; - } - } - - public static HelperContext getHelperContext(Composite model) { - HelperContext helperContext = null; - for (Object ext : model.getExtensions()) { - if (ext instanceof HelperContext) { - helperContext = (HelperContext)ext; - break; - } - } - if (helperContext == null) { - helperContext = SDOUtil.createHelperContext(); - model.getExtensions().add(helperContext); - } - - if (helperContext == null) { - helperContext = getDefaultHelperContext(); - } - - return helperContext; - } - - protected static HelperContext getDefaultHelperContext() { - // SDOUtil.createHelperContext(); - return HelperProvider.getDefaultContext(); - } - - public static QName getElement(DataType dataType) { - Object logical = dataType.getLogical(); - QName elementName = SDODataBinding.ROOT_ELEMENT; - if (logical instanceof XMLType) { - XMLType xmlType = (XMLType)logical; - QName element = xmlType.getElementName(); - if (element != null) { - elementName = element; - } - } - return elementName; - } -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java deleted file mode 100644 index 2736d4bbde..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDODataBinding.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo; - -import java.lang.annotation.Annotation; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.databinding.ExceptionHandler; -import org.apache.tuscany.sca.databinding.SimpleTypeMapper; -import org.apache.tuscany.sca.databinding.WrapperHandler; -import org.apache.tuscany.sca.databinding.impl.BaseDataBinding; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; -import commonj.sdo.helper.CopyHelper; -import commonj.sdo.helper.HelperContext; -import commonj.sdo.helper.XMLDocument; -import commonj.sdo.impl.HelperProvider; - -/** - * SDO Databinding - * - * @version $Reve$ $Date$ - */ -public class SDODataBinding extends BaseDataBinding { - public static final String NAME = DataObject.class.getName(); - public static final String[] ALIASES = new String[] {"sdo"}; - - public static final String ROOT_NAMESPACE = "commonj.sdo"; - public static final QName ROOT_ELEMENT = new QName(ROOT_NAMESPACE, "dataObject"); - - private WrapperHandler wrapperHandler; - - public SDODataBinding() { - super(NAME, ALIASES, DataObject.class); - wrapperHandler = new SDOWrapperHandler(); - } - - @Override - public boolean introspect(DataType dataType, Annotation[] annotations) { - Object physical = dataType.getPhysical(); - if (!(physical instanceof Class)) { - return false; - } - Class javaType = (Class)physical; - HelperContext context = HelperProvider.getDefaultContext(); - // FIXME: Need a better to test dynamic SDO - if (DataObject.class.isAssignableFrom(javaType)) { - // Dynamic SDO - dataType.setDataBinding(getName()); - dataType.setLogical(XMLType.UNKNOWN); - return true; - } - // FIXME: We need to access HelperContext - Type type = context.getTypeHelper().getType(javaType); - if (type == null) { - return false; - } - if (type.isDataType()) { - // FIXME: Ignore simple types? - return false; - } - String namespace = type.getURI(); - String name = context.getXSDHelper().getLocalName(type); - QName xmlType = new QName(namespace, name); - dataType.setDataBinding(getName()); - dataType.setLogical(new XMLType(null, xmlType)); - return true; - } - - @Override - public WrapperHandler getWrapperHandler() { - return wrapperHandler; - } - - public SimpleTypeMapper getSimpleTypeMapper() { - return new SDOSimpleTypeMapper(); - } - - @Override - public Object copy(Object arg) { - HelperContext context = HelperProvider.getDefaultContext(); - CopyHelper copyHelper = context.getCopyHelper(); - if (arg instanceof XMLDocument) { - XMLDocument document = (XMLDocument)arg; - DataObject dataObject = copyHelper.copy(document.getRootObject()); - return context.getXMLHelper().createDocument(dataObject, - document.getRootElementURI(), - document.getRootElementName()); - } else if (arg instanceof DataObject) { - return context.getCopyHelper().copy((DataObject)arg); - } else { - return super.copy(arg); - } - } - - @Override - public ExceptionHandler getExceptionHandler() { - return new SDOExceptionHandler(); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOExceptionHandler.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOExceptionHandler.java deleted file mode 100644 index 1056d2ec38..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOExceptionHandler.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Method; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.databinding.ExceptionHandler; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -import commonj.sdo.Type; -import commonj.sdo.helper.HelperContext; -import commonj.sdo.impl.HelperProvider; - -/** - * SDO implementation of ExceptionHandler - * - * @version $Rev$ $Date$ - */ -public class SDOExceptionHandler implements ExceptionHandler { - private static final Class[] EMPTY_CLASS_ARRAY = new Class[0]; - - // FIXME: Need a way to pass in the HelperContext - private HelperContext helperContext = HelperProvider.getDefaultContext(); - - /** - *
    - *
  • WrapperException(String message, FaultBean faultInfo)
    - * A constructor where WrapperException is replaced with the name of the - * generated wrapper exception and FaultBean is replaced by the name of the - * generated fault bean. - *
  • WrapperException(String message, FaultBean faultInfo, Throwable - * cause)
    - * A constructor whereWrapperException is replaced with the name of the - * generated wrapper exception and FaultBean is replaced by the name of the - * generated fault bean. The last argument, cause, may be used to convey - * protocol specific fault information - *
- */ - public Exception createException(DataType exceptionType, String message, Object faultInfo, Throwable cause) { - Class exceptionClass = (Class)exceptionType.getPhysical(); - DataType faultBeanType = exceptionType.getLogical(); - Class faultBeanClass = (Class)faultBeanType.getPhysical(); - try { - Constructor constructor = - exceptionClass.getConstructor(new Class[] {String.class, faultBeanClass, Throwable.class}); - return (Exception)constructor.newInstance(new Object[] {message, faultInfo, cause}); - } catch (Throwable e) { - throw new IllegalArgumentException(e); - } - } - - public Object getFaultInfo(Exception exception) { - if (exception == null) { - return null; - } - try { - Method method = exception.getClass().getMethod("getFaultInfo", EMPTY_CLASS_ARRAY); - return method.invoke(exception, (Object[])null); - } catch (Throwable e) { - throw new IllegalArgumentException(e); - } - } - - public DataType getFaultType(DataType exceptionDataType) { - Class exceptionType = (Class) exceptionDataType.getPhysical(); - Class faultBeanClass = null; - try { - Method method = exceptionType.getMethod("getFaultInfo", EMPTY_CLASS_ARRAY); - faultBeanClass = method.getReturnType(); - } catch (NoSuchMethodException e) { - faultBeanClass = null; - } - if (faultBeanClass == null) { - return null; - } - - QName faultElement = null; - try { - Field field = exceptionType.getField("FAULT_ELEMENT"); - faultElement = (QName)field.get(null); - } catch (NoSuchFieldException e) { - // Fall back to type inspection - Type type = helperContext.getTypeHelper().getType(faultBeanClass); - if (type != null) { - String ns = type.getURI(); - String name = helperContext.getXSDHelper().getLocalName(type); - faultElement = new QName(ns, name); - } - } catch (Throwable e) { - // Ignore - } - if (faultElement == null) { - return null; - } - DataType faultType = - new DataTypeImpl(SDODataBinding.NAME, faultBeanClass, new XMLType(faultElement, null)); - return faultType; - - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOSimpleTypeMapper.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOSimpleTypeMapper.java deleted file mode 100644 index f4e2044aa2..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOSimpleTypeMapper.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.databinding.SimpleTypeMapper; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.Type; -import commonj.sdo.helper.HelperContext; -import commonj.sdo.helper.TypeHelper; - -/** - * SDO Java/XML mapping for simple XSD types - */ -public class SDOSimpleTypeMapper implements SimpleTypeMapper { - public static final String URI_2001_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema"; - - public SDOSimpleTypeMapper() { - super(); - } - - public Object toJavaObject(QName typeName, String value, TransformationContext context) { - Type type = null; - if (URI_2001_SCHEMA_XSD.equals(typeName.getNamespaceURI())) { - type = SDOUtil.getXSDSDOType(typeName.getLocalPart()); - } else { - HelperContext helperContext = SDOContextHelper.getHelperContext(context); - TypeHelper typeHelper = helperContext.getTypeHelper(); - type = typeHelper.getType(typeName.getNamespaceURI(), typeName.getLocalPart()); - } - return SDOUtil.createFromString(type, value); - } - - public String toXMLLiteral(QName typeName, Object obj, TransformationContext context) { - Type type = null; - if (URI_2001_SCHEMA_XSD.equals(typeName.getNamespaceURI())) { - type = SDOUtil.getXSDSDOType(typeName.getLocalPart()); - } else { - HelperContext helperContext = SDOContextHelper.getHelperContext(context); - TypeHelper typeHelper = helperContext.getTypeHelper(); - type = typeHelper.getType(typeName.getNamespaceURI(), typeName.getLocalPart()); - } - return SDOUtil.convertToString(type, obj); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandler.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandler.java deleted file mode 100644 index d89627da71..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandler.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.WrapperHandler; -import org.apache.tuscany.sca.interfacedef.util.ElementInfo; - -import commonj.sdo.DataObject; -import commonj.sdo.Property; -import commonj.sdo.Sequence; -import commonj.sdo.Type; -import commonj.sdo.helper.DataFactory; -import commonj.sdo.helper.HelperContext; -import commonj.sdo.helper.XMLDocument; -import commonj.sdo.helper.XMLHelper; - -/** - * SDO Wrapper Handler - */ -public class SDOWrapperHandler implements WrapperHandler { - - /** - * @see org.apache.tuscany.sca.databinding.WrapperHandler#create(ElementInfo, TransformationContext) - */ - public Object create(ElementInfo element, TransformationContext context) { - HelperContext helperContext = SDOContextHelper.getHelperContext(context); - QName typeName = element.getType().getQName(); - DataFactory dataFactory = helperContext.getDataFactory(); - DataObject root = dataFactory.create(typeName.getNamespaceURI(), typeName.getLocalPart()); - XMLHelper xmlHelper = helperContext.getXMLHelper(); - return xmlHelper.createDocument(root, element.getQName().getNamespaceURI(), element.getQName().getLocalPart()); - } - - /** - * @see org.apache.tuscany.sca.databinding.WrapperHandler#setChild(java.lang.Object, int, ElementInfo, - * java.lang.Object) - */ - public void setChild(Object wrapper, int i, ElementInfo childElement, Object value) { - DataObject wrapperDO = - (wrapper instanceof XMLDocument) ? ((XMLDocument)wrapper).getRootObject() : (DataObject)wrapper; - wrapperDO.set(i, value); - } - - @SuppressWarnings("unchecked") - public List getChildren(Object wrapper) { - DataObject wrapperDO = - (wrapper instanceof XMLDocument) ? ((XMLDocument)wrapper).getRootObject() : (DataObject)wrapper; - List properties = wrapperDO.getInstanceProperties(); - List elements = new ArrayList(); - Type type = wrapperDO.getType(); - if (type.isSequenced()) { - // Add values in the sequence - Sequence sequence = wrapperDO.getSequence(); - for (int i = 0; i < sequence.size(); i++) { - // Skip mixed text - if (sequence.getProperty(i) != null) { - elements.add(sequence.getValue(i)); - } - } - } else { - for (Property p : properties) { - Object child = wrapperDO.get(p); - if (p.isMany()) { - for (Object c : (Collection)child) { - elements.add(c); - } - } else { - elements.add(child); - } - } - } - return elements; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/String2DataObject.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/String2DataObject.java deleted file mode 100755 index 01ec74bb30..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/String2DataObject.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.sdo; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.HelperContext; -import commonj.sdo.helper.XMLHelper; - -public class String2DataObject extends BaseTransformer implements - PullTransformer { - - public DataObject transform(String source, TransformationContext context) { - try { - HelperContext helperContext = SDOContextHelper.getHelperContext(context); - XMLHelper xmlHelper = helperContext.getXMLHelper(); - return xmlHelper.load(source).getRootObject(); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return String.class; - } - - public Class getTargetType() { - return DataObject.class; - } - - public int getWeight() { - return 50; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2String.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2String.java deleted file mode 100644 index d11e6e46d9..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2String.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.sdo; - -import java.io.StringWriter; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -import commonj.sdo.helper.HelperContext; -import commonj.sdo.helper.XMLDocument; -import commonj.sdo.helper.XMLHelper; - -public class XMLDocument2String extends BaseTransformer implements - PullTransformer { - - public String transform(XMLDocument source, TransformationContext context) { - try { - HelperContext helperContext = SDOContextHelper.getHelperContext(context); - XMLHelper xmlHelper = helperContext.getXMLHelper(); - StringWriter writer = new StringWriter(); - xmlHelper.save(source, writer, null); - return writer.toString(); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return XMLDocument.class; - } - - public Class getTargetType() { - return String.class; - } - - public int getWeight() { - return 40; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReader.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReader.java deleted file mode 100755 index 9e888258f0..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReader.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.sdo; - -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sdo.helper.XMLStreamHelper; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.helper.HelperContext; -import commonj.sdo.helper.XMLDocument; - -public class XMLDocument2XMLStreamReader extends BaseTransformer implements - PullTransformer { - /** - * @param source - * @param context - * @return - */ - public XMLStreamReader transform(XMLDocument source, TransformationContext context) { - try { - HelperContext helperContext = SDOContextHelper.getHelperContext(context); - XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(helperContext.getTypeHelper()); - return streamHelper.createXMLStreamReader(source); - } catch (XMLStreamException e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return XMLDocument.class; - } - - public Class getTargetType() { - return XMLStreamReader.class; - } - - public int getWeight() { - return 10; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2DataObject.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2DataObject.java deleted file mode 100755 index 8797ed1f28..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2DataObject.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.sdo; - -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sdo.helper.XMLStreamHelper; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.DataObject; -import commonj.sdo.helper.HelperContext; - -public class XMLStreamReader2DataObject extends BaseTransformer implements - PullTransformer { - - public DataObject transform(XMLStreamReader source, TransformationContext context) { - try { - HelperContext helperContext = SDOContextHelper.getHelperContext(context); - XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(helperContext.getTypeHelper()); - // The XMLStreamHelper requires that the reader is posistioned at - // START_ELEMENT - while (source.getEventType() != XMLStreamConstants.START_ELEMENT && source.hasNext()) { - source.next(); - } - return streamHelper.loadObject(source); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getTargetType() { - return DataObject.class; - } - - public Class getSourceType() { - return XMLStreamReader.class; - } - - public int getWeight() { - return 15; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2XMLDocument.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2XMLDocument.java deleted file mode 100755 index 43b05d9cb8..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/XMLStreamReader2XMLDocument.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.sdo; - -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sdo.helper.XMLStreamHelper; -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.helper.HelperContext; -import commonj.sdo.helper.XMLDocument; - -public class XMLStreamReader2XMLDocument extends BaseTransformer implements - PullTransformer { - - public XMLDocument transform(XMLStreamReader source, TransformationContext context) { - try { - HelperContext helperContext = SDOContextHelper.getHelperContext(context); - XMLStreamHelper streamHelper = SDOUtil.createXMLStreamHelper(helperContext.getTypeHelper()); - return streamHelper.load(source); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getTargetType() { - return XMLDocument.class; - } - - public Class getSourceType() { - return XMLStreamReader.class; - } - - public int getWeight() { - return 15; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/api/HelperContext.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/api/HelperContext.java deleted file mode 100644 index 9b6beead14..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/api/HelperContext.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.sdo.api; - -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; - -/** - * This annotation can be used by component implementation class to receive the - * SDO HelperContext. - * - * @version $Rev$ $Date$ - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) -public @interface HelperContext { -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/module/SDODataBindingModuleActivator.java b/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/module/SDODataBindingModuleActivator.java deleted file mode 100644 index 4f6caa6ec0..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/module/SDODataBindingModuleActivator.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo.module; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.ModelFactoryExtensionPoint; -import org.apache.tuscany.sca.core.ModuleActivator; -import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; -import org.apache.tuscany.sca.databinding.TransformerExtensionPoint; -import org.apache.tuscany.sca.databinding.sdo.DataObject2String; -import org.apache.tuscany.sca.databinding.sdo.DataObject2XMLStreamReader; -import org.apache.tuscany.sca.databinding.sdo.HelperContextProcessor; -import org.apache.tuscany.sca.databinding.sdo.HelperContextRegistry; -import org.apache.tuscany.sca.databinding.sdo.HelperContextRegistryImpl; -import org.apache.tuscany.sca.databinding.sdo.ImportSDOProcessor; -import org.apache.tuscany.sca.databinding.sdo.SDODataBinding; -import org.apache.tuscany.sca.databinding.sdo.String2DataObject; -import org.apache.tuscany.sca.databinding.sdo.XMLDocument2String; -import org.apache.tuscany.sca.databinding.sdo.XMLDocument2XMLStreamReader; -import org.apache.tuscany.sca.databinding.sdo.XMLStreamReader2DataObject; -import org.apache.tuscany.sca.databinding.sdo.XMLStreamReader2XMLDocument; -import org.apache.tuscany.sca.implementation.java.introspect.JavaClassIntrospectorExtensionPoint; - -/** - * @version $Rev$ $Date$ - */ -public class SDODataBindingModuleActivator implements ModuleActivator { - - public Object[] getExtensionPoints() { - return null; - } - - public void start(ExtensionPointRegistry registry) { - ModelFactoryExtensionPoint factories = registry.getExtensionPoint(ModelFactoryExtensionPoint.class); - AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class); - - DataBindingExtensionPoint dataBindings = registry.getExtensionPoint(DataBindingExtensionPoint.class); - dataBindings.addDataBinding(new SDODataBinding()); - - StAXArtifactProcessorExtensionPoint processors = registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class); - HelperContextRegistry contextRegistry = new HelperContextRegistryImpl(); - processors.addArtifactProcessor(new ImportSDOProcessor(contextRegistry)); - - TransformerExtensionPoint transformers = registry.getExtensionPoint(TransformerExtensionPoint.class); - transformers.addTransformer(new DataObject2String()); - transformers.addTransformer(new DataObject2XMLStreamReader()); - transformers.addTransformer(new XMLDocument2String()); - transformers.addTransformer(new String2DataObject()); - transformers.addTransformer(new XMLDocument2XMLStreamReader()); - transformers.addTransformer(new XMLStreamReader2DataObject()); - transformers.addTransformer(new XMLStreamReader2XMLDocument()); - - JavaClassIntrospectorExtensionPoint introspectors = registry.getExtensionPoint(JavaClassIntrospectorExtensionPoint.class); - introspectors.addClassVisitor(new HelperContextProcessor(assemblyFactory, contextRegistry)); - - } - - public void stop(ExtensionPointRegistry registry) { - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/branches/sca-java-0.90/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator deleted file mode 100644 index b39b5ae567..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# Implementation class for the ExtensionActivator -org.apache.tuscany.sca.databinding.sdo.module.SDODataBindingModuleActivator diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/com/example/stock/sdo/fault/InvalidSymbolFault_Exception.java b/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/com/example/stock/sdo/fault/InvalidSymbolFault_Exception.java deleted file mode 100644 index 8c4f243df5..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/com/example/stock/sdo/fault/InvalidSymbolFault_Exception.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package com.example.stock.sdo.fault; - -import javax.xml.namespace.QName; - -import com.example.stock.sdo.InvalidSymbolFault; - -/** - * Hand-crafted java exception for SDO fault - * - */ -public class InvalidSymbolFault_Exception extends Exception { - /** - * Generated QName for the fault element - */ - public static final QName FAULT_ELEMENT = new QName("http://www.example.com/stock", "InvalidSymbolFault"); - /** - * Java type that goes as soapenv:Fault detail element. - */ - private InvalidSymbolFault faultInfo; - - /** - * @param faultInfo - * @param message - */ - public InvalidSymbolFault_Exception(String message, InvalidSymbolFault faultInfo) { - super(message); - this.faultInfo = faultInfo; - } - - /** - * @param faultInfo - * @param message - * @param cause - */ - public InvalidSymbolFault_Exception(String message, InvalidSymbolFault faultInfo, Throwable cause) { - super(message, cause); - this.faultInfo = faultInfo; - } - - /** - * @return returns fault bean: - * org.apache.tuscany.sca.test.exceptions.impl.jaxb.InvalidSymbolFault - */ - public InvalidSymbolFault getFaultInfo() { - return faultInfo; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2StringTestCase.java b/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2StringTestCase.java deleted file mode 100644 index 3665434cee..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2StringTestCase.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -import com.example.ipo.sdo.PurchaseOrderType; -import commonj.sdo.DataObject; - -/** - * - */ -public class DataObject2StringTestCase extends SDOTransformerTestCaseBase { - @Override - protected DataType getSourceDataType() { - return new DataTypeImpl(binding, PurchaseOrderType.class, new XMLType(ORDER_QNAME, null)); - } - - @Override - protected DataType getTargetDataType() { - return new DataTypeImpl>(String.class, String.class); - } - - public final void testTransform() { - String xml = new DataObject2String().transform(dataObject, context); - Assert.assertTrue(xml.indexOf("San Jose") != -1); - DataObject po = new String2DataObject().transform(xml, reversedContext); - Assert.assertTrue(po instanceof PurchaseOrderType); - PurchaseOrderType orderType = (PurchaseOrderType)po; - Assert.assertEquals("San Jose", orderType.getBillTo().getCity()); - } - - public final void testXML() { - String xml = - ""; - DataObject dataObject = new String2DataObject().transform(xml, reversedContext); - context.setSourceDataType(new DataTypeImpl(DataObject.class.getName(), DataObject.class, null)); - xml = new DataObject2String().transform(dataObject, context); - Assert.assertTrue(xml.contains("xsi:type=\"ipo:USAddress\"")); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReaderTestCase.java b/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReaderTestCase.java deleted file mode 100644 index 369912f115..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/DataObject2XMLStreamReaderTestCase.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo; - -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -import com.example.ipo.sdo.PurchaseOrderType; - -/** - * - */ -public class DataObject2XMLStreamReaderTestCase extends SDOTransformerTestCaseBase { - - @Override - protected DataType getSourceDataType() { - return new DataTypeImpl(binding, PurchaseOrderType.class, new XMLType(ORDER_QNAME, null)); - } - - @Override - protected DataType getTargetDataType() { - return new DataTypeImpl>(XMLStreamReader.class, XMLStreamReader.class); - } - - public final void testTransform() throws XMLStreamException { - XMLStreamReader reader = new DataObject2XMLStreamReader().transform(dataObject, context); - while (reader.hasNext()) { - int event = reader.next(); - if (event == XMLStreamConstants.START_ELEMENT) { - break; - } - } - new XMLStreamReader2DataObject().transform(reader, reversedContext); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/HelperContextProcessorTestCase.java b/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/HelperContextProcessorTestCase.java deleted file mode 100644 index c6fc6813e0..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/HelperContextProcessorTestCase.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo; - -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.net.URI; - -import javax.xml.stream.XMLInputFactory; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.DefaultAssemblyFactory; -import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory; -import org.apache.tuscany.sca.implementation.java.JavaImplementation; -import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory; -import org.apache.tuscany.sca.implementation.java.impl.JavaResourceImpl; - -import commonj.sdo.helper.HelperContext; - -/** - * @version $Rev$ $Date$ - */ -public class HelperContextProcessorTestCase extends TestCase { - - @SuppressWarnings("unchecked") - public void testProcessor() throws Exception { - HelperContextRegistry registry = new HelperContextRegistryImpl(); - HelperContextProcessor processor = new HelperContextProcessor(new DefaultAssemblyFactory(), registry); - URI id = URI.create("/composite1/"); - XMLInputFactory xmlFactory = XMLInputFactory.newInstance(); - - AssemblyFactory assemblyFactory = new DefaultAssemblyFactory(); - JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory(); - JavaImplementation componentType = javaImplementationFactory.createJavaImplementation(); - componentType.setJavaClass(FooImpl.class); - for (Field f : FooImpl.class.getDeclaredFields()) { - processor.visitField(f, componentType); - - } - for (Method m : FooImpl.class.getMethods()) { - processor.visitMethod(m, componentType); - } - - JavaResourceImpl r1 = (JavaResourceImpl)componentType.getResources().get("context"); - assertNotNull(r1); - JavaResourceImpl r2 = (JavaResourceImpl)componentType.getResources().get("context2"); - assertNotNull(r2); -// HelperContext c1 = (HelperContext)r1.getObjectFactory().getInstance(); -// HelperContext c2 = (HelperContext)r2.getObjectFactory().getInstance(); -// assertSame(c1, c2); - } - - private static class FooImpl { - @org.apache.tuscany.sca.databinding.sdo.api.HelperContext - protected HelperContext context2; - - private HelperContext context; - - @org.apache.tuscany.sca.databinding.sdo.api.HelperContext - public void setContext(HelperContext context1) { - this.context = context1; - } - } -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessorTestCase.java b/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessorTestCase.java deleted file mode 100755 index cd7a02cb88..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/ImportSDOProcessorTestCase.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.sdo; - -import java.io.StringReader; -import java.net.URI; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import com.example.ipo.sdo.SdoFactory; - -/** - * @version $Rev$ $Date$ - */ -public class ImportSDOProcessorTestCase extends TestCase { - private static boolean inited; - - private ImportSDOProcessor loader; - private XMLInputFactory xmlFactory; - - public void testMinimal() throws Exception { - String xml = ""; - XMLStreamReader reader = getReader(xml); - assertTrue(loader.read(reader) instanceof ImportSDO); - } - - public void testLocation() throws Exception { - String xml = ""; - XMLStreamReader reader = getReader(xml); - assertTrue(loader.read(reader) instanceof ImportSDO); - } - - public void testFactory() throws Exception { - String xml = ""; - XMLStreamReader reader = getReader(xml); - assertFalse(inited); - ImportSDO importSDO = loader.read(reader); - assertNotNull(importSDO); - loader.resolve(importSDO, new TestModelResolver(getClass().getClassLoader())); - assertTrue(inited); - } - - protected void setUp() throws Exception { - super.setUp(); - URI id = URI.create("/composite1/"); - loader = new ImportSDOProcessor(new HelperContextRegistryImpl()); - xmlFactory = XMLInputFactory.newInstance(); - } - - protected XMLStreamReader getReader(String xml) throws XMLStreamException { - XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(xml)); - reader.next(); - return reader; - } - - public static class MockFactory { - public static final Object INSTANCE = SdoFactory.INSTANCE; - - static { - ImportSDOProcessorTestCase.inited = true; - } - } -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDODataBindingTestCase.java b/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDODataBindingTestCase.java deleted file mode 100644 index 17e4901cc2..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDODataBindingTestCase.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo; - -import javax.xml.namespace.QName; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -import com.example.ipo.sdo.PurchaseOrderType; -import com.example.ipo.sdo.SdoFactory; -import com.example.ipo.sdo.USAddress; -import commonj.sdo.DataObject; -import commonj.sdo.helper.HelperContext; -import commonj.sdo.helper.XMLDocument; -import commonj.sdo.impl.HelperProvider; - -/** - * - */ -public class SDODataBindingTestCase extends TestCase { - protected static final QName ORDER_QNAME = new QName("http://www.example.com/IPO", "purchaseOrder"); - private SDODataBinding binding; - private HelperContext context; - - /** - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - binding = new SDODataBinding(); - context = HelperProvider.getDefaultContext(); - SdoFactory.INSTANCE.register(context); - } - - public final void testIntrospect() { - DataType dataType = new DataTypeImpl(DataObject.class, null); - boolean yes = binding.introspect(dataType, null); - assertTrue(yes); - assertTrue(dataType.getDataBinding().equals(binding.getName())); - assertTrue(dataType.getPhysical() == DataObject.class && dataType.getLogical() == XMLType.UNKNOWN); - dataType = new DataTypeImpl(PurchaseOrderType.class, null); - yes = binding.introspect(dataType, null); - assertTrue(yes); - assertEquals(PurchaseOrderType.class, dataType.getPhysical()); - assertEquals(new QName("http://www.example.com/IPO", "PurchaseOrderType"), ((XMLType)dataType.getLogical()) - .getTypeName()); - dataType = new DataTypeImpl(USAddress.class, null); - yes = binding.introspect(dataType, null); - assertTrue(yes); - assertEquals(USAddress.class, dataType.getPhysical()); - assertEquals(new QName("http://www.example.com/IPO", "USAddress"), ((XMLType)dataType.getLogical()) - .getTypeName()); - } - - public final void testCopyRoot() { - PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType(); - po.setComment("Comment"); - Object copy = binding.copy(po); - assertTrue(copy instanceof PurchaseOrderType); - assertTrue(po != copy); - assertTrue(context.getEqualityHelper().equal((DataObject)po, (DataObject)copy)); - assertEquals("Comment", ((PurchaseOrderType)copy).getComment()); - } - - public final void testCopyNonRoot() { - USAddress address = SdoFactory.INSTANCE.createUSAddress(); - address.setCity("San Jose"); - Object copy = binding.copy(address); - assertTrue(copy instanceof USAddress); - assertTrue(address != copy); - assertTrue(context.getEqualityHelper().equal((DataObject)address, (DataObject)copy)); - assertEquals("San Jose", ((USAddress)copy).getCity()); - } - - public final void testCopyXMLDocument() { - PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType(); - po.setComment("Comment"); - XMLDocument doc = - context.getXMLHelper().createDocument((DataObject)po, - ORDER_QNAME.getNamespaceURI(), - ORDER_QNAME.getLocalPart()); - Object copy = binding.copy(doc); - assertTrue(copy instanceof XMLDocument); - XMLDocument docCopy = (XMLDocument)copy; - assertTrue(doc != copy); - assertTrue(context.getEqualityHelper().equal((DataObject)po, docCopy.getRootObject())); - assertEquals("Comment", ((PurchaseOrderType)docCopy.getRootObject()).getComment()); - } -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOExceptionHandlerTestCase.java b/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOExceptionHandlerTestCase.java deleted file mode 100644 index f8373cfd1c..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOExceptionHandlerTestCase.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -import com.example.stock.sdo.InvalidSymbolFault; -import com.example.stock.sdo.StockFactory; -import com.example.stock.sdo.fault.InvalidSymbolFault_Exception; -import commonj.sdo.impl.HelperProvider; - -/** - * Test case for SDOExceptionHandler - */ -public class SDOExceptionHandlerTestCase extends TestCase { - // FIXME: Tuscany SDO impl uses _._type for anonymouse type, by the SDO - // spec, it should be same as the - // enclosing element/attribute name - private SDOExceptionHandler handler; - - /** - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - this.handler = new SDOExceptionHandler(); - StockFactory.INSTANCE.register(HelperProvider.getDefaultContext()); - } - - public void testGetFaultType() { - DataType execType = new DataTypeImpl(InvalidSymbolFault_Exception.class, XMLType.UNKNOWN); - DataType dataType = handler.getFaultType(execType); - assertEquals(InvalidSymbolFault.class, dataType.getPhysical()); - assertEquals(InvalidSymbolFault_Exception.FAULT_ELEMENT, ((XMLType) dataType.getLogical()).getElementName()); - assertEquals(SDODataBinding.NAME, dataType.getDataBinding()); - } - - public void testCreate() { - DataType execType = new DataTypeImpl(InvalidSymbolFault_Exception.class, XMLType.UNKNOWN); - DataType faultType = handler.getFaultType(execType); - InvalidSymbolFault fault = StockFactory.INSTANCE.createInvalidSymbolFault(); - fault.setMessage("ABC"); - fault.setSymbol("IBM0"); - DataType exType = new DataTypeImpl(InvalidSymbolFault_Exception.class, faultType); - Exception ex = handler.createException(exType, "Invalid symbol", fault, null); - assertTrue(ex instanceof InvalidSymbolFault_Exception); - InvalidSymbolFault_Exception exception = (InvalidSymbolFault_Exception)ex; - assertEquals("Invalid symbol", exception.getMessage()); - assertSame(fault, exception.getFaultInfo()); - } - - public void testGetFaultInfo() { - InvalidSymbolFault fault = StockFactory.INSTANCE.createInvalidSymbolFault(); - fault.setMessage("ABC"); - fault.setSymbol("IBM0"); - InvalidSymbolFault_Exception exception = new InvalidSymbolFault_Exception("Invalid symbol", fault); - Object faultInfo = handler.getFaultInfo(exception); - assertSame(fault, faultInfo); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOTransformerTestCaseBase.java b/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOTransformerTestCaseBase.java deleted file mode 100644 index ff1ac633a8..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOTransformerTestCaseBase.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo; - -import javax.xml.namespace.QName; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.impl.TransformationContextImpl; -import org.apache.tuscany.sca.interfacedef.DataType; - -import com.example.ipo.sdo.PurchaseOrderType; -import com.example.ipo.sdo.SdoFactory; -import com.example.ipo.sdo.USAddress; -import commonj.sdo.DataObject; -import commonj.sdo.helper.HelperContext; -import commonj.sdo.impl.HelperProvider; - -/** - * The base class for SDO-related test cases - */ -public abstract class SDOTransformerTestCaseBase extends TestCase { - protected static final QName ORDER_QNAME = new QName("http://www.example.com/IPO", "purchaseOrder"); - - protected HelperContext helperContext; - protected String binding = DataObject.class.getName(); - protected TransformationContext context; - protected TransformationContext reversedContext; - protected DataObject dataObject; - - /** - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - helperContext = HelperProvider.getDefaultContext(); - SdoFactory.INSTANCE.register(helperContext); - - context = new TransformationContextImpl(); - context.setSourceDataType(getSourceDataType()); - context.setTargetDataType(getTargetDataType()); - - reversedContext = new TransformationContextImpl(); - reversedContext.setSourceDataType(getTargetDataType()); - reversedContext.setTargetDataType(getSourceDataType()); - - PurchaseOrderType po = SdoFactory.INSTANCE.createPurchaseOrderType(); - USAddress address = SdoFactory.INSTANCE.createUSAddress(); - address.setCity("San Jose"); - address.setStreet("123 ABC St"); - address.setState("CA"); - address.setStreet("95131"); - po.setBillTo(address); - dataObject = (DataObject) po; - } - - protected abstract DataType getSourceDataType(); - - protected abstract DataType getTargetDataType(); - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandlerTestCase.java b/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandlerTestCase.java deleted file mode 100644 index 1c3358a4d5..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/SDOWrapperHandlerTestCase.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.sdo; - -import java.util.List; - -import junit.framework.TestCase; - -import org.apache.tuscany.sdo.util.SDOUtil; - -import commonj.sdo.helper.HelperContext; -import commonj.sdo.helper.XMLDocument; -import commonj.sdo.helper.XMLHelper; -import commonj.sdo.helper.XSDHelper; - -/** - * @version $Rev$ $Date$ - */ -public class SDOWrapperHandlerTestCase extends TestCase { - private HelperContext context; - private SDOWrapperHandler handler; - - public void setUp() throws Exception { - context = SDOUtil.createHelperContext(); - handler = new SDOWrapperHandler(); - } - - public void testWrapperAnyType() throws Exception { - XMLHelper xmlHelper = context.getXMLHelper(); - XMLDocument document = xmlHelper.load(getClass().getResourceAsStream("/wrapper.xml")); - List children = handler.getChildren(document); - assertEquals(5, children.size()); - } - - public void testWrapper() throws Exception { - XSDHelper xsdHelper = context.getXSDHelper(); - xsdHelper.define(getClass().getResourceAsStream("/wrapper.xsd"), null); - XMLHelper xmlHelper = context.getXMLHelper(); - XMLDocument document = xmlHelper.load(getClass().getResourceAsStream("/wrapper.xml")); - List children = handler.getChildren(document); - assertEquals(5, children.size()); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/TestModelResolver.java b/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/TestModelResolver.java deleted file mode 100644 index f1caa4e8a7..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/TestModelResolver.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; - - -/** - * A default implementation of an artifact resolver, based on a map. - * - * @version $Rev$ $Date$ - */ -public class TestModelResolver implements ModelResolver { - private static final long serialVersionUID = -7826976465762296634L; - - private Map map = new HashMap(); - - public TestModelResolver(ClassLoader classLoader) { - } - - public T resolveModel(Class modelClass, T unresolved) { - Object resolved = map.get(unresolved); - if (resolved != null) { - - // Return the resolved object - return modelClass.cast(resolved); - - } else { - - // Return the unresolved object - return unresolved; - } - } - - public void addModel(Object resolved) { - map.put(resolved, resolved); - } - - public Object removeModel(Object resolved) { - return map.remove(resolved); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReaderTestCase.java b/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReaderTestCase.java deleted file mode 100644 index 78bc62eb3a..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/java/org/apache/tuscany/sca/databinding/sdo/XMLDocument2XMLStreamReaderTestCase.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.sdo; - -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -import com.example.ipo.sdo.PurchaseOrderType; -import commonj.sdo.helper.XMLDocument; - -/** - * - */ -public class XMLDocument2XMLStreamReaderTestCase extends SDOTransformerTestCaseBase { - - @Override - protected DataType getSourceDataType() { - return new DataTypeImpl(XMLDocument.class.getName(), XMLDocument.class, new XMLType(ORDER_QNAME, null)); - } - - @Override - protected DataType getTargetDataType() { - return new DataTypeImpl>(XMLStreamReader.class, XMLStreamReader.class); - } - - public final void testTransform() throws XMLStreamException { - XMLDocument document = - helperContext.getXMLHelper().createDocument(dataObject, - ORDER_QNAME.getNamespaceURI(), - ORDER_QNAME.getLocalPart()); - XMLStreamReader reader = new XMLDocument2XMLStreamReader().transform(document, context); - XMLDocument document2 = new XMLStreamReader2XMLDocument().transform(reader, reversedContext); - Assert.assertEquals(ORDER_QNAME.getNamespaceURI(), document2.getRootElementURI()); - Assert.assertEquals(ORDER_QNAME.getLocalPart(), document2.getRootElementName()); - Assert.assertTrue(document2.getRootObject() instanceof PurchaseOrderType); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/ipo.xsd b/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/ipo.xsd deleted file mode 100755 index 241ec15d36..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/ipo.xsd +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - International Purchase order schema for Example.com - Copyright 2000 Example.com. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/model/sca-core.xsd b/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/model/sca-core.xsd deleted file mode 100755 index 56c6977254..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/model/sca-core.xsd +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/model/sca-implementation-mock.xsd b/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/model/sca-implementation-mock.xsd deleted file mode 100755 index bbaf58f00c..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/model/sca-implementation-mock.xsd +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/stock.xsd b/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/stock.xsd deleted file mode 100644 index a0a6717371..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/stock.xsd +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/wrapper.xml b/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/wrapper.xml deleted file mode 100644 index 2526629409..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/wrapper.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - message - symbol - message1 - symbol1 - symbol2 - diff --git a/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/wrapper.xsd b/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/wrapper.xsd deleted file mode 100644 index ea4dc5f7f3..0000000000 --- a/branches/sca-java-0.90/modules/databinding-sdo/src/test/resources/wrapper.xsd +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/databinding/.checkstyle b/branches/sca-java-0.90/modules/databinding/.checkstyle deleted file mode 100644 index c7b30ffd5e..0000000000 --- a/branches/sca-java-0.90/modules/databinding/.checkstyle +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding/.pmd b/branches/sca-java-0.90/modules/databinding/.pmd deleted file mode 100644 index 2db10d6a6a..0000000000 --- a/branches/sca-java-0.90/modules/databinding/.pmd +++ /dev/null @@ -1,20 +0,0 @@ - - -truefalse \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/databinding/.ruleset b/branches/sca-java-0.90/modules/databinding/.ruleset deleted file mode 100644 index ba9b5ce886..0000000000 --- a/branches/sca-java-0.90/modules/databinding/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-0.90/modules/databinding/DISCLAIMER b/branches/sca-java-0.90/modules/databinding/DISCLAIMER deleted file mode 100644 index d68a410903..0000000000 --- a/branches/sca-java-0.90/modules/databinding/DISCLAIMER +++ /dev/null @@ -1,8 +0,0 @@ -Apache Tuscany is an effort undergoing incubation at The Apache Software -Foundation (ASF), sponsored by the Apache Web Services PMC. Incubation is -required of all newly accepted projects until a further review indicates that -the infrastructure, communications, and decision making process have stabilized -in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the -code, it does indicate that the project has yet to be fully endorsed by the ASF. - diff --git a/branches/sca-java-0.90/modules/databinding/LICENSE b/branches/sca-java-0.90/modules/databinding/LICENSE deleted file mode 100644 index 8aa906c321..0000000000 --- a/branches/sca-java-0.90/modules/databinding/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - diff --git a/branches/sca-java-0.90/modules/databinding/NOTICE b/branches/sca-java-0.90/modules/databinding/NOTICE deleted file mode 100644 index 94481d6cfa..0000000000 --- a/branches/sca-java-0.90/modules/databinding/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2007 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/branches/sca-java-0.90/modules/databinding/pom.xml b/branches/sca-java-0.90/modules/databinding/pom.xml deleted file mode 100644 index 81a1fd6443..0000000000 --- a/branches/sca-java-0.90/modules/databinding/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-modules - 0.90-incubating-SNAPSHOT - ../pom.xml - - tuscany-databinding - Apache Tuscany DataBinding Framework - - - - org.apache.tuscany.sca - tuscany-interface - 0.90-incubating-SNAPSHOT - - - - stax - stax-api - 1.0.1 - - - - org.codehaus.woodstox - wstx-asl - 3.2.0 - runtime - - - diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataBinding.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataBinding.java deleted file mode 100644 index e8f5317a25..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataBinding.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding; - -import java.lang.annotation.Annotation; - -import org.apache.tuscany.sca.interfacedef.DataType; - -/** - * DataBinding represents a data representation, for example, SDO, JAXB and AXIOM - */ -public interface DataBinding { - /** - * A special databinding for input message of an operation - */ - String IDL_INPUT = "idl:input"; - /** - * A special databinding for output message of an operation - */ - String IDL_OUTPUT = "idl:output"; - /** - * A special databinding for fault message of an operation - */ - String IDL_FAULT = "idl:fault"; - /** - * The name of a databinding should be case-insensitive and unique - * - * @return The name of the databinding - */ - String getName(); - - /** - * Get the aliases for the databinding - * - * @return An array of aliases - */ - String[] getAliases(); - - /** - * Introspect and populate information to a DataType model - * - * @param javaType The java class or interface to be introspected - * @param annotations The java annotations - * @return true if the databinding has recognized the given data type - */ - boolean introspect(DataType dataType, Annotation[] annotations); - - /** - * Introspect the data to figure out the corresponding data type - * - * @param value The object to be checked - * @return The DataType or null if the java type is not supported by this databinding - */ - DataType introspect(Object value); - - /** - * Provide a WrapperHandler for this databinding - * @return A wrapper handler which can handle wrapping/wrapping for this databinding - */ - WrapperHandler getWrapperHandler(); - - /** - * Make a copy of the object for "pass-by-value" semantics - * @param source object to copy - * @return copy of the object passed in as argument - */ - Object copy(Object object); - - /** - * Get the type mapper for simple types - * @return The databinding-specific simple type mapper - */ - SimpleTypeMapper getSimpleTypeMapper(); - - /** - * Get the handler that can handle exceptions/faults in the - * databinding-specific way - * - * @return An instance of the exception handler - */ - ExceptionHandler getExceptionHandler(); -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataBindingExtensionPoint.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataBindingExtensionPoint.java deleted file mode 100644 index 471b4b715f..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataBindingExtensionPoint.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding; - -import java.lang.annotation.Annotation; - -import org.apache.tuscany.sca.interfacedef.DataType; - -/** - * An extension point for data binding extensions. - */ -public interface DataBindingExtensionPoint { - - /** - * Register a data binding - * - * @param dataBinding - */ - void addDataBinding(DataBinding dataBinding); - - /** - * Look up a data binding by id - * - * @param id The name of the databinding - * @return The databinding - */ - DataBinding getDataBinding(String id); - - /** - * Unregister a data binding - * - * @param id - * @return The unregistered databinding - */ - DataBinding removeDataBinding(String id); - - /** - * Introspect the java class to figure out what DataType supports it - * - * @param DataType The initial data type - * @param annotations The java annotations - * @return A DataType representing the java type or null if no databinding - * recognizes the java type - */ - boolean introspectType(DataType dataType, Annotation[] annotations); - - /** - * Introspect the value to figure out the corresponding DataType - * - * @param value The object value - * @return A DataType representing the value or null if no databinding - * recognizes the value - */ - DataType introspectType(Object value); -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataPipe.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataPipe.java deleted file mode 100755 index a6f747996d..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DataPipe.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding; - -/** - * Data pipe allows a data source pushes data into its sink and pipe the data into its result - * - * @param The data binding type of the sink - * @param The data binding type of the result - */ -public interface DataPipe extends Transformer { - - /** - * Returns a sink (for example, java.io.OutputStream, java.io.Writer or org.xml.sax.ContentHandler) to receive data - * pushed by the source - * - * @return The sink to consume data - */ - S getSink(); - - /** - * Returns the data populated by the sink - * - * @return - */ - R getResult(); - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultDataBindingExtensionPoint.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultDataBindingExtensionPoint.java deleted file mode 100644 index cce57cb2ae..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultDataBindingExtensionPoint.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding; - -import java.lang.annotation.Annotation; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import org.apache.tuscany.sca.databinding.javabeans.JavaBeansDataBinding; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; - -/** - * The default implementation of a data binding extension point. - * - * @version $Rev$ $Date$ - */ -public class DefaultDataBindingExtensionPoint implements DataBindingExtensionPoint { - private final Map bindings = new HashMap(); - - public DataBinding getDataBinding(String id) { - if (id == null) { - return null; - } - return bindings.get(id.toLowerCase()); - } - - public void addDataBinding(DataBinding dataBinding) { - bindings.put(dataBinding.getName().toLowerCase(), dataBinding); - String[] aliases = dataBinding.getAliases(); - if (aliases != null) { - for (String alias : aliases) { - bindings.put(alias.toLowerCase(), dataBinding); - } - } - } - - public DataBinding removeDataBinding(String id) { - if (id == null) { - return null; - } - DataBinding dataBinding = bindings.remove(id.toLowerCase()); - if (dataBinding != null) { - String[] aliases = dataBinding.getAliases(); - if (aliases != null) { - for (String alias : aliases) { - bindings.remove(alias.toLowerCase()); - } - } - } - return dataBinding; - } - - private Set getDataBindings() { - return new HashSet(bindings.values()); - } - - public boolean introspectType(DataType dataType, Annotation[] annotations) { - for (DataBinding binding : getDataBindings()) { - // don't introspect for JavaBeansDatabinding as all javatypes will - // anyways match to its basetype - // which is java.lang.Object. Default to this only if no databinding - // results - if (!binding.getName().equals(JavaBeansDataBinding.NAME)) { - if (binding.introspect(dataType, annotations)) { - return true; - } - } - } - // FIXME: Should we honor the databinding from operation/interface - // level? - Class physical = dataType.getPhysical(); - if (physical == Object.class || Throwable.class.isAssignableFrom((Class)physical)) { - return false; - } - dataType.setDataBinding(JavaBeansDataBinding.NAME); - return false; - } - - public DataType introspectType(Object value) { - DataType dataType = null; - for (DataBinding binding : getDataBindings()) { - // don't introspect for JavaBeansDatabinding as all javatypes will - // anyways match to its basetype - // which is java.lang.Object. Default to this only if no databinding - // results - if (!binding.getName().equals(JavaBeansDataBinding.NAME)) { - dataType = binding.introspect(value); - } - if (dataType != null) { - return dataType; - } - } - return new DataTypeImpl(JavaBeansDataBinding.NAME, value.getClass(), value.getClass()); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultTransformerExtensionPoint.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultTransformerExtensionPoint.java deleted file mode 100755 index 8c37ce2d89..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/DefaultTransformerExtensionPoint.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.sca.databinding.impl.DirectedGraph; - -/** - * @version $Rev$ $Date$ - */ -public class DefaultTransformerExtensionPoint implements TransformerExtensionPoint { - private DataBindingExtensionPoint dataBindings; - - private final DirectedGraph graph = new DirectedGraph(); - - public DefaultTransformerExtensionPoint(DataBindingExtensionPoint dataBindings) { - this.dataBindings = dataBindings; - } - - public void addTransformer(String sourceType, String resultType, int weight, Transformer transformer) { - graph.addEdge(sourceType, resultType, transformer, weight); - } - - public void addTransformer(Transformer transformer) { - graph.addEdge(transformer.getSourceDataBinding(), - transformer.getTargetDataBinding(), - transformer, - transformer.getWeight()); - } - - public boolean removeTransformer(String sourceType, String resultType) { - return graph.removeEdge(sourceType, resultType); - } - - public Transformer getTransformer(String sourceType, String resultType) { - DirectedGraph.Edge edge = graph.getEdge(sourceType, resultType); - return (edge == null) ? null : edge.getValue(); - } - - public List getTransformerChain(String sourceType, String resultType) { - String source = normalize(sourceType); - String result = normalize(resultType); - List transformers = new ArrayList(); - DirectedGraph.Path path = graph.getShortestPath(source, result); - if (path == null) { - return null; - } - for (DirectedGraph.Edge edge : path.getEdges()) { - transformers.add(edge.getValue()); - } - return transformers; - } - - public String toString() { - return graph.toString(); - } - - /** - * Normalize the id to a name of a data binding as databindings may have aliases - * @param id - * @return - */ - private String normalize(String id) { - if (dataBindings != null) { - DataBinding dataBinding = dataBindings.getDataBinding(id); - return dataBinding == null ? id : dataBinding.getName(); - } else { - return id; - } - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/ExceptionHandler.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/ExceptionHandler.java deleted file mode 100644 index 131e8a3114..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/ExceptionHandler.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding; - -import org.apache.tuscany.sca.interfacedef.DataType; - -/** - * ExceptionHandler provides databinding-specific logic for exception handling - * - * @version $Rev$ $Date$ - */ -public interface ExceptionHandler { - /** - * Create an exception to wrap the fault data - * - * @param exceptionType The DataType for the exception - * @param message The error message - * @param faultInfo The databinding-specific fault data - * @param cause The protocol-specific error - * @return An instance of java exception to represent the fault - */ - Exception createException(DataType exceptionType, String message, Object faultInfo, Throwable cause); - - /** - * Retrieve the fault info from a java exception - * - * @param exception The databinding-specific java exception that represents - * the fault data - * @return The databinding-specific fault data - */ - Object getFaultInfo(Exception exception); - - /** - * Introspect an exception class to figure out the fault data type - * - * @param exceptionDataType The exception class - * @return The data type for the fault - */ - DataType getFaultType(DataType exceptionDataType); -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/Mediator.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/Mediator.java deleted file mode 100755 index 168a1052b3..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/Mediator.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding; - -import java.util.Map; - -import org.apache.tuscany.sca.interfacedef.DataType; - -/** - * This interface will be used as a Tuscany system service to perform data mediations - * - * Mediate the data from one type to the other one - * - */ -public interface Mediator { - - /** - * Mediate the data from the source type to the target type - * @param source The data to be mediated - * @param sourceDataType Data type for the source data - * @param targetDataType Data type for the target data - * @param context - * @return - */ - Object mediate(Object source, DataType sourceDataType, DataType targetDataType, Map context); - /** - * Mediate the source data into the target which is a sink to receive the data - * @param source The data to be mediated - * @param target The sink to receive data - * @param sourceDataType Data type for the source data - * @param targetDataType Data type for the target data - */ - void mediate( - Object source, - Object target, - DataType sourceDataType, - DataType targetDataType, - Map context); - - /** - * Get the DataBindings used by this mediator. - * @return - */ - DataBindingExtensionPoint getDataBindings(); - - /** - * Get the Transformers used by this mediator. - * @return - */ - TransformerExtensionPoint getTransformers(); -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/PullTransformer.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/PullTransformer.java deleted file mode 100644 index feed87e45f..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/PullTransformer.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding; - -/** - * PullTransformer transforms data from one binding format to the other one which can be directly consumed - * - * @param The source data type - * @param the target data type - */ -public interface PullTransformer extends Transformer { - /** - * Transform source data into the result type. - * - * @param source The source data - * @param context The context for the transformation - * @return The transformed result - */ - R transform(S source, TransformationContext context); -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/PushTransformer.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/PushTransformer.java deleted file mode 100644 index 80e5e4f0a3..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/PushTransformer.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding; - -/** - * A transformer that pushes data from its source into the sink - * - * @param - * @param - */ -public interface PushTransformer extends Transformer { - /** - * @param source The source data - * @param sink The sink to receive the data - * @param context - */ - void transform(S source, R sink, TransformationContext context); -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/SimpleTypeMapper.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/SimpleTypeMapper.java deleted file mode 100644 index 70ea431d57..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/SimpleTypeMapper.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding; - -import javax.xml.namespace.QName; - -/** - * Type Mapper between XML schema simple data types and java objects - */ -public interface SimpleTypeMapper { - /** - * Parse the XML lexical representation into a java object - * @param simpleType The XSD simple type - * @param value the XML lexical representation - * @param context The context of the transformation - * @return A java object for the XML value - */ - Object toJavaObject(QName simpleType, String value, TransformationContext context); - /** - * Create the XML lexical representation for a java object - * @param simpleType The XSD simple type - * @param obj The java object - * @param context The context of the transformation - * @return The XML lexical representation - */ - String toXMLLiteral(QName simpleType, Object obj, TransformationContext context); -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformationContext.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformationContext.java deleted file mode 100755 index 27818dc24f..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformationContext.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding; - -import java.util.Map; - -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.Operation; - -/** - * Context for data transformation - * - */ -public interface TransformationContext { - - Operation getSourceOperation(); - void setSourceOperation(Operation sourceOperation); - Operation getTargetOperation(); - void setTargetOperation(Operation targetOperation); - - /** - * Get the source data type - * - * @return - */ - DataType getSourceDataType(); - - /** - * Get the target data type - * - * @return - */ - DataType getTargetDataType(); - - /** - * Set the source data type - * - * @param sourceDataType - */ - void setSourceDataType(DataType sourceDataType); - - /** - * Set the target data type - * - * @param targetDataType - */ - void setTargetDataType(DataType targetDataType); - - /** - * Get the classloader - * - * @return - */ - ClassLoader getClassLoader(); - - /** - * Get a map of metadata - * - * @return - */ - Map getMetadata(); - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformationException.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformationException.java deleted file mode 100755 index 8d2b36482d..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformationException.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding; - - -/** - * Reports problems during data transformation - */ -public class TransformationException extends RuntimeException { - - private static final long serialVersionUID = 7662385613693006428L; - private String sourceDataBinding; - private String targetDataBinding; - - public TransformationException() { - super(); - } - - public TransformationException(String message, Throwable cause) { - super(message, cause); - } - - public TransformationException(String message) { - super(message); - } - - public TransformationException(Throwable cause) { - super(cause); - } - - public String getSourceDataBinding() { - return sourceDataBinding; - } - - public void setSourceDataBinding(String sourceDataBinding) { - this.sourceDataBinding = sourceDataBinding; - } - - public String getTargetDataBinding() { - return targetDataBinding; - } - - public void setTargetDataBinding(String targetDataBinding) { - this.targetDataBinding = targetDataBinding; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/Transformer.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/Transformer.java deleted file mode 100755 index 062f087a15..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/Transformer.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding; - -/** - * A transformer provides the data transformation from source type to target type. The cost of the transformation is - * modeled as weight. - */ -public interface Transformer { - /** - * Get the source type that this transformer transforms data from. The type is used as the key when the transformer - * is registered with TransformerRegistry. - * - * @return A key indentifying the source type - */ - String getSourceDataBinding(); - - /** - * Get the target type that this transformer transforms data into. The type is used as the key when the transformer - * is registered with TransformerRegistry. - * - * @return A key indentifying the target type - */ - String getTargetDataBinding(); - - /** - * Get the cost of the transformation. The weight can be used to choose the most efficient path if there are more - * than one available from the source to the target. - * - * @return An integer representing the cost of the transformation - */ - int getWeight(); -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformerExtensionPoint.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformerExtensionPoint.java deleted file mode 100755 index 1abae06754..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/TransformerExtensionPoint.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding; - -import java.util.List; - -/** - * An extension point for data transformer extensions. - */ -public interface TransformerExtensionPoint { - - /** - * Register a transformer - * - * @param sourceDataBinding - * @param targetDataBinding - * @param weight - * @param transformer - */ - void addTransformer(String sourceDataBinding, - String targetDataBinding, - int weight, - Transformer transformer); - - /** - * Register a transformer - * - * @param transformer - */ - void addTransformer(Transformer transformer); - - /** - * Unregister a transformer - * - * @param sourceDataBinding - * @param targetDataBinding - * @return - */ - boolean removeTransformer(String sourceDataBinding, String targetDataBinding); - - /** - * Get the direct Transformer which can transform data from source type to - * result type - * - * @param sourceDataBinding - * @param targetDataBinding - * @return - */ - Transformer getTransformer(String sourceDataBinding, String targetDataBinding); - - /** - * Get the a chain of Transformers which can transform data from source type - * to result type - * - * @param sourceDataBinding - * @param targetDataBinding - * @return - */ - List getTransformerChain(String sourceDataBinding, String targetDataBinding); -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/WrapperHandler.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/WrapperHandler.java deleted file mode 100644 index a94e986755..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/WrapperHandler.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding; - -import java.util.List; - -import org.apache.tuscany.sca.interfacedef.util.ElementInfo; - -/** - * A contract for transformers to deal with wrapping/unwrapping for WSDL wrapper style operations - */ -public interface WrapperHandler { - /** - * Create a wrapper element - * - * @param element The XSD element - * @param context The transformation context - * @return An object representing the wrapper element - */ - T create(ElementInfo element, TransformationContext context); - - /** - * Set child element for the wrapper - * - * @param wrapper The wrapper - * @param i The index - * @param childElement The XSD element - * @param value The value of the child - */ - void setChild(T wrapper, int i, ElementInfo childElement, Object value); - - /** - * Get a list of child elements from the wrapper - * @param wrapper - * @return child elements under the wrapper - */ - List getChildren(T wrapper); -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/annotation/DataBinding.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/annotation/DataBinding.java deleted file mode 100644 index 1d0e117d34..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/annotation/DataBinding.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.annotation; - -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * Used to demarcate expected data types for an operation - * - * @version $Rev$ $Date$ - */ -@Target({TYPE, METHOD}) -@Retention(RUNTIME) -public @interface DataBinding { - - /** - * Returns the unique name of the data binding - * @return the unique name of the data binding - */ - String value(); - boolean wrapperStyle() default false; - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/BaseDataBinding.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/BaseDataBinding.java deleted file mode 100644 index 377984a1cc..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/BaseDataBinding.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.impl; - -import java.lang.annotation.Annotation; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; - -import org.apache.tuscany.sca.databinding.DataBinding; -import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; -import org.apache.tuscany.sca.databinding.ExceptionHandler; -import org.apache.tuscany.sca.databinding.SimpleTypeMapper; -import org.apache.tuscany.sca.databinding.WrapperHandler; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; - -/** - * Base Implementation of DataBinding - * - * @version $Rev$ $Date$ - */ -public abstract class BaseDataBinding implements DataBinding { - - protected DataBindingExtensionPoint registry; - - protected Class baseType; - - protected String name; - protected String[] aliases; - - /** - * Create a databinding with the base java type whose name will be used as - * the name of the databinding - * - * @param baseType The base java class or interface representing the - * databinding, for example, org.w3c.dom.Node - */ - protected BaseDataBinding(Class baseType) { - this(baseType.getName(), null, baseType); - } - - /** - * Create a databinding with the name and base java type - * - * @param name The name of the databinding - * @param baseType The base java class or interface representing the - * databinding, for example, org.w3c.dom.Node - */ - protected BaseDataBinding(String name, Class baseType) { - this(name, null, baseType); - } - - /** - * Create a databinding with the name and base java type - * - * @param name The name of the databinding - * @param aliases The aliases of the databinding - * @param baseType The base java class or interface representing the - * databinding, for example, org.w3c.dom.Node - */ - protected BaseDataBinding(String name, String[] aliases, Class baseType) { - this.name = name; - this.baseType = baseType; - this.aliases = aliases; - } - - public void setDataBindingRegistry(DataBindingExtensionPoint registry) { - this.registry = registry; - } - - public void init() { - registry.addDataBinding(this); - } - - @SuppressWarnings("unchecked") - public boolean introspect(DataType type, Annotation[] annotations) { - assert type != null; - Type physical = type.getPhysical(); - if (physical instanceof ParameterizedType) { - physical = ((ParameterizedType)physical).getRawType(); - } - if (physical instanceof Class) { - Class cls = (Class)physical; - if (baseType != null && baseType.isAssignableFrom(cls)) { - type.setDataBinding(getName()); - type.setLogical(baseType); - return true; - } - } - return false; - } - - public DataType introspect(Object value) { - if (value == null) { - return null; - } else { - DataType dataType = new DataTypeImpl(value.getClass(), value.getClass()); - if (introspect(dataType, null)) { - return dataType; - } else { - return null; - } - } - } - - public final String getName() { - return name; - } - - /** - * @see org.apache.tuscany.sca.databinding.DataBinding#getWrapperHandler() - */ - public WrapperHandler getWrapperHandler() { - return null; - } - - public ExceptionHandler getExceptionHandler() { - return null; - } - - public Object copy(Object object) { - return object; - } - - public SimpleTypeMapper getSimpleTypeMapper() { - return new SimpleTypeMapperImpl(); - } - - public String[] getAliases() { - return aliases; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/BaseTransformer.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/BaseTransformer.java deleted file mode 100644 index 5d68324f31..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/BaseTransformer.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.impl; - -import org.apache.tuscany.sca.databinding.Transformer; -import org.apache.tuscany.sca.databinding.TransformerExtensionPoint; - -/** - * Base Implementation of Transformer which provides the registration to the transformer registry - * - * @version $Rev$ $Date$ - */ -public abstract class BaseTransformer implements Transformer { - - protected TransformerExtensionPoint registry; - - protected BaseTransformer() { - super(); - } - - public void setTransformerRegistry(TransformerExtensionPoint registry) { - this.registry = registry; - } - - public void init() { - registry.addTransformer(this); - } - - protected abstract Class getSourceType(); - - protected abstract Class getTargetType(); - - public String getSourceDataBinding() { - return getSourceType().getName(); - } - - public String getTargetDataBinding() { - return getTargetType().getName(); - } - - public int getWeight() { - // default to 50 - return 50; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/DOMHelper.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/DOMHelper.java deleted file mode 100644 index 2fe4cc44cf..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/DOMHelper.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.impl; - -import javax.xml.namespace.QName; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -/** - * Helper for DOM - */ -public final class DOMHelper { - private static final DocumentBuilderFactory FACTORY = DocumentBuilderFactory.newInstance(); - static { - FACTORY.setNamespaceAware(true); - } - - private DOMHelper() { - } - - public static Document newDocument() throws ParserConfigurationException { - return newDocumentBuilder().newDocument(); - } - - public static DocumentBuilder newDocumentBuilder() throws ParserConfigurationException { - return FACTORY.newDocumentBuilder(); - } - - public static QName getQName(Node node) { - String ns = node.getNamespaceURI(); - if (ns == null) { - ns = ""; - } - // node.getLocalName() will return null if it is created using DOM Level - // 1 method - // such as createElement() - return new QName(ns, node.getNodeName()); - } - - public static Element createElement(Document document, QName name) { - String prefix = name.getPrefix(); - String qname = - (prefix != null && prefix.length() > 0) ? prefix + ":" + name.getLocalPart() : name - .getLocalPart(); - return document.createElementNS(name.getNamespaceURI(), qname); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/DirectedGraph.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/DirectedGraph.java deleted file mode 100755 index d99fe488de..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/DirectedGraph.java +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.impl; - -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * Directed, weighted graph - * - * @param The type of vertex object - * @param The type of edge object - */ -public class DirectedGraph { - private final Map vertices = new HashMap(); - - /** - * Key for the shortest path cache - */ - private final class VertexPair { - private Vertex source; - - private Vertex target; - - /** - * @param source - * @param target - */ - private VertexPair(Vertex source, Vertex target) { - super(); - this.source = source; - this.target = target; - } - - public boolean equals(Object object) { - if (!VertexPair.class.isInstance(object)) { - return false; - } - VertexPair pair = (VertexPair)object; - return source == pair.source && target == pair.target; - } - - public int hashCode() { - int x = source == null ? 0 : source.hashCode(); - int y = target == null ? 0 : target.hashCode(); - return x ^ y; - } - - } - - private final Map paths = new HashMap(); - - /** - * Vertex of a graph - */ - public final class Vertex { - private V value; - - // TODO: Do we want to support multiple edges for a vertex pair? If so, - // we should use a List instead of Map - private Map outEdges = new HashMap(); - - private Vertex(V value) { - this.value = value; - } - - public String toString() { - return "(" + value + ")"; - } - - public V getValue() { - return value; - } - - public Map getOutEdges() { - return outEdges; - } - - } - - /** - * An Edge connects two vertices in one direction - */ - public final class Edge { - private Vertex sourceVertex; - - private Vertex targetVertex; - - private E value; - - private int weight; - - public Edge(Vertex source, Vertex target, E value, int weight) { - this.sourceVertex = source; - this.targetVertex = target; - this.value = value; - this.weight = weight; - } - - public String toString() { - return sourceVertex + "->" + targetVertex + "[" + value + "," + weight + "]"; - } - - public E getValue() { - return value; - } - - public void setValue(E value) { - this.value = value; - } - - public Vertex getTargetVertex() { - return targetVertex; - } - - public void setTargetVertex(Vertex vertex) { - this.targetVertex = vertex; - } - - public int getWeight() { - return weight; - } - - public void setWeight(int weight) { - this.weight = weight; - } - - public Vertex getSourceVertex() { - return sourceVertex; - } - - public void setSourceVertex(Vertex sourceVertex) { - this.sourceVertex = sourceVertex; - } - } - - private final class Node implements Comparable { - - private long distance = Integer.MAX_VALUE; - - private Node previous; // NOPMD by rfeng on 9/26/06 9:17 PM - - private Vertex vertex; // NOPMD by rfeng on 9/26/06 9:17 PM - - private Node(Vertex vertex) { - this.vertex = vertex; - } - - public int compareTo(Node o) { - return (distance > o.distance) ? 1 : ((distance == o.distance) ? 0 : -1); - } - } - - public void addEdge(V source, V target, E edgeValue, int weight) { - Vertex s = getVertex(source); - if (s == null) { - s = new Vertex(source); - vertices.put(source, s); - } - Vertex t = getVertex(target); - if (t == null) { - t = new Vertex(target); - vertices.put(target, t); - } - Edge edge = new Edge(s, t, edgeValue, weight); - s.outEdges.put(t, edge); - } - - public Vertex getVertex(V source) { - Vertex s = vertices.get(source); - return s; - } - - public boolean removeEdge(V source, V target) { - Vertex s = getVertex(source); - if (s == null) { - return false; - } - - Vertex t = getVertex(target); - if (t == null) { - return false; - } - - return s.outEdges.remove(t) != null; - - } - - public Edge getEdge(Vertex source, Vertex target) { - return source.outEdges.get(target); - } - - public Edge getEdge(V source, V target) { - return getEdge(getVertex(source), getVertex(target)); - } - - /** - * Get the shortes path from the source vertex to the target vertex using - * Dijkstra's algorithm. If there's no path, null will be returned. If the - * source is the same as the target, it returns a path with empty edges with - * weight 0. - * - * @param sourceValue The value identifies the source - * @param targetValue The value identifies the target - * @return The shortest path - */ - public Path getShortestPath(V sourceValue, V targetValue) { - Vertex source = getVertex(sourceValue); - if (source == null) { - return null; - } - Vertex target = getVertex(targetValue); - if (target == null) { - return null; - } - - VertexPair pair = new VertexPair(source, target); - if (paths.containsKey(pair)) { - return paths.get(pair); - } - - // HACK: To support same vertex - if (source == target) { - Path path = new Path(); - Edge edge = getEdge(source, target); - if (edge != null) { - path.addEdge(edge); - } - paths.put(pair, path); - return path; - } - - Map nodes = new HashMap(); - for (Vertex v : vertices.values()) { - Node node = new Node(v); - if (v == source) { - node.distance = 0; - } - nodes.put(v, node); - } - - Set otherNodes = new HashSet(nodes.values()); - Set nodesOnPath = new HashSet(); - while (!otherNodes.isEmpty()) { - Node nextNode = extractMin(otherNodes); - if (nextNode.vertex == target) { - Path path = getPath(nextNode); - paths.put(pair, path); // Cache it - return path; - } - nodesOnPath.add(nextNode); - for (Edge edge : nextNode.vertex.outEdges.values()) { - Node adjacentNode = nodes.get(edge.targetVertex); - if (nextNode.distance + edge.weight < adjacentNode.distance) { - adjacentNode.distance = nextNode.distance + edge.weight; - adjacentNode.previous = nextNode; - } - } - } - paths.put(pair, null); // Cache it - return null; - } - - /** - * Searches for the vertex u in the vertex set Q that has the least d[u] - * value. That vertex is removed from the set Q and returned to the user. - * - * @param nodes - * @return - */ - private Node extractMin(Set nodes) { - Node node = Collections.min(nodes); - nodes.remove(node); - return node; - } - - /** - * The path between two vertices - */ - public final class Path { - private List edges = new LinkedList(); - - private int weight; - - public int getWeight() { - return weight; - } - - public List getEdges() { - return edges; - } - - public void addEdge(Edge edge) { - edges.add(0, edge); - weight += edge.weight; - } - - public String toString() { - return edges + ", " + weight; - } - } - - private Path getPath(Node t) { - if (t.distance == Integer.MAX_VALUE) { - return null; - } - Path path = new Path(); - Node u = t; - while (u.previous != null) { - Edge edge = getEdge(u.previous.vertex, u.vertex); - path.addEdge(edge); - u = u.previous; - } - return path; - } - - public String toString() { - StringBuffer sb = new StringBuffer(); - for (Vertex v : vertices.values()) { - sb.append(v.outEdges.values()).append("\n"); - } - return sb.toString(); - } - - public Map getVertices() { - return vertices; - } - - public void addGraph(DirectedGraph otherGraph) { - for (Vertex v : otherGraph.vertices.values()) { - for (Edge e : v.outEdges.values()) { - addEdge(e.sourceVertex.value, e.targetVertex.value, e.value, e.weight); - } - } - } -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/Group2GroupTransformer.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/Group2GroupTransformer.java deleted file mode 100644 index 52917aaf50..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/Group2GroupTransformer.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.impl; - -import org.apache.tuscany.sca.databinding.Mediator; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.interfacedef.DataType; - -/** - * This is a special transformer to transform the output from one IDL to the - * other one - */ -public class Group2GroupTransformer extends BaseTransformer implements - PullTransformer { - - protected Mediator mediator; - - /** - * @param wrapperHandler - */ - public Group2GroupTransformer() { - super(); - } - - /** - * @param mediator the mediator to set - */ - public void setMediator(Mediator mediator) { - this.mediator = mediator; - } - - @Override - public String getSourceDataBinding() { - return GroupDataBinding.NAME; - } - - @Override - public String getTargetDataBinding() { - return GroupDataBinding.NAME; - } - - /** - * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getSourceType() - */ - @Override - protected Class getSourceType() { - return Object.class; - } - - /** - * @see org.apache.tuscany.sca.databinding.impl.BaseTransformer#getTargetType() - */ - @Override - protected Class getTargetType() { - return Object.class; - } - - /** - * @see org.apache.tuscany.sca.databinding.Transformer#getWeight() - */ - public int getWeight() { - return 10; - } - - @SuppressWarnings("unchecked") - public Object transform(Object source, TransformationContext context) { - DataType sourceType = context.getSourceDataType(); - DataType targetType = context.getTargetDataType(); - - return mediator.mediate(source, sourceType.getLogical(), targetType.getLogical(), context.getMetadata()); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/GroupDataBinding.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/GroupDataBinding.java deleted file mode 100644 index 2403600389..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/GroupDataBinding.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.impl; - -import java.lang.annotation.Annotation; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; - -import org.apache.tuscany.sca.interfacedef.DataType; - -/** - * The base class for a special databinding which represents a group of other databindings - * - * @version $Rev$ $Date$ - */ -public abstract class GroupDataBinding extends BaseDataBinding { - public static final String NAME = "databinding:group"; - - /** - * Marker type is a java class or interface representing the data format. - */ - protected Class[] markerTypes; - - public GroupDataBinding(Class[] types) { - super(NAME, null, GroupDataBinding.class); - this.markerTypes = types; - } - - @SuppressWarnings("unchecked") - public boolean introspect(DataType type, Annotation[] annotations) { - if (markerTypes == null) { - return false; - } - Type physical = type.getPhysical(); - if (physical instanceof ParameterizedType) { - physical = ((ParameterizedType)physical).getRawType(); - } - if (!(physical instanceof Class)) { - return false; - } - Class cls = (Class)physical; - for (Class c : markerTypes) { - if (isTypeOf(c, cls)) { - type.setDataBinding(getDataBinding(c)); - type.setLogical(getLogical(cls, annotations)); - return true; - } - } - return false; - } - - /** - * Test if the given type is a subtype of the base type - * @param markerType - * @param type - * @return - */ - protected boolean isTypeOf(Class markerType, Class type) { - return markerType.isAssignableFrom(type); - } - - /** - * Derive the databinding name from a base class - * @param baseType - * @return - */ - protected String getDataBinding(Class baseType) { - return baseType.getName(); - } - - /** - * Get the logical type - * @param type The java type - * @param annotations - * @return - */ - protected abstract Object getLogical(Class type, Annotation[] annotations); - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/Java2SimpleTypeTransformer.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/Java2SimpleTypeTransformer.java deleted file mode 100644 index b39a944f32..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/Java2SimpleTypeTransformer.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.impl; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.SimpleTypeMapper; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -/** - * Transformer to convert data from a simple java object to a databinding's representation - */ -public abstract class Java2SimpleTypeTransformer extends BaseTransformer implements - PullTransformer { - - protected SimpleTypeMapper mapper; - - public Java2SimpleTypeTransformer() { - this.mapper = new SimpleTypeMapperImpl(); - } - - public Java2SimpleTypeTransformer(SimpleTypeMapper mapper) { - this.mapper = (mapper != null) ? mapper : new SimpleTypeMapperImpl(); - } - - public T transform(Object source, TransformationContext context) { - XMLType xmlType = (XMLType) context.getTargetDataType().getLogical(); - String text = mapper.toXMLLiteral(xmlType.getTypeName(), source, context); - return createElement(xmlType.getElementName(), text, context); - } - - public Class getSourceType() { - return Object.class; - } - - public int getWeight() { - return 10000; - } - - protected abstract T createElement(QName element, String literal, TransformationContext context); - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/MediatorImpl.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/MediatorImpl.java deleted file mode 100644 index adff1718de..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/MediatorImpl.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.impl; - -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.sca.databinding.DataBindingExtensionPoint; -import org.apache.tuscany.sca.databinding.DataPipe; -import org.apache.tuscany.sca.databinding.Mediator; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.PushTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.Transformer; -import org.apache.tuscany.sca.databinding.TransformerExtensionPoint; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; - -/** - * Default Mediator implementation - */ -public class MediatorImpl implements Mediator { - - private DataBindingExtensionPoint dataBindings; - private TransformerExtensionPoint transformers; - - public MediatorImpl(DataBindingExtensionPoint dataBindings, - TransformerExtensionPoint transformers) { - this.dataBindings = dataBindings; - this.transformers = transformers; - } - - @SuppressWarnings("unchecked") - public Object mediate(Object source, DataType sourceDataType, DataType targetDataType, Map metadata) { - if (sourceDataType == null || sourceDataType.getDataBinding() == null) { - sourceDataType = dataBindings.introspectType(source); - } - if (sourceDataType == null) { - return source; - } else if (sourceDataType.equals(targetDataType)) { - return source; - } - - List path = getTransformerChain(sourceDataType, targetDataType); - - Object result = source; - int size = path.size(); - int i = 0; - while (i < size) { - Transformer transformer = path.get(i); - TransformationContext context = createTransformationContext(sourceDataType, - targetDataType, - size, - i, - transformer, - metadata); - // the source and target type - if (transformer instanceof PullTransformer) { - // For intermediate node, set data type to null - result = ((PullTransformer)transformer).transform(result, context); - } else if (transformer instanceof PushTransformer) { - DataPipe dataPipe = (i < size - 1) ? (DataPipe)path.get(++i) : null; - ((PushTransformer)transformer).transform(result, dataPipe.getSink(), context); - result = dataPipe.getResult(); - } - i++; - } - - return result; - } - - private TransformationContext createTransformationContext(DataType sourceDataType, - DataType targetDataType, - int size, - int index, - Transformer transformer, - Map metadata) { - DataType sourceType = (index == 0) ? sourceDataType : new DataTypeImpl(transformer - .getSourceDataBinding(), Object.class, sourceDataType.getLogical()); - DataType targetType = (index == size - 1) ? targetDataType : new DataTypeImpl(transformer - .getTargetDataBinding(), Object.class, targetDataType.getLogical()); - ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); - TransformationContext context = new TransformationContextImpl(sourceType, targetType, classLoader, metadata); - return context; - } - - @SuppressWarnings("unchecked") - public void mediate(Object source, - Object target, - DataType sourceDataType, - DataType targetDataType, - Map metadata) { - if (source == null) { - // Shortcut for null value - return; - } - if (sourceDataType == null || sourceDataType.getDataBinding() == null) { - sourceDataType = dataBindings.introspectType(source); - } - if (sourceDataType == null) { - return; - } else if (sourceDataType.equals(targetDataType)) { - return; - } - - List path = getTransformerChain(sourceDataType, targetDataType); - Object result = source; - int size = path.size(); - for (int i = 0; i < size; i++) { - Transformer transformer = path.get(i); - TransformationContext context = createTransformationContext(sourceDataType, - targetDataType, - size, - i, - transformer, - metadata); - - if (transformer instanceof PullTransformer) { - result = ((PullTransformer)transformer).transform(result, context); - } else if (transformer instanceof PushTransformer) { - DataPipe dataPipe = (i < size - 1) ? (DataPipe)path.get(++i) : null; - Object sink = dataPipe != null ? dataPipe.getSink() : target; - ((PushTransformer)transformer).transform(result, sink, context); - result = (dataPipe != null) ? dataPipe.getResult() : null; - } - } - } - - private List getTransformerChain(DataType sourceDataType, DataType targetDataType) { - String sourceId = sourceDataType.getDataBinding(); - String targetId = targetDataType.getDataBinding(); - List path = transformers.getTransformerChain(sourceId, targetId); - if (path == null) { - TransformationException ex = new TransformationException("No path found for the transformation"); - ex.setSourceDataBinding(sourceId); - ex.setTargetDataBinding(targetId); - throw ex; - } - return path; - } - - public DataBindingExtensionPoint getDataBindings() { - return dataBindings; - } - - public TransformerExtensionPoint getTransformers() { - return transformers; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/PipedTransformer.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/PipedTransformer.java deleted file mode 100755 index 9a1385f193..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/PipedTransformer.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.impl; - -import org.apache.tuscany.sca.databinding.DataPipe; -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.PushTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; - -/** - * A utility class to connect PushTransformer and DataPipe to create a - * PullTransformer - * - * @param Source type - * @param Intermidate type - * @param Result type - */ -public class PipedTransformer implements PullTransformer { - private PushTransformer pusher; - - private DataPipe pipe; - - /** - * @param pumper - * @param pipe - */ - public PipedTransformer(PushTransformer pumper, DataPipe pipe) { - super(); - this.pusher = pumper; - this.pipe = pipe; - } - - public R transform(S source, TransformationContext context) { - pusher.transform(source, pipe.getSink(), context); - return pipe.getResult(); - } - - public String getSourceDataBinding() { - return pusher.getSourceDataBinding(); - } - - public String getTargetDataBinding() { - return pipe.getTargetDataBinding(); - } - - public int getWeight() { - return pusher.getWeight() + pipe.getWeight(); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/SimpleType2JavaTransformer.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/SimpleType2JavaTransformer.java deleted file mode 100644 index 009c7f2272..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/SimpleType2JavaTransformer.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.impl; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.SimpleTypeMapper; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -/** - * Transformer to convert data from a databinding's representation of simple - * types to Java Objects - */ -public abstract class SimpleType2JavaTransformer extends BaseTransformer implements - PullTransformer { - - protected SimpleTypeMapper mapper; - - public SimpleType2JavaTransformer() { - this.mapper = new SimpleTypeMapperImpl(); - } - - public SimpleType2JavaTransformer(SimpleTypeMapper mapper) { - this.mapper = (mapper != null) ? mapper : new SimpleTypeMapperImpl(); - } - - public Object transform(T source, TransformationContext context) { - XMLType xmlType = (XMLType) context.getSourceDataType().getLogical(); - return mapper.toJavaObject(xmlType.getTypeName(), getText(source), context); - } - - public Class getTargetType() { - return Object.class; - } - - public int getWeight() { - // Cannot be used for imtermediate - return 10000; - } - - /** - * Get the string value from the source - * @param source - * @return A string - */ - protected abstract String getText(T source); -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/SimpleTypeMapperImpl.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/SimpleTypeMapperImpl.java deleted file mode 100644 index 9c23efe091..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/SimpleTypeMapperImpl.java +++ /dev/null @@ -1,392 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.impl; - -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.HashMap; -import java.util.Map; - -import javax.xml.datatype.DatatypeConfigurationException; -import javax.xml.datatype.DatatypeFactory; -import javax.xml.datatype.XMLGregorianCalendar; -import javax.xml.namespace.NamespaceContext; -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.databinding.SimpleTypeMapper; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.interfacedef.util.TypeInfo; - -public class SimpleTypeMapperImpl extends XSDDataTypeConverter implements SimpleTypeMapper { - - public static final Map JAVA2XML = new HashMap(); - - public static final String URI_2001_SCHEMA_XSD = "http://www.w3.org/2001/XMLSchema"; - - public static final Map XML2JAVA = new HashMap(); - - public static final QName XSD_ANY = new QName(URI_2001_SCHEMA_XSD, "any"); - - public static final QName XSD_ANYSIMPLETYPE = new QName(URI_2001_SCHEMA_XSD, "anySimpleType"); - - public static final QName XSD_ANYTYPE = new QName(URI_2001_SCHEMA_XSD, "anyType"); - - public static final QName XSD_ANYURI = new QName(URI_2001_SCHEMA_XSD, "anyURI"); - - public static final QName XSD_BASE64 = new QName(URI_2001_SCHEMA_XSD, "base64Binary"); - - public static final QName XSD_BOOLEAN = new QName(URI_2001_SCHEMA_XSD, "boolean"); - - public static final QName XSD_BYTE = new QName(URI_2001_SCHEMA_XSD, "byte"); - - public static final QName XSD_DATE = new QName(URI_2001_SCHEMA_XSD, "date"); - - public static final QName XSD_DATETIME = new QName(URI_2001_SCHEMA_XSD, "dateTime"); - - public static final QName XSD_DAY = new QName(URI_2001_SCHEMA_XSD, "gDay"); - - public static final QName XSD_DECIMAL = new QName(URI_2001_SCHEMA_XSD, "decimal"); - - public static final QName XSD_DOUBLE = new QName(URI_2001_SCHEMA_XSD, "double"); - - public static final QName XSD_DURATION = new QName(URI_2001_SCHEMA_XSD, "duration"); - - public static final QName XSD_ENTITIES = new QName(URI_2001_SCHEMA_XSD, "ENTITIES"); - - public static final QName XSD_ENTITY = new QName(URI_2001_SCHEMA_XSD, "ENTITY"); - - public static final QName XSD_FLOAT = new QName(URI_2001_SCHEMA_XSD, "float"); - - public static final QName XSD_HEXBIN = new QName(URI_2001_SCHEMA_XSD, "hexBinary"); - - public static final QName XSD_IDREF = new QName(URI_2001_SCHEMA_XSD, "IDREF"); - - public static final QName XSD_IDREFS = new QName(URI_2001_SCHEMA_XSD, "IDREFS"); - - public static final QName XSD_INT = new QName(URI_2001_SCHEMA_XSD, "int"); - - public static final QName XSD_INTEGER = new QName(URI_2001_SCHEMA_XSD, "integer"); - - public static final QName XSD_LONG = new QName(URI_2001_SCHEMA_XSD, "long"); - - public static final QName XSD_MONTH = new QName(URI_2001_SCHEMA_XSD, "gMonth"); - - public static final QName XSD_MONTHDAY = new QName(URI_2001_SCHEMA_XSD, "gMonthDay"); - - public static final QName XSD_NAME = new QName(URI_2001_SCHEMA_XSD, "Name"); - - public static final QName XSD_NCNAME = new QName(URI_2001_SCHEMA_XSD, "NCName"); - - public static final QName XSD_NEGATIVEINTEGER = new QName(URI_2001_SCHEMA_XSD, "negativeInteger"); - - public static final QName XSD_NMTOKEN = new QName(URI_2001_SCHEMA_XSD, "NMTOKEN"); - - public static final QName XSD_NMTOKENS = new QName(URI_2001_SCHEMA_XSD, "NMTOKENS"); - - public static final QName XSD_NONNEGATIVEINTEGER = new QName(URI_2001_SCHEMA_XSD, "nonNegativeInteger"); - - public static final QName XSD_NONPOSITIVEINTEGER = new QName(URI_2001_SCHEMA_XSD, "nonPositiveInteger"); - - public static final QName XSD_NORMALIZEDSTRING = new QName(URI_2001_SCHEMA_XSD, "normalizedString"); - - public static final QName XSD_NOTATION = new QName(URI_2001_SCHEMA_XSD, "NOTATION"); - - public static final QName XSD_POSITIVEINTEGER = new QName(URI_2001_SCHEMA_XSD, "positiveInteger"); - - public static final QName XSD_QNAME = new QName(URI_2001_SCHEMA_XSD, "QName"); - - public static final QName XSD_SHORT = new QName(URI_2001_SCHEMA_XSD, "short"); - - public static final Map XSD_SIMPLE_TYPES = new HashMap(); - - public static final QName XSD_STRING = new QName(URI_2001_SCHEMA_XSD, "string"); - - public static final QName XSD_TIME = new QName(URI_2001_SCHEMA_XSD, "time"); - - public static final QName XSD_TOKEN = new QName(URI_2001_SCHEMA_XSD, "token"); - - public static final QName XSD_UNSIGNEDBYTE = new QName(URI_2001_SCHEMA_XSD, "unsignedByte"); - - public static final QName XSD_UNSIGNEDINT = new QName(URI_2001_SCHEMA_XSD, "unsignedInt"); - - public static final QName XSD_UNSIGNEDLONG = new QName(URI_2001_SCHEMA_XSD, "unsignedLong"); - - public static final QName XSD_UNSIGNEDSHORT = new QName(URI_2001_SCHEMA_XSD, "unsignedShort"); - - public static final QName XSD_YEAR = new QName(URI_2001_SCHEMA_XSD, "gYear"); - - public static final QName XSD_YEARMONTH = new QName(URI_2001_SCHEMA_XSD, "gYearMonth"); - - private static final String[] XSD_TYPE_NAMES = - {"string", "boolean", "double", "float", "int", "integer", "long", "short", "byte", "decimal", "base64Binary", - "hexBinary", "anySimpleType", "anyType", "any", "QName", "dateTime", "date", "time", "normalizedString", - "token", "unsignedLong", "unsignedInt", "unsignedShort", "unsignedByte", "positiveInteger", "negativeInteger", - "nonNegativeInteger", "nonPositiveInteger", "gYearMonth", "gMonthDay", "gYear", "gMonth", "gDay", "duration", - "Name", "NCName", "NMTOKEN", "NMTOKENS", "NOTATION", "ENTITY", "ENTITIES", "IDREF", "IDREFS", "anyURI", - "language", "ID"}; - - static { - for (String type : XSD_TYPE_NAMES) { - TypeInfo simpleType = new TypeInfo(new QName(URI_2001_SCHEMA_XSD, type), true, null); - XSD_SIMPLE_TYPES.put(type, simpleType); - } - } - - static { - JAVA2XML.put(boolean.class, "boolean"); - JAVA2XML.put(byte.class, "byte"); - JAVA2XML.put(short.class, "short"); - JAVA2XML.put(int.class, "int"); - JAVA2XML.put(long.class, "long"); - JAVA2XML.put(float.class, "float"); - JAVA2XML.put(double.class, "double"); - JAVA2XML.put(Boolean.class, "boolean"); - JAVA2XML.put(Byte.class, "byte"); - JAVA2XML.put(Short.class, "short"); - JAVA2XML.put(Integer.class, "int"); - JAVA2XML.put(Long.class, "long"); - JAVA2XML.put(Float.class, "float"); - JAVA2XML.put(Double.class, "double"); - JAVA2XML.put(java.lang.String.class, "string"); - JAVA2XML.put(java.math.BigInteger.class, "integer"); - JAVA2XML.put(java.math.BigDecimal.class, "decimal"); - JAVA2XML.put(java.util.Calendar.class, "dateTime"); - JAVA2XML.put(java.util.Date.class, "dateTime"); - JAVA2XML.put(javax.xml.namespace.QName.class, "QName"); - JAVA2XML.put(java.net.URI.class, "string"); - JAVA2XML.put(javax.xml.datatype.XMLGregorianCalendar.class, "anySimpleType"); - JAVA2XML.put(javax.xml.datatype.Duration.class, "duration"); - JAVA2XML.put(java.lang.Object.class, "anyType"); - JAVA2XML.put(java.awt.Image.class, "base64Binary"); - JAVA2XML.put(byte[].class, "base64Binary"); - // java2XSD.put(javax.activation.DataHandler.class, "base64Binary"); - JAVA2XML.put(javax.xml.transform.Source.class, "base64Binary"); - JAVA2XML.put(java.util.UUID.class, "string"); - } - - static { - XML2JAVA.put("string", java.lang.String.class); - XML2JAVA.put("integer", java.math.BigInteger.class); - XML2JAVA.put("int", int.class); - XML2JAVA.put("long", long.class); - XML2JAVA.put("short", short.class); - XML2JAVA.put("decimal", java.math.BigDecimal.class); - XML2JAVA.put("float", float.class); - XML2JAVA.put("double", double.class); - XML2JAVA.put("boolean", boolean.class); - XML2JAVA.put("byte", byte.class); - XML2JAVA.put("QName", javax.xml.namespace.QName.class); - XML2JAVA.put("dateTime", javax.xml.datatype.XMLGregorianCalendar.class); - XML2JAVA.put("base64Binary", byte[].class); - XML2JAVA.put("hexBinary", byte[].class); - XML2JAVA.put("unsignedInt", long.class); - XML2JAVA.put("unsignedShort", int.class); - XML2JAVA.put("unsignedByte", short.class); - XML2JAVA.put("time", javax.xml.datatype.XMLGregorianCalendar.class); - XML2JAVA.put("date", javax.xml.datatype.XMLGregorianCalendar.class); - XML2JAVA.put("gDay", javax.xml.datatype.XMLGregorianCalendar.class); - XML2JAVA.put("gMonth", javax.xml.datatype.XMLGregorianCalendar.class); - XML2JAVA.put("gYear", javax.xml.datatype.XMLGregorianCalendar.class); - XML2JAVA.put("gYearMonth", javax.xml.datatype.XMLGregorianCalendar.class); - XML2JAVA.put("gMonthDay", javax.xml.datatype.XMLGregorianCalendar.class); - XML2JAVA.put("anySimpleType", java.lang.Object.class); // For elements - // XML2JAVA.put("anySimpleType", java.lang.String.class); // For - // attributes - XML2JAVA.put("duration", javax.xml.datatype.Duration.class); - XML2JAVA.put("NOTATION", javax.xml.namespace.QName.class); - } - - private DatatypeFactory factory; - - public SimpleTypeMapperImpl() { - super(); - try { - this.factory = DatatypeFactory.newInstance(); - } catch (DatatypeConfigurationException e) { - throw new IllegalArgumentException(e); - } - } - - public static Class getJavaType(QName xmlType) { - if (URI_2001_SCHEMA_XSD.equals(xmlType.getNamespaceURI())) { - return XML2JAVA.get(xmlType.getLocalPart()); - } else { - return null; - } - } - - public TypeInfo getXMLType(Class javaType) { - return XSD_SIMPLE_TYPES.get(JAVA2XML.get(javaType)); - } - - public Object toJavaObject(QName simpleType, String literal, TransformationContext context) { - /** - *
    - *
  • xsd:string --- java.lang.String - *
  • xsd:integer --- java.math.BigInteger - *
  • xsd:int --- int - *
  • xsd:long --- long - *
  • xsd:short --- short - *
  • xsd:decimal --- java.math.BigDecimal - *
  • xsd:float --- float - *
  • xsd:double --- double - *
  • xsd:boolean --- boolean - *
  • xsd:byte --- byte - *
  • xsd:QName --- javax.xml.namespace.QName - *
  • xsd:dateTime --- javax.xml.datatype.XMLGregorianCalendar - *
  • xsd:base64Binary --- byte[] - *
  • xsd:hexBinary --- byte[] - *
  • xsd:unsignedInt --- long - *
  • xsd:unsignedShort --- int - *
  • xsd:unsignedByte --- short - *
  • xsd:time --- javax.xml.datatype.XMLGregorianCalendar - *
  • xsd:date --- javax.xml.datatype.XMLGregorianCalendar - *
  • xsd:g* --- javax.xml.datatype.XMLGregorianCalendar - *
  • xsd:anySimpleType (for xsd:element of this type)a - * java.lang.Object - *
  • xsd:anySimpleType (for xsd:attribute of this type) - * java.lang.String - *
  • xsd:duration javax.xml.datatype.Duration - *
  • xsd:NOTATION javax.xml.namespace.QName - *
- */ - - if (literal == null) { - return null; - } - String value = literal.trim(); - - QName type = simpleType; - if (type.equals(XSD_STRING)) { - return parseString(value); - } else if (type.equals(XSD_INT)) { - return parseInt(value); - } else if (type.equals(XSD_INTEGER)) { - return parseInteger(value); - } else if (type.equals(XSD_INT)) { - return parseInt(value); - } else if (type.equals(XSD_FLOAT)) { - return parseFloat(value); - } else if (type.equals(XSD_DOUBLE)) { - return parseDouble(value); - } else if (type.equals(XSD_SHORT)) { - return parseShort(value); - } else if (type.equals(XSD_DECIMAL)) { - return parseDecimal(value); - } else if (type.equals(XSD_BOOLEAN)) { - return parseBoolean(value); - } else if (type.equals(XSD_BYTE)) { - return parseByte(value); - } else if (type.equals(XSD_LONG)) { - return parseLong(value); - } else if (type.equals(XSD_UNSIGNEDBYTE)) { - return parseUnsignedShort(value); - } else if (type.equals(XSD_UNSIGNEDSHORT)) { - return parseUnsignedShort(value); - } else if (type.equals(XSD_UNSIGNEDINT)) { - return parseUnsignedInt(value); - } else if (type.equals(XSD_UNSIGNEDLONG)) { - return parseUnsignedInt(value); - } else if (type.equals(XSD_DATETIME)) { - return parseDateTime(value); - } else if (type.equals(XSD_DATE)) { - return parseDate(value); - } else if (type.equals(XSD_TIME)) { - return parseTime(value); - } else if (type.equals(XSD_DURATION)) { - return parseDuration(value); - } else if (type.equals(XSD_HEXBIN)) { - return parseHexBinary(value); - } else if (type.equals(XSD_BASE64)) { - return parseBase64Binary(value); - } else if (type.equals(XSD_QNAME)) { - NamespaceContext namespaceContext = - (NamespaceContext)((context != null) ? context.getMetadata().get(NamespaceContext.class.getName()) : null); - return parseQName(value, namespaceContext); - } else if (type.equals(XSD_NOTATION)) { - NamespaceContext namespaceContext = - (NamespaceContext)((context != null) ? context.getMetadata().get(NamespaceContext.class.getName()) : null); - return parseQName(value, namespaceContext); - } else if (type.equals(XSD_YEAR)) { - return factory.newXMLGregorianCalendar(value); - } else if (type.equals(XSD_MONTH)) { - return factory.newXMLGregorianCalendar(value); - } else if (type.equals(XSD_DAY)) { - return factory.newXMLGregorianCalendar(value); - } else if (type.equals(XSD_YEARMONTH)) { - return factory.newXMLGregorianCalendar(value); - } else if (type.equals(XSD_MONTHDAY)) { - return factory.newXMLGregorianCalendar(value); - } else { - return value; - } - } - - @SuppressWarnings("deprecation") - private XMLGregorianCalendar toXMLGregorianCalendar(Date date) { - GregorianCalendar c = - new GregorianCalendar(date.getYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), - date.getSeconds()); - return factory.newXMLGregorianCalendar(c); - } - - private XMLGregorianCalendar toXMLGregorianCalendar(GregorianCalendar calendar) { - return factory.newXMLGregorianCalendar(calendar); - } - - public String toXMLLiteral(QName simpleType, Object obj, TransformationContext context) { - if (obj instanceof Float || obj instanceof Double) { - if (obj instanceof Float) { - return printDouble(((Float)obj).floatValue()); - } else { - return printDouble(((Double)obj).doubleValue()); - } - } else if (obj instanceof GregorianCalendar) { - GregorianCalendar calendar = (GregorianCalendar)obj; - return toXMLGregorianCalendar(calendar).toXMLFormat(); - } else if (obj instanceof Date) { - return toXMLGregorianCalendar((Date)obj).toXMLFormat(); - } else if (obj instanceof XMLGregorianCalendar) { - return ((XMLGregorianCalendar)obj).toXMLFormat(); - } else if (obj instanceof byte[]) { - if (simpleType != null) { - if (simpleType.equals(XSD_BASE64)) { - return printBase64Binary((byte[])obj); - } else if (simpleType.equals(XSD_HEXBIN)) { - return printHexBinary((byte[])obj); - } - } - } else if (obj instanceof QName) { - NamespaceContext namespaceContext = - (NamespaceContext)((context != null) ? context.getMetadata().get(NamespaceContext.class.getName()) : null); - return printQName((QName)obj, namespaceContext); - } - return obj.toString(); - } - - public static boolean isSimpleXSDType(QName typeName) { - if (typeName == null) { - return false; - } - return typeName.getNamespaceURI().equals(URI_2001_SCHEMA_XSD) - && XSD_SIMPLE_TYPES.get(typeName.getLocalPart()) != null; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/TransformationContextImpl.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/TransformationContextImpl.java deleted file mode 100755 index 6a11f4fcb3..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/TransformationContextImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.impl; - -import java.lang.ref.WeakReference; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.interfacedef.DataType; -import org.apache.tuscany.sca.interfacedef.Operation; - -public class TransformationContextImpl implements TransformationContext { - private DataType sourceDataType; - - private DataType targetDataType; - - private final Map metadata = new HashMap(); - - private WeakReference classLoaderRef; - - public TransformationContextImpl() { - super(); - setClassLoader(Thread.currentThread().getContextClassLoader()); - } - - public TransformationContextImpl(DataType sourceDataType, - DataType targetDataType, - ClassLoader classLoader, - Map metadata) { - super(); - this.sourceDataType = sourceDataType; - this.targetDataType = targetDataType; - setClassLoader(classLoader); - if (metadata != null) { - this.metadata.putAll(metadata); - } - } - - public DataType getSourceDataType() { - return sourceDataType; - } - - public DataType getTargetDataType() { - return targetDataType; - } - - public void setSourceDataType(DataType sourceDataType) { - this.sourceDataType = sourceDataType; - } - - public void setTargetDataType(DataType targetDataType) { - this.targetDataType = targetDataType; - } - - public final void setClassLoader(ClassLoader classLoader) { - this.classLoaderRef = new WeakReference(classLoader); - } - - public ClassLoader getClassLoader() { - return classLoaderRef.get(); - } - - public Map getMetadata() { - return metadata; - } - - /** - * @return the sourceOperation - */ - public Operation getSourceOperation() { - return (Operation) metadata.get("source.operation"); - } - - /** - * @param sourceOperation the sourceOperation to set - */ - public void setSourceOperation(Operation sourceOperation) { - this.metadata.put("source.operation", sourceOperation); - } - - /** - * @return the targetOperation - */ - public Operation getTargetOperation() { - return (Operation) metadata.get("target.operation"); - } - - /** - * @param targetOperation the targetOperation to set - */ - public void setTargetOperation(Operation targetOperation) { - this.metadata.put("target.operation", targetOperation); - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/XSDDataTypeConverter.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/XSDDataTypeConverter.java deleted file mode 100644 index 7c92c365cf..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/impl/XSDDataTypeConverter.java +++ /dev/null @@ -1,941 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.impl; - -import java.io.IOException; -import java.io.OutputStream; -import java.io.Writer; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.text.FieldPosition; -import java.text.Format; -import java.text.ParsePosition; -import java.util.Calendar; -import java.util.TimeZone; - -import javax.xml.XMLConstants; -import javax.xml.datatype.DatatypeConfigurationException; -import javax.xml.datatype.DatatypeFactory; -import javax.xml.datatype.Duration; -import javax.xml.namespace.NamespaceContext; -import javax.xml.namespace.QName; - -/** - * Utility class for XSD data type conversions - */ -public class XSDDataTypeConverter { - public static final class Base64Binary { - private static final char[] S_BASE64CHAR = - {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', - 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', - 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', - '5', '6', '7', '8', '9', '+', '/'}; - - private static final char S_BASE64PAD = '='; - - private static final byte[] S_DECODETABLE = new byte[128]; - - static { - for (int i = 0; i < S_DECODETABLE.length; i++) { - S_DECODETABLE[i] = Byte.MAX_VALUE; // 127 - } - for (int i = 0; i < S_BASE64CHAR.length; i++) { - // 0 to 63 - S_DECODETABLE[S_BASE64CHAR[i]] = (byte) i; - } - } - - private Base64Binary() { - } - - /** - * - */ - public static byte[] decode(char[] data, int off, int len) { - char[] ibuf = new char[4]; - int ibufcount = 0; - byte[] obuf = new byte[len / 4 * 3 + 3]; - int obufcount = 0; - for (int i = off; i < off + len; i++) { - char ch = data[i]; - if (ch == S_BASE64PAD || ch < S_DECODETABLE.length && S_DECODETABLE[ch] != Byte.MAX_VALUE) { - ibuf[ibufcount++] = ch; - if (ibufcount == ibuf.length) { - ibufcount = 0; - obufcount += decode0(ibuf, obuf, obufcount); - } - } - } - if (obufcount == obuf.length) { - return obuf; - } - byte[] ret = new byte[obufcount]; - System.arraycopy(obuf, 0, ret, 0, obufcount); - return ret; - } - - /** - * - */ - public static void decode(char[] data, int off, int len, OutputStream ostream) throws IOException { - char[] ibuf = new char[4]; - int ibufcount = 0; - byte[] obuf = new byte[3]; - for (int i = off; i < off + len; i++) { - char ch = data[i]; - if (ch == S_BASE64PAD || ch < S_DECODETABLE.length && S_DECODETABLE[ch] != Byte.MAX_VALUE) { - ibuf[ibufcount++] = ch; - if (ibufcount == ibuf.length) { - ibufcount = 0; - int obufcount = decode0(ibuf, obuf, 0); - ostream.write(obuf, 0, obufcount); - } - } - } - } - - /** - * - */ - public static byte[] decode(String data) { - char[] ibuf = new char[4]; - int ibufcount = 0; - byte[] obuf = new byte[data.length() / 4 * 3 + 3]; - int obufcount = 0; - for (int i = 0; i < data.length(); i++) { - char ch = data.charAt(i); - if (ch == S_BASE64PAD || ch < S_DECODETABLE.length && S_DECODETABLE[ch] != Byte.MAX_VALUE) { - ibuf[ibufcount++] = ch; - if (ibufcount == ibuf.length) { - ibufcount = 0; - obufcount += decode0(ibuf, obuf, obufcount); - } - } - } - if (obufcount == obuf.length) { - return obuf; - } - byte[] ret = new byte[obufcount]; - System.arraycopy(obuf, 0, ret, 0, obufcount); - return ret; - } - - /** - * - */ - public static void decode(String data, OutputStream ostream) throws IOException { - char[] ibuf = new char[4]; - int ibufcount = 0; - byte[] obuf = new byte[3]; - for (int i = 0; i < data.length(); i++) { - char ch = data.charAt(i); - if (ch == S_BASE64PAD || ch < S_DECODETABLE.length && S_DECODETABLE[ch] != Byte.MAX_VALUE) { - ibuf[ibufcount++] = ch; - if (ibufcount == ibuf.length) { - ibufcount = 0; - int obufcount = decode0(ibuf, obuf, 0); - ostream.write(obuf, 0, obufcount); - } - } - } - } - - private static int decode0(char[] ibuf, byte[] obuf, int index) { - int wp = index; - int outlen = 3; - if (ibuf[3] == S_BASE64PAD) { - outlen = 2; - } - if (ibuf[2] == S_BASE64PAD) { - outlen = 1; - } - int b0 = S_DECODETABLE[ibuf[0]]; - int b1 = S_DECODETABLE[ibuf[1]]; - int b2 = S_DECODETABLE[ibuf[2]]; - int b3 = S_DECODETABLE[ibuf[3]]; - switch (outlen) { - case 1: - obuf[wp] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3); - return 1; - case 2: - obuf[wp++] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3); - obuf[wp] = (byte) (b1 << 4 & 0xf0 | b2 >> 2 & 0xf); - return 2; - case 3: - obuf[wp++] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3); - obuf[wp++] = (byte) (b1 << 4 & 0xf0 | b2 >> 2 & 0xf); - obuf[wp] = (byte) (b2 << 6 & 0xc0 | b3 & 0x3f); - return 3; - default: - throw new IllegalArgumentException("The character sequence is not base64 encoded."); - } - } - - /** - * Returns base64 representation of specified byte array. - */ - public static String encode(byte[] data) { - return encode(data, 0, data.length); - } - - /** - * Returns base64 representation of specified byte array. - */ - public static String encode(byte[] data, int off, int len) { - if (len <= 0) { - return ""; - } - char[] out = new char[len / 3 * 4 + 4]; - int rindex = off; - int windex = 0; - int rest = len - off; - while (rest >= 3) { - int i = - ((data[rindex] & 0xff) << 16) + ((data[rindex + 1] & 0xff) << 8) - + (data[rindex + 2] & 0xff); - out[windex++] = S_BASE64CHAR[i >> 18]; - out[windex++] = S_BASE64CHAR[(i >> 12) & 0x3f]; - out[windex++] = S_BASE64CHAR[(i >> 6) & 0x3f]; - out[windex++] = S_BASE64CHAR[i & 0x3f]; - rindex += 3; - rest -= 3; - } - if (rest == 1) { - int i = data[rindex] & 0xff; - out[windex++] = S_BASE64CHAR[i >> 2]; - out[windex++] = S_BASE64CHAR[(i << 4) & 0x3f]; - out[windex++] = S_BASE64PAD; - out[windex++] = S_BASE64PAD; - } else if (rest == 2) { - int i = ((data[rindex] & 0xff) << 8) + (data[rindex + 1] & 0xff); - out[windex++] = S_BASE64CHAR[i >> 10]; - out[windex++] = S_BASE64CHAR[(i >> 4) & 0x3f]; - out[windex++] = S_BASE64CHAR[(i << 2) & 0x3f]; - out[windex++] = S_BASE64PAD; - } - return new String(out, 0, windex); - } - - /** - * Outputs base64 representation of the specified byte array to a byte stream. - */ - public static void encode(byte[] data, int off, int len, OutputStream ostream) throws IOException { - if (len <= 0) { - return; - } - byte[] out = new byte[4]; - int rindex = off; - int rest = len - off; - while (rest >= 3) { - int i = - ((data[rindex] & 0xff) << 16) + ((data[rindex + 1] & 0xff) << 8) - + (data[rindex + 2] & 0xff); - out[0] = (byte) S_BASE64CHAR[i >> 18]; - out[1] = (byte) S_BASE64CHAR[(i >> 12) & 0x3f]; - out[2] = (byte) S_BASE64CHAR[(i >> 6) & 0x3f]; - out[3] = (byte) S_BASE64CHAR[i & 0x3f]; - ostream.write(out, 0, 4); - rindex += 3; - rest -= 3; - } - if (rest == 1) { - int i = data[rindex] & 0xff; - out[0] = (byte) S_BASE64CHAR[i >> 2]; - out[1] = (byte) S_BASE64CHAR[(i << 4) & 0x3f]; - out[2] = (byte) S_BASE64PAD; - out[3] = (byte) S_BASE64PAD; - ostream.write(out, 0, 4); - } else if (rest == 2) { - int i = ((data[rindex] & 0xff) << 8) + (data[rindex + 1] & 0xff); - out[0] = (byte) S_BASE64CHAR[i >> 10]; - out[1] = (byte) S_BASE64CHAR[(i >> 4) & 0x3f]; - out[2] = (byte) S_BASE64CHAR[(i << 2) & 0x3f]; - out[3] = (byte) S_BASE64PAD; - ostream.write(out, 0, 4); - } - } - - /** - * Outputs base64 representation of the specified byte array to a character stream. - */ - public static void encode(byte[] data, int off, int len, Writer writer) throws IOException { - if (len <= 0) { - return; - } - char[] out = new char[4]; - int rindex = off; - int rest = len - off; - int output = 0; - while (rest >= 3) { - int i = - ((data[rindex] & 0xff) << 16) + ((data[rindex + 1] & 0xff) << 8) - + (data[rindex + 2] & 0xff); - out[0] = S_BASE64CHAR[i >> 18]; - out[1] = S_BASE64CHAR[(i >> 12) & 0x3f]; - out[2] = S_BASE64CHAR[(i >> 6) & 0x3f]; - out[3] = S_BASE64CHAR[i & 0x3f]; - writer.write(out, 0, 4); - rindex += 3; - rest -= 3; - output += 4; - if (output % 76 == 0) { - writer.write("\n"); - } - } - if (rest == 1) { - int i = data[rindex] & 0xff; - out[0] = S_BASE64CHAR[i >> 2]; - out[1] = S_BASE64CHAR[(i << 4) & 0x3f]; - out[2] = S_BASE64PAD; - out[3] = S_BASE64PAD; - writer.write(out, 0, 4); - } else if (rest == 2) { - int i = ((data[rindex] & 0xff) << 8) + (data[rindex + 1] & 0xff); - out[0] = S_BASE64CHAR[i >> 10]; - out[1] = S_BASE64CHAR[(i >> 4) & 0x3f]; - out[2] = S_BASE64CHAR[(i << 2) & 0x3f]; - out[3] = S_BASE64PAD; - writer.write(out, 0, 4); - } - } - } - - /** - *

- * Utility class for xs:hexbinary.

- */ - public static final class HexBinary { - private HexBinary() { - } - - /** - * Converts the string pValue into an array of hex bytes. - */ - public static byte[] decode(String pValue) { - if ((pValue.length() % 2) != 0) { - throw new IllegalArgumentException("A HexBinary string must have even length."); - } - byte[] result = new byte[pValue.length() / 2]; - int j = 0; - int i = 0; - while (i < pValue.length()) { - byte b; - char c = pValue.charAt(i++); - char d = pValue.charAt(i++); - if (c >= '0' && c <= '9') { - b = (byte) ((c - '0') << 4); - } else if (c >= 'A' && c <= 'F') { - b = (byte) ((c - 'A' + 10) << 4); - } else if (c >= 'a' && c <= 'f') { - b = (byte) ((c - 'a' + 10) << 4); - } else { - throw new IllegalArgumentException("Invalid hex digit: " + c); - } - if (d >= '0' && d <= '9') { - b += (byte) (d - '0'); - } else if (d >= 'A' && d <= 'F') { - b += (byte) (d - 'A' + 10); - } else if (d >= 'a' && d <= 'f') { - b += (byte) (d - 'a' + 10); - } else { - throw new IllegalArgumentException("Invalid hex digit: " + d); - } - result[j++] = b; - } - return result; - } - - /** - * Converts the byte array pHexBinary into a string. - */ - public static String encode(byte[] pHexBinary) { - StringBuffer result = new StringBuffer(); - for (int i = 0; i < pHexBinary.length; i++) { - byte b = pHexBinary[i]; - byte c = (byte) ((b & 0xf0) >> 4); - if (c <= 9) { - result.append((char) ('0' + c)); - } else { - result.append((char) ('A' + c - 10)); - } - c = (byte) (b & 0x0f); - if (c <= 9) { - result.append((char) ('0' + c)); - } else { - result.append((char) ('A' + c - 10)); - } - } - return result.toString(); - } - - /** - * Creates a clone of the given byte array. - */ - public static byte[] getClone(byte[] pHexBinary) { - byte[] result = new byte[pHexBinary.length]; - System.arraycopy(pHexBinary, 0, result, 0, pHexBinary.length); - return result; - } - } - - public class XSDDateFormat extends XSDDateTimeFormat { - private static final long serialVersionUID = -1629412916827246627L; - - /** - * Creates a new instance. - */ - public XSDDateFormat() { - super(true, false); - } - } - - /** - *

- * An instance of {@link java.text.Format}, which may be used to parse and format xs:dateTime values. - *

- */ - public static class XSDDateTimeFormat extends Format { - private static final long serialVersionUID = -1148332471737068969L; - - final boolean parseDate; - - final boolean parseTime; - - /** - * Creates a new instance. - */ - public XSDDateTimeFormat() { - this(true, true); - } - - XSDDateTimeFormat(boolean pParseDate, boolean pParseTime) { - parseDate = pParseDate; - parseTime = pParseTime; - } - - private void append(StringBuffer pBuffer, int pNum, int pMinLen) { - String s = Integer.toString(pNum); - for (int i = s.length(); i < pMinLen; i++) { - pBuffer.append('0'); - } - pBuffer.append(s); - } - - public StringBuffer format(Object pCalendar, StringBuffer pBuffer, FieldPosition pPos) { - assert pCalendar != null : "The Calendar argument must not be null."; - assert pBuffer != null : "The StringBuffer argument must not be null."; - assert pPos != null : "The FieldPosition argument must not be null."; - - Calendar cal = (Calendar) pCalendar; - if (parseDate) { - int year = cal.get(Calendar.YEAR); - if (year < 0) { - pBuffer.append('-'); - year = -year; - } - append(pBuffer, year, 4); - pBuffer.append('-'); - append(pBuffer, cal.get(Calendar.MONTH) + 1, 2); - pBuffer.append('-'); - append(pBuffer, cal.get(Calendar.DAY_OF_MONTH), 2); - if (parseTime) { - pBuffer.append('T'); - } - } - if (parseTime) { - append(pBuffer, cal.get(Calendar.HOUR_OF_DAY), 2); - pBuffer.append(':'); - append(pBuffer, cal.get(Calendar.MINUTE), 2); - pBuffer.append(':'); - append(pBuffer, cal.get(Calendar.SECOND), 2); - int millis = cal.get(Calendar.MILLISECOND); - if (millis > 0) { - pBuffer.append('.'); - append(pBuffer, millis, 3); - } - } - TimeZone tz = cal.getTimeZone(); - // JDK 1.4: int offset = tz.getOffset(cal.getTimeInMillis()); - int offset = cal.get(Calendar.ZONE_OFFSET); - if (tz.inDaylightTime(cal.getTime())) { - offset += cal.get(Calendar.DST_OFFSET); - } - if (offset == 0) { - pBuffer.append('Z'); - } else { - if (offset < 0) { - pBuffer.append('-'); - offset = -offset; - } else { - pBuffer.append('+'); - } - int minutes = offset / (60 * 1000); - int hours = minutes / 60; - minutes -= hours * 60; - append(pBuffer, hours, 2); - pBuffer.append(':'); - append(pBuffer, minutes, 2); - } - return pBuffer; - } - - private int parseInt(String pString, int offset, StringBuffer pDigits) { - int length = pString.length(); - int pOffset = offset; - pDigits.setLength(0); - while (pOffset < length) { - char c = pString.charAt(pOffset); - if (Character.isDigit(c)) { - pDigits.append(c); - ++pOffset; - } else { - break; - } - } - return pOffset; - } - - public Object parseObject(String pString, ParsePosition pParsePosition) { - assert pString != null : "The String argument must not be null."; - assert pParsePosition != null : "The ParsePosition argument must not be null."; - int offset = pParsePosition.getIndex(); - int length = pString.length(); - - boolean isMinus = false; - StringBuffer digits = new StringBuffer(); - int year = 0; - int month = 0; - int mday = 0; - if (parseDate) { - // Sign - if (offset < length) { - char c = pString.charAt(offset); - if (c == '+') { - ++offset; - } else if (c == '-') { - ++offset; - isMinus = true; - } - } - - offset = parseInt(pString, offset, digits); - if (digits.length() < 4) { - pParsePosition.setErrorIndex(offset); - return null; - } - year = Integer.parseInt(digits.toString()); - - if (offset < length && pString.charAt(offset) == '-') { - ++offset; - } else { - pParsePosition.setErrorIndex(offset); - return null; - } - - offset = parseInt(pString, offset, digits); - if (digits.length() != 2) { - pParsePosition.setErrorIndex(offset); - return null; - } - month = Integer.parseInt(digits.toString()); - - if (offset < length && pString.charAt(offset) == '-') { - ++offset; - } else { - pParsePosition.setErrorIndex(offset); - return null; - } - - offset = parseInt(pString, offset, digits); - if (digits.length() != 2) { - pParsePosition.setErrorIndex(offset); - return null; - } - mday = Integer.parseInt(digits.toString()); - - if (parseTime) { - if (offset < length && pString.charAt(offset) == 'T') { - ++offset; - } else { - pParsePosition.setErrorIndex(offset); - return null; - } - } - } else { - year = month = mday = 0; - } - - int hour = 0; - int minute = 0; - int second = 0; - int millis = 0; - if (parseTime) { - offset = parseInt(pString, offset, digits); - if (digits.length() != 2) { - pParsePosition.setErrorIndex(offset); - return null; - } - hour = Integer.parseInt(digits.toString()); - - if (offset < length && pString.charAt(offset) == ':') { - ++offset; - } else { - pParsePosition.setErrorIndex(offset); - return null; - } - - offset = parseInt(pString, offset, digits); - if (digits.length() != 2) { - pParsePosition.setErrorIndex(offset); - return null; - } - minute = Integer.parseInt(digits.toString()); - - if (offset < length && pString.charAt(offset) == ':') { - ++offset; - } else { - pParsePosition.setErrorIndex(offset); - return null; - } - - offset = parseInt(pString, offset, digits); - if (digits.length() != 2) { - pParsePosition.setErrorIndex(offset); - return null; - } - second = Integer.parseInt(digits.toString()); - - if (offset < length && pString.charAt(offset) == '.') { - ++offset; - offset = parseInt(pString, offset, digits); - if (digits.length() > 0) { - millis = Integer.parseInt(digits.toString()); - } else { - millis = 0; - } - } else { - millis = 0; - } - } else { - hour = minute = second = millis = 0; - } - - digits.setLength(0); - digits.append("GMT"); - if (offset < length) { - char c = pString.charAt(offset); - if (c == 'Z') { - // Ignore UTC, it is the default - ++offset; - } else if (c == '+' || c == '-') { - digits.append(c); - ++offset; - for (int i = 0; i < 5; i++) { - if (offset >= length) { - pParsePosition.setErrorIndex(offset); - return null; - } - c = pString.charAt(offset); - if ((i != 2 && Character.isDigit(c)) || (i == 2 && c == ':')) { - digits.append(c); - } else { - pParsePosition.setErrorIndex(offset); - return null; - } - ++offset; - } - } - } - - Calendar cal = Calendar.getInstance(TimeZone.getTimeZone(digits.toString())); - cal.set(isMinus ? -year : year, parseDate ? month - 1 : month, mday, hour, minute, second); - cal.set(Calendar.MILLISECOND, millis); - pParsePosition.setIndex(offset); - return cal; - } - } - - public static class XSDTimeFormat extends XSDDateTimeFormat { - private static final long serialVersionUID = 1346506860724640517L; - - /** - * Creates a new instance. - */ - public XSDTimeFormat() { - super(false, true); - } - } - - private static final long MAX_UNSIGNED_INT = (((long) Integer.MAX_VALUE) * 2) + 1; - - private static final int MAX_UNSIGNED_SHORT = Short.MAX_VALUE * 2 + 1; - - public String parseAnySimpleType(String value) { - return value; - } - - public byte[] parseBase64Binary(String value) { - return Base64Binary.decode(value); - } - - public boolean parseBoolean(String value) { - return Boolean.valueOf(value).booleanValue(); - } - - public byte parseByte(String value) { - return Byte.parseByte(value); - } - - public Calendar parseDate(String value) { - XSDDateFormat format = new XSDDateFormat(); - ParsePosition pos = new ParsePosition(0); - Calendar cal = (Calendar) format.parseObject(value, pos); - if (cal == null) { - throw new IllegalArgumentException("Failed to parse date " + value + " at:" - + value.substring(pos.getErrorIndex())); - } - return cal; - } - - public Calendar parseDateTime(String value) { - XSDDateTimeFormat format = new XSDDateTimeFormat(); - ParsePosition pos = new ParsePosition(0); - Calendar cal = (Calendar) format.parseObject(value, pos); - if (cal == null) { - throw new IllegalArgumentException("Failed to parse dateTime " + value + " at:" - + value.substring(pos.getErrorIndex())); - } - return cal; - } - - public BigDecimal parseDecimal(String value) { - return new BigDecimal(value); - } - - public double parseDouble(String value) { - if ("INF".equals(value)) { - return Double.POSITIVE_INFINITY; - } else if ("-INF".equals(value)) { - return Double.NEGATIVE_INFINITY; - } else if ("NaN".equals(value)) { - return Double.NaN; - } else { - return Double.parseDouble(value); - } - } - - public Duration parseDuration(String pDuration) { - try { - return DatatypeFactory.newInstance().newDuration(pDuration); - } catch (DatatypeConfigurationException e) { - throw new IllegalArgumentException(e); - } - } - - public float parseFloat(String value) { - if ("INF".equals(value)) { - return Float.POSITIVE_INFINITY; - } else if ("-INF".equals(value)) { - return Float.NEGATIVE_INFINITY; - } else if ("NaN".equals(value)) { - return Float.NaN; - } else { - return Float.parseFloat(value); - } - } - - public byte[] parseHexBinary(String value) { - return HexBinary.decode(value); - } - - public int parseInt(String value) { - return Integer.parseInt(value); - } - - public BigInteger parseInteger(String value) { - return new BigInteger(value); - } - - public long parseLong(String value) { - return Long.parseLong(value); - } - - public QName parseQName(String value, NamespaceContext context) { - int offset = value.indexOf(':'); - String uri; - String localName; - switch (offset) { - case -1: - localName = value; - uri = context.getNamespaceURI(""); - if (uri == null) { - // Should not happen, indicates an error in the - // NamespaceContext - // implementation - throw new IllegalArgumentException("The default prefix is not bound."); - } - break; - case 0: - throw new IllegalArgumentException("Default prefix must be indicated by not using a colon: " - + value); - default: - String prefix = value.substring(0, offset); - localName = value.substring(offset + 1); - uri = context.getNamespaceURI(prefix); - if (uri == null) { - throw new IllegalArgumentException("The prefix " + prefix + " is not bound."); - } - } - return new QName(uri, localName); - } - - public short parseShort(String value) { - return Short.parseShort(value); - } - - public String parseString(String value) { - return value; - } - - public Calendar parseTime(String value) { - XSDTimeFormat format = new XSDTimeFormat(); - ParsePosition pos = new ParsePosition(0); - Calendar cal = (Calendar) format.parseObject(value, pos); - if (cal == null) { - throw new IllegalArgumentException("Failed to parse time " + value + " at:" - + value.substring(pos.getErrorIndex())); - } - return cal; - } - - public long parseUnsignedInt(String value) { - long l = Long.parseLong(value); - if (l < 0) { - throw new IllegalArgumentException("Failed to parse UnsignedInt " + value - + ": result is negative"); - } - if (l > MAX_UNSIGNED_INT) { - throw new IllegalArgumentException("Failed to parse UnsignedInt " + value - + ": result exceeds maximum value " + MAX_UNSIGNED_INT); - } - return l; - } - - public int parseUnsignedShort(String value) { - int i = Integer.parseInt(value); - if (i < 0) { - throw new IllegalArgumentException("Failed to parse UnsignedShort " + value - + ": result is negative"); - } - if (i > MAX_UNSIGNED_SHORT) { - throw new IllegalArgumentException("Failed to parse UnsignedShort " + value - + ": result exceeds maximum value " + MAX_UNSIGNED_SHORT); - } - return i; - } - - public String printAnySimpleType(String value) { - return value; - } - - public String printBase64Binary(byte[] value) { - return Base64Binary.encode(value); - } - - public String printBoolean(boolean value) { - return (value ? Boolean.TRUE : Boolean.FALSE).toString(); - } - - public String printByte(byte value) { - return Byte.toString(value); - } - - public String printDate(Calendar value) { - return new XSDDateFormat().format(value); - } - - public String printDateTime(Calendar value) { - return new XSDDateTimeFormat().format(value); - } - - public String printDecimal(BigDecimal value) { - return value.toString(); - } - - public String printDouble(double value) { - return Double.toString(value); - } - - public String printDuration(Duration pDuration) { - return pDuration.toString(); - } - - public String printFloat(float value) { - return Float.toString(value); - } - - public String printHexBinary(byte[] value) { - return HexBinary.encode(value); - } - - public String printInt(int value) { - return Integer.toString(value); - } - - public String printInteger(BigInteger value) { - return value.toString(); - } - - public String printLong(long value) { - return Long.toString(value); - } - - public String printQName(QName value, NamespaceContext context) { - String prefix = context.getPrefix(value.getNamespaceURI()); - if (prefix == null) { - throw new IllegalArgumentException("The namespace URI " + value.getNamespaceURI() - + " is not bound."); - } else if (XMLConstants.DEFAULT_NS_PREFIX.equals(prefix)) { - return value.getLocalPart(); - } else { - return prefix + ":" + value.getLocalPart(); - } - } - - public String printShort(short value) { - return Short.toString(value); - } - - public String printString(String value) { - return value; - } - - public String printTime(Calendar value) { - return new XSDTimeFormat().format(value); - } - - public String printUnsignedInt(long value) { - return Long.toString(value); - } - - public String printUnsignedShort(int value) { - return Integer.toString(value); - } -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/DOMNode2JavaBeanTransformer.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/DOMNode2JavaBeanTransformer.java deleted file mode 100644 index 34ddc4d268..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/DOMNode2JavaBeanTransformer.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.javabeans; - -import java.util.ArrayList; -import java.util.List; - -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * Transformer to convert data from DOM Node to JavaBean - */ -public class DOMNode2JavaBeanTransformer extends XML2JavaBeanTransformer { - - @Override - public Node getRootElement(Node element) throws XML2JavaMapperException { - if (element instanceof Document) { - return ((Document)element).getDocumentElement(); - } else { - return element; - } - - } - - @Override - public List getChildElements(Node parent) throws XML2JavaMapperException { - NodeList nodeList = parent.getChildNodes(); - List nodeArrayList = new ArrayList(nodeList.getLength()); - for (int count = 0; count < nodeList.getLength(); ++count) { - nodeArrayList.add(nodeList.item(count)); - } - - return nodeArrayList; - } - - @Override - public String getElementName(Node element) throws XML2JavaMapperException { - return element.getLocalName(); - } - - @Override - public String getText(Node element) throws XML2JavaMapperException { - if (element instanceof Document) { - element = ((Document)element).getDocumentElement(); - } - return element.getTextContent(); - } - - @Override - public boolean isTextElement(Node element) throws XML2JavaMapperException { - return element.getNodeType() == Node.TEXT_NODE; - } - - public Class getSourceType() { - return Node.class; - } -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/Java2XMLMapperException.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/Java2XMLMapperException.java deleted file mode 100644 index 050c4288c3..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/Java2XMLMapperException.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.javabeans; - -import javax.xml.namespace.QName; - -/** - * This exception is used to encapsulate and rethrow exceptions that arise out - * of converting JavaBean objects to XML - */ -public class Java2XMLMapperException extends RuntimeException { - private static final long serialVersionUID = 6811924384399578686L; - - private QName xmlElementName; - private String javaFieldName; - private Class javaType; - - public Java2XMLMapperException(String message) { - super(message); - } - - public Java2XMLMapperException(Throwable cause) { - super(cause); - } - - public String getJavaFieldName() { - return javaFieldName; - } - - public void setJavaFieldName(String javaFieldName) { - this.javaFieldName = javaFieldName; - } - - public Class getJavaType() { - return javaType; - } - - public void setJavaType(Class javaType) { - this.javaType = javaType; - } - - public QName getXmlElementName() { - return xmlElementName; - } - - public void setXmlElementName(QName xmlElementName) { - this.xmlElementName = xmlElementName; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2DOMNodeTransformer.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2DOMNodeTransformer.java deleted file mode 100644 index c363a36d95..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2DOMNodeTransformer.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.javabeans; - -import javax.xml.namespace.QName; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.tuscany.sca.databinding.impl.DOMHelper; -import org.w3c.dom.Document; -import org.w3c.dom.Node; - -/** - * Transformer to convert data from a JavaBean object to DOM Node - */ -public class JavaBean2DOMNodeTransformer extends JavaBean2XMLTransformer { - - public static final String COLON = ":"; - private Document factory; - - public JavaBean2DOMNodeTransformer() { - super(); - try { - factory = DOMHelper.newDocument(); - } catch (ParserConfigurationException e) { - throw new Java2XMLMapperException(e); - } - } - - @Override - public void appendChild(Node parentElement, Node childElement) throws Java2XMLMapperException { - parentElement.appendChild(childElement); - } - - @Override - public Node createElement(QName qName) throws Java2XMLMapperException { - String qualifedName = - (qName.getPrefix() == null || qName.getPrefix().length() <= 0) ? qName.getLocalPart() - : qName.getPrefix() + COLON + qName.getLocalPart(); - return factory.createElementNS(qName.getNamespaceURI(), qualifedName); - } - - @Override - public Node createText(String textData) throws Java2XMLMapperException { - return factory.createTextNode(textData); - } - - public Class getTargetType() { - return Node.class; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLStreamReader.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLStreamReader.java deleted file mode 100644 index a41d853958..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLStreamReader.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.javabeans; - -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sca.databinding.xml.BeanUtil; -import org.apache.tuscany.sca.databinding.xml.XMLDocumentStreamReader; - -public class JavaBean2XMLStreamReader extends BaseTransformer implements - PullTransformer { - - public XMLStreamReader transform(Object source, TransformationContext context) { - try { - return new XMLDocumentStreamReader(BeanUtil.getXMLStreamReader(source)); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return Object.class; - } - - public Class getTargetType() { - return XMLStreamReader.class; - } - - public int getWeight() { - return 50; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLTransformer.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLTransformer.java deleted file mode 100644 index 56910582c0..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLTransformer.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.javabeans; - -import java.lang.reflect.Array; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.Date; -import java.util.GregorianCalendar; - -import javax.xml.datatype.XMLGregorianCalendar; -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl; - -/** - * Transformer to convert data from a JavaBean object to xml - */ -public abstract class JavaBean2XMLTransformer extends BaseTransformer implements - PullTransformer { - - public static final String GET = "get"; - public static final String PREFIX = "n"; - public static final String PERIOD = "."; - public static final String FWD_SLASH = "/"; - public static final String HTTP = "http://"; - private static int prefixCount = 1; - - protected SimpleTypeMapperImpl mapper; - - public JavaBean2XMLTransformer() { - this.mapper = new SimpleTypeMapperImpl(); - } - - public T transform(Object source, TransformationContext context) { - - //FIXME See how/if we still need to get the metadata here - //QName rootElementName = (QName)context.getTargetDataType().getMetadata("RootElementName"); - //if (rootElementName == null) { - QName rootElementName = new QName(resolveRootElementName(source.getClass())); - //} - - T root = createElement(rootElementName); - appendChildElements(root, - resolveElementName(source.getClass()), - source.getClass(), - source, - context); - return root; - } - - private void appendChildElements(T parent, - QName elementName, - Class javaType, - Object javaObject, - TransformationContext context) { - T element = null; - if (javaObject != null) { - if (javaType.isPrimitive() || isSimpleJavaType(javaObject)) { - appendChild(parent, createText(mapper.toXMLLiteral(null, javaObject, context))); - } else if (javaType.isArray()) { - boolean arrayDone = false; - Object arrayObject = null; - for (int count = 0; !arrayDone; ++count) { - try { - arrayObject = Array.get(javaObject, count); - element = createElement(elementName); - appendChild(parent, element); - appendChildElements(element, - elementName, - javaType.getComponentType(), - arrayObject, - context); - } catch (ArrayIndexOutOfBoundsException e1) { - arrayDone = true; - } - } - } else { - Field[] javaFields = javaType.getFields(); - for (Field aField : javaFields) { - try { - QName fieldElementName = new QName(aField.getName()); - if (!aField.getType().isArray()) { - element = createElement(fieldElementName); - appendChild(parent, element); - appendChildElements(element, - fieldElementName, - aField.getType(), - aField.get(javaObject), - context); - } else { - appendChildElements(parent, - fieldElementName, - aField.getType(), - aField.get(javaObject), - context); - } - } catch (IllegalAccessException e) { - Java2XMLMapperException java2xmlEx = new Java2XMLMapperException(e); - java2xmlEx.setJavaFieldName(aField.getName()); - java2xmlEx.setJavaType(javaType); - throw java2xmlEx; - } - } - - Method[] methods = javaType.getDeclaredMethods(); - String fieldName = null; - for (Method aMethod : methods) { - try { - if (Modifier.isPublic(aMethod.getModifiers()) && aMethod.getName().startsWith(GET) - && aMethod.getParameterTypes().length == 0) { - fieldName = resolveFieldFromMethod(aMethod.getName()); - try { - javaType.getField(fieldName); - } catch (NoSuchFieldException e) { - QName fieldElementName = new QName(fieldName); - if (aMethod.getReturnType().isArray()) { - appendChildElements(parent, fieldElementName, aMethod.getReturnType(), aMethod - .invoke(javaObject, new Object[0]), context); - } else { - element = createElement(fieldElementName); - appendChild(parent, element); - appendChildElements(element, fieldElementName, aMethod.getReturnType(), aMethod - .invoke(javaObject, new Object[0]), context); - } - } - } - } catch (IllegalAccessException e) { - Java2XMLMapperException java2xmlEx = new Java2XMLMapperException(e); - java2xmlEx.setJavaFieldName(fieldName); - java2xmlEx.setJavaType(javaType); - throw java2xmlEx; - } catch (InvocationTargetException e) { - Java2XMLMapperException java2xmlEx = new Java2XMLMapperException(e); - java2xmlEx.setJavaFieldName(fieldName); - java2xmlEx.setJavaType(javaType); - throw java2xmlEx; - } - } - } - } - } - - public Class getSourceType() { - return Object.class; - } - - private boolean isSimpleJavaType(Object javaObject) { - if (javaObject instanceof String) { - return true; - } - if (javaObject instanceof Byte || javaObject instanceof Character - || javaObject instanceof Short - || javaObject instanceof Integer - || javaObject instanceof Long - || javaObject instanceof Float - || javaObject instanceof Double) { - return true; - } - if (javaObject instanceof GregorianCalendar || javaObject instanceof Date - || javaObject instanceof XMLGregorianCalendar - || javaObject instanceof byte[] - || javaObject instanceof QName) { - return true; - } - return false; - } - - private String resolveRootElementName(Class javaType) { - if (javaType.isArray()) { - return javaType.getComponentType().getSimpleName() + "_collection"; - } else { - return javaType.getSimpleName() + "_instance"; - } - } - - - private QName resolveElementName(Class javaType) { - if (javaType.isArray()) { - return new QName(javaType.getComponentType().getSimpleName()); - } else { - return new QName(javaType.getSimpleName()); - } - } - - private String resolveFieldFromMethod(String methodName) { - StringBuffer fieldName = new StringBuffer(); - fieldName.append(Character.toLowerCase(methodName.charAt(GET.length()))); - fieldName.append(methodName.substring(GET.length() + 1)); - return fieldName.toString(); - } - - public String getNexPrefix() { - return PREFIX + prefixCount++; - } - - @Override - public int getWeight() { - return JavaBeansDataBinding.HEAVY_WEIGHT; - } - - public abstract T createElement(QName qName) throws Java2XMLMapperException; - public abstract T createText(String textData) throws Java2XMLMapperException; - public abstract void appendChild(T parentElement, T childElement) throws Java2XMLMapperException; -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java deleted file mode 100644 index 966fc48bb8..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.javabeans; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.ObjectStreamClass; -import java.io.OutputStream; -import java.io.Serializable; - -import org.apache.tuscany.sca.databinding.impl.BaseDataBinding; - -/** - * DataBinding for JavaBeans - */ -public class JavaBeansDataBinding extends BaseDataBinding { - /** - * Defining a weight to a very high number so that the transformer won't be picked - * up by other paths unless it's the only available path - */ - public static final int HEAVY_WEIGHT = 10000; - public static final String NAME = Object.class.getName(); - - public JavaBeansDataBinding() { - super(NAME, Object.class); - } - - public Object copy(Object arg) { - if (arg == null) { - return null; - } - final Class clazz = arg.getClass(); - if (String.class == clazz || clazz.isPrimitive() - || Number.class.isAssignableFrom(clazz) - || Boolean.class.isAssignableFrom(clazz) - || Character.class.isAssignableFrom(clazz) - || Byte.class.isAssignableFrom(clazz)) { - // Immutable classes - return arg; - } - try { - if (arg instanceof Serializable) { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ObjectOutputStream oos = getObjectOutputStream(bos); - oos.writeObject(arg); - oos.close(); - bos.close(); - - ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); - ObjectInputStream ois = getObjectInputStream(bis, clazz.getClassLoader()); - Object objectCopy = ois.readObject(); - ois.close(); - bis.close(); - return objectCopy; - } else { - // return arg; - throw new IllegalArgumentException("Pass-by-value is not supported for the given object"); - } - } catch (Exception e) { - throw new IllegalArgumentException("Pass-by-value is not supported for the given object", e); - } - } - - protected ObjectOutputStream getObjectOutputStream(OutputStream os) throws IOException { - return new ObjectOutputStream(os); - } - - protected ObjectInputStream getObjectInputStream(InputStream is, final ClassLoader cl) throws IOException { - ObjectInputStream ois = new ObjectInputStream(is) { - @Override - protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { - try { - return Class.forName(desc.getName(), false, cl); - } catch (ClassNotFoundException e) { - return super.resolveClass(desc); - } - } - - }; - return ois; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaBeanTransformer.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaBeanTransformer.java deleted file mode 100644 index 2bf16a5b86..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaBeanTransformer.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.javabeans; - -import java.lang.reflect.Array; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl; -import org.apache.tuscany.sca.interfacedef.util.XMLType; - -/** - * Transformer to convert data from XML to JavaBean - */ -public abstract class XML2JavaBeanTransformer extends BaseTransformer implements - PullTransformer { - - public static final String SET = "set"; - - protected SimpleTypeMapperImpl mapper; - - public XML2JavaBeanTransformer() { - this.mapper = new SimpleTypeMapperImpl(); - } - - @Override - public int getWeight() { - return JavaBeansDataBinding.HEAVY_WEIGHT; - } - - public Object transform(T source, TransformationContext context) { - XMLType xmlType = (XMLType) context.getSourceDataType().getLogical(); - return toJavaObject(xmlType.getTypeName(), getRootElement(source), context); - } - - public Object toJavaObject(QName xmlType, T xmlElement, TransformationContext context) { - if (SimpleTypeMapperImpl.isSimpleXSDType(xmlType)) { - return mapper.toJavaObject(xmlType, getText(xmlElement), context); - } else { - Class javaType = (Class)context.getTargetDataType().getPhysical(); - return createJavaObject(xmlElement, javaType, context); - } - } - - @SuppressWarnings("unchecked") - private L createJavaObject(T element, Class javaType, TransformationContext context) - throws XML2JavaMapperException { - List childElements = getChildElements(element); - if (childElements.size() == 1 && isTextElement(childElements.get(0))) { - return (L) mapper.toJavaObject(mapper.getXMLType(javaType).getQName(), - getText(childElements.get(0)), - context); - } else { - String fieldName = null; - try { - L javaInstance = javaType.newInstance(); - Map> arrayFields = new Hashtable>(); - Map> arraySetters = new Hashtable>(); - for (int count = 0; count < childElements.size(); ++count) { - if (!isTextElement(childElements.get(count))) { - fieldName = getElementName(childElements.get(count)); - try { - Field javaField = javaType.getField(fieldName); - setFieldValue(javaInstance, - javaField, - childElements.get(count), - arrayFields, - context); - - } catch (NoSuchFieldException e1) { - setFieldValueUsingSetter(javaType, - javaInstance, - fieldName, - childElements.get(count), - arraySetters, - context); - } - } - } - - setArrayValues(javaInstance, arrayFields, arraySetters); - return javaInstance; - } catch (Exception e2) { - XML2JavaMapperException xml2JavaEx = new XML2JavaMapperException(e2); - xml2JavaEx.setJavaType(javaType); - xml2JavaEx.setJavaFieldName(fieldName); - throw xml2JavaEx; - } - } - } - - private void setFieldValue(Object javaInstance, - Field javaField, - T fieldValue, - Map> arrayFields, - TransformationContext context) throws IllegalAccessException { - Class javaFieldType = (Class) javaField.getType(); - - if (javaFieldType.isArray()) { - Class componentType = javaFieldType.getComponentType(); - List fldValueArray = arrayFields.get(javaField); - if (fldValueArray == null) { - fldValueArray = new ArrayList(); - arrayFields.put(javaField, fldValueArray); - } - fldValueArray.add(createJavaObject(fieldValue, componentType, context)); - } else { - javaField.setAccessible(true); - javaField.set(javaInstance, createJavaObject(fieldValue, javaFieldType, context)); - } - } - - private void setFieldValueUsingSetter(Class javaType, - Object javaInstance, - String fieldName, - T fieldValue, - Map> arraySetters, - TransformationContext context) throws IllegalAccessException, - InvocationTargetException { - char firstChar = Character.toUpperCase(fieldName.charAt(0)); - StringBuilder methodName = new StringBuilder(SET + fieldName); - methodName.setCharAt(SET.length(), firstChar); - boolean methodNotFound = true; - - for (int methodCount = 0; methodNotFound && methodCount < javaType.getMethods().length; ++methodCount) { - Method aMethod = javaType.getMethods()[methodCount]; - if (aMethod.getName().equals(methodName.toString()) - && aMethod.getParameterTypes().length == 1) { - Class paramType = aMethod.getParameterTypes()[0]; - - if (paramType.isArray()) { - Class componentType = paramType.getComponentType(); - List setterValueArray = arraySetters.get(aMethod); - if (setterValueArray == null) { - setterValueArray = new ArrayList(); - arraySetters.put(aMethod, setterValueArray); - } - setterValueArray.add(createJavaObject(fieldValue, componentType, context)); - } else { - aMethod.invoke(javaInstance, new Object[] {createJavaObject(fieldValue, - paramType, - context)}); - } - methodNotFound = false; - } - } - - if (methodNotFound) { - XML2JavaMapperException xml2JavaEx = - new XML2JavaMapperException("No field or setter method to configure xml data"); - xml2JavaEx.setJavaFieldName(fieldName); - xml2JavaEx.setJavaType(javaType); - throw xml2JavaEx; - } - } - - private void setArrayValues(Object javaInstance, - Map> arrayFields, - Map> arraySetters) throws IllegalAccessException, - InvocationTargetException { - if (arrayFields.size() > 0) { - for (Field javaField : arrayFields.keySet()) { - javaField.setAccessible(true); - - if (javaField.getType().getComponentType().isPrimitive()) { - javaField.set(javaInstance, createPrimitiveArray(javaField.getType() - .getComponentType(), - arrayFields.get(javaField))); - } else { - javaField.set(javaInstance, - createNonPrimitiveArray(javaField.getType().getComponentType(), - arrayFields.get(javaField))); - } - } - } - - if (arraySetters.size() > 0) { - for (Method aMethod : arraySetters.keySet()) { - Class paramType = aMethod.getParameterTypes()[0]; - if (paramType.getComponentType().isPrimitive()) { - aMethod.invoke(javaInstance, - new Object[] {createPrimitiveArray(paramType.getComponentType(), - arraySetters.get(aMethod))}); - } else { - aMethod.invoke(javaInstance, - new Object[] {createNonPrimitiveArray(paramType.getComponentType(), - arraySetters.get(aMethod))}); - } - } - } - } - - private Object createNonPrimitiveArray(Class fieldType, List values) { - Object objectArray = Array.newInstance(fieldType, values.size()); - for (int count = 0; count < values.size(); ++count) { - Array.set(objectArray, count, values.get(count)); - } - return objectArray; - } - - private Object createPrimitiveArray(Class fieldType, List values) { - if (fieldType.isPrimitive()) { - if (fieldType.getName().equals("int")) { - int[] primitiveValues = new int[values.size()]; - for (int count = 0; count < values.size(); ++count) { - primitiveValues[count] = ((Integer) values.get(count)).intValue(); - } - return primitiveValues; - } else if (fieldType.getName().equals("float")) { - float[] primitiveValues = new float[values.size()]; - for (int count = 0; count < values.size(); ++count) { - primitiveValues[count] = ((Float) values.get(count)).floatValue(); - } - return primitiveValues; - } else if (fieldType.getName().equals("boolean")) { - boolean[] primitiveValues = new boolean[values.size()]; - for (int count = 0; count < values.size(); ++count) { - primitiveValues[count] = ((Boolean) values.get(count)).booleanValue(); - } - return primitiveValues; - } else if (fieldType.getName().equals("char")) { - char[] primitiveValues = new char[values.size()]; - for (int count = 0; count < values.size(); ++count) { - primitiveValues[count] = ((Character) values.get(count)).charValue(); - } - return primitiveValues; - } else if (fieldType.getName().equals("byte")) { - byte[] primitiveValues = new byte[values.size()]; - for (int count = 0; count < values.size(); ++count) { - primitiveValues[count] = ((Byte) values.get(count)).byteValue(); - } - return primitiveValues; - } else if (fieldType.getName().equals("short")) { - short[] primitiveValues = new short[values.size()]; - for (int count = 0; count < values.size(); ++count) { - primitiveValues[count] = ((Short) values.get(count)).shortValue(); - } - return primitiveValues; - } else if (fieldType.getName().equals("long")) { - long[] primitiveValues = new long[values.size()]; - for (int count = 0; count < values.size(); ++count) { - primitiveValues[count] = ((Long) values.get(count)).longValue(); - } - return primitiveValues; - } else if (fieldType.getName().equals("double")) { - double[] primitiveValues = new double[values.size()]; - for (int count = 0; count < values.size(); ++count) { - primitiveValues[count] = ((Double) values.get(count)).doubleValue(); - } - return primitiveValues; - } - } - return values; - } - - public abstract String getText(T source) throws XML2JavaMapperException; - - public abstract List getChildElements(T parent) throws XML2JavaMapperException; - - public abstract String getElementName(T element) throws XML2JavaMapperException; - - public abstract boolean isTextElement(T element) throws XML2JavaMapperException; - - public abstract T getRootElement(T element) throws XML2JavaMapperException; - - public Class getTargetType() { - return Object.class; - } -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaMapperException.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaMapperException.java deleted file mode 100644 index b7dee262c0..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaMapperException.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.javabeans; - -import javax.xml.namespace.QName; - -/** - * This exception is used to encapsulate and rethrow exceptions that arise out - * of converting XML Data to Java Objects. - */ -public class XML2JavaMapperException extends RuntimeException { - private static final long serialVersionUID = 6596530102591630642L; - - private QName xmlElementName; - private String javaFieldName; - private Class javaType; - - public XML2JavaMapperException(String message) { - super(message); - } - - public XML2JavaMapperException(Throwable cause) { - super(cause); - } - - public QName getXmlElementName() { - return xmlElementName; - } - - public void setXmlElementName(QName xmlElementName) { - this.xmlElementName = xmlElementName; - } - - public String getJavaFieldName() { - return javaFieldName; - } - - public void setJavaFieldName(String javaFieldName) { - this.javaFieldName = javaFieldName; - } - - public Class getJavaType() { - return javaType; - } - - public void setJavaType(Class javaType) { - this.javaType = javaType; - } - - @Override - public String getMessage() { - return super.getMessage() + " <" + getJavaFieldName() + "> " + " in <" + getJavaType() + ">"; - } - - - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/BeanUtil.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/BeanUtil.java deleted file mode 100644 index 3ada634375..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/BeanUtil.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import java.beans.BeanInfo; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.lang.reflect.Array; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl; -import org.apache.tuscany.sca.interfacedef.util.TypeInfo; - -public final class BeanUtil { - private static final Object[] NULL = (Object[])null; - private static int nsCount = 1; - - private static final SimpleTypeMapperImpl MAPPER = new SimpleTypeMapperImpl(); - - private BeanUtil() { - } - - private static boolean isSimpleType(Class javaType) { - return MAPPER.getXMLType(javaType) != null; - } - - private static String getStringValue(Object o) { - if (o == null) { - return null; - } - TypeInfo info = MAPPER.getXMLType(o.getClass()); - if (info != null) { - return MAPPER.toXMLLiteral(info.getQName(), o, null); - } else { - return String.valueOf(o); - } - } - - /** - * To Serilize Bean object this method is used, this will create an object - * array using given bean object - * - * @param beanObject - * @param beanName - */ - public static XMLStreamReader getXMLStreamReader(Object beanObject, QName beanName) { - try { - ClassLoader cl = beanObject.getClass().getClassLoader(); - if (cl == null) { - cl = ClassLoader.getSystemClassLoader(); - } - String beanNS = beanName.getNamespaceURI(); - String beanPrefix = beanName.getPrefix(); - BeanInfo beanInfo = Introspector.getBeanInfo(beanObject.getClass()); - PropertyDescriptor[] propDescs = beanInfo.getPropertyDescriptors(); - Map propertMap = new HashMap(); - for (int i = 0; i < propDescs.length; i++) { - PropertyDescriptor propDesc = propDescs[i]; - propertMap.put(propDesc.getName(), propDesc); - } - List properties = new ArrayList(propertMap.keySet()); - Collections.sort(properties); - List props = new ArrayList(); - for (int i = 0; i < properties.size(); i++) { - String property = properties.get(i); - PropertyDescriptor propDesc = (PropertyDescriptor)propertMap.get(property); - if (propDesc == null) { - // JAM does bad thing so I need to add this - continue; - } - Class ptype = propDesc.getPropertyType(); - if ("class".equals(property)) { - continue; - } - if (isSimpleType(ptype)) { - Object value = propDesc.getReadMethod().invoke(beanObject, NULL); - NamedProperty prop = - new NamedProperty(new QName(beanNS, property, beanPrefix), getStringValue(value)); - props.add(prop); - } else if (ptype.isArray()) { - if (isSimpleType(ptype.getComponentType())) { - Object value = propDesc.getReadMethod().invoke(beanObject, NULL); - if (value != null) { - int i1 = Array.getLength(value); - for (int j = 0; j < i1; j++) { - Object o = Array.get(value, j); - NamedProperty prop = - new NamedProperty(new QName(beanNS, property, beanPrefix), getStringValue(o)); - props.add(prop); - } - } else { - NamedProperty prop = new NamedProperty(new QName(beanNS, property, beanPrefix), value); - props.add(prop); - } - - } else { - Object value[] = (Object[])propDesc.getReadMethod().invoke(beanObject, NULL); - if (value != null) { - for (int j = 0; j < value.length; j++) { - Object o = value[j]; - NamedProperty prop = - new NamedProperty(new QName(beanNS, property, beanPrefix), getStringValue(o)); - props.add(prop); - } - } else { - NamedProperty prop = new NamedProperty(new QName(beanNS, property, beanPrefix), value); - props.add(prop); - } - } - } else if (Collection.class.isAssignableFrom(ptype)) { - Object value = propDesc.getReadMethod().invoke(beanObject, NULL); - Collection objList = (Collection)value; - if (objList != null && objList.size() > 0) { - // this was given error , when the array.size = 0 - // and if the array contain simple type , then the - // ADBPullParser asked - // PullParser from That simpel type - for (Iterator j = objList.iterator(); j.hasNext();) { - Object o = j.next(); - if (isSimpleType(o.getClass())) { - NamedProperty prop = - new NamedProperty(new QName(beanNS, property, beanPrefix), getStringValue(o)); - props.add(prop); - } else { - NamedProperty prop = new NamedProperty(new QName(beanNS, property, beanPrefix), o); - props.add(prop); - } - } - - } else { - NamedProperty prop = new NamedProperty(new QName(beanNS, property, beanPrefix), value); - props.add(prop); - } - } else { - Object value = propDesc.getReadMethod().invoke(beanObject, NULL); - NamedProperty prop = new NamedProperty(new QName(beanNS, property, beanPrefix), value); - props.add(prop); - } - } - NamedProperty[] elements = new NamedProperty[props.size()]; - props.toArray(elements); - return new XMLFragmentStreamReaderImpl(beanName, elements, null); - } catch (Exception e) { - throw new IllegalArgumentException(e); - } - } - - /** - * to get the pull parser for a given bean object , generate the wrpper - * element using class name - * - * @param beanObject - */ - public static XMLStreamReader getXMLStreamReader(Object beanObject) { - String className = beanObject.getClass().getName(); - if (className.indexOf(".") > 0) { - className = className.substring(className.lastIndexOf('.') + 1, className.length()); - } - return getXMLStreamReader(beanObject, new QName(className)); - } - - /** - * increments the namespace counter and returns a new prefix - * - * @return unique prefix - */ - public static String getUniquePrefix() { - return "s" + nsCount++; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMDataBinding.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMDataBinding.java deleted file mode 100644 index 605d769fda..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMDataBinding.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - - -import org.apache.tuscany.sca.databinding.WrapperHandler; -import org.apache.tuscany.sca.databinding.impl.BaseDataBinding; -import org.w3c.dom.Node; - -/** - * DOM DataBinding - * - * @version $Rev$ $Date$ - */ -public class DOMDataBinding extends BaseDataBinding { - public static final String NAME = Node.class.getName(); - public static final String[] ALIASES = new String[] {"dom"}; - - public DOMDataBinding() { - super(NAME, ALIASES, Node.class); - } - - @Override - public WrapperHandler getWrapperHandler() { - return new DOMWrapperHandler(); - } - - public Object copy(Object source) { - if (Node.class.isAssignableFrom(source.getClass())) { - Node nodeSource = (Node) source; - return nodeSource.cloneNode(true); - } - return super.copy(source); - } -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMWrapperHandler.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMWrapperHandler.java deleted file mode 100644 index 1bb6277934..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMWrapperHandler.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.xml; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.WrapperHandler; -import org.apache.tuscany.sca.databinding.impl.DOMHelper; -import org.apache.tuscany.sca.interfacedef.util.ElementInfo; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -public class DOMWrapperHandler implements WrapperHandler { - - private Document document; - - public DOMWrapperHandler() { - super(); - try { - this.document = DOMHelper.newDocument(); - } catch (ParserConfigurationException e) { - throw new TransformationException(e); - } - } - - public Node create(ElementInfo element, TransformationContext context) { - QName name = element.getQName(); - return DOMHelper.createElement(document, name); - } - - public void setChild(Node wrapper, int i, ElementInfo childElement, Object value) { - Node node = (Node) value; - if (node.getNodeType() == Node.DOCUMENT_NODE) { - node = ((Document) node).getDocumentElement(); - } - wrapper.appendChild(wrapper.getOwnerDocument().importNode(node, true)); - } - - public List getChildren(Node wrapper) { - assert wrapper != null; - if (wrapper.getNodeType() == Node.DOCUMENT_NODE) { - wrapper = ((Document) wrapper).getDocumentElement(); - } - List elements = new ArrayList(); - NodeList nodes = wrapper.getChildNodes(); - for (int j = 0; j < nodes.getLength(); j++) { - Node node = nodes.item(j); - if (node.getNodeType() == Node.ELEMENT_NODE) { - elements.add(node); - } - } - return elements; - } -} \ No newline at end of file diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMXMLStreamReader.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMXMLStreamReader.java deleted file mode 100644 index e377dd1d8b..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DOMXMLStreamReader.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import static javax.xml.XMLConstants.DEFAULT_NS_PREFIX; -import static javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.w3c.dom.Attr; -import org.w3c.dom.CharacterData; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -public class DOMXMLStreamReader extends XMLFragmentStreamReaderImpl { - private Element rootElement; - - public DOMXMLStreamReader(Node node) { - super(null); - switch (node.getNodeType()) { - case Node.DOCUMENT_NODE: - this.rootElement = ((Document)node).getDocumentElement(); - break; - case Node.ELEMENT_NODE: - this.rootElement = (Element)node; - break; - default: - throw new IllegalArgumentException("Illegal Node"); - } - String ns = rootElement.getNamespaceURI(); - String prefix = rootElement.getPrefix(); - String name = rootElement.getLocalName(); - elementQName = new QName(ns == null ? "" : ns, name, prefix == null ? "" : prefix); - } - - @Override - protected final NamedProperty[] getAttributes() { - if (attributes == null) { - List attributeList = new ArrayList(); - NamedNodeMap nodeMap = rootElement.getAttributes(); - for (int i = 0; i < nodeMap.getLength(); i++) { - Attr attr = (Attr)nodeMap.item(i); - String ns = attr.getNamespaceURI(); - String prefix = attr.getPrefix(); - if (!XMLNS_ATTRIBUTE_NS_URI.equals(ns)) { - QName attrName = new QName(ns == null ? "" : ns, attr.getLocalName(), prefix != null ? prefix : ""); - NamedProperty pair = new NamedProperty(attrName, attr.getValue()); - attributeList.add(pair); - } - } - attributes = new NamedProperty[attributeList.size()]; - attributeList.toArray(attributes); - } - return attributes; - } - - @Override - protected QName[] getNamespaces() { - List nsList = new ArrayList(); - NamedNodeMap nodeMap = rootElement.getAttributes(); - for (int i = 0; i < nodeMap.getLength(); i++) { - Attr attr = (Attr)nodeMap.item(i); - String ns = attr.getNamespaceURI(); - if (XMLNS_ATTRIBUTE_NS_URI.equals(ns)) { - String prefix = attr.getPrefix(); - if (prefix == null) { - // xmlns="http://ns" - nsList.add(new QName(attr.getValue(), "", DEFAULT_NS_PREFIX)); - } else { - // xmlns:ns="http://ns" - nsList.add(new QName(attr.getValue(), "", attr.getLocalName())); - } - } - } - QName[] nss = new QName[nsList.size()]; - nsList.toArray(nss); - return nss; - } - - @Override - protected NamedProperty[] getElements() { - if (elements == null) { - List elementList = new ArrayList(); - NodeList nodeList = rootElement.getChildNodes(); - for (int i = 0; i < nodeList.getLength(); i++) { - Node node = nodeList.item(i); - switch (node.getNodeType()) { - case Node.TEXT_NODE: - case Node.CDATA_SECTION_NODE: - NamedProperty pair = new NamedProperty(ELEMENT_TEXT, ((CharacterData)node).getData()); - elementList.add(pair); - break; - - case Node.ELEMENT_NODE: - Element element = (Element)node; - QName elementName = new QName(element.getNamespaceURI(), element.getLocalName()); - pair = new NamedProperty(elementName, new DOMXMLStreamReader(element)); - elementList.add(pair); - break; - } - } - elements = new NamedProperty[elementList.size()]; - elementList.toArray(elements); - } - return elements; - } -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DelegatingNamespaceContext.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DelegatingNamespaceContext.java deleted file mode 100644 index 2f63f932ea..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/DelegatingNamespaceContext.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import java.util.ArrayList; -import java.util.EmptyStackException; -import java.util.Iterator; -import java.util.List; - -import javax.xml.namespace.NamespaceContext; - -public class DelegatingNamespaceContext implements NamespaceContext { - private static int count; - - private class WrappingIterator implements Iterator { - - private Iterator containedIterator; - - public WrappingIterator(Iterator containedIterator) { - this.containedIterator = containedIterator; - } - - public Iterator getContainedIterator() { - return containedIterator; - } - - public boolean hasNext() { - return containedIterator.hasNext(); - } - - public Object next() { - return containedIterator.next(); - } - - /** - * As per the contract on the API of Namespace context the returned iterator should be immutable - */ - public void remove() { - throw new UnsupportedOperationException(); - } - - public void setContainedIterator(Iterator containedIterator) { - this.containedIterator = containedIterator; - } - } - - private NamespaceContext parentNsContext; - - private FastStack prefixStack = new FastStack(); - - // Keep two arraylists for the prefixes and namespaces. They should be in - // sync - // since the index of the entry will be used to relate them - // use the minimum initial capacity to let things handle memory better - - private FastStack uriStack = new FastStack(); - - /** - * Generates a unique namespace prefix that is not in the scope of the NamespaceContext - * - * @return string - */ - public String generateUniquePrefix() { - String prefix = "p" + count++; - // null should be returned if the prefix is not bound! - while (getNamespaceURI(prefix) != null) { - prefix = "p" + count++; - } - - return prefix; - } - - public String getNamespaceURI(String prefix) { - // do the corrections as per the javadoc - int index = prefixStack.search(prefix); - if (index != -1) { - return (String)uriStack.get(index); - } - if (parentNsContext != null) { - return parentNsContext.getPrefix(prefix); - } - return null; - } - - public NamespaceContext getParentNsContext() { - return parentNsContext; - } - - public String getPrefix(String uri) { - // do the corrections as per the javadoc - int index = uriStack.search(uri); - if (index != -1) { - return (String)prefixStack.get(index); - } - - if (parentNsContext != null) { - return parentNsContext.getPrefix(uri); - } - return null; - } - - public Iterator getPrefixes(String uri) { - // create an arraylist that contains the relevant prefixes - String[] uris = (String[])uriStack.toArray(new String[uriStack.size()]); - List tempList = new ArrayList(); - for (int i = uris.length - 1; i >= 0; i--) { - if (uris[i].equals(uri)) { - tempList.add(prefixStack.get(i)); - // we assume that array conversion preserves the order - } - } - // by now all the relevant prefixes are collected - // make a new iterator and provide a wrapper iterator to - // obey the contract on the API - return new WrappingIterator(tempList.iterator()); - } - - /** - * Pop a namespace - */ - public void popNamespace() { - prefixStack.pop(); - uriStack.pop(); - } - - /** - * Register a namespace in this context - * - * @param prefix - * @param uri - */ - public void pushNamespace(String prefix, String uri) { - prefixStack.push(prefix); - uriStack.push(uri); - - } - - public void setParentNsContext(NamespaceContext parentNsContext) { - this.parentNsContext = parentNsContext; - } - - /** - * An implementation of the {@link java.util.Stack} API that is based on an ArrayList instead of a - * Vector, so it is not synchronized to protect against multi-threaded access. The implementation is - * therefore operates faster in environments where you do not need to worry about multiple thread contention. - *

- * The removal order of an ArrayStack is based on insertion order: The most recently added element is - * removed first. The iteration order is not the same as the removal order. The iterator returns elements - * from the bottom up, whereas the {@link #remove()} method removes them from the top down. - *

- * Unlike Stack, ArrayStack accepts null entries. - */ - public static class FastStack extends ArrayList { - - /** Ensure serialization compatibility */ - private static final long serialVersionUID = 2130079159931574599L; - - /** - * Constructs a new empty ArrayStack. The initial size is controlled by ArrayList - * and is currently 10. - */ - public FastStack() { - super(); - } - - /** - * Constructs a new empty ArrayStack with an initial size. - * - * @param initialSize the initial size to use - * @throws IllegalArgumentException if the specified initial size is negative - */ - public FastStack(int initialSize) { - super(initialSize); - } - - /** - * Return true if this stack is currently empty. - *

- * This method exists for compatibility with java.util.Stack. New users of this class should use - * isEmpty instead. - * - * @return true if the stack is currently empty - */ - public boolean empty() { - return isEmpty(); - } - - /** - * Returns the top item off of this stack without removing it. - * - * @return the top item on the stack - * @throws EmptyStackException if the stack is empty - */ - public T peek() throws EmptyStackException { - int n = size(); - if (n <= 0) { - throw new EmptyStackException(); - } else { - return get(n - 1); - } - } - - /** - * Returns the n'th item down (zero-relative) from the top of this stack without removing it. - * - * @param n the number of items down to go - * @return the n'th item on the stack, zero relative - * @throws EmptyStackException if there are not enough items on the stack to satisfy this request - */ - public T peek(int n) throws EmptyStackException { - int m = (size() - n) - 1; - if (m < 0) { - throw new EmptyStackException(); - } else { - return get(m); - } - } - - /** - * Pops the top item off of this stack and return it. - * - * @return the top item on the stack - * @throws EmptyStackException if the stack is empty - */ - public T pop() throws EmptyStackException { - int n = size(); - if (n <= 0) { - throw new EmptyStackException(); - } else { - return remove(n - 1); - } - } - - /** - * Pushes a new item onto the top of this stack. The pushed item is also returned. This is equivalent to calling - * add. - * - * @param item the item to be added - * @return the item just pushed - */ - public Object push(T item) { - add(item); - return item; - } - - /** - * Returns the top-most index for the object in the stack - * - * @param object the object to be searched for - * @return top-most index, or -1 if not found - */ - public int search(T object) { - int i = size() - 1; // Current index - while (i >= 0) { - T current = get(i); - if ((object == null && current == null) || (object != null && object.equals(current))) { - return i; - } - i--; - } - return -1; - } - - /** - * Returns the element on the top of the stack. - * - * @return the element on the top of the stack - * @throws EmptyStackException if the stack is empty - */ - public T get() { - int size = size(); - if (size == 0) { - throw new EmptyStackException(); - } - return get(size - 1); - } - - /** - * Removes the element on the top of the stack. - * - * @return the removed element - * @throws EmptyStackException if the stack is empty - */ - public T remove() { - int size = size(); - if (size == 0) { - throw new EmptyStackException(); - } - return remove(size - 1); - } - - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputSource2Node.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputSource2Node.java deleted file mode 100644 index 2d85d9bfb2..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputSource2Node.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import javax.xml.transform.Source; -import javax.xml.transform.dom.DOMResult; -import javax.xml.transform.stream.StreamSource; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.w3c.dom.Node; -import org.xml.sax.InputSource; - -/** - * Push DOM InputSource to Node - */ -public class InputSource2Node extends BaseTransformer implements - PullTransformer { - private static final Source2ResultTransformer TRANSFORMER = new Source2ResultTransformer(); - - public Node transform(InputSource source, TransformationContext context) { - try { - Source streamSource = new StreamSource(source.getCharacterStream()); - DOMResult result = new DOMResult(); - TRANSFORMER.transform(streamSource, result, context); - return result.getNode(); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return InputSource.class; - } - - public Class getTargetType() { - return Node.class; - } - - public int getWeight() { - return 40; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputSource2SAX.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputSource2SAX.java deleted file mode 100644 index a652114977..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputSource2SAX.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import org.apache.tuscany.sca.databinding.PushTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.xml.sax.ContentHandler; -import org.xml.sax.InputSource; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.XMLReaderFactory; - -/** - * Push InputSource to SAX - */ -public class InputSource2SAX extends BaseTransformer implements - PushTransformer { - - public void transform(InputSource source, ContentHandler target, TransformationContext context) { - try { - XMLReader reader = XMLReaderFactory.createXMLReader(); - reader.setFeature("http://xml.org/sax/features/namespaces", true); - reader.setFeature("http://xml.org/sax/features/namespace-prefixes", false); - reader.setContentHandler(target); - reader.parse(source); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return InputSource.class; - } - - public Class getTargetType() { - return ContentHandler.class; - } - - public int getWeight() { - return 40; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputStream2Node.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputStream2Node.java deleted file mode 100644 index 4a0a697c5c..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputStream2Node.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import java.io.InputStream; - -import javax.xml.transform.Source; -import javax.xml.transform.dom.DOMResult; -import javax.xml.transform.sax.SAXSource; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.w3c.dom.Node; -import org.xml.sax.InputSource; - -/** - * Push DOM InputSource to Node - */ -public class InputStream2Node extends BaseTransformer implements - PullTransformer { - private static final Source2ResultTransformer TRANSFORMER = new Source2ResultTransformer(); - - public Node transform(InputStream source, TransformationContext context) { - try { - Source streamSource = new SAXSource(new InputSource(source)); - DOMResult result = new DOMResult(); - TRANSFORMER.transform(streamSource, result, context); - return result.getNode(); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return InputStream.class; - } - - public Class getTargetType() { - return Node.class; - } - - public int getWeight() { - return 40; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputStream2SAX.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputStream2SAX.java deleted file mode 100644 index e3af07d707..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/InputStream2SAX.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import java.io.InputStream; - -import org.apache.tuscany.sca.databinding.PushTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.xml.sax.ContentHandler; -import org.xml.sax.InputSource; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.XMLReaderFactory; - -/** - * Push InputStream to SAX - */ -public class InputStream2SAX extends BaseTransformer implements - PushTransformer { - public void transform(InputStream source, ContentHandler target, TransformationContext context) { - try { - XMLReader reader = XMLReaderFactory.createXMLReader(); - reader.setContentHandler(target); - reader.parse(new InputSource(source)); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return InputStream.class; - } - - public Class getTargetType() { - return ContentHandler.class; - } - - public int getWeight() { - return 40; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NameValueArrayStreamReader.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NameValueArrayStreamReader.java deleted file mode 100644 index 157a95025d..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NameValueArrayStreamReader.java +++ /dev/null @@ -1,403 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import javax.xml.namespace.NamespaceContext; -import javax.xml.namespace.QName; -import javax.xml.stream.Location; -import javax.xml.stream.XMLStreamException; - -public class NameValueArrayStreamReader implements XMLFragmentStreamReader { - - private static final int START_ELEMENT_STATE = 0; - private static final int TEXT_STATE = 1; - private static final int END_ELEMENT_STATE = 2; - private static final int FINAL_END_ELEMENT_STATE = 3; - private static final int START_ELEMENT_STATE_WITH_NULL = 4; - - private DelegatingNamespaceContext namespaceContext = new DelegatingNamespaceContext(); - // the index of the array - private int arrayIndex; - - private QName name; - private String[] values; - - // start element is the default state - private int state = START_ELEMENT_STATE; - - public NameValueArrayStreamReader(QName name, String[] values) { - this.name = name; - this.values = values; - } - - public void setParentNamespaceContext(NamespaceContext nsContext) { - this.namespaceContext.setParentNsContext(nsContext); - } - - public void init() { - // todo what if the Qname namespace has not been declared - } - - public Object getProperty(String string) throws IllegalArgumentException { - return null; - } - - /** - * @throws XMLStreamException - */ - public int next() throws XMLStreamException { - switch (state) { - case START_ELEMENT_STATE: - if (values.length > 0) { - state = TEXT_STATE; - return CHARACTERS; - } else { - state = FINAL_END_ELEMENT_STATE; - return END_ELEMENT; - } - - case START_ELEMENT_STATE_WITH_NULL: - if (arrayIndex == (values.length - 1)) { - state = FINAL_END_ELEMENT_STATE; - } else { - state = END_ELEMENT_STATE; - } - return END_ELEMENT; - case FINAL_END_ELEMENT_STATE: - // oops, not supposed to happen! - throw new XMLStreamException("end already reached!"); - case END_ELEMENT_STATE: - // we've to have more values since this is not the - // last value - // increment the counter - arrayIndex++; - if (values[arrayIndex] == null) { - state = START_ELEMENT_STATE_WITH_NULL; - } else { - state = START_ELEMENT_STATE; - } - return START_ELEMENT; - case TEXT_STATE: - if (arrayIndex == (values.length - 1)) { - state = FINAL_END_ELEMENT_STATE; - return END_ELEMENT; - } else { - state = END_ELEMENT_STATE; - return END_ELEMENT; - } - - default: - throw new XMLStreamException("unknown event type!"); - } - } - - public void require(int i, String string, String string1) throws XMLStreamException { - // nothing done here - } - - public String getElementText() throws XMLStreamException { - return null; // not implemented - } - - public int nextTag() throws XMLStreamException { - return 0; // not implemented - } - - public String getAttributeValue(String string, String string1) { - if (state == TEXT_STATE) { - // todo something - return null; - } else { - return null; - } - - } - - public int getAttributeCount() { - if (state == START_ELEMENT_STATE_WITH_NULL) { - return 1; - } - if (state == START_ELEMENT_STATE) { - return 0; - } else { - throw new IllegalStateException(); - } - - } - - public QName getAttributeName(int i) { - if (state == START_ELEMENT_STATE_WITH_NULL && i == 0) { - return NIL_QNAME; - } - if (state == START_ELEMENT_STATE) { - return null; - } else { - throw new IllegalStateException(); - } - } - - public String getAttributeNamespace(int i) { - if (state == START_ELEMENT_STATE_WITH_NULL && i == 0) { - return NIL_QNAME.getNamespaceURI(); - } - if (state == START_ELEMENT_STATE) { - return null; - } else { - throw new IllegalStateException(); - } - } - - public String getAttributeLocalName(int i) { - if (state == START_ELEMENT_STATE_WITH_NULL && i == 0) { - return NIL_QNAME.getLocalPart(); - } - if (state == START_ELEMENT_STATE) { - return null; - } else { - throw new IllegalStateException(); - } - } - - public String getAttributePrefix(int i) { - if (state == START_ELEMENT_STATE_WITH_NULL && i == 0) { - return NIL_QNAME.getPrefix(); - } - if (state == START_ELEMENT_STATE) { - return null; - } else { - throw new IllegalStateException(); - } - } - - public String getAttributeType(int i) { - return null; // not implemented - } - - public String getAttributeValue(int i) { - if (state == START_ELEMENT_STATE_WITH_NULL && i == 0) { - return NIL_VALUE_TRUE; - } - if (state == START_ELEMENT_STATE) { - return null; - } else { - throw new IllegalStateException(); - } - } - - public boolean isAttributeSpecified(int i) { - return false; // not supported - } - - public int getNamespaceCount() { - if (state == START_ELEMENT_STATE_WITH_NULL && isXsiNamespacePresent()) { - return 1; - } else { - return 0; - } - - } - - public String getNamespacePrefix(int i) { - if (state == START_ELEMENT_STATE_WITH_NULL && isXsiNamespacePresent() && i == 0) { - return NIL_QNAME.getPrefix(); - } else { - return null; - } - } - - public String getNamespaceURI(int i) { - if (state == START_ELEMENT_STATE_WITH_NULL && isXsiNamespacePresent() && i == 0) { - return NIL_QNAME.getNamespaceURI(); - } else { - return null; - } - } - - public NamespaceContext getNamespaceContext() { - return this.namespaceContext; - } - - public boolean isDone() { - return state == FINAL_END_ELEMENT_STATE; - } - - public int getEventType() { - switch (state) { - case START_ELEMENT_STATE: - return START_ELEMENT; - case END_ELEMENT_STATE: - return END_ELEMENT; - case TEXT_STATE: - return CHARACTERS; - case FINAL_END_ELEMENT_STATE: - return END_ELEMENT; - default: - throw new UnsupportedOperationException(); - // we've no idea what this is!!!!! - } - - } - - public String getText() { - if (state == TEXT_STATE) { - return values[arrayIndex]; - } else { - throw new IllegalStateException(); - } - } - - public char[] getTextCharacters() { - if (state == TEXT_STATE) { - return values[arrayIndex].toCharArray(); - } else { - throw new IllegalStateException(); - } - } - - public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException { - // not implemented - throw new UnsupportedOperationException(); - } - - public int getTextStart() { - if (state == TEXT_STATE) { - return 0; - } else { - throw new IllegalStateException(); - } - } - - public int getTextLength() { - if (state == TEXT_STATE) { - return values[arrayIndex].length(); - } else { - throw new IllegalStateException(); - } - - } - - public String getEncoding() { - return null; - } - - public boolean hasText() { - return state == TEXT_STATE; - } - - public Location getLocation() { - return null; // not supported - } - - public QName getName() { - if (state != TEXT_STATE) { - return name; - } else { - return null; - } - } - - public String getLocalName() { - if (state != TEXT_STATE) { - return name.getLocalPart(); - } else { - return null; - } - } - - public boolean hasName() { - return state != TEXT_STATE; - - } - - public String getNamespaceURI() { - if (state != TEXT_STATE) { - return name.getNamespaceURI(); - } else { - return null; - } - - } - - public String getPrefix() { - if (state != TEXT_STATE) { - return name.getPrefix(); - } else { - return null; - } - } - - public String getVersion() { - return null; // todo 1.0 ? - } - - public boolean isStandalone() { - return false; - } - - public boolean standaloneSet() { - return false; - } - - public String getCharacterEncodingScheme() { - return null; - } - - public String getPITarget() { - return null; - } - - public String getPIData() { - return null; - } - - public boolean hasNext() throws XMLStreamException { - return state != FINAL_END_ELEMENT_STATE; - } - - public void close() throws XMLStreamException { - // Do nothing - we've nothing to free here - } - - public String getNamespaceURI(String prefix) { - return namespaceContext.getNamespaceURI(prefix); - } - - public boolean isStartElement() { - return state == START_ELEMENT_STATE; - } - - public boolean isEndElement() { - return state == END_ELEMENT_STATE; - } - - public boolean isCharacters() { - return state == TEXT_STATE; - } - - public boolean isWhiteSpace() { - return false; // no whitespaces here - } - - /** - * Test whether the xsi namespace is present - */ - private boolean isXsiNamespacePresent() { - return namespaceContext.getNamespaceURI(NIL_QNAME.getPrefix()) != null; - } -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NameValuePairStreamReader.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NameValuePairStreamReader.java deleted file mode 100644 index 71af7519e7..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NameValuePairStreamReader.java +++ /dev/null @@ -1,347 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import javax.xml.namespace.NamespaceContext; -import javax.xml.namespace.QName; -import javax.xml.stream.Location; -import javax.xml.stream.XMLStreamException; - - -public class NameValuePairStreamReader implements XMLFragmentStreamReader { - - private static final int START_ELEMENT_STATE = 0; - private static final int TEXT_STATE = 1; - private static final int END_ELEMENT_STATE = 2; - - private DelegatingNamespaceContext namespaceContext = new DelegatingNamespaceContext(); - - private QName name; - private String value; - - private int state = START_ELEMENT_STATE; - // initiate at the start element state - - // keeps track whether the namespace is declared - // false by default - private boolean nsDeclared; - - public NameValuePairStreamReader(QName name, String value) { - this.name = name; - this.value = value; - } - - public Object getProperty(String key) throws IllegalArgumentException { - return null; - } - - public int next() throws XMLStreamException { - // no need to handle null here. it should have been handled - // already - switch (state) { - case START_ELEMENT_STATE: - state = TEXT_STATE; - return CHARACTERS; - case END_ELEMENT_STATE: - // oops, not supposed to happen! - throw new XMLStreamException("end already reached!"); - case TEXT_STATE: - state = END_ELEMENT_STATE; - return END_ELEMENT; - default: - throw new XMLStreamException("unknown event type!"); - } - } - - public void require(int i, String string, String string1) throws XMLStreamException { - // not implemented - } - - public String getElementText() throws XMLStreamException { - if (state == START_ELEMENT) { - // move to the end state and return the value - state = END_ELEMENT_STATE; - return value; - } else { - throw new XMLStreamException(); - } - - } - - public int nextTag() throws XMLStreamException { - return 0; // todo - } - - public boolean hasNext() throws XMLStreamException { - return state != END_ELEMENT_STATE; - } - - public void close() throws XMLStreamException { - // Do nothing - we've nothing to free here - } - - public String getNamespaceURI(String prefix) { - return namespaceContext.getNamespaceURI(prefix); - } - - public boolean isStartElement() { - return state == START_ELEMENT_STATE; - } - - public boolean isEndElement() { - return state == END_ELEMENT_STATE; - } - - public boolean isCharacters() { - return state == TEXT_STATE; - } - - public boolean isWhiteSpace() { - return false; // no whitespaces here - } - - public String getAttributeValue(String string, String string1) { - return null; - } - - public int getAttributeCount() { - return 0; - } - - public QName getAttributeName(int i) { - return null; - } - - public String getAttributeNamespace(int i) { - return null; - } - - public String getAttributeLocalName(int i) { - return null; - } - - public String getAttributePrefix(int i) { - return null; - } - - public String getAttributeType(int i) { - return null; - } - - public String getAttributeValue(int i) { - return null; - } - - public boolean isAttributeSpecified(int i) { - return false; // no attribs here - } - - public int getNamespaceCount() { - return nsDeclared ? 1 : 0; - } - - public String getNamespacePrefix(int i) { - return (nsDeclared && i == 0) ? name.getPrefix() : null; - } - - public String getNamespaceURI(int i) { - return (nsDeclared && i == 0) ? name.getNamespaceURI() : null; - } - - public NamespaceContext getNamespaceContext() { - return this.namespaceContext; - } - - public int getEventType() { - switch (state) { - case START_ELEMENT_STATE: - return START_ELEMENT; - case END_ELEMENT_STATE: - return END_ELEMENT; - case TEXT_STATE: - return CHARACTERS; - default: - throw new UnsupportedOperationException(); - // we've no idea what this is!!!!! - } - - } - - public String getText() { - if (state == TEXT_STATE) { - return value; - } else { - throw new IllegalStateException(); - } - } - - public char[] getTextCharacters() { - if (state == TEXT_STATE) { - return value.toCharArray(); - } else { - throw new IllegalStateException(); - } - } - - public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException { - // not implemented - throw new UnsupportedOperationException(); - } - - public int getTextStart() { - if (state == TEXT_STATE) { - return 0; - } else { - throw new IllegalStateException(); - } - } - - public int getTextLength() { - if (state == TEXT_STATE) { - return value.length(); - } else { - throw new IllegalStateException(); - } - - } - - public String getEncoding() { - return null; - } - - public boolean hasText() { - return state == TEXT_STATE; - } - - public Location getLocation() { - return new Location() { - public int getLineNumber() { - return 0; - } - - public int getColumnNumber() { - return 0; - } - - public int getCharacterOffset() { - return 0; - } - - public String getPublicId() { - return null; - } - - public String getSystemId() { - return null; - } - }; - } - - public QName getName() { - if (state != TEXT_STATE) { - return name; - } else { - return null; - } - } - - public String getLocalName() { - if (state != TEXT_STATE) { - return name.getLocalPart(); - } else { - return null; - } - } - - public boolean hasName() { - return state != TEXT_STATE; - - } - - public String getNamespaceURI() { - if (state != TEXT_STATE) { - return name.getNamespaceURI(); - } else { - return null; - } - - } - - public String getPrefix() { - if (state != TEXT_STATE) { - return name.getPrefix(); - } else { - return null; - } - } - - public String getVersion() { - return null; // todo 1.0 ? - } - - public boolean isStandalone() { - return false; - } - - public boolean standaloneSet() { - return false; - } - - public String getCharacterEncodingScheme() { - return null; - } - - public String getPITarget() { - return null; - } - - public String getPIData() { - return null; - } - - public boolean isDone() { - return state == END_ELEMENT_STATE; - } - - public void setParentNamespaceContext(NamespaceContext nsContext) { - this.namespaceContext.setParentNsContext(nsContext); - } - - public void init() { - // just add the current elements namespace and prefix to the this - // elements nscontext - addToNsMap(name.getPrefix(), name.getNamespaceURI()); - - } - - /** - * @param prefix - * @param uri - */ - private void addToNsMap(String prefix, String uri) { - // todo - need to fix this up to cater for cases where - // namespaces are having no prefixes - if (!uri.equals(namespaceContext.getNamespaceURI(prefix))) { - // this namespace is not there. Need to declare it - namespaceContext.pushNamespace(prefix, uri); - nsDeclared = true; - } - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NamedProperty.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NamedProperty.java deleted file mode 100644 index 04d7d65a0d..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NamedProperty.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.databinding.xml; - -import java.util.Map; - -import javax.xml.namespace.QName; - -/** - * A named property - * - * @version $Rev$ $Date$ - */ -public class NamedProperty implements Map.Entry { - private QName key; - - private Object value; - - public NamedProperty(QName key, Object value) { - this.key = key; - this.value = value; - } - - public NamedProperty(String key, Object value) { - this.key = new QName(key); - this.value = value; - } - - public QName getKey() { - return key; - } - - public Object getValue() { - return value; - } - - public Object setValue(Object value) { - Object v = this.value; - this.value = value; - return v; - } -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NilElementStreamReader.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NilElementStreamReader.java deleted file mode 100644 index abc4bf3785..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/NilElementStreamReader.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import javax.xml.namespace.NamespaceContext; -import javax.xml.namespace.QName; -import javax.xml.stream.Location; -import javax.xml.stream.XMLStreamException; - -public class NilElementStreamReader implements XMLFragmentStreamReader { - - private static final int END_ELEMENT_STATE = 2; - - private static final int START_ELEMENT_STATE = 1; - private int currentState = START_ELEMENT; - - private QName elementQName; - - public NilElementStreamReader(QName elementQName) { - this.elementQName = elementQName; - } - - public void setParentNamespaceContext(NamespaceContext nsContext) { - // NOOP - } - - public void close() throws XMLStreamException { - // do nothing - } - - public int getAttributeCount() { - return 1; - } - - public String getAttributeLocalName(int i) { - return (i == 0) ? NIL_QNAME.getLocalPart() : null; - } - - public QName getAttributeName(int i) { - return (i == 0) ? NIL_QNAME : null; - } - - public String getAttributeNamespace(int i) { - return (i == 0) ? NIL_QNAME.getNamespaceURI() : null; - } - - public String getAttributePrefix(int i) { - return (i == 0) ? NIL_QNAME.getPrefix() : null; - } - - public String getAttributeType(int i) { - throw new UnsupportedOperationException(); - } - - public String getAttributeValue(int i) { - return (i == 0) ? NIL_VALUE_TRUE : null; - } - - public String getAttributeValue(String string, String string1) { - if (string == null && NIL_QNAME.getLocalPart().equals(string1)) { - return NIL_VALUE_TRUE; - } - return null; - } - - public String getCharacterEncodingScheme() { - throw new UnsupportedOperationException(); - } - - public String getElementText() throws XMLStreamException { - return null; - } - - public String getEncoding() { - return null; - } - - public int getEventType() { - int returnEvent = START_DOCUMENT; - switch (currentState) { - case START_ELEMENT_STATE: - returnEvent = START_ELEMENT; - break; - case END_ELEMENT_STATE: - returnEvent = END_ELEMENT; - break; - } - return returnEvent; - } - - public String getLocalName() { - return elementQName.getLocalPart(); - } - - public Location getLocation() { - return new Location() { - public int getCharacterOffset() { - return 0; - } - - public int getColumnNumber() { - return 0; - } - - public int getLineNumber() { - return 0; - } - - public String getPublicId() { - return null; - } - - public String getSystemId() { - return null; - } - }; - } - - public QName getName() { - return elementQName; - } - - public NamespaceContext getNamespaceContext() { - throw new UnsupportedOperationException(); - } - - public int getNamespaceCount() { - return 0; - } - - public String getNamespacePrefix(int i) { - return null; - } - - public String getNamespaceURI() { - return elementQName.getNamespaceURI(); - } - - public String getNamespaceURI(int i) { - return null; - } - - public String getNamespaceURI(String string) { - if (elementQName.getPrefix() != null && elementQName.getPrefix().equals(string)) { - return elementQName.getNamespaceURI(); - } else { - return null; - } - } - - public String getPIData() { - throw new UnsupportedOperationException(); - } - - public String getPITarget() { - throw new UnsupportedOperationException(); - } - - public String getPrefix() { - return elementQName.getPrefix(); - } - - public Object getProperty(String key) throws IllegalArgumentException { - // since optimization is a global property - // we've to implement it everywhere - return null; - } - - public String getText() { - return null; - } - - public char[] getTextCharacters() { - return new char[0]; - } - - public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException { - return 0; - } - - public int getTextLength() { - return 0; - } - - public int getTextStart() { - return 0; - } - - public String getVersion() { - throw new UnsupportedOperationException(); - } - - public boolean hasName() { - return true; - } - - public boolean hasNext() throws XMLStreamException { - return currentState != END_ELEMENT_STATE; - - } - - public boolean hasText() { - return false; - } - - public void init() { - // NOOP - } - - public boolean isAttributeSpecified(int i) { - return i == 0; - } - - public boolean isCharacters() { - return false; - } - - public boolean isDone() { - return currentState == END_ELEMENT_STATE; - } - - public boolean isEndElement() { - return currentState == END_ELEMENT_STATE; - } - - public boolean isStandalone() { - throw new UnsupportedOperationException(); - } - - public boolean isStartElement() { - return currentState == START_ELEMENT_STATE; - } - - public boolean isWhiteSpace() { - return false; - } - - public int next() throws XMLStreamException { - int returnEvent = START_DOCUMENT; - switch (currentState) { - case START_ELEMENT_STATE: - currentState = END_ELEMENT_STATE; - returnEvent = END_ELEMENT; - break; - case END_ELEMENT_STATE: - throw new XMLStreamException("parser completed!"); - - } - return returnEvent; - } - - public int nextTag() throws XMLStreamException { - throw new UnsupportedOperationException(); - } - - public void require(int i, String string, String string1) throws XMLStreamException { - // nothing - } - - public boolean standaloneSet() { - throw new UnsupportedOperationException(); - } -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2OutputStream.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2OutputStream.java deleted file mode 100644 index 31207ebf68..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2OutputStream.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import java.io.OutputStream; - -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.apache.tuscany.sca.databinding.PushTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.w3c.dom.Node; - -/** - * Push DOM Node to OutputStream - */ -public class Node2OutputStream extends BaseTransformer implements - PushTransformer { - private static final Source2ResultTransformer TRANSFORMER = new Source2ResultTransformer(); - - public void transform(Node source, OutputStream writer, TransformationContext context) { - try { - Source domSource = new DOMSource(source); - Result result = new StreamResult(writer); - TRANSFORMER.transform(domSource, result, context); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return Node.class; - } - - public Class getTargetType() { - return OutputStream.class; - } - - public int getWeight() { - return 40; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2String.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2String.java deleted file mode 100755 index 60be7dbfd3..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2String.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import java.io.StringWriter; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.w3c.dom.Node; - -/** - * Transform DOM Node to XML String - */ -public class Node2String extends BaseTransformer implements PullTransformer { - private static final Node2Writer TRANSFORMER = new Node2Writer(); - - public String transform(Node source, TransformationContext context) { - try { - StringWriter writer = new StringWriter(); - TRANSFORMER.transform(source, writer, context); - return writer.toString(); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return Node.class; - } - - public Class getTargetType() { - return String.class; - } - - public int getWeight() { - return 40; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2Writer.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2Writer.java deleted file mode 100644 index 4973319fc3..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2Writer.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import java.io.Writer; - -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.apache.tuscany.sca.databinding.PushTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.w3c.dom.Node; - -/** - * Push DOM Node to Writer - */ -public class Node2Writer extends BaseTransformer implements PushTransformer { - private static final Source2ResultTransformer TRANSFORMER = new Source2ResultTransformer(); - - public void transform(Node source, Writer writer, TransformationContext context) { - try { - Source domSource = new DOMSource(source); - Result result = new StreamResult(writer); - TRANSFORMER.transform(domSource, result, context); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return Node.class; - } - - public Class getTargetType() { - return Writer.class; - } - - public int getWeight() { - return 40; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2XMLStreamReader.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2XMLStreamReader.java deleted file mode 100644 index 539e0d7da2..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Node2XMLStreamReader.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.w3c.dom.Node; - -/** - * Transform DOM Node to XML XMLStreamReader - */ -public class Node2XMLStreamReader extends BaseTransformer implements - PullTransformer { - - public XMLStreamReader transform(Node source, TransformationContext context) { - try { - DOMXMLStreamReader reader = new DOMXMLStreamReader(source); - return new XMLDocumentStreamReader(reader); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return Node.class; - } - - public Class getTargetType() { - return XMLStreamReader.class; - } - - public int getWeight() { - return 40; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Reader2Node.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Reader2Node.java deleted file mode 100644 index 556f0ef398..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Reader2Node.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import java.io.Reader; - -import javax.xml.transform.Source; -import javax.xml.transform.dom.DOMResult; -import javax.xml.transform.stream.StreamSource; - -import org.apache.tuscany.sca.databinding.PullTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.w3c.dom.Node; - -/** - * Push DOM Reader to Node - */ -public class Reader2Node extends BaseTransformer implements PullTransformer { - private static final Source2ResultTransformer TRANSFORMER = new Source2ResultTransformer(); - - public Node transform(Reader source, TransformationContext context) { - try { - Source streamSource = new StreamSource(source); - DOMResult result = new DOMResult(); - TRANSFORMER.transform(streamSource, result, context); - return result.getNode(); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return Reader.class; - } - - public Class getTargetType() { - return Node.class; - } - - public int getWeight() { - return 40; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Reader2SAX.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Reader2SAX.java deleted file mode 100644 index da0dad15cc..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Reader2SAX.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import java.io.Reader; - -import org.apache.tuscany.sca.databinding.PushTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.xml.sax.ContentHandler; -import org.xml.sax.InputSource; - -/** - * Transform XML string to SAX - */ -public class Reader2SAX extends BaseTransformer implements - PushTransformer { - public void transform(Reader source, ContentHandler target, TransformationContext context) { - try { - new InputSource2SAX().transform(new InputSource(source), target, context); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return Reader.class; - } - - public Class getTargetType() { - return ContentHandler.class; - } - - public int getWeight() { - return 40; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SAX2DOM.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SAX2DOM.java deleted file mode 100644 index e6fab7caf0..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SAX2DOM.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Copyright 2001-2004 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.sca.databinding.xml; - -import java.util.ArrayList; -import java.util.List; -import java.util.Stack; - -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.tuscany.sca.databinding.impl.DOMHelper; -import org.w3c.dom.Comment; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.ProcessingInstruction; -import org.w3c.dom.Text; -import org.xml.sax.Attributes; -import org.xml.sax.ContentHandler; -import org.xml.sax.Locator; -import org.xml.sax.SAXException; -import org.xml.sax.ext.LexicalHandler; - -/** - * SAX2DOM adapter - */ -public class SAX2DOM implements ContentHandler, LexicalHandler { - public static final String EMPTYSTRING = ""; - public static final String XML_PREFIX = "xml"; - public static final String XMLNS_PREFIX = "xmlns"; - public static final String XMLNS_STRING = "xmlns:"; - public static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/"; - - private Node root; - - private Document document; - - private Node nextSibling; - - private Stack nodeStk = new Stack(); - - private List namespaceDecls; - - private Node lastSibling; - - public SAX2DOM() throws ParserConfigurationException { - this.document = DOMHelper.newDocument(); - this.root = document; - } - - public SAX2DOM(Node root, Node nextSibling) throws ParserConfigurationException { - this.root = root; - if (root instanceof Document) { - this.document = (Document)root; - } else if (root != null) { - this.document = root.getOwnerDocument(); - } else { - this.document = DOMHelper.newDocument(); - this.root = document; - } - - this.nextSibling = nextSibling; - } - - public SAX2DOM(Node root) throws ParserConfigurationException { - this(root, null); - } - - public Node getDOM() { - return root; - } - - public void characters(char[] ch, int start, int length) { - final Node last = (Node)nodeStk.peek(); - - // No text nodes can be children of root (DOM006 exception) - if (last != document) { - final String text = new String(ch, start, length); - if (lastSibling != null && lastSibling.getNodeType() == Node.TEXT_NODE) { - ((Text)lastSibling).appendData(text); - } else if (last == root && nextSibling != null) { - lastSibling = last.insertBefore(document.createTextNode(text), nextSibling); - } else { - lastSibling = last.appendChild(document.createTextNode(text)); - } - - } - } - - public void startDocument() { - nodeStk.push(root); - } - - public void endDocument() { - nodeStk.pop(); - } - - public void startElement(String namespace, String localName, String qName, Attributes attrs) { - final Element tmp = (Element)document.createElementNS(namespace, qName); - - // Add namespace declarations first - if (namespaceDecls != null) { - final int nDecls = namespaceDecls.size(); - for (int i = 0; i < nDecls; i++) { - final String prefix = (String)namespaceDecls.get(i++); - - if (prefix == null || prefix.equals(EMPTYSTRING)) { - tmp.setAttributeNS(XMLNS_URI, XMLNS_PREFIX, (String)namespaceDecls.get(i)); - } else { - tmp.setAttributeNS(XMLNS_URI, XMLNS_STRING + prefix, (String)namespaceDecls.get(i)); - } - } - namespaceDecls.clear(); - } - - // Add attributes to element - final int nattrs = attrs.getLength(); - for (int i = 0; i < nattrs; i++) { - if (attrs.getLocalName(i) == null) { - tmp.setAttribute(attrs.getQName(i), attrs.getValue(i)); - } else { - tmp.setAttributeNS(attrs.getURI(i), attrs.getQName(i), attrs.getValue(i)); - } - } - - // Append this new node onto current stack node - Node last = (Node)nodeStk.peek(); - - // If the SAX2DOM is created with a non-null next sibling node, - // insert the result nodes before the next sibling under the root. - if (last == root && nextSibling != null) { - last.insertBefore(tmp, nextSibling); - } else { - last.appendChild(tmp); - } - - // Push this node onto stack - nodeStk.push(tmp); - lastSibling = null; - } - - public void endElement(String namespace, String localName, String qName) { - nodeStk.pop(); - lastSibling = null; - } - - public void startPrefixMapping(String prefix, String uri) { - if (namespaceDecls == null) { - namespaceDecls = new ArrayList(2); - } - namespaceDecls.add(prefix); - namespaceDecls.add(uri); - } - - public void endPrefixMapping(String prefix) { - // do nothing - } - - /** - * This class is only used internally so this method should never be called. - */ - public void ignorableWhitespace(char[] ch, int start, int length) { - } - - /** - * adds processing instruction node to DOM. - */ - public void processingInstruction(String target, String data) { - final Node last = (Node)nodeStk.peek(); - ProcessingInstruction pi = document.createProcessingInstruction(target, data); - if (pi != null) { - if (last == root && nextSibling != null) { - last.insertBefore(pi, nextSibling); - } else { - last.appendChild(pi); - } - - lastSibling = pi; - } - } - - /** - * This class is only used internally so this method should never be called. - */ - public void setDocumentLocator(Locator locator) { - } - - /** - * This class is only used internally so this method should never be called. - */ - public void skippedEntity(String name) { - } - - /** - * Lexical Handler method to create comment node in DOM tree. - */ - public void comment(char[] ch, int start, int length) { - final Node last = (Node)nodeStk.peek(); - Comment comment = document.createComment(new String(ch, start, length)); - if (comment != null) { - if (last == root && nextSibling != null) { - last.insertBefore(comment, nextSibling); - } else { - last.appendChild(comment); - } - - lastSibling = comment; - } - } - - // Lexical Handler methods- not implemented - public void startCDATA() { - } - - public void endCDATA() { - } - - public void startEntity(java.lang.String name) { - } - - public void endDTD() { - } - - public void endEntity(String name) { - } - - public void startDTD(String name, String publicId, String systemId) throws SAXException { - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SAX2DOMPipe.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SAX2DOMPipe.java deleted file mode 100644 index 0f454b8e81..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/SAX2DOMPipe.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.tuscany.sca.databinding.DataPipe; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; -import org.w3c.dom.Node; -import org.xml.sax.ContentHandler; - -public class SAX2DOMPipe extends BaseTransformer implements - DataPipe { - private SAX2DOM pipe; - - /** - * - */ - public SAX2DOMPipe() { - super(); - try { - this.pipe = new SAX2DOM(); - } catch (ParserConfigurationException e) { - throw new IllegalArgumentException(e); - } - } - - public Node getResult() { - return pipe.getDOM(); - } - - public Class getTargetType() { - return Node.class; - } - - public ContentHandler getSink() { - return pipe; - } - - public Class getSourceType() { - return ContentHandler.class; - } - - public int getWeight() { - return 30; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Source2ResultTransformer.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Source2ResultTransformer.java deleted file mode 100755 index 7b562096a8..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/Source2ResultTransformer.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.TransformerFactory; - -import org.apache.tuscany.sca.databinding.PushTransformer; -import org.apache.tuscany.sca.databinding.TransformationContext; -import org.apache.tuscany.sca.databinding.TransformationException; -import org.apache.tuscany.sca.databinding.impl.BaseTransformer; - -/** - * Transform TrAX Source to Result - */ -public class Source2ResultTransformer extends BaseTransformer implements - PushTransformer { - private static final TransformerFactory FACTORY = TransformerFactory.newInstance(); - - public void transform(Source source, Result result, TransformationContext context) { - try { - javax.xml.transform.Transformer transformer = FACTORY.newTransformer(); - transformer.transform(source, result); - } catch (Exception e) { - throw new TransformationException(e); - } - } - - public Class getSourceType() { - return Source.class; - } - - public Class getTargetType() { - return Result.class; - } - - public int getWeight() { - return 40; - } - -} diff --git a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAX2SAXAdapter.java b/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAX2SAXAdapter.java deleted file mode 100644 index 6257681091..0000000000 --- a/branches/sca-java-0.90/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/xml/StAX2SAXAdapter.java +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.sca.databinding.xml; - -import javax.xml.namespace.QName; -import javax.xml.stream.Location; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.xml.sax.Attributes; -import org.xml.sax.ContentHandler; -import org.xml.sax.Locator; -import org.xml.sax.SAXException; -import org.xml.sax.helpers.AttributesImpl; - -/** - * Adapter that converts from StAX to SAX event streams. Currently the following - * SAX events are not generated: - *