From 3caf8614f25d6b1962e20331fdf423c863bc02f3 Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:13:31 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835144 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/extensions/axis2/binding/.ruleset | 190 --- .../sca/extensions/axis2/binding/LICENSE.txt | 202 --- .../sca/extensions/axis2/binding/NOTICE.txt | 14 - .../sca/extensions/axis2/binding/pom.xml | 146 -- .../axis2/binding/src/main/assembly/axis2.xml | 38 - .../binding/axis2/Axis2AsyncTargetInvoker.java | 94 -- .../tuscany/binding/axis2/Axis2BindingBuilder.java | 331 ----- .../axis2/Axis2BindingBuilderRuntimeException.java | 65 - .../axis2/Axis2BindingRunTimeException.java | 48 - .../axis2/Axis2CallbackInvocationHandler.java | 50 - .../binding/axis2/Axis2OneWayTargetInvoker.java | 72 - .../binding/axis2/Axis2ReferenceBinding.java | 194 --- .../binding/axis2/Axis2ReferenceCallback.java | 56 - .../axis2/Axis2ReferenceCallbackTargetInvoker.java | 114 -- .../tuscany/binding/axis2/Axis2ServiceBinding.java | 390 ------ .../axis2/Axis2ServiceCallbackTargetInvoker.java | 120 -- .../axis2/Axis2ServiceInMessageReceiver.java | 68 - .../Axis2ServiceInOutAsyncMessageReceiver.java | 91 -- .../Axis2ServiceInOutSyncMessageReceiver.java | 117 -- .../tuscany/binding/axis2/Axis2ServiceServlet.java | 211 --- .../tuscany/binding/axis2/Axis2TargetInvoker.java | 186 --- .../tuscany/binding/axis2/TuscanyDispatcher.java | 79 -- .../binding/axis2/WebServiceBindingDefinition.java | 210 --- .../binding/axis2/WebServiceBindingLoader.java | 244 ---- .../axis2/util/TuscanyAxisConfigurator.java | 44 - .../axis2/util/WebServiceOperationMetaData.java | 491 ------- .../binding/axis2/util/WebServicePortMetaData.java | 377 ------ .../main/resources/META-INF/sca/binding.axis2.scdl | 48 - .../src/main/resources/META-INF/sca/default.scdl | 49 - .../resources/META-INF/sca/extension.composite | 22 - .../tuscany/binding/axis2/engine/config/axis2.xml | 306 ----- .../binding/axis2/Axis2BindingBuilderTestCase.java | 229 ---- .../binding/axis2/Axis2ReferenceTestCase.java | 111 -- .../binding/axis2/Axis2ServiceTestCase.java | 153 --- .../org/apache/tuscany/binding/axis2/Greeter.java | 31 - .../tuscany/binding/axis2/GreetingCallback.java | 24 - .../axis2/WebServicebindingLoaderTestCase.java | 187 --- .../test/resources/wsdl/hello_world_doc_lit.wsdl | 151 --- .../sca/extensions/axis2/databinding/.ruleset | 172 --- .../sca/extensions/axis2/databinding/LICENSE.txt | 202 --- .../sca/extensions/axis2/databinding/NOTICE.txt | 14 - .../sca/extensions/axis2/databinding/pom.xml | 78 -- .../databinding/axiom/AxiomDataBinding.java | 67 - .../databinding/axiom/AxiomExceptionHandler.java | 60 - .../tuscany/databinding/axiom/AxiomHelper.java | 64 - .../databinding/axiom/OMElement2Object.java | 40 - .../databinding/axiom/OMElement2String.java | 62 - .../axiom/OMElement2XMLStreamReader.java | 50 - .../databinding/axiom/OMElementWrapperHandler.java | 70 - .../databinding/axiom/Object2OMElement.java | 55 - .../databinding/axiom/String2OMElement.java | 60 - .../axiom/XMLStreamReader2OMElement.java | 63 - .../resources/META-INF/sca/databinding.axiom.scdl | 57 - .../src/main/resources/META-INF/sca/default.scdl | 56 - .../resources/META-INF/sca/extension.composite | 22 - .../axiom/AxiomExceptionHandlerTestCase.java | 107 -- .../databinding/axiom/OMElementTestCase.java | 103 -- .../axis2/databinding/src/test/resources/ipo.xml | 33 - .../axis2/databinding/src/test/resources/ipo.xsd | 118 -- .../databinding/src/test/resources/order.wsdl | 58 - .../sca/extensions/axis2/itests/old-style/pom.xml | 89 -- .../src/main/java/helloworld/HelloWorldImpl.java | 33 - .../main/java/helloworld/HelloWorldService.java | 33 - .../helloworld/HelloWorldServiceComponent.java | 43 - .../src/main/resources/OldStyleReference.composite | 37 - .../src/main/resources/OldStyleService.composite | 35 - .../src/main/resources/wsdl/helloworld.wsdl | 80 -- .../apache/tuscany/sca/itest/HelloWorldServer.java | 49 - .../apache/tuscany/sca/itest/OldStyleTestCase.java | 65 - .../sca/extensions/axis2/itests/pom.xml | 41 - .../axis2/itests/service-explicit-uri/pom.xml | 89 -- .../src/main/java/helloworld/HelloWorldImpl.java | 33 - .../main/java/helloworld/HelloWorldService.java | 33 - .../helloworld/HelloWorldServiceComponent.java | 43 - .../src/main/resources/client.composite | 36 - .../src/main/resources/service.composite | 35 - .../src/main/resources/wsdl/helloworld.wsdl | 80 -- .../apache/tuscany/sca/itest/HelloWorldServer.java | 49 - .../sca/itest/ServiceExplicitURITestCase.java | 65 - .../axis2/itests/service-relative-uri/pom.xml | 89 -- .../src/main/java/helloworld/HelloWorldImpl.java | 33 - .../main/java/helloworld/HelloWorldService.java | 33 - .../helloworld/HelloWorldServiceComponent.java | 43 - .../src/main/resources/client.composite | 36 - .../src/main/resources/service.composite | 35 - .../src/main/resources/wsdl/helloworld.wsdl | 80 -- .../apache/tuscany/sca/itest/HelloWorldServer.java | 49 - .../sca/itest/ServiceRelativeURITestCase.java | 65 - .../sca/extensions/axis2/itests/simplest/pom.xml | 89 -- .../src/main/java/helloworld/HelloWorldImpl.java | 33 - .../main/java/helloworld/HelloWorldService.java | 33 - .../helloworld/HelloWorldServiceComponent.java | 43 - .../simplest/src/main/resources/client.composite | 36 - .../simplest/src/main/resources/service.composite | 35 - .../src/main/resources/wsdl/helloworld.wsdl | 80 -- .../apache/tuscany/sca/itest/HelloWorldServer.java | 49 - .../apache/tuscany/sca/itest/SimplestTestCase.java | 65 - .../extensions/axis2/itests/wsdl-binidng/pom.xml | 90 -- .../src/main/java/helloworld/HelloWorldImpl.java | 33 - .../main/java/helloworld/HelloWorldService.java | 33 - .../helloworld/HelloWorldServiceComponent.java | 43 - .../src/main/resources/client.composite | 37 - .../src/main/resources/service.composite | 35 - .../src/main/resources/wsdl/helloworld.wsdl | 80 -- .../apache/tuscany/sca/itest/HelloWorldServer.java | 49 - .../sca/itest/WsdlElementBindingTestCase.java | 67 - .../extensions/axis2/plugins/java2wsdl/LICENSE.txt | 1407 -------------------- .../extensions/axis2/plugins/java2wsdl/NOTICE.txt | 14 - .../sca/extensions/axis2/plugins/java2wsdl/pom.xml | 46 - .../java2wsdl/plugin/Java2WSDLGeneratorMojo.java | 153 --- .../sca/extensions/axis2/plugins/pom.xml | 39 - .../extensions/axis2/plugins/wsdl2java/LICENSE.txt | 1407 -------------------- .../extensions/axis2/plugins/wsdl2java/NOTICE.txt | 14 - .../sca/extensions/axis2/plugins/wsdl2java/pom.xml | 46 - .../wsdl2java/plugin/WSDL2JavaGeneratorMojo.java | 152 --- .../tools/wsdl2java/plugin/WSDLFileOption.java | 92 -- .../sca/extensions/axis2/pom.xml | 181 --- .../axis2/samples/calculator-ws/LICENSE.txt | 202 --- .../axis2/samples/calculator-ws/NOTICE.txt | 14 - .../extensions/axis2/samples/calculator-ws/pom.xml | 76 -- .../axis2/samples/calculator-ws/readme.html | 103 -- .../src/main/resources/calculator.wsdl | 58 - .../src/main/webapp/WEB-INF/default.scdl | 35 - .../calculator-ws/src/main/webapp/WEB-INF/web.xml | 22 - .../samples/calculator-ws/src/main/webapp/calc.jsp | 43 - .../calculator-ws/src/main/webapp/index.html | 5 - .../axis2/samples/helloworld-async-ws/.ruleset | 172 --- .../axis2/samples/helloworld-async-ws/pom.xml | 76 -- .../axis2/samples/helloworld-async-ws/readme.htm | 66 - .../axis2/samples/helloworld-async-ws/setup.bat | 16 - .../main/java/helloworld/HelloWorldCallback.java | 27 - .../src/main/java/helloworld/HelloWorldImpl.java | 63 - .../main/java/helloworld/HelloWorldService.java | 43 - .../src/main/resources/META-INF/LICENSE.txt | 1277 ------------------ .../src/main/resources/META-INF/NOTICE | 18 - .../src/main/resources/META-INF/README.txt | 35 - .../src/main/resources/wsdl/helloworld.wsdl | 180 --- .../src/main/webapp/META-INF/sca/default.scdl | 48 - .../webapp/META-INF/tuscany/binding.axis2.scdl | 44 - .../webapp/META-INF/tuscany/databinding.axiom.scdl | 51 - .../webapp/META-INF/tuscany/databinding.sdo.scdl | 60 - .../webapp/META-INF/tuscany/interface.wsdl.scdl | 44 - .../src/main/webapp/META-INF/tuscany/webapp.scdl | 149 --- .../src/main/webapp/WEB-INF/web.xml | 51 - .../samples/helloworld-async-wsclient/pom.xml | 80 -- .../samples/helloworld-async-wsclient/run.bat | 53 - .../helloworld-async-wsclient/run_celtix.bat | 16 - .../main/java/helloworld/HelloWorldCallback.java | 27 - .../src/main/java/helloworld/HelloWorldClient.java | 40 - .../src/main/java/helloworld/HelloWorldLocal.java | 33 - .../main/java/helloworld/HelloWorldService.java | 38 - .../helloworld/HelloWorldServiceComponent.java | 58 - .../src/main/resources/META-INF/LICENSE.txt | 1277 ------------------ .../src/main/resources/META-INF/NOTICE | 18 - .../src/main/resources/META-INF/README.txt | 35 - .../src/main/resources/META-INF/sca/default.scdl | 46 - .../src/main/resources/logging.properties | 29 - .../src/main/resources/wsdl/helloworld.wsdl | 152 --- .../java/helloworld/HelloWorldWSAsyncClient.java | 46 - .../META-INF/tuscany/test-extensions.scdl | 28 - .../axis2/samples/helloworld-om-ws/pom.xml | 94 -- .../axis2/samples/helloworld-om-ws/readme.htm | 48 - .../axis2/samples/helloworld-om-ws/setup.bat | 16 - .../main/java/helloworld/om/HelloWorldImpl.java | 45 - .../main/java/helloworld/om/HelloWorldServer.java | 28 - .../main/java/helloworld/om/HelloWorldService.java | 36 - .../src/main/resources/META-INF/LICENSE.txt | 1277 ------------------ .../src/main/resources/META-INF/NOTICE | 18 - .../src/main/resources/META-INF/README.txt | 35 - .../src/main/resources/helloworldws-om.composite | 34 - .../src/main/resources/wsdl/helloworld-om.wsdl | 78 -- .../helloworld/om/HelloWorldServerTestCase.java | 44 - .../axis2/samples/helloworld-om-wsclient/pom.xml | 95 -- .../axis2/samples/helloworld-om-wsclient/run.bat | 53 - .../main/java/helloworld/om/HelloWorldClient.java | 84 -- .../main/java/helloworld/om/HelloWorldService.java | 34 - .../helloworld/om/HelloWorldServiceComponent.java | 47 - .../src/main/resources/META-INF/LICENSE.txt | 1277 ------------------ .../src/main/resources/META-INF/NOTICE | 18 - .../src/main/resources/META-INF/README.txt | 35 - .../main/resources/helloworldwsclient-om.composite | 34 - .../src/main/resources/logging.properties | 27 - .../src/main/resources/wsdl/helloworld-om.wsdl | 78 -- .../helloworld/om/HelloWorldClientTestCase.java | 72 - .../java/helloworld/om/HelloWorldServerTest.java | 44 - .../axis2/samples/helloworld-oneway-ws/pom.xml | 136 -- .../src/main/java/greeter/GreeterImpl.java | 31 - .../src/main/java/greeter/GreeterService.java | 31 - .../src/main/resources/wsdl/greeter.wsdl | 64 - .../src/main/webapp/META-INF/sca/default.scdl | 40 - .../webapp/META-INF/tuscany/binding.axis2.scdl | 44 - .../webapp/META-INF/tuscany/databinding.axiom.scdl | 51 - .../webapp/META-INF/tuscany/databinding.sdo.scdl | 60 - .../webapp/META-INF/tuscany/interface.wsdl.scdl | 44 - .../src/main/webapp/META-INF/tuscany/webapp.scdl | 148 -- .../src/main/webapp/WEB-INF/web.xml | 51 - .../samples/helloworld-oneway-wsclient/pom.xml | 96 -- .../src/main/java/greeter/GreeterClient.java | 36 - .../src/main/java/greeter/GreeterImpl.java | 37 - .../src/main/java/greeter/GreeterLocal.java | 24 - .../src/main/java/greeter/GreeterService.java | 30 - .../src/main/resources/META-INF/sca/default.scdl | 42 - .../src/main/resources/wsdl/greeter.wsdl | 64 - .../test/java/greeter/GreeterWSOneWayClient.java | 58 - .../META-INF/tuscany/test-extensions.scdl | 28 - .../extensions/axis2/samples/helloworld-ws/pom.xml | 83 -- .../src/main/java/helloworld/HelloWorldImpl.java | 33 - .../src/main/java/helloworld/HelloWorldServer.java | 28 - .../main/java/helloworld/HelloWorldService.java | 33 - .../src/main/resources/META-INF/LICENSE.txt | 1277 ------------------ .../src/main/resources/META-INF/NOTICE | 18 - .../src/main/resources/META-INF/README.txt | 35 - .../src/main/resources/helloworldws.composite | 33 - .../src/main/resources/system.composite | 36 - .../src/main/resources/wsdl/helloworld.wsdl | 79 -- .../java/helloworld/HelloWorldServerTestCase.java | 48 - .../axis2/samples/helloworld-wsclient/pom.xml | 87 -- .../src/main/java/helloworld/HelloWorldClient.java | 41 - .../main/java/helloworld/HelloWorldService.java | 28 - .../helloworld/HelloWorldServiceComponent.java | 43 - .../src/main/resources/META-INF/LICENSE.txt | 1277 ------------------ .../src/main/resources/META-INF/NOTICE | 18 - .../src/main/resources/META-INF/README.txt | 35 - .../main/resources/helloworldwsclient.composite | 37 - .../src/main/resources/logging.properties | 30 - .../src/main/resources/wsdl/helloworld.wsdl | 79 -- .../java/helloworld/HelloWorldClientTestCase.java | 65 - .../test/java/helloworld/HelloWorldServerTest.java | 46 - .../axis2/samples/loanapplication-ws/pom.xml | 85 -- .../java/loanappconversation/LoanApplication.java | 35 - .../main/java/loanappconversation/LoanService.java | 40 - .../java/loanappconversation/LoanServiceImpl.java | 69 - .../main/resources/wsdl/loanappconversation.wsdl | 271 ---- .../src/main/webapp/WEB-INF/default.scdl | 41 - .../src/main/webapp/WEB-INF/web.xml | 51 - .../axis2/samples/loanapplication-wsclient/pom.xml | 85 -- .../LoanAppConversationClient.java | 57 - .../java/loanappconversation/LoanApplication.java | 35 - .../main/java/loanappconversation/LoanClient.java | 30 - .../java/loanappconversation/LoanClientImpl.java | 63 - .../main/java/loanappconversation/LoanService.java | 40 - .../src/main/resources/META-INF/sca/default.scdl | 40 - .../main/resources/wsdl/loanappconversation.wsdl | 271 ---- .../LoanAppConversationTestCase.java | 63 - .../sca/extensions/axis2/samples/pom.xml | 121 -- .../sca/extensions/axis2/tools/java2wsdl/pom.xml | 164 --- .../java2wsdl/generate/GenerationParameters.java | 435 ------ .../tools/java2wsdl/generate/Java2WSDL.java | 81 -- .../java2wsdl/generate/Java2WSDLGenerator.java | 46 - .../generate/Java2WSDLGeneratorFactory.java | 89 -- .../java2wsdl/generate/Java2WSDLGeneratorImpl.java | 239 ---- .../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 -- .../wsdl2java/generate/JavaInterfaceEmitter.java | 222 --- .../wsdl2java/generate/JavaInterfaceGenerator.java | 230 ---- .../generate/RemotableInterfaceWritter.java | 53 - .../generate/SDODataBindingCodegenExtension.java | 63 - .../generate/SDODataBindingTypeMappingEntry.java | 51 - .../wsdl2java/generate/WSDL2JavaGenerator.java | 349 ----- .../src/main/resources/META-INF/LICENSE.txt | 1277 ------------------ .../java2wsdl/src/main/resources/META-INF/NOTICE | 18 - .../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 - .../generate/WSDL2JavaGeneratorTestCase.java | 44 - .../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 -- .../sca/extensions/axis2/tools/pom.xml | 131 -- .../sca/extensions/axis2/tools/wsdl2java/pom.xml | 164 --- .../java2wsdl/generate/GenerationParameters.java | 435 ------ .../tools/java2wsdl/generate/Java2WSDL.java | 81 -- .../java2wsdl/generate/Java2WSDLGenerator.java | 46 - .../generate/Java2WSDLGeneratorFactory.java | 89 -- .../java2wsdl/generate/Java2WSDLGeneratorImpl.java | 239 ---- .../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 -- .../wsdl2java/generate/JavaInterfaceEmitter.java | 222 --- .../wsdl2java/generate/JavaInterfaceGenerator.java | 230 ---- .../generate/RemotableInterfaceWritter.java | 53 - .../generate/SDODataBindingCodegenExtension.java | 63 - .../generate/SDODataBindingTypeMappingEntry.java | 51 - .../wsdl2java/generate/WSDL2JavaGenerator.java | 357 ----- .../src/main/resources/META-INF/LICENSE.txt | 1277 ------------------ .../wsdl2java/src/main/resources/META-INF/NOTICE | 18 - .../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 - .../generate/WSDL2JavaGeneratorTestCase.java | 65 - .../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 -- .../sca/extensions/jms/binding/LICENSE.txt | 202 --- .../sca/extensions/jms/binding/NOTICE.txt | 14 - .../sca/extensions/jms/binding/pom.xml | 91 -- .../jms/DefaultOperationAndDataBinding.java | 162 --- .../tuscany/binding/jms/JMSBindingBuilder.java | 177 --- .../tuscany/binding/jms/JMSBindingDefinition.java | 274 ---- .../tuscany/binding/jms/JMSBindingException.java | 40 - .../tuscany/binding/jms/JMSBindingLoader.java | 199 --- .../org/apache/tuscany/binding/jms/JMSProxy.java | 131 -- .../tuscany/binding/jms/JMSReferenceBinding.java | 75 -- .../tuscany/binding/jms/JMSResourceFactory.java | 38 - .../tuscany/binding/jms/JMSServiceBinding.java | 100 -- .../tuscany/binding/jms/JMSTargetInvoker.java | 119 -- .../binding/jms/OperationAndDataBinding.java | 49 - .../binding/jms/SimpleJMSResourceFactory.java | 114 -- .../jms/databinding/AbstractJmsTransformer.java | 98 -- .../jms/databinding/Input2JmsInputTransformer.java | 69 - .../jms/databinding/JmsInput2InputTransformer.java | 68 - .../databinding/JmsOutput2OutputTransformer.java | 72 - .../databinding/Output2JmsOutputTransformer.java | 71 - .../main/resources/META-INF/sca/binding.jms.scdl | 52 - .../src/main/resources/META-INF/sca/default.scdl | 52 - .../resources/META-INF/sca/extension.composite | 22 - .../tuscany/binding/jms/GreetingService.java | 26 - .../tuscany/binding/jms/GreetingServiceImpl.java | 27 - .../tuscany/binding/jms/HelloworldService.java | 26 - .../tuscany/binding/jms/HelloworldServiceImpl.java | 27 - .../apache/tuscany/binding/jms/IntroService.java | 23 - .../tuscany/binding/jms/IntroServiceImpl.java | 36 - .../binding/jms/JMSBindingLoaderTestCase.java | 91 -- .../tuscany/binding/jms/JMSBindingTestCaseX.java | 111 -- .../tuscany/binding/jms/JMSProxyTestCase.java | 89 -- .../jms/databinding/JmsTransformerTestCase.java | 64 - .../src/test/resources/META-INF/sca/default.scdl | 61 - .../src/test/resources/wsdl/helloworld.wsdl | 130 -- .../sca/extensions/jms/pom.xml | 66 - .../jms/samples/helloworld.jmsReference/pom.xml | 77 -- .../src/main/java/helloworld/HelloWorldImpl.java | 47 - .../main/java/helloworld/HelloWorldService.java | 30 - .../src/main/resources/META-INF/sca/default.scdl | 36 - .../test/java/helloworld/HelloWorldJmsClient.java | 57 - .../jms/samples/helloworld.jmsService/pom.xml | 76 -- .../src/main/java/helloworld/HelloWorldImpl.java | 35 - .../main/java/helloworld/HelloWorldService.java | 30 - .../src/main/resources/META-INF/sca/default.scdl | 36 - .../test/java/helloworld/HelloWorldJmsServer.java | 79 -- .../sca/extensions/jms/samples/pom.xml | 97 -- .../sca/extensions/jsonrpc/binding/.ruleset | 190 --- .../sca/extensions/jsonrpc/binding/LICENSE.txt | 202 --- .../sca/extensions/jsonrpc/binding/pom.xml | 71 - .../binding/jsonrpc/JSONRPCBindingBuilder.java | 66 - .../binding/jsonrpc/JSONRPCBindingDefinition.java | 38 - .../binding/jsonrpc/JSONRPCBindingLoader.java | 57 - .../binding/jsonrpc/JSONRPCEntryPointServlet.java | 141 -- .../binding/jsonrpc/JSONRPCServiceBinding.java | 94 -- .../binding/jsonrpc/ScriptGetterServlet.java | 52 - .../tuscany/binding/jsonrpc/util/JavaToSmd.java | 49 - .../resources/META-INF/sca/binding.jsonrpc.scdl | 42 - .../src/main/resources/META-INF/sca/default.scdl | 43 - .../resources/META-INF/sca/extension.composite | 22 - .../org/apache/tuscany/binding/jsonrpc/jsonrpc.js | 484 ------- .../jsonrpc/JSONRPCBindingBuilderTestCase.java | 70 - .../jsonrpc/JSONRPCBindingLoaderTestCase.java | 81 -- .../binding/jsonrpc/JSONRPCBindingTestCase.java | 37 - .../jsonrpc/JSONRPCEntryPointServletTestCase.java | 186 --- .../binding/jsonrpc/JSONRPCServiceTestCase.java | 100 -- .../jsonrpc/ScriptGetterServletTestCase.java | 57 - .../tuscany/binding/jsonrpc/TestInterface.java | 25 - .../binding/jsonrpc/util/JavaToSmdTestCase.java | 62 - .../sca/extensions/jsonrpc/pom.xml | 66 - .../extensions/jsonrpc/samples/helloworld/.ruleset | 190 --- .../jsonrpc/samples/helloworld/build.xml | 81 -- .../extensions/jsonrpc/samples/helloworld/pom.xml | 116 -- .../java/helloworldjsonrpc/HelloWorldService.java | 28 - .../helloworldjsonrpc/HelloWorldServiceImpl.java | 36 - .../src/main/webapp/HelloWorldJSONRPC.html | 136 -- .../src/main/webapp/META-INF/LICENSE.txt | 1277 ------------------ .../helloworld/src/main/webapp/META-INF/NOTICE | 18 - .../src/main/webapp/WEB-INF/default.scdl | 32 - .../helloworld/src/main/webapp/WEB-INF/web.xml | 50 - .../samples/helloworld/src/main/webapp/style.css | 4 - .../sca/extensions/jsonrpc/samples/pom.xml | 96 -- .../sca-java-integration/sca/extensions/pom.xml | 159 --- .../sca/extensions/script/container.bsf/.ruleset | 190 --- .../extensions/script/container.bsf/LICENSE.txt | 202 --- .../sca/extensions/script/container.bsf/NOTICE.txt | 14 - .../sca/extensions/script/container.bsf/pom.xml | 96 -- .../tuscany/container/script/ScriptComponent.java | 135 -- .../container/script/ScriptComponentBuilder.java | 97 -- .../container/script/ScriptComponentType.java | 47 - .../script/ScriptComponentTypeLoader.java | 76 -- .../container/script/ScriptImplementation.java | 74 - .../ScriptImplementationJavaScriptLoader.java | 43 - .../script/ScriptImplementationLoader.java | 120 -- .../script/ScriptImplementationPythonLoader.java | 78 -- .../script/ScriptImplementationRubyLoader.java | 43 - .../tuscany/container/script/ScriptInstance.java | 51 - .../container/script/ScriptInstanceFactory.java | 151 --- .../container/script/ScriptTargetInvoker.java | 56 - .../src/main/resources/META-INF/sca/default.scdl | 40 - .../resources/META-INF/sca/extension.composite | 22 - .../main/resources/META-INF/sca/script.system.scdl | 52 - .../script/ScriptComponentBuilderTestCase.java | 117 -- .../container/script/ScriptComponentTestCase.java | 88 -- .../script/ScriptComponentTypeLoaderTestCase.java | 113 -- .../script/ScriptComponentTypeTestCase.java | 32 - .../ScriptImplementationLoaderLoadingTestCase.java | 78 -- .../script/ScriptImplementationLoaderTestCase.java | 133 -- .../script/ScriptImplementationTestCase.java | 35 - .../script/ScriptInstanceFactoryTestCase.java | 106 -- .../container/script/ScriptInstanceTestCase.java | 46 - .../container/script/ScriptInvokerTestCase.java | 78 -- .../container/script/mock/MockBSFEngine.java | 30 - .../tuscany/container/script/foo.componentType | 9 - .../org/apache/tuscany/container/script/foo.mock | 1 - .../container/script/helper/foo.componentType | 9 - .../tuscany/container/script/helper/foo.mock | 1 - .../extensions/script/databinding.e4x/LICENSE.txt | 202 --- .../extensions/script/databinding.e4x/NOTICE.txt | 14 - .../sca/extensions/script/databinding.e4x/pom.xml | 124 -- .../script/databinding/e4x/E4X2OMElement.java | 49 - .../script/databinding/e4x/E4X2Object.java | 46 - .../script/databinding/e4x/E4XDataBinding.java | 57 - .../script/databinding/e4x/E4XWrapperHandler.java | 76 -- .../script/databinding/e4x/OMElement2E4X.java | 70 - .../script/databinding/e4x/Object2E4X.java | 57 - .../resources/META-INF/sca/databinding.e4x.scdl | 50 - .../src/main/resources/META-INF/sca/default.scdl | 50 - .../resources/META-INF/sca/extension.composite | 22 - .../sca/extensions/script/itests/pom.xml | 138 -- .../main/java/calculator/CalculatorService.java | 32 - .../src/main/java/calculator/DivideService.java | 24 - .../main/java/helloworld/HelloWorldService.java | 33 - .../resources/META-INF/sca/helloworld.composite | 40 - .../resources/META-INF/sca/properties.composite | 79 -- .../resources/META-INF/sca/references.composite | 43 - .../src/main/resources/META-INF/sca/xml.composite | 44 - .../calculator/CalculatorImpl.componentType | 31 - .../main/resources/calculator/CalculatorImpl.py | 56 - .../main/resources/calculator/CalculatorImpl.rb | 48 - .../resources/calculator/DivideImpl.componentType | 30 - .../src/main/resources/calculator/DivideImpl.py | 65 - .../src/main/resources/calculator/DivideImpl.rb | 39 - .../calculator/sample.calculator.composite | 45 - .../resources/helloworld/helloworld.componentType | 27 - .../main/resources/helloworld/helloworld.groovy | 22 - .../src/main/resources/helloworld/helloworld.js | 22 - .../src/main/resources/helloworld/helloworld.py | 19 - .../src/main/resources/helloworld/helloworld.rb | 21 - .../resources/properties/helloworld.componentType | 29 - .../src/main/resources/properties/helloworld.js | 22 - .../src/main/resources/properties/helloworld.py | 19 - .../src/main/resources/properties/helloworld.rb | 21 - .../properties/helloworldDyn.componentType | 27 - .../src/main/resources/properties/helloworldDyn.js | 24 - .../src/main/resources/properties/helloworldDyn.py | 21 - .../src/main/resources/properties/helloworldDyn.rb | 23 - .../references/helloworldProxy.componentType | 31 - .../main/resources/references/helloworldProxy.js | 22 - .../main/resources/references/helloworldProxy.py | 19 - .../main/resources/references/helloworldProxy.rb | 21 - .../itests/src/main/resources/wsdl/helloworld.wsdl | 80 -- .../main/resources/xml/helloworld.componentType | 31 - .../itests/src/main/resources/xml/helloworld.js | 23 - .../main/resources/xml/helloworldXML.componentType | 27 - .../itests/src/main/resources/xml/helloworldXML.js | 29 - .../resources/xml/helloworldXMLProxy.componentType | 31 - .../src/main/resources/xml/helloworldXMLProxy.js | 27 - .../java/calculator/CalculatorClientTestCase.java | 59 - .../java/helloworld/HelloWorldClientTestCase.java | 72 - .../helloworld/JavaScriptPropertiesTestCase.java | 75 -- .../java/helloworld/PythonPropertiesTestCase.java | 74 - .../test/java/helloworld/ReferencesTestCase.java | 68 - .../java/helloworld/RubyPropertiesTestCase.java | 73 - .../src/test/java/helloworld/XMLTestCase.java | 61 - .../sca/extensions/script/pom.xml | 40 - .../sca/kernel/api/.checkstyle | 24 - branches/sca-java-integration/sca/kernel/api/.pmd | 20 - .../sca-java-integration/sca/kernel/api/.ruleset | 190 --- .../sca/kernel/api/LICENSE.txt | 202 --- .../sca-java-integration/sca/kernel/api/NOTICE.txt | 14 - .../sca-java-integration/sca/kernel/api/pom.xml | 42 - .../java/org/apache/tuscany/api/SCARuntime.java | 251 ---- .../org/apache/tuscany/api/TuscanyException.java | 164 --- .../tuscany/api/TuscanyRuntimeException.java | 168 --- .../apache/tuscany/api/annotation/DataType.java | 45 - .../apache/tuscany/api/annotation/IDLMapping.java | 51 - .../apache/tuscany/api/annotation/LogLevel.java | 40 - .../org/apache/tuscany/api/annotation/Monitor.java | 34 - .../apache/tuscany/api/annotation/Resource.java | 49 - .../tuscany/api/TuscanyExceptionTestCase.java | 164 --- .../api/TuscanyRuntimeExceptionTestCase.java | 142 -- .../sca/kernel/core/.checkstyle | 6 - branches/sca-java-integration/sca/kernel/core/.pmd | 2 - .../sca-java-integration/sca/kernel/core/.ruleset | 190 --- .../sca/kernel/core/LICENSE.txt | 202 --- .../sca/kernel/core/NOTICE.txt | 14 - .../sca-java-integration/sca/kernel/core/pom.xml | 96 -- .../binding/local/AbstractLocalTargetInvoker.java | 77 -- .../core/binding/local/LocalBindingBuilder.java | 56 - .../core/binding/local/LocalBindingDefinition.java | 45 - .../core/binding/local/LocalBindingLoader.java | 70 - .../binding/local/LocalCallbackTargetInvoker.java | 74 - .../core/binding/local/LocalReferenceBinding.java | 61 - .../core/binding/local/LocalServiceBinding.java | 55 - .../core/binding/local/LocalTargetInvoker.java | 73 - .../tuscany/core/bootstrap/Bootstrapper.java | 88 -- .../core/bootstrap/DefaultBootstrapper.java | 262 ---- .../tuscany/core/bootstrap/DefaultRuntime.java | 83 -- .../tuscany/core/bootstrap/DefaultSCARuntime.java | 92 -- .../tuscany/core/builder/BuilderRegistryImpl.java | 293 ---- .../apache/tuscany/core/builder/ConnectorImpl.java | 627 --------- .../core/builder/IllegalCallbackException.java | 54 - .../builder/IncompatibleInterfacesException.java | 93 -- .../core/builder/InvalidTargetTypeException.java | 41 - .../builder/NoCompatibleBindingsException.java | 36 - .../builder/NoConversationalContractException.java | 37 - .../core/builder/NoRegisteredBuilderException.java | 38 - .../builder/TargetServiceNotFoundException.java | 42 - .../tuscany/core/builder/WireConnectException.java | 58 - .../builder/WirePostProcessorRegistryImpl.java | 57 - .../core/builder/WiringExceptionFormatter.java | 72 - .../core/component/ComponentContextImpl.java | 85 -- .../tuscany/core/component/ScopeIdentifier.java | 35 - .../tuscany/core/component/WorkContextImpl.java | 211 --- .../core/component/event/AbstractEvent.java | 39 - .../core/component/event/AbstractRequestEvent.java | 38 - .../core/component/event/CompositeEvent.java | 33 - .../core/component/event/CompositeStart.java | 47 - .../core/component/event/CompositeStop.java | 46 - .../core/component/event/ConversationEnd.java | 31 - .../core/component/event/ConversationStart.java | 31 - .../core/component/event/ConversationalEvent.java | 39 - .../core/component/event/HttpRequestEnded.java | 38 - .../core/component/event/HttpRequestStart.java | 38 - .../core/component/event/HttpSessionEnd.java | 38 - .../core/component/event/HttpSessionEvent.java | 45 - .../core/component/event/HttpSessionStart.java | 38 - .../tuscany/core/component/event/RequestEnd.java | 38 - .../tuscany/core/component/event/RequestEvent.java | 28 - .../tuscany/core/component/event/RequestStart.java | 37 - .../component/scope/AbstractScopeContainer.java | 158 --- .../component/scope/CompositeScopeContainer.java | 189 --- .../scope/CompositeScopeObjectFactory.java | 50 - .../scope/ConversationalScopeContainer.java | 217 --- .../scope/ConversationalScopeObjectFactory.java | 58 - .../component/scope/HttpSessionScopeContainer.java | 135 -- .../scope/HttpSessionScopeObjectFactory.java | 54 - .../core/component/scope/InstanceWrapper.java | 41 - .../core/component/scope/InstanceWrapperImpl.java | 63 - .../component/scope/RequestScopeContainer.java | 126 -- .../component/scope/RequestScopeObjectFactory.java | 47 - .../core/component/scope/ScopeRegistryImpl.java | 63 - .../component/scope/StatelessScopeContainer.java | 75 -- .../scope/StatelessScopeObjectFactory.java | 54 - .../databinding/impl/DataBindingInteceptor.java | 250 ---- .../impl/DataBindingJavaInterfaceProcessor.java | 126 -- .../databinding/impl/DataBindingRegistryImpl.java | 121 -- .../impl/DataBindingWirePostProcessor.java | 157 --- .../core/databinding/impl/DataTypeLoader.java | 67 - .../core/databinding/impl/DirectedGraph.java | 357 ----- .../impl/Exception2ExceptionTransformer.java | 126 -- .../databinding/impl/Group2GroupTransformer.java | 97 -- .../core/databinding/impl/GroupDataBinding.java | 97 -- .../databinding/impl/Input2InputTransformer.java | 201 --- .../core/databinding/impl/MediatorImpl.java | 185 --- .../databinding/impl/Output2OutputTransformer.java | 186 --- .../databinding/impl/PassByValueInterceptor.java | 131 -- .../impl/PassByValueWirePostProcessor.java | 188 --- .../core/databinding/impl/PipedTransformer.java | 66 - .../core/databinding/impl/SimpleDataBinding.java | 61 - .../impl/TransformationContextImpl.java | 83 -- .../databinding/impl/TransformerRegistryImpl.java | 101 -- .../javabeans/DOMNode2JavaBeanTransformer.java | 78 -- .../javabeans/Java2XMLMapperException.java | 69 - .../javabeans/JavaBean2DOMNodeTransformer.java | 70 - .../javabeans/JavaBean2XMLStreamReader.java | 56 - .../javabeans/JavaBean2XMLTransformer.java | 226 ---- .../javabeans/JavaBeansDataBinding.java | 107 -- .../javabeans/XML2JavaBeanTransformer.java | 300 ----- .../javabeans/XML2JavaMapperException.java | 76 -- .../tuscany/core/databinding/xml/BeanUtil.java | 196 --- .../core/databinding/xml/DOMDataBinding.java | 52 - .../core/databinding/xml/DOMWrapperHandler.java | 78 -- .../core/databinding/xml/DOMXMLStreamReader.java | 129 -- .../xml/DelegatingNamespaceContext.java | 310 ----- .../core/databinding/xml/InputSource2Node.java | 65 - .../core/databinding/xml/InputSource2SAX.java | 63 - .../core/databinding/xml/InputStream2Node.java | 67 - .../core/databinding/xml/InputStream2SAX.java | 62 - .../xml/NameValueArrayStreamReader.java | 403 ------ .../databinding/xml/NameValuePairStreamReader.java | 347 ----- .../core/databinding/xml/NamedProperty.java | 59 - .../databinding/xml/NilElementStreamReader.java | 279 ---- .../core/databinding/xml/Node2OutputStream.java | 66 - .../tuscany/core/databinding/xml/Node2String.java | 59 - .../tuscany/core/databinding/xml/Node2Writer.java | 65 - .../core/databinding/xml/Node2XMLStreamReader.java | 59 - .../tuscany/core/databinding/xml/Reader2Node.java | 65 - .../tuscany/core/databinding/xml/Reader2SAX.java | 58 - .../tuscany/core/databinding/xml/SAX2DOM.java | 244 ---- .../tuscany/core/databinding/xml/SAX2DOMPipe.java | 67 - .../databinding/xml/Source2ResultTransformer.java | 60 - .../core/databinding/xml/StAX2SAXAdapter.java | 256 ---- .../core/databinding/xml/StAXDataBinding.java | 52 - .../tuscany/core/databinding/xml/StAXHelper.java | 85 -- .../core/databinding/xml/StreamDataPipe.java | 57 - .../tuscany/core/databinding/xml/String2Node.java | 60 - .../tuscany/core/databinding/xml/String2SAX.java | 59 - .../databinding/xml/String2XMLStreamReader.java | 55 - .../databinding/xml/WrappingXMLStreamReader.java | 230 ---- .../databinding/xml/Writer2ReaderDataPipe.java | 56 - .../databinding/xml/XMLDocumentStreamReader.java | 432 ------ .../databinding/xml/XMLFragmentStreamReader.java | 53 - .../xml/XMLFragmentStreamReaderImpl.java | 857 ------------ .../core/databinding/xml/XMLGroupDataBinding.java | 58 - .../core/databinding/xml/XMLStreamReader2Node.java | 62 - .../core/databinding/xml/XMLStreamReader2SAX.java | 73 - .../databinding/xml/XMLStreamReader2String.java | 55 - .../core/databinding/xml/XMLStreamSerializer.java | 266 ---- .../core/databinding/xml/XMLStreamable.java | 37 - .../core/databinding/xml/XMLStringDataBinding.java | 51 - .../core/deployer/AbstractDeploymentContext.java | 61 - .../core/deployer/ChildDeploymentContext.java | 60 - .../apache/tuscany/core/deployer/DeployerImpl.java | 176 --- .../core/deployer/RootDeploymentContext.java | 65 - .../deployer/federation/FederatedDeployer.java | 109 -- .../core/idl/java/IllegalCallbackException.java | 34 - .../tuscany/core/idl/java/InterfaceJavaLoader.java | 117 -- .../java/JavaInterfaceProcessorRegistryImpl.java | 169 --- .../implementation/IntrospectionRegistryImpl.java | 135 -- .../core/implementation/PojoAtomicComponent.java | 282 ---- .../core/implementation/PojoConfiguration.java | 232 ---- .../composite/AbstractCompositeBuilder.java | 61 - .../composite/AbstractCompositeComponent.java | 151 --- .../composite/AbstractCompositeContext.java | 124 -- .../composite/ComponentTimeoutException.java | 33 - .../implementation/composite/CompositeBuilder.java | 50 - .../composite/CompositeComponentImpl.java | 114 -- .../composite/CompositeComponentTypeLoader.java | 67 - .../implementation/composite/CompositeLoader.java | 426 ------ .../core/implementation/composite/Dependency.java | 39 - .../composite/ImplementationCompositeLoader.java | 126 -- .../composite/ManagedRequestContext.java | 58 - .../implementation/composite/ReferenceImpl.java | 90 -- .../core/implementation/composite/ServiceImpl.java | 98 -- .../composite/SystemCompositeBuilder.java | 67 - .../composite/SystemSingletonAtomicComponent.java | 164 --- .../implementation/java/JavaAtomicComponent.java | 100 -- .../implementation/java/JavaComponentBuilder.java | 208 --- .../java/JavaComponentTypeLoader.java | 141 -- .../implementation/java/JavaImplementation.java | 62 - .../java/JavaImplementationLoader.java | 65 - .../implementation/java/JavaTargetInvoker.java | 144 -- .../processor/AllowsPassByReferenceProcessor.java | 63 - .../processor/AmbiguousConstructorException.java | 41 - .../processor/ConstructorProcessor.java | 112 -- .../implementation/processor/ContextProcessor.java | 140 -- .../processor/ConversationProcessor.java | 142 -- .../implementation/processor/DestroyProcessor.java | 62 - .../processor/DuplicateConstructorException.java | 38 - .../processor/DuplicateDestructorException.java | 37 - .../processor/DuplicateInitException.java | 37 - .../processor/DuplicateReferenceException.java | 38 - .../processor/DuplicateResourceException.java | 37 - .../processor/EagerInitProcessor.java | 59 - .../processor/HeuristicPojoProcessor.java | 550 -------- .../IllegalCallbackReferenceException.java | 37 - .../processor/IllegalContextException.java | 37 - .../processor/IllegalDestructorException.java | 37 - .../processor/IllegalInitException.java | 36 - .../processor/IllegalReferenceException.java | 37 - .../processor/IllegalResourceException.java | 37 - .../IllegalServiceDefinitionException.java | 37 - .../ImplementationProcessorServiceImpl.java | 469 ------- .../implementation/processor/InitProcessor.java | 62 - .../processor/InvalidAutowireException.java | 34 - .../processor/InvalidConstructorException.java | 39 - .../InvalidConversationalImplementation.java | 45 - .../processor/InvalidPropertyException.java | 34 - .../processor/InvalidReferenceException.java | 41 - .../processor/InvalidResourceException.java | 33 - .../processor/InvalidServiceType.java | 34 - .../implementation/processor/MonitorProcessor.java | 57 - .../processor/NoConstructorException.java | 36 - .../processor/PropertyProcessor.java | 79 -- .../processor/ReferenceProcessor.java | 184 --- .../processor/ResourceProcessor.java | 117 -- .../implementation/processor/ScopeProcessor.java | 64 - .../implementation/processor/ServiceProcessor.java | 156 --- .../processor/ServiceTypeNotFoundException.java | 34 - .../processor/UnknownContextTypeException.java | 32 - .../system/builder/SystemComponentBuilder.java | 184 --- .../component/SystemAtomicComponentImpl.java | 55 - .../system/loader/SystemComponentTypeLoader.java | 101 -- .../loader/SystemCompositeComponentTypeLoader.java | 70 - .../system/loader/SystemImplementationLoader.java | 75 -- .../model/SystemCompositeImplementation.java | 57 - .../system/model/SystemImplementation.java | 51 - .../injection/ArrayMultiplicityObjectFactory.java | 54 - .../core/injection/CallbackWireObjectFactory.java | 47 - .../injection/CompositeContextObjectFactory.java | 48 - .../tuscany/core/injection/ContextInjector.java | 32 - .../injection/ConversationIDObjectFactory.java | 36 - .../tuscany/core/injection/EventInvoker.java | 34 - .../tuscany/core/injection/FieldInjector.java | 57 - .../core/injection/InjectionRuntimeException.java | 55 - .../apache/tuscany/core/injection/Injector.java | 35 - .../core/injection/InvalidAccessorException.java | 34 - .../injection/InvalidResourceTypeException.java | 33 - .../core/injection/JNDIListObjectFactory.java | 58 - .../tuscany/core/injection/JNDIObjectFactory.java | 50 - .../injection/ListMultiplicityObjectFactory.java | 50 - .../tuscany/core/injection/MethodEventInvoker.java | 55 - .../tuscany/core/injection/MethodInjector.java | 55 - .../core/injection/NoAccessorException.java | 39 - .../injection/NoMultiplicityTypeException.java | 29 - .../core/injection/ObjectCallbackException.java | 48 - .../tuscany/core/injection/PojoObjectFactory.java | 123 -- .../injection/RequestContextObjectFactory.java | 26 - .../core/injection/ResourceNotFoundException.java | 34 - .../core/injection/ResourceObjectFactory.java | 146 -- .../core/injection/SingletonListObjectFactory.java | 42 - .../core/injection/SingletonObjectFactory.java | 39 - .../core/launcher/CompositeContextImpl.java | 60 - .../tuscany/core/launcher/LaunchException.java | 49 - .../apache/tuscany/core/launcher/LauncherImpl.java | 250 ---- .../tuscany/core/launcher/LauncherRuntimeInfo.java | 96 -- .../tuscany/core/loader/ComponentLoader.java | 524 -------- .../core/loader/ComponentTypeElementLoader.java | 90 -- .../DefaultPropertyValueLoaderException.java | 32 - .../tuscany/core/loader/DependencyLoader.java | 88 -- .../apache/tuscany/core/loader/IncludeLoader.java | 111 -- .../tuscany/core/loader/JNDIPropertyFactory.java | 71 - .../core/loader/LoaderExceptionFormatter.java | 50 - .../tuscany/core/loader/LoaderRegistryImpl.java | 185 --- .../loader/ManyPropertyValueLoaderException.java | 32 - .../loader/MissingTypePropertyLoaderException.java | 32 - .../tuscany/core/loader/PolicySetLoader.java | 196 --- .../apache/tuscany/core/loader/PropertyLoader.java | 170 --- .../core/loader/PropertyLoaderException.java | 69 - .../tuscany/core/loader/ReferenceLoader.java | 196 --- .../apache/tuscany/core/loader/ServiceLoader.java | 106 -- .../core/loader/StringParserPropertyFactory.java | 205 --- .../org/apache/tuscany/core/loader/WireLoader.java | 112 -- .../marshaller/ComponentDefinitionMarshaller.java | 80 -- .../core/monitor/DefaultExceptionFormatter.java | 54 - .../core/monitor/InvalidLevelException.java | 64 - .../core/monitor/JavaLoggingMonitorFactory.java | 321 ----- .../tuscany/core/monitor/MonitorFactoryUtil.java | 78 -- .../tuscany/core/monitor/NullMonitorFactory.java | 58 - .../tuscany/core/policy/IntentRegistryImpl.java | 167 --- .../core/policy/PolicyBuilderRegistryImpl.java | 79 -- .../tuscany/core/policy/PolicyEngineImpl.java | 297 ----- .../apache/tuscany/core/policy/PolicyHelper.java | 65 - .../tuscany/core/property/PropertyHelper.java | 235 ---- .../core/property/PropertyObjectFactoryImpl.java | 147 -- .../SimpleMultivaluedPropertyObjectFactory.java | 74 - .../core/property/SimplePropertyObjectFactory.java | 64 - .../tuscany/core/runtime/AbstractRuntime.java | 283 ---- .../tuscany/core/runtime/mini/SimpleRuntime.java | 32 - .../core/runtime/mini/SimpleRuntimeImpl.java | 140 -- .../core/runtime/mini/SimpleRuntimeInfo.java | 48 - .../core/runtime/mini/SimpleRuntimeInfoImpl.java | 184 --- .../services/artifact/LocalMavenRepository.java | 100 -- .../deployment/ArtifactResolverRegistryImpl.java | 70 - .../services/deployment/AssemblyServiceImpl.java | 156 --- .../deployment/ContentTypeDescriberImpl.java | 111 -- .../deployment/ContributionDirectoryWatcher.java | 70 - .../services/deployment/ContributionLoader.java | 126 -- .../ContributionProcessorRegistryImpl.java | 96 -- .../deployment/ContributionRepositoryImpl.java | 275 ---- .../deployment/ContributionServiceImpl.java | 232 ---- .../services/deployment/DomainUpdateException.java | 47 - .../InvalidContributionMetadataException.java | 52 - .../deployment/InvalidDocumentException.java | 38 - .../services/deployment/XMLChangeSetHandler.java | 132 -- .../CompositeContributionProcessor.java | 102 -- .../contribution/FolderContributionProcessor.java | 139 -- .../InvalidComponentDefinitionlException.java | 41 - .../InvalidFolderContributionURIException.java | 41 - .../InvalidPojoComponentDefinitionlException.java | 36 - .../contribution/JarContributionProcessor.java | 146 -- .../contribution/JavaContributionProcessor.java | 107 -- .../MetadataContributionProcessor.java | 90 -- .../ComponentDefinitionArtifactResolver.java | 69 - .../extension/AbstractExtensionDeployer.java | 122 -- .../host/DelegatingResourceHostRegistry.java | 142 -- .../core/services/store/memory/MemoryStore.java | 198 --- .../core/services/work/jca/JcaWorkScheduler.java | 206 --- .../services/work/jsr237/Jsr237WorkScheduler.java | 217 --- .../work/jsr237/workmanager/DefaultWorkEvent.java | 73 - .../work/jsr237/workmanager/DefaultWorkItem.java | 166 --- .../jsr237/workmanager/ThreadPoolWorkManager.java | 220 --- .../tuscany/core/test/SCATestCaseRunner.java | 213 --- .../tuscany/core/util/ClassLoaderHelper.java | 93 -- .../org/apache/tuscany/core/util/FileHelper.java | 704 ---------- .../org/apache/tuscany/core/util/IOHelper.java | 184 --- .../tuscany/core/util/JavaIntrospectionHelper.java | 439 ------ .../tuscany/core/util/ReferenceLoaderHelper.java | 167 --- .../tuscany/core/wire/BridgingInterceptor.java | 29 - .../core/wire/CallbackInterfaceInterceptor.java | 60 - .../core/wire/InboundInvocationChainImpl.java | 41 - .../apache/tuscany/core/wire/InboundWireImpl.java | 166 --- ...ompatibleServiceContractExceptionFormatter.java | 95 -- .../tuscany/core/wire/InvocationChainImpl.java | 107 -- .../tuscany/core/wire/InvokerInterceptor.java | 59 - .../org/apache/tuscany/core/wire/LoopBackWire.java | 33 - .../core/wire/NoMethodForOperationException.java | 42 - .../core/wire/NonBlockingBridgingInterceptor.java | 177 --- .../core/wire/OptimizedWireObjectFactory.java | 47 - .../core/wire/OutboundInvocationChainImpl.java | 53 - .../apache/tuscany/core/wire/OutboundWireImpl.java | 176 --- .../core/wire/SynchronousBridgingInterceptor.java | 55 - .../tuscany/core/wire/WireObjectFactory.java | 84 -- .../tuscany/core/wire/WireServiceExtension.java | 323 ----- .../org/apache/tuscany/core/wire/WireUtils.java | 146 -- .../wire/jdk/JDKCallbackInvocationHandler.java | 137 -- .../core/wire/jdk/JDKInboundInvocationHandler.java | 173 --- .../wire/jdk/JDKOutboundInvocationHandler.java | 249 ---- .../tuscany/core/wire/jdk/JDKWireService.java | 114 -- .../META-INF/tuscany/default-system.composite | 163 --- .../org/apache/tuscany/core/composite.scdl | 45 - .../org/apache/tuscany/core/databinding.scdl | 183 --- .../org/apache/tuscany/core/deployment.scdl | 70 - .../org/apache/tuscany/core/formatters.scdl | 43 - .../org/apache/tuscany/core/implementation.scdl | 78 -- .../org/apache/tuscany/core/interfaceJava.scdl | 35 - .../apache/tuscany/core/javaImplementation.scdl | 39 - .../resources/org/apache/tuscany/core/loader.scdl | 52 - .../apache/tuscany/core/systemImplementation.scdl | 46 - .../local/AbstractLocalTargetInvokerTestCase.java | 72 - .../binding/local/LocalBindingBuilderTestCase.java | 38 - .../binding/local/LocalBindingLoaderTestCase.java | 70 - ...ckTargetInvokerInvocationExceptionTestCase.java | 86 -- .../local/LocalCallbackTargetInvokerTestCase.java | 82 -- ...ocalCallbackTargetInvokerThrowableTestCase.java | 98 -- .../binding/local/LocalTargetInvokerTestCase.java | 127 -- .../core/bootstrap/BootstrapperTestCase.java | 42 - .../builder/AbstractConnectorImplTestCase.java | 306 ----- .../core/builder/AtomicConnectorTestCase.java | 125 -- .../builder/BuilderRegistryNoBindingsTestCase.java | 80 -- .../core/builder/BuilderRegistryTestCase.java | 219 --- .../core/builder/ConnectorImplTestCase.java | 322 ----- .../core/builder/ConnectorPostProcessTestCase.java | 104 -- .../builder/IllegalCallbackExceptionTestCase.java | 43 - .../builder/InboundtoOutboundConnectTestCase.java | 168 --- .../IncompatibleInterfacesExceptionTestCase.java | 41 - .../InvalidTargetTypeExceptionTestCase.java | 41 - .../core/builder/LocalReferenceWiringTestCase.java | 236 ---- ...rwardNonBlockingCallbackConnectionTestCase.java | 172 --- ...ckingForwardSyncCallbackConnectionTestCase.java | 171 --- .../builder/OutboundToInboundConnectTestCase.java | 184 --- .../core/builder/ReferenceConnectorTestCase.java | 169 --- .../core/builder/ServiceConnectorTestCase.java | 172 --- ...nchronousForwardCallbackConnectionTestCase.java | 256 ---- .../TargetServiceNotFoundExceptionTestCase.java | 41 - .../WirePostProcessorRegistryImplTestCase.java | 63 - .../builder/WiringExceptionFormatterTestCase.java | 88 -- .../core/component/WorkContextImplTestCase.java | 65 - .../core/component/event/EventTestCase.java | 72 - .../scope/AbstractScopeContainerTestCase.java | 126 -- .../scope/BasicCompositeScopeTestCase.java | 127 -- .../scope/BasicConversationalScopeTestCase.java | 129 -- .../scope/BasicHttpSessionScopeTestCase.java | 145 -- .../component/scope/BasicRequestScopeTestCase.java | 128 -- .../scope/BasicStatelessScopeTestCase.java | 120 -- .../CompositeScopeInitDestroyErrorTestCase.java | 78 -- .../CompositeScopeInstanceLifecycleTestCase.java | 186 --- .../scope/CompositeScopeObjectFactoryTestCase.java | 38 - .../scope/CompositeScopeRestartTestCase.java | 99 -- ...lScopeContainerDestroyOnExpirationTestCase.java | 121 -- ...ConversationalScopeContainerMaxAgeTestCase.java | 76 -- ...rsationalScopeContainerMaxIdleTimeTestCase.java | 79 -- ...rsationalScopeContainerPersistenceTestCase.java | 181 --- ...nversationalScopeInstanceLifecycleTestCase.java | 70 - .../scope/ConversationalScopeRestartTestCase.java | 112 -- .../scope/DependencyLifecycleTestCase.java | 170 --- .../HttpSessionScopeInitDestroyErrorTestCase.java | 69 - .../HttpSessionScopeInstanceLifecycleTestCase.java | 136 -- .../scope/HttpSessionScopeRestartTestCase.java | 105 -- .../component/scope/InstanceWrapperTestCase.java | 66 - .../tuscany/core/component/scope/MockFactory.java | 137 -- .../RequestScopeInitDestroyErrorTestCase.java | 63 - .../RequestScopeInstanceLifecycleTestCase.java | 129 -- .../scope/RequestScopeRestartTestCase.java | 99 -- .../component/scope/ScopeRegistryTestCase.java | 80 -- .../scope/StatelessScopeContainerTestCase.java | 48 - .../scope/StatelessScopeObjectFactoryTestCase.java | 37 - .../core/component/scope/WorkContextTestCase.java | 212 --- .../impl/DataBindingInterceptorTestCase.java | 132 -- .../DataBindingJavaInterfaceProcessorTestCase.java | 80 -- .../impl/DataBindingLoaderTestCase.java | 79 -- .../impl/DataBindingRegistryImplTestCase.java | 98 -- .../core/databinding/impl/DataBindingTestCase.java | 45 - ...ndingWirePostProcessorOptimizationTestCase.java | 111 -- .../impl/DataBindingWirePostProcessorTestCase.java | 231 ---- .../databinding/impl/DirectedGraphTestCase.java | 89 -- .../databinding/impl/IDLTransformerTestCase.java | 217 --- .../databinding/impl/MediatorImplTestCase.java | 118 -- .../impl/PassByValueInterceptorTestCase.java | 75 -- .../impl/PassByValueWirePostProcessorTestCase.java | 266 ---- .../impl/TransformerRegistryImplTestCase.java | 106 -- .../DOMNode2JavaBeanTransformerTestCase.java | 187 --- .../JavaBean2DOMNodeTransformerTestCase.java | 127 -- .../core/databinding/xml/DOM2StAXTestCase.java | 89 -- .../core/databinding/xml/DataPipeTestCase.java | 89 -- .../xml/JavaBean2XMLStreamReaderTestCase.java | 133 -- .../core/databinding/xml/Node2StringTestCase.java | 35 - .../xml/PushTransformationTestCase.java | 81 -- .../core/databinding/xml/StAXHelperTestCase.java | 47 - .../databinding/xml/TraxTransformerTestCase.java | 99 -- .../core/deployer/BootstrapDeployerTestCase.java | 168 --- .../java/ConversationalIntrospectionTestCase.java | 82 -- ...JavaInterfaceProcessorRegistryImplTestCase.java | 100 -- .../IntrospectionRegistryTestCase.java | 124 -- .../PojoAtomicComponentTestCase.java | 159 --- .../tuscany/core/implementation/TestUtils.java | 74 - .../composite/AutowireResolutionTestCase.java | 87 -- .../implementation/composite/AutowireTestCase.java | 230 ---- .../composite/CompositeBuilderTestCase.java | 215 --- .../CompositeComponentImplBasicTestCase.java | 119 -- .../CompositeComponentImplSystemWireTestCase.java | 170 --- .../composite/CompositeComponentImplTestCase.java | 179 --- .../CompositeComponentResolutionTestCase.java | 84 -- .../composite/CompositeLifecycleTestCase.java | 120 -- .../CompositeLoaderWireResolutionTestCase.java | 232 ---- .../composite/CompositePropagationTestCase.java | 95 -- .../composite/DuplicateRegistrationTestCase.java | 105 -- .../ImplementationCompositeLoaderTestCase.java | 194 --- .../composite/JavaObjectRegistrationTestCase.java | 88 -- .../composite/ManagedRequestContextTestCase.java | 42 - .../composite/ReferenceImplTestCase.java | 61 - .../composite/ServiceImplTestCase.java | 61 - .../composite/SystemComponentBuilderTestCase.java | 180 --- .../SystemSingletonAtomicComponentTestCase.java | 61 - ...vaAtomicComponentMetadataInjectionTestCase.java | 37 - ...avaAtomicComponentNegativeMetadataTestCase.java | 49 - .../java/JavaBuilderPropertyTestCase.java | 137 -- ...JavaComponentBuilderConversationIDTestCase.java | 80 -- .../java/JavaComponentBuilderMetadataTestCase.java | 112 -- .../JavaComponentBuilderReferenceTestCase.java | 149 --- .../java/JavaComponentBuilderResourceTestCase.java | 81 -- .../java/JavaComponentTypeLoaderTestCase.java | 78 -- .../java/JavaReferenceWireTestCase.java | 153 --- .../JavaTargetInvokerBasicInvocationTestCase.java | 188 --- .../java/JavaTargetInvokerMediationTestCase.java | 61 - ...TargetInvokerNonBlockingInvocationTestCase.java | 229 ---- .../java/JavaTargetInvokerSequenceTestCase.java | 117 -- .../JavaTargetInvokerStatelessDestroyTestCase.java | 54 - .../java/JavaTargetInvokerTestCase.java | 53 - .../implementation/java/MultiplicityTestCase.java | 34 - .../java/ResourceInjectionTestCase.java | 111 -- .../integration/CallbackInvocationTestCase.java | 395 ------ .../integration/OutboundWireToJavaTestCase.java | 233 ---- .../AllowsPassByReferenceProcessorTestCase.java | 59 - .../processor/ConstructorAutowireTestCase.java | 154 --- .../ConstructorProcessorExtensibilityTestCase.java | 82 -- .../processor/ConstructorProcessorTestCase.java | 185 --- .../processor/ConstructorPropertyTestCase.java | 168 --- .../processor/ConstructorReferenceTestCase.java | 172 --- .../processor/ConstructorResourceTestCase.java | 166 --- .../processor/ContextProcessorTestCase.java | 197 --- .../processor/ConversationProcessorTestCase.java | 151 --- .../processor/ConvertTimeMillisTestCase.java | 110 -- .../processor/DestroyProcessorTestCase.java | 100 -- .../processor/EagerInitProcessorTestCase.java | 54 - .../processor/HeuristicAndPropertyTestCase.java | 70 - .../processor/HeuristicConstructorTestCase.java | 330 ----- .../processor/HeuristicPojoProcessorTestCase.java | 395 ------ .../HeutisticExtensibleConstructorTestCase.java | 129 -- .../ImplementationProcessorServiceTestCase.java | 117 -- ...plementationProcessorServiceUniqueTestCase.java | 67 - .../processor/InitProcessorTestCase.java | 98 -- .../processor/MonitorProcessorTestCase.java | 180 --- .../processor/PropertyProcessorTestCase.java | 204 --- .../processor/ReferenceProcessorTestCase.java | 225 ---- .../processor/ResourceProcessorTestCase.java | 99 -- .../processor/ScopeProcessorTestCase.java | 128 -- .../processor/ServiceCallbackTestCase.java | 166 --- .../processor/ServiceProcessorTestCase.java | 136 -- .../SystemComponentBuilderResourceTestCase.java | 75 -- .../component/SystemAtomicComponentTestCase.java | 124 -- ...ystemAtomicComponentWireInvocationTestCase.java | 60 - .../loader/SystemComponentTypeLoaderTestCase.java | 82 -- .../loader/SystemImplementationLoaderTestCase.java | 106 -- .../CallbackWireObjectFactoryTestCase.java | 47 - .../core/injection/FieldInjectorTestCase.java | 48 - .../core/injection/JNDIObjectFactoryTestCase.java | 61 - .../core/injection/MethodEventInvokerTestCase.java | 72 - .../core/injection/MethodInjectorTestCase.java | 79 -- .../core/injection/PojoObjectFactoryTestCase.java | 64 - .../RequestContextObjectFactoryTestCase.java | 37 - .../injection/ResourceObjectFactoryTestCase.java | 152 --- .../injection/SingletonObjectFactoryTestCase.java | 33 - .../conversation/AbstractConversationTestCase.java | 62 - .../ConversationIdleExpireTestCase.java | 140 -- .../ConversationMaxAgeExpireTestCase.java | 141 -- .../ConversationStartStopEndTestCase.java | 141 -- .../IntrospectionRegistryIntegrationTestCase.java | 131 -- .../builder/SystemBuilderPropertyTestCase.java | 89 -- .../tuscany/core/integration/mock/MockFactory.java | 278 ---- .../integration/scope/ScopeReferenceTestCase.java | 781 ----------- .../wire/DifferentInterfaceWireTestCase.java | 137 -- .../wire/ReferenceInjectionTestCase.java | 72 - .../oneway/OneWayWireToJavaInvocationTestCase.java | 130 -- .../loader/ComponentLoaderNoBindingTestCase.java | 91 -- .../loader/ComponentLoaderPropertyTestCase.java | 90 -- .../loader/ComponentLoaderReferenceTestCase.java | 87 -- .../core/loader/ComponentLoaderTestCase.java | 201 --- .../loader/ComponentLoaderValidationTestCase.java | 170 --- .../ComponentReferenceOverridingTestCase.java | 178 --- .../loader/ComponentTypeElementLoaderTestCase.java | 90 -- .../core/loader/DependencyLoaderTestCase.java | 124 -- .../tuscany/core/loader/IncludeLoaderTestCase.java | 169 --- .../core/loader/JNDIPropertyFactoryTestCase.java | 66 - .../loader/LoaderExceptionFormatterTestCase.java | 47 - .../loader/MultivaluePropertyLoadingTestCase.java | 204 --- .../core/loader/PolicySetLoaderTestCase.java | 71 - .../core/loader/PropertyLoaderTestCase.java | 180 --- .../core/loader/PropertyParsingTestCase.java | 78 -- .../core/loader/ReferenceLoaderTestCase.java | 143 -- .../tuscany/core/loader/ServiceLoaderTestCase.java | 166 --- .../loader/StAXLoaderRegistryImplTestCase.java | 131 -- .../StringParserPropertyFactoryTestCase.java | 133 -- .../tuscany/core/loader/WireLoaderTestCase.java | 159 --- .../core/mock/binding/MockServiceBinding.java | 82 -- .../tuscany/core/mock/component/AsyncTarget.java | 31 - .../core/mock/component/BadContextPojo.java | 28 - .../tuscany/core/mock/component/BadNamePojo.java | 26 - .../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 - .../core/mock/component/OrderException.java | 40 - .../core/mock/component/OrderedDependentPojo.java | 29 - .../mock/component/OrderedDependentPojoImpl.java | 36 - .../core/mock/component/OrderedEagerInitPojo.java | 60 - .../core/mock/component/OrderedInitPojo.java | 28 - .../core/mock/component/OrderedInitPojoImpl.java | 61 - .../tuscany/core/mock/component/OtherTarget.java | 31 - .../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 - .../tuscany/core/mock/component/SimpleTarget.java | 30 - .../core/mock/component/SimpleTargetImpl.java | 41 - .../apache/tuscany/core/mock/component/Source.java | 37 - .../tuscany/core/mock/component/SourceImpl.java | 63 - .../core/mock/component/StatelessComponent.java | 30 - .../mock/component/StatelessComponentImpl.java | 27 - .../apache/tuscany/core/mock/component/Target.java | 32 - .../tuscany/core/mock/component/TargetImpl.java | 38 - .../tuscany/core/mock/wire/MockStaticInvoker.java | 97 -- .../core/mock/wire/MockSyncInterceptor.java | 55 - .../tuscany/core/mock/wire/MockTargetInvoker.java | 33 - .../monitor/DefaultExceptionFormatterTestCase.java | 63 - .../tuscany/core/monitor/JavaLoggingTestCase.java | 153 --- .../core/policy/IntentRegistryImplTestCase.java | 152 --- .../core/policy/PolicyEngineImplTestCase.java | 140 -- .../core/property/PropertyHelperTestCase.java | 107 -- .../SimplePropertyObjectFactoryTestCase.java | 113 -- .../artifact/LocalMavenRepositoryTestCase.java | 82 -- .../deployment/AssemblyServiceImplTestCase.java | 107 -- .../ContentTypeDescriberImplTestCase.java | 52 - .../deployment/ContributionLoaderTestCase.java | 82 -- .../deployment/ContributionRepositoryTestCase.java | 76 -- .../ContributionServiceImplTestCase.java | 72 - .../CompositeContributionProcessorTestCase.java | 84 -- .../FolderContributionProcessorTestCase.java | 56 - .../JarContributionProcessorTestCase.java | 53 - .../JavaContributionProcessorTestCase.java | 79 -- .../DelegatingResourceHostRegistryTestCase.java | 147 -- .../services/store/memory/MemoryStoreTestCase.java | 164 --- .../work/jsr237/Jsr237WorkSchedulerTest.java | 81 -- .../work/jsr237/Jsr237WorkSchedulerTestCase.java | 100 -- .../workmanager/ThreadPoolWorkManagerTestCase.java | 132 -- .../java/org/apache/tuscany/core/util/Bean1.java | 45 - .../java/org/apache/tuscany/core/util/Bean2.java | 47 - .../core/util/JavaIntrospectionHelperTestCase.java | 180 --- .../org/apache/tuscany/core/util/SuperBean.java | 48 - .../BasicReferenceInvocationHandlerTestCase.java | 69 - .../wire/CallbackInterfaceInterceptorTestCase.java | 60 - .../core/wire/ContractCompatibilityTestCase.java | 401 ------ .../core/wire/InboundInvocationErrorTestCase.java | 166 --- ...eServiceContractExceptionFormatterTestCase.java | 82 -- .../core/wire/InvocationChainImplTestCase.java | 94 -- .../wire/InvocationConfigurationErrorTestCase.java | 95 -- .../core/wire/InvocationConfigurationTestCase.java | 95 -- .../NonBlockingBridgingInterceptorTestCase.java | 75 -- .../wire/OptimizedWireObjectFactoryTestCase.java | 44 - .../core/wire/OutboundInvocationErrorTestCase.java | 133 -- .../wire/OutboundInvocationHandlerTestCase.java | 132 -- .../tuscany/core/wire/OutboundWireTestCase.java | 38 - .../SynchronousBridgingInterceptorTestCase.java | 44 - .../core/wire/WireObjectFactoryTestCase.java | 138 -- .../core/wire/WireOptimizationTestCase.java | 154 --- .../core/wire/WireServiceExtensionTestCase.java | 333 ----- .../tuscany/core/wire/WireUtilsTestCase.java | 94 -- ...backInvocationHandlerSerializationTestCase.java | 54 - .../jdk/JDKCallbackInvocationHandlerTestCase.java | 54 - ...oundInvocationHandlerSerializationTestCase.java | 110 -- .../jdk/JDKInboundInvocationHandlerTestCase.java | 162 --- .../JDKOutboundInvocationHandlerProxyTestCase.java | 80 -- ...oundInvocationHandlerSerializationTestCase.java | 132 -- .../jdk/JDKOutboundInvocationHandlerTestCase.java | 176 --- .../tuscany/core/wire/jdk/JDKProxyTestCase.java | 61 - .../resources/deployables/sample-calculator.jar | Bin 26901 -> 0 bytes .../apache/tuscany/core/databinding/impl/ipo.xsd | 136 -- .../tuscany/core/databinding/impl/order.wsdl | 76 -- .../apache/tuscany/core/databinding/xml/foo.xml | 22 - .../tuscany/core/deployer/boot1-include.scdl | 33 - .../org/apache/tuscany/core/deployer/boot1.scdl | 35 - .../org/apache/tuscany/core/deployer/boot2.scdl | 136 -- .../org/apache/tuscany/core/loader/TestPolicy.scdl | 51 - .../apache/tuscany/core/loader/test-include.scdl | 22 - .../org/apache/tuscany/core/policy/PolicySet.scdl | 66 - .../org/apache/tuscany/core/property/ipo.xml | 33 - .../tuscany/core/services/deployment/test.ext | 0 .../tuscany/core/services/deployment/test.scdl | 22 - .../resources/repository/sample-calculator.jar | Bin 26901 -> 0 bytes .../sca/kernel/host-api/.checkstyle | 24 - .../sca-java-integration/sca/kernel/host-api/.pmd | 20 - .../sca/kernel/host-api/.ruleset | 190 --- .../sca/kernel/host-api/LICENSE.txt | 202 --- .../sca/kernel/host-api/NOTICE.txt | 14 - .../sca/kernel/host-api/pom.xml | 50 - .../apache/tuscany/host/AbstractRuntimeInfo.java | 125 -- .../org/apache/tuscany/host/MonitorFactory.java | 49 - .../java/org/apache/tuscany/host/RuntimeInfo.java | 72 - .../tuscany/host/deployment/AssemblyService.java | 105 -- .../tuscany/host/deployment/ContentTypes.java | 35 - .../deployment/ContributionProcessorException.java | 76 -- .../host/deployment/ContributionService.java | 120 -- .../host/deployment/DeploymentException.java | 51 - .../UnsupportedContentTypeException.java | 48 - .../org/apache/tuscany/host/launcher/Launcher.java | 58 - .../tuscany/host/management/ManagementService.java | 35 - .../tuscany/host/monitor/ExceptionFormatter.java | 34 - .../tuscany/host/monitor/FormatterRegistry.java | 42 - .../java/org/apache/tuscany/host/rmi/RMIHost.java | 49 - .../org/apache/tuscany/host/rmi/RMIHostAdmin.java | 39 - .../apache/tuscany/host/rmi/RMIHostException.java | 45 - .../tuscany/host/rmi/RMIHostRuntimeException.java | 45 - .../host/runtime/InitializationException.java | 37 - .../tuscany/host/runtime/ShutdownException.java | 33 - .../tuscany/host/runtime/TuscanyRuntime.java | 115 -- .../host/servlet/ServletRequestInjector.java | 41 - .../tuscany/host/rmi/RMIHostExceptionTestCase.java | 54 - .../host/rmi/RMIHostRuntimeExceptionTestCase.java | 54 - branches/sca-java-integration/sca/kernel/pom.xml | 181 --- .../sca/kernel/spi/.checkstyle | 9 - branches/sca-java-integration/sca/kernel/spi/.pmd | 2 - .../sca-java-integration/sca/kernel/spi/.ruleset | 190 --- .../sca/kernel/spi/LICENSE.txt | 202 --- .../sca-java-integration/sca/kernel/spi/NOTICE.txt | 14 - .../sca-java-integration/sca/kernel/spi/pom.xml | 68 - .../sca/kernel/spi/src/doc/Context Model.emx | 673 ---------- .../org/apache/tuscany/spi/AbstractLifecycle.java | 77 -- .../apache/tuscany/spi/CoreRuntimeException.java | 55 - .../apache/tuscany/spi/InvalidNameException.java | 45 - .../java/org/apache/tuscany/spi/Lifecycle.java | 69 - .../tuscany/spi/ObjectCreationException.java | 56 - .../java/org/apache/tuscany/spi/ObjectFactory.java | 35 - .../java/org/apache/tuscany/spi/QualifiedName.java | 96 -- .../apache/tuscany/spi/annotation/Autowire.java | 46 - .../tuscany/spi/bootstrap/ComponentNames.java | 70 - .../tuscany/spi/bootstrap/RuntimeComponent.java | 55 - .../apache/tuscany/spi/builder/BindingBuilder.java | 57 - .../org/apache/tuscany/spi/builder/Builder.java | 86 -- .../spi/builder/BuilderConfigException.java | 48 - .../tuscany/spi/builder/BuilderException.java | 55 - .../spi/builder/BuilderInstantiationException.java | 39 - .../tuscany/spi/builder/BuilderRegistry.java | 85 -- .../tuscany/spi/builder/ComponentBuilder.java | 36 - .../org/apache/tuscany/spi/builder/Connector.java | 52 - .../apache/tuscany/spi/builder/GenericBuilder.java | 42 - .../builder/InvalidServiceInterfaceException.java | 35 - .../spi/builder/MissingWireTargetException.java | 36 - .../spi/builder/ScopeNotFoundException.java | 29 - .../tuscany/spi/builder/WiringException.java | 124 -- .../tuscany/spi/component/AbstractSCAObject.java | 134 -- .../tuscany/spi/component/AtomicComponent.java | 126 -- .../apache/tuscany/spi/component/Component.java | 100 -- .../tuscany/spi/component/ComponentException.java | 52 - .../component/ComponentRegistrationException.java | 45 - .../spi/component/ComponentRuntimeException.java | 54 - .../tuscany/spi/component/CompositeComponent.java | 156 --- .../spi/component/DuplicateNameException.java | 36 - .../spi/component/IllegalTargetException.java | 33 - .../spi/component/InvalidAutowireInterface.java | 31 - .../InvalidConversationSequenceException.java | 31 - .../spi/component/PersistenceException.java | 41 - .../tuscany/spi/component/PrepareException.java | 35 - .../spi/component/ReactivationException.java | 45 - .../apache/tuscany/spi/component/Reference.java | 34 - .../tuscany/spi/component/ReferenceBinding.java | 88 -- .../tuscany/spi/component/SCAExternalizable.java | 43 - .../apache/tuscany/spi/component/SCAObject.java | 73 - .../spi/component/SCAObjectStartException.java | 33 - .../spi/component/SCAObjectStopException.java | 33 - .../tuscany/spi/component/ScopeContainer.java | 87 -- .../spi/component/ScopeContainerMonitor.java | 36 - .../tuscany/spi/component/ScopeRegistry.java | 43 - .../org/apache/tuscany/spi/component/Service.java | 52 - .../tuscany/spi/component/ServiceBinding.java | 95 -- .../spi/component/TargetDestructionException.java | 40 - .../tuscany/spi/component/TargetException.java | 50 - .../component/TargetInitializationException.java | 39 - .../spi/component/TargetInvocationException.java | 43 - .../component/TargetInvokerCreationException.java | 50 - .../spi/component/TargetNotFoundException.java | 36 - .../spi/component/TargetResolutionException.java | 43 - .../apache/tuscany/spi/component/WorkContext.java | 116 -- .../tuscany/spi/databinding/DataBinding.java | 99 -- .../spi/databinding/DataBindingRegistry.java | 70 - .../apache/tuscany/spi/databinding/DataPipe.java | 44 - .../tuscany/spi/databinding/ExceptionHandler.java | 57 - .../apache/tuscany/spi/databinding/Mediator.java | 67 - .../tuscany/spi/databinding/PullTransformer.java | 36 - .../tuscany/spi/databinding/PushTransformer.java | 34 - .../tuscany/spi/databinding/SimpleTypeMapper.java | 44 - .../spi/databinding/TransformationContext.java | 72 - .../spi/databinding/TransformationException.java | 46 - .../tuscany/spi/databinding/Transformer.java | 49 - .../spi/databinding/TransformerRegistry.java | 75 -- .../tuscany/spi/databinding/WrapperHandler.java | 55 - .../spi/databinding/extension/DOMHelper.java | 69 - .../extension/DataBindingExtension.java | 166 --- .../extension/Java2SimpleTypeTransformer.java | 60 - .../extension/SimpleType2JavaTransformer.java | 63 - .../extension/SimpleTypeMapperExtension.java | 392 ------ .../extension/TransformerExtension.java | 73 - .../extension/XSDDataTypeConverter.java | 940 ------------- .../tuscany/spi/deployer/ArtifactResolver.java | 84 -- .../spi/deployer/ArtifactResolverRegistry.java | 45 - .../tuscany/spi/deployer/ChangeSetHandler.java | 48 - .../spi/deployer/ChangeSetHandlerRegistry.java | 28 - .../tuscany/spi/deployer/CompositeClassLoader.java | 52 - .../apache/tuscany/spi/deployer/ContentType.java | 37 - .../tuscany/spi/deployer/ContentTypeDescriber.java | 36 - .../spi/deployer/ContributionProcessor.java | 66 - .../deployer/ContributionProcessorRegistry.java | 36 - .../spi/deployer/ContributionRepository.java | 78 -- .../org/apache/tuscany/spi/deployer/Deployer.java | 62 - .../tuscany/spi/deployer/DeploymentContext.java | 84 -- .../tuscany/spi/deployer/DeploymentMonitor.java | 20 - .../tuscany/spi/event/AbstractEventPublisher.java | 83 -- .../java/org/apache/tuscany/spi/event/Event.java | 33 - .../org/apache/tuscany/spi/event/EventFilter.java | 33 - .../apache/tuscany/spi/event/EventPublisher.java | 50 - .../tuscany/spi/event/RuntimeEventListener.java | 31 - .../org/apache/tuscany/spi/event/TrueFilter.java | 31 - .../spi/extension/AbstractComponentExtension.java | 65 - .../spi/extension/ArtifactResolverExtension.java | 75 -- .../spi/extension/AtomicComponentExtension.java | 225 ---- .../spi/extension/BindingBuilderExtension.java | 79 -- .../spi/extension/ComponentBuilderExtension.java | 100 -- .../extension/ComponentTypeLoaderExtension.java | 63 - .../spi/extension/CompositeComponentExtension.java | 564 -------- .../extension/ContributionProcessorExtension.java | 75 -- .../tuscany/spi/extension/ExecutionMonitor.java | 33 - .../spi/extension/GenericBuilderExtension.java | 52 - .../tuscany/spi/extension/LoaderExtension.java | 79 -- .../spi/extension/ReferenceBindingExtension.java | 78 -- .../spi/extension/ServiceBindingExtension.java | 90 -- .../extension/SystemAtomicComponentExtension.java | 45 - .../spi/extension/TargetInvokerExtension.java | 96 -- .../org/apache/tuscany/spi/host/ResourceHost.java | 46 - .../tuscany/spi/host/ResourceHostRegistry.java | 72 - .../spi/host/ResourceResolutionException.java | 32 - .../org/apache/tuscany/spi/host/ServletHost.java | 58 - .../org/apache/tuscany/spi/idl/ElementInfo.java | 54 - .../InvalidConversationalOperationException.java | 40 - .../spi/idl/InvalidServiceContractException.java | 50 - .../spi/idl/OverloadedOperationException.java | 41 - .../tuscany/spi/idl/ServiceFaultException.java | 82 -- .../java/org/apache/tuscany/spi/idl/TypeInfo.java | 66 - .../java/org/apache/tuscany/spi/idl/XMLType.java | 124 -- .../spi/idl/java/InterfaceJavaIntrospector.java | 57 - .../apache/tuscany/spi/idl/java/JavaIDLUtils.java | 104 -- .../spi/idl/java/JavaInterfaceProcessor.java | 34 - .../idl/java/JavaInterfaceProcessorExtension.java | 47 - .../idl/java/JavaInterfaceProcessorRegistry.java | 39 - .../tuscany/spi/idl/java/JavaServiceContract.java | 39 - .../java/AbstractPropertyProcessor.java | 205 --- .../implementation/java/ConstructorDefinition.java | 51 - .../java/DuplicatePropertyException.java | 35 - .../java/IllegalPropertyException.java | 36 - .../java/ImplementationProcessor.java | 128 -- .../java/ImplementationProcessorExtension.java | 118 -- .../java/ImplementationProcessorService.java | 91 -- .../implementation/java/IntrospectionRegistry.java | 38 - .../spi/implementation/java/Introspector.java | 47 - .../java/JavaMappedComponentType.java | 61 - .../implementation/java/JavaMappedProperty.java | 64 - .../implementation/java/JavaMappedReference.java | 60 - .../spi/implementation/java/JavaMappedService.java | 91 -- .../spi/implementation/java/PojoComponentType.java | 121 -- .../implementation/java/ProcessingException.java | 65 - .../tuscany/spi/implementation/java/Resource.java | 138 -- .../tuscany/spi/loader/ComponentTypeLoader.java | 45 - .../loader/DuplicateReferenceNameException.java | 81 -- ...mpatibleOverridingServiceContractException.java | 74 - .../spi/loader/InvalidConfigurationException.java | 36 - .../loader/InvalidPromotedReferenceException.java | 39 - .../spi/loader/InvalidReferenceException.java | 38 - .../spi/loader/InvalidServiceException.java | 30 - .../tuscany/spi/loader/InvalidValueException.java | 40 - .../tuscany/spi/loader/InvalidWireException.java | 45 - .../java/org/apache/tuscany/spi/loader/Loader.java | 92 -- .../apache/tuscany/spi/loader/LoaderException.java | 92 -- .../apache/tuscany/spi/loader/LoaderRegistry.java | 69 - .../org/apache/tuscany/spi/loader/LoaderUtil.java | 78 -- .../spi/loader/MissingImplementationException.java | 35 - .../spi/loader/MissingIncludeException.java | 32 - .../MissingMustOverridePropertyException.java | 30 - .../spi/loader/MissingPropertyValueException.java | 30 - .../spi/loader/MissingReferenceException.java | 32 - .../spi/loader/MissingResourceException.java | 67 - .../spi/loader/MissingSideFileException.java | 31 - .../loader/NotOverridablePropertyException.java | 30 - .../tuscany/spi/loader/PropertyObjectFactory.java | 49 - .../ReferenceMultiplicityOverridingException.java | 78 -- .../ReferenceMultiplicityViolationException.java | 75 -- .../tuscany/spi/loader/StAXElementLoader.java | 48 - .../spi/loader/UndefinedPropertyException.java | 28 - .../spi/loader/UndefinedReferenceException.java | 30 - .../loader/UnrecognizedComponentTypeException.java | 42 - .../spi/loader/UnrecognizedElementException.java | 46 - .../tuscany/spi/marshaller/MarshalException.java | 48 - .../tuscany/spi/marshaller/ModelMarshaller.java | 54 - .../spi/model/AbstractReferenceDefinition.java | 137 -- .../tuscany/spi/model/AtomicImplementation.java | 33 - .../tuscany/spi/model/BindingDefinition.java | 47 - .../tuscany/spi/model/ComponentDefinition.java | 152 --- .../spi/model/ComponentReferenceDefinition.java | 95 -- .../apache/tuscany/spi/model/ComponentType.java | 188 --- .../model/ComponentTypeReferenceDefinition.java | 40 - .../tuscany/spi/model/CompositeComponentType.java | 197 --- .../tuscany/spi/model/CompositeImplementation.java | 56 - .../spi/model/CompositeReferenceDefinition.java | 55 - .../org/apache/tuscany/spi/model/Contribution.java | 113 -- .../tuscany/spi/model/ContributionImport.java | 50 - .../org/apache/tuscany/spi/model/DataType.java | 249 ---- .../apache/tuscany/spi/model/DeployedArtifact.java | 114 -- .../apache/tuscany/spi/model/Implementation.java | 43 - .../java/org/apache/tuscany/spi/model/Include.java | 80 -- .../java/org/apache/tuscany/spi/model/Intent.java | 92 -- .../org/apache/tuscany/spi/model/IntentMap.java | 64 - .../org/apache/tuscany/spi/model/IntentName.java | 140 -- .../apache/tuscany/spi/model/InteractionScope.java | 29 - .../org/apache/tuscany/spi/model/ModelObject.java | 38 - .../org/apache/tuscany/spi/model/Multiplicity.java | 47 - .../org/apache/tuscany/spi/model/Operation.java | 413 ------ .../apache/tuscany/spi/model/OverrideOptions.java | 34 - .../apache/tuscany/spi/model/PolicyAttachable.java | 21 - .../tuscany/spi/model/PolicyAttachableModel.java | 49 - .../tuscany/spi/model/PolicyContentModel.java | 45 - .../org/apache/tuscany/spi/model/PolicyModel.java | 29 - .../org/apache/tuscany/spi/model/PolicySet.java | 99 -- .../tuscany/spi/model/PolicySetReference.java | 38 - .../org/apache/tuscany/spi/model/Property.java | 132 -- .../apache/tuscany/spi/model/PropertyValue.java | 134 -- .../org/apache/tuscany/spi/model/Qualifier.java | 51 - .../apache/tuscany/spi/model/ReferenceTarget.java | 50 - .../java/org/apache/tuscany/spi/model/Scope.java | 61 - .../apache/tuscany/spi/model/ServiceContract.java | 279 ---- .../tuscany/spi/model/ServiceDefinition.java | 163 --- .../tuscany/spi/model/WSPolicyAttachment.java | 35 - .../apache/tuscany/spi/model/WireDefinition.java | 47 - .../org/apache/tuscany/spi/model/WrapperInfo.java | 141 -- .../apache/tuscany/spi/policy/IntentRegistry.java | 83 -- .../tuscany/spi/policy/PolicyBuilderRegistry.java | 70 - .../apache/tuscany/spi/policy/PolicyEngine.java | 42 - .../tuscany/spi/policy/PolicySetContainer.java | 46 - .../apache/tuscany/spi/policy/SCATypeManager.java | 29 - .../tuscany/spi/policy/SourcePolicyBuilder.java | 41 - .../spi/policy/SourcePolicyBuilderExtension.java | 53 - .../tuscany/spi/policy/TargetPolicyBuilder.java | 41 - .../spi/policy/TargetPolicyBuilderExtension.java | 53 - .../tuscany/spi/resolver/ResolutionException.java | 52 - .../org/apache/tuscany/spi/resolver/Resolver.java | 37 - .../tuscany/spi/resolver/ResolverRegistry.java | 46 - .../apache/tuscany/spi/services/VoidService.java | 33 - .../tuscany/spi/services/artifact/Artifact.java | 197 --- .../spi/services/artifact/ArtifactRepository.java | 45 - .../discovery/AbstractDiscoveryService.java | 149 --- .../spi/services/discovery/DiscoveryException.java | 48 - .../spi/services/discovery/DiscoveryService.java | 75 -- .../spi/services/discovery/RequestListener.java | 39 - .../spi/services/discovery/ResponseListener.java | 40 - .../management/TuscanyManagementService.java | 40 - .../services/store/DuplicateRecordException.java | 31 - .../spi/services/store/RecoveryListener.java | 46 - .../apache/tuscany/spi/services/store/Store.java | 96 -- .../tuscany/spi/services/store/StoreException.java | 54 - .../spi/services/store/StoreExpirationEvent.java | 71 - .../tuscany/spi/services/store/StoreMonitor.java | 74 - .../spi/services/store/StoreReadException.java | 41 - .../spi/services/store/StoreWriteException.java | 43 - .../spi/services/work/NotificationListener.java | 66 - .../tuscany/spi/services/work/WorkScheduler.java | 52 - .../spi/services/work/WorkSchedulerException.java | 41 - .../tuscany/spi/util/SCAObjectInputStream.java | 60 - .../org/apache/tuscany/spi/util/stax/StaxUtil.java | 401 ------ .../spi/wire/AbstractInboundInvocationHandler.java | 54 - .../wire/AbstractOutboundInvocationHandler.java | 104 -- .../tuscany/spi/wire/InboundInvocationChain.java | 29 - .../org/apache/tuscany/spi/wire/InboundWire.java | 89 -- .../wire/IncompatibleServiceContractException.java | 74 - .../org/apache/tuscany/spi/wire/Interceptor.java | 50 - .../apache/tuscany/spi/wire/InvocationChain.java | 95 -- .../spi/wire/InvocationRuntimeException.java | 46 - .../java/org/apache/tuscany/spi/wire/Message.java | 120 -- .../org/apache/tuscany/spi/wire/MessageId.java | 56 - .../org/apache/tuscany/spi/wire/MessageImpl.java | 116 -- .../tuscany/spi/wire/OutboundChainHolder.java | 38 - .../tuscany/spi/wire/OutboundInvocationChain.java | 28 - .../org/apache/tuscany/spi/wire/OutboundWire.java | 106 -- .../tuscany/spi/wire/ProxyCreationException.java | 51 - .../org/apache/tuscany/spi/wire/TargetInvoker.java | 79 -- .../java/org/apache/tuscany/spi/wire/Wire.java | 82 -- .../tuscany/spi/wire/WireInvocationHandler.java | 32 - .../apache/tuscany/spi/wire/WireObjectFactory.java | 48 - .../apache/tuscany/spi/wire/WirePostProcessor.java | 40 - .../spi/wire/WirePostProcessorExtension.java | 44 - .../spi/wire/WirePostProcessorRegistry.java | 44 - .../org/apache/tuscany/spi/wire/WireService.java | 157 --- .../org/apache/tuscany/spi/AssertionTestCase.java | 38 - .../apache/tuscany/spi/QualifiedNameTestCase.java | 67 - .../spi/TuscanyRuntimeExceptionTestCase.java | 69 - .../spi/annotation/ConstructorAnnotationTest.java | 60 - .../spi/component/AbstractSCAObjectTestCase.java | 128 -- .../databinding/extension/DOMHelperTestCase.java | 55 - .../extension/DataBindingExtensionTestCase.java | 83 -- .../SimpleTypeMapperExtensionTestCase.java | 114 -- .../extension/TransformerExtensionTestCase.java | 74 - .../extension/XSDDataTypeConverterTestCase.java | 60 - .../spi/event/AbstractEventPublisherTestCase.java | 92 -- .../AtomicComponentExtensionTestCase.java | 148 -- .../ComponentTypeLoaderExtensionTestCase.java | 60 - ...ompositeComponentExtensionAutowireTestCase.java | 302 ----- .../CompositeComponentExtensionTestCase.java | 332 ----- .../spi/extension/LoaderExtensionTestCase.java | 71 - .../ReferenceBindingExtensionTestCase.java | 67 - .../tuscany/spi/extension/ReferenceTestCase.java | 94 -- .../extension/ServiceBindingExtensionTestCase.java | 87 -- .../TargetInvokerExtensionSequenceTestCase.java | 169 --- .../extension/TargetInvokerExtensionTestCase.java | 82 -- .../tuscany/spi/idl/java/JavaIDLUtilsTestCase.java | 178 --- .../java/AbstractPropertyProcessorTestCase.java | 176 --- .../spi/loader/LoaderExceptionTestCase.java | 33 - .../spi/model/CompositeComponentTypeTestCase.java | 43 - .../tuscany/spi/model/IntentNameTestCase.java | 16 - .../tuscany/spi/model/OperationTestCase.java | 52 - .../apache/tuscany/spi/model/ScopeTestCase.java | 59 - .../tuscany/spi/model/ServiceContractTestCase.java | 85 -- .../SourcePolicyBuilderExtensionTestCase.java | 50 - .../TargetPolicyBuilderExtensionTestCase.java | 50 - .../tuscany/spi/util/MockSCAExternalizable.java | 52 - .../apache/tuscany/spi/util/MockSerializable.java | 42 - .../spi/util/SCAObjectInputStreamTestCase.java | 51 - .../tuscany/spi/util/stax/StaxUtilTestCase.java | 58 - .../AbstractInboundInvocationHandlerTestCase.java | 55 - .../AbstractOutboundInvocationHandlerTestCase.java | 102 -- .../spi/wire/OutboundChainHolderTestCase.java | 35 - .../sca/kernel/spi/src/test/resources/test.scdl | 34 - branches/sca-java-integration/sca/pom.xml | 335 ----- .../services/databinding/databinding-jaxb/.ruleset | 172 --- .../databinding/databinding-jaxb/LICENSE.txt | 202 --- .../databinding/databinding-jaxb/NOTICE.txt | 14 - .../services/databinding/databinding-jaxb/pom.xml | 148 -- .../apache/tuscany/databinding/jaxb/JAXB2Node.java | 72 - .../databinding/jaxb/JAXBContextHelper.java | 192 --- .../tuscany/databinding/jaxb/JAXBDataBinding.java | 114 -- .../databinding/jaxb/JAXBExceptionHandler.java | 106 -- .../databinding/jaxb/JAXBWrapperHandler.java | 123 -- .../jaxb/JAXWSJavaInterfaceProcessor.java | 107 -- .../apache/tuscany/databinding/jaxb/Node2JAXB.java | 69 - .../tuscany/databinding/jaxb/Reader2JAXB.java | 70 - .../databinding/jaxb/XMLStreamReader2JAXB.java | 70 - .../resources/META-INF/sca/databinding.jaxb.scdl | 49 - .../src/main/resources/META-INF/sca/default.scdl | 49 - .../resources/META-INF/sca/extension.composite | 22 - .../databinding/jaxb/JAXBDataBindingTestCase.java | 127 -- .../jaxb/JAXBExceptionHandlerTestCase.java | 77 -- .../tuscany/databinding/jaxb/JAXBTestCase.java | 158 --- .../jaxb/JAXBWrapperHandlerTestCase.java | 72 - .../databinding/jaxb/fault/InvalidSymbolFault.java | 59 - .../jaxb/fault/InvalidSymbolFault_Exception.java | 44 - .../databinding-jaxb/src/test/resources/ipo.xsd | 118 -- .../services/databinding/databinding-json/.ruleset | 172 --- .../databinding/databinding-json/LICENSE.txt | 202 --- .../databinding/databinding-json/NOTICE.txt | 14 - .../services/databinding/databinding-json/pom.xml | 70 - .../databinding/json/JSON2XMLStreamReader.java | 62 - .../tuscany/databinding/json/JSONDataBinding.java | 52 - .../databinding/json/XMLStreamReader2JSON.java | 69 - .../databinding/json/XMLStreamSerializer.java | 272 ---- .../databinding/json/axiom/JSON2OMElement.java | 83 -- .../json/axiom/JSONBadgerfishDataSource.java | 56 - .../databinding/json/axiom/JSONDataSource.java | 174 --- .../resources/META-INF/sca/databinding.json.scdl | 43 - .../resources/META-INF/sca/extension.composite | 22 - .../databinding/json/JSONTransformerTestCase.java | 91 -- .../databinding-json/src/test/resources/ipo.xsd | 118 -- .../databinding/databinding-sdo-axiom/.checkstyle | 6 - .../databinding/databinding-sdo-axiom/.ruleset | 172 --- .../databinding/databinding-sdo-axiom/LICENSE.txt | 202 --- .../databinding/databinding-sdo-axiom/NOTICE.txt | 14 - .../databinding/databinding-sdo-axiom/pom.xml | 138 -- .../databinding/sdo2om/DataObject2OMElement.java | 89 -- .../databinding/sdo2om/DataObjectSerializer.java | 408 ------ .../tuscany/databinding/sdo2om/SDODataSource.java | 66 - .../databinding/sdo2om/XMLDocument2OMElement.java | 64 - .../META-INF/sca/databinding.sdo-axiom.scdl | 39 - .../resources/META-INF/sca/extension.composite | 22 - .../sdo2om/DataObject2OMElementTestCase.java | 38 - .../sdo2om/MockTransformationContext.java | 83 -- .../sdo2om/SDOTransformerTestCaseBase.java | 78 -- .../sdo2om/XMLDocument2OMElementTestCase.java | 45 - .../src/test/resources/ipo.xsd | 118 -- .../src/test/resources/stock.xsd | 33 - .../databinding/databinding-sdo/.checkstyle | 6 - .../services/databinding/databinding-sdo/.ruleset | 172 --- .../databinding/databinding-sdo/LICENSE.txt | 202 --- .../databinding/databinding-sdo/NOTICE.txt | 14 - .../services/databinding/databinding-sdo/pom.xml | 119 -- .../tuscany/databinding/sdo/DataObject2String.java | 61 - .../sdo/DataObject2XMLStreamReader.java | 70 - .../tuscany/databinding/sdo/DataObjectLoader.java | 73 - .../apache/tuscany/databinding/sdo/ImportSDO.java | 47 - .../tuscany/databinding/sdo/ImportSDOBuilder.java | 57 - .../tuscany/databinding/sdo/ImportSDOLoader.java | 163 --- .../tuscany/databinding/sdo/ModelDataObject.java | 43 - .../tuscany/databinding/sdo/SDOContextHelper.java | 111 -- .../tuscany/databinding/sdo/SDODataBinding.java | 122 -- .../databinding/sdo/SDOExceptionHandler.java | 123 -- .../tuscany/databinding/sdo/SDOHelperContext.java | 48 - .../databinding/sdo/SDOSimpleTypeMapper.java | 66 - .../tuscany/databinding/sdo/SDOWrapperHandler.java | 99 -- .../tuscany/databinding/sdo/String2DataObject.java | 58 - .../databinding/sdo/XMLDocument2String.java | 62 - .../sdo/XMLDocument2XMLStreamReader.java | 66 - .../sdo/XMLStreamReader2DataObject.java | 67 - .../sdo/XMLStreamReader2XMLDocument.java | 61 - .../resources/META-INF/sca/databinding.sdo.scdl | 72 - .../src/main/resources/META-INF/sca/default.scdl | 66 - .../resources/META-INF/sca/extension.composite | 22 - .../sdo/fault/InvalidSymbolFault_Exception.java | 67 - .../databinding/sdo/DataObject2StringTestCase.java | 64 - .../sdo/DataObject2XMLStreamReaderTestCase.java | 57 - .../databinding/sdo/DataObjectLoaderTestCase.java | 82 -- .../databinding/sdo/ImportSDOLoaderTestCase.java | 87 -- .../databinding/sdo/SDODataBindingTestCase.java | 110 -- .../sdo/SDOExceptionHandlerTestCase.java | 81 -- .../sdo/SDOTransformerTestCaseBase.java | 79 -- .../databinding/sdo/SDOWrapperHandlerTestCase.java | 65 - .../sdo/XMLDocument2XMLStreamReaderTestCase.java | 60 - .../META-INF/tuscany/databinding.sdo.scdl | 34 - .../databinding-sdo/src/test/resources/ipo.xsd | 118 -- .../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 | 9 - .../databinding-sdo/src/test/resources/wrapper.xsd | 38 - .../databinding/databinding-xmlbeans/.ruleset | 172 --- .../databinding/databinding-xmlbeans/LICENSE.txt | 202 --- .../databinding/databinding-xmlbeans/NOTICE.txt | 14 - .../databinding/databinding-xmlbeans/pom.xml | 97 -- .../databinding/xmlbeans/Node2XmlObject.java | 56 - .../databinding/xmlbeans/XMLBeansDataBinding.java | 35 - .../xmlbeans/XMLStreamReader2XmlObject.java | 56 - .../databinding/xmlbeans/XmlObject2Node.java | 52 - .../xmlbeans/XmlObject2XMLStreamReader.java | 47 - .../META-INF/sca/databinding.xmlbeans.scdl | 43 - .../src/main/resources/META-INF/sca/default.scdl | 43 - .../resources/META-INF/sca/extension.composite | 22 - .../databinding/xmlbeans/XmlObjectTestCase.java | 99 -- .../src/test/resources/ipo.xsd | 118 -- .../src/test/resources/ipo.xsdconfig | 21 - .../sca/services/databinding/pom.xml | 70 - .../sca-java-integration/sca/services/idl/pom.xml | 61 - .../sca/services/idl/wsdl/.ruleset | 190 --- .../sca/services/idl/wsdl/LICENSE.txt | 202 --- .../sca/services/idl/wsdl/NOTICE.txt | 14 - .../sca/services/idl/wsdl/pom.xml | 57 - .../idl/wsdl/InterfaceWSDLIntrospector.java | 48 - .../idl/wsdl/InterfaceWSDLIntrospectorImpl.java | 102 -- .../tuscany/idl/wsdl/InterfaceWSDLLoader.java | 146 -- .../tuscany/idl/wsdl/InvalidFragmentException.java | 30 - .../idl/wsdl/InvalidWSDLContributionException.java | 36 - .../tuscany/idl/wsdl/InvalidWSDLException.java | 34 - .../idl/wsdl/InvalidWSDLLocationException.java | 33 - .../idl/wsdl/NotSupportedWSDLException.java | 37 - .../idl/wsdl/UnresolveableResourceException.java | 34 - .../idl/wsdl/WSDLContributionProcessor.java | 263 ---- .../tuscany/idl/wsdl/WSDLDefinitionRegistry.java | 91 -- .../idl/wsdl/WSDLDefinitionRegistryImpl.java | 214 --- .../org/apache/tuscany/idl/wsdl/WSDLLoader.java | 110 -- .../tuscany/idl/wsdl/WSDLLoaderException.java | 45 - .../apache/tuscany/idl/wsdl/WSDLLoaderImpl.java | 141 -- .../org/apache/tuscany/idl/wsdl/WSDLLocation.java | 60 - .../org/apache/tuscany/idl/wsdl/WSDLOperation.java | 525 -------- .../tuscany/idl/wsdl/WSDLServiceContract.java | 60 - .../apache/tuscany/idl/wsdl/XMLSchemaRegistry.java | 87 -- .../tuscany/idl/wsdl/XMLSchemaRegistryImpl.java | 129 -- .../tuscany/idl/wsdl/XSDContributionProcessor.java | 136 -- .../src/main/resources/META-INF/sca/default.scdl | 50 - .../resources/META-INF/sca/extension.composite | 22 - .../src/main/resources/META-INF/sca/idl.wsdl.scdl | 52 - .../InterfaceWSDLIntrospectorImplTestCase.java | 83 -- .../wsdl/WSDLContributionProcessorTestCase.java | 86 -- .../idl/wsdl/WSDLDefinitionRegistryTestCase.java | 91 -- .../tuscany/idl/wsdl/WSDLLoaderImplTestCase.java | 53 - .../tuscany/idl/wsdl/WSDLOperationTestCase.java | 115 -- .../idl/wsdl/WrapperStyleOperationTestCase.java | 72 - .../idl/wsdl/XMLSchemaRegistryImplTestCase.java | 105 -- .../idl/wsdl/XSDContributionProcessorTestCase.java | 92 -- .../org/apache/tuscany/idl/wsdl/example.wsdl | 26 - .../tuscany/idl/wsdl/invalid-stockquote.wsdl | 40 - .../resources/org/apache/tuscany/idl/wsdl/ipo.xsd | 118 -- .../org/apache/tuscany/idl/wsdl/stockquote.wsdl | 40 - .../org/apache/tuscany/idl/wsdl/test1.wsdl | 45 - .../org/apache/tuscany/idl/wsdl/test1.xsd | 15 - .../org/apache/tuscany/idl/wsdl/test2.wsdl | 63 - .../tuscany/idl/wsdl/unwrapped-stockquote.wsdl | 58 - branches/sca-java-integration/sca/services/pom.xml | 63 - .../sca/services/transports/http.jetty/.ruleset | 190 --- .../sca/services/transports/http.jetty/LICENSE.txt | 202 --- .../sca/services/transports/http.jetty/NOTICE.txt | 14 - .../sca/services/transports/http.jetty/pom.xml | 71 - .../apache/tuscany/service/jetty/JettyLogger.java | 106 -- .../apache/tuscany/service/jetty/JettyService.java | 38 - .../tuscany/service/jetty/JettyServiceImpl.java | 356 ----- .../tuscany/service/jetty/TransportMonitor.java | 42 - .../main/resources/META-INF/sca/http.jetty.scdl | 35 - .../main/resources/META-INF/sca/service.composite | 22 - .../service/jetty/JettyServiceImplTestCase.java | 220 --- 1679 files changed, 168691 deletions(-) delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/.ruleset delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/NOTICE.txt delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/binding/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/assembly/axis2.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2AsyncTargetInvoker.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilderRuntimeException.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingRunTimeException.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2CallbackInvocationHandler.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2OneWayTargetInvoker.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceBinding.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceCallback.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceCallbackTargetInvoker.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceBinding.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceCallbackTargetInvoker.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInMessageReceiver.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutAsyncMessageReceiver.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutSyncMessageReceiver.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceServlet.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2TargetInvoker.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/TuscanyDispatcher.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/WebServiceBindingDefinition.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/WebServiceBindingLoader.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/util/TuscanyAxisConfigurator.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/util/WebServiceOperationMetaData.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/util/WebServicePortMetaData.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/resources/META-INF/sca/binding.axis2.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/resources/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/resources/META-INF/sca/extension.composite delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/binding/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilderTestCase.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/Axis2ReferenceTestCase.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/Axis2ServiceTestCase.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/Greeter.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/GreetingCallback.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/WebServicebindingLoaderTestCase.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/binding/src/test/resources/wsdl/hello_world_doc_lit.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/databinding/.ruleset delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/databinding/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/databinding/NOTICE.txt delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/databinding/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/AxiomDataBinding.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/AxiomExceptionHandler.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/AxiomHelper.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2Object.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2String.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2XMLStreamReader.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/OMElementWrapperHandler.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/Object2OMElement.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/String2OMElement.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/XMLStreamReader2OMElement.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/resources/META-INF/sca/databinding.axiom.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/resources/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/resources/META-INF/sca/extension.composite delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/java/org/apache/tuscany/databinding/axiom/AxiomExceptionHandlerTestCase.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/java/org/apache/tuscany/databinding/axiom/OMElementTestCase.java delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/resources/ipo.xml delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/resources/ipo.xsd delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/resources/order.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/old-style/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/java/helloworld/HelloWorldImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/java/helloworld/HelloWorldService.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/java/helloworld/HelloWorldServiceComponent.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/resources/OldStyleReference.composite delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/resources/OldStyleService.composite delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/resources/wsdl/helloworld.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/test/java/org/apache/tuscany/sca/itest/OldStyleTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/java/helloworld/HelloWorldImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/java/helloworld/HelloWorldService.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/java/helloworld/HelloWorldServiceComponent.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/resources/client.composite delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/resources/service.composite delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/resources/wsdl/helloworld.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/test/java/org/apache/tuscany/sca/itest/ServiceExplicitURITestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/java/helloworld/HelloWorldImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/java/helloworld/HelloWorldService.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/java/helloworld/HelloWorldServiceComponent.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/resources/client.composite delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/resources/service.composite delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/resources/wsdl/helloworld.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/test/java/org/apache/tuscany/sca/itest/ServiceRelativeURITestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/simplest/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/java/helloworld/HelloWorldImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/java/helloworld/HelloWorldService.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/java/helloworld/HelloWorldServiceComponent.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/resources/client.composite delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/resources/service.composite delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/resources/wsdl/helloworld.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/test/java/org/apache/tuscany/sca/itest/SimplestTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/java/helloworld/HelloWorldImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/java/helloworld/HelloWorldService.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/java/helloworld/HelloWorldServiceComponent.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/resources/client.composite delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/resources/service.composite delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/resources/wsdl/helloworld.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/test/java/org/apache/tuscany/sca/itest/WsdlElementBindingTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/plugins/java2wsdl/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/plugins/java2wsdl/NOTICE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/plugins/java2wsdl/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/plugins/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/plugin/Java2WSDLGeneratorMojo.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/plugins/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/NOTICE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDL2JavaGeneratorMojo.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDLFileOption.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/NOTICE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/readme.html delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/resources/calculator.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/webapp/WEB-INF/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/webapp/WEB-INF/web.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/webapp/calc.jsp delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/webapp/index.html delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/.ruleset delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/readme.htm delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/setup.bat delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/java/helloworld/HelloWorldCallback.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/java/helloworld/HelloWorldImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/java/helloworld/HelloWorldService.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/resources/META-INF/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/resources/META-INF/NOTICE delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/resources/META-INF/README.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/resources/wsdl/helloworld.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/binding.axis2.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/databinding.axiom.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/databinding.sdo.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/interface.wsdl.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/webapp.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/WEB-INF/web.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/run.bat delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/run_celtix.bat delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldCallback.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldClient.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldLocal.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldService.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldServiceComponent.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/META-INF/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/META-INF/NOTICE delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/META-INF/README.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/logging.properties delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/wsdl/helloworld.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/test/java/helloworld/HelloWorldWSAsyncClient.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/test/resources/META-INF/tuscany/test-extensions.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/readme.htm delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/setup.bat delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldServer.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldService.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/META-INF/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/META-INF/NOTICE delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/META-INF/README.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/helloworldws-om.composite delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/wsdl/helloworld-om.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/test/java/helloworld/om/HelloWorldServerTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/pom.xml delete mode 100755 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/run.bat delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/java/helloworld/om/HelloWorldClient.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/java/helloworld/om/HelloWorldService.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/java/helloworld/om/HelloWorldServiceComponent.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/META-INF/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/META-INF/NOTICE delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/META-INF/README.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/helloworldwsclient-om.composite delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/logging.properties delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/wsdl/helloworld-om.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/test/java/helloworld/om/HelloWorldClientTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/test/java/helloworld/om/HelloWorldServerTest.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/java/greeter/GreeterImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/java/greeter/GreeterService.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/resources/wsdl/greeter.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/binding.axis2.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/databinding.axiom.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/databinding.sdo.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/interface.wsdl.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/webapp.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/WEB-INF/web.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/java/greeter/GreeterClient.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/java/greeter/GreeterImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/java/greeter/GreeterLocal.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/java/greeter/GreeterService.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/resources/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/resources/wsdl/greeter.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/test/java/greeter/GreeterWSOneWayClient.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/test/resources/META-INF/tuscany/test-extensions.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/java/helloworld/HelloWorldImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/java/helloworld/HelloWorldServer.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/java/helloworld/HelloWorldService.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/META-INF/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/META-INF/NOTICE delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/META-INF/README.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/helloworldws.composite delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/system.composite delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/wsdl/helloworld.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/test/java/helloworld/HelloWorldServerTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/java/helloworld/HelloWorldClient.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/java/helloworld/HelloWorldService.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/java/helloworld/HelloWorldServiceComponent.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/META-INF/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/META-INF/NOTICE delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/META-INF/README.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/helloworldwsclient.composite delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/logging.properties delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/wsdl/helloworld.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/test/java/helloworld/HelloWorldClientTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/test/java/helloworld/HelloWorldServerTest.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/java/loanappconversation/LoanApplication.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/java/loanappconversation/LoanService.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/java/loanappconversation/LoanServiceImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/resources/wsdl/loanappconversation.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/webapp/WEB-INF/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/webapp/WEB-INF/web.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanAppConversationClient.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanApplication.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanClient.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanClientImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanService.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/resources/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/resources/wsdl/loanappconversation.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/test/java/loanappconversation/LoanAppConversationTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/samples/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/GenerationParameters.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGenerator.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2OMBuilder.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLBuilder.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLConstants.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLOptionsValidator.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanySchemaGenerator.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyTypeTable.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyWSDLTypesGenerator.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenEvent.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenListener.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/util/XMLNameUtil.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingTypeMappingEntry.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/resources/META-INF/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/resources/META-INF/NOTICE delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/resources/META-INF/README.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/resources/RemotableInterfaceTemplate.xsl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGeneratorTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/soapinterop/CreditScoreDocLit.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/AccountService.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/CreditScoreDocLit.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/helloworld.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/interopdoc.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/sequences.xsd delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/GenerationParameters.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGenerator.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2OMBuilder.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLBuilder.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLConstants.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLOptionsValidator.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanySchemaGenerator.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyTypeTable.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyWSDLTypesGenerator.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenEvent.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenListener.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/util/XMLNameUtil.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingTypeMappingEntry.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/resources/META-INF/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/resources/META-INF/NOTICE delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/resources/META-INF/README.txt delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/resources/RemotableInterfaceTemplate.xsl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGeneratorTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/soapinterop/CreditScoreDocLit.java delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/AccountService.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/CreditScoreDocLit.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/helloworld.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/interopdoc.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/sequences.xsd delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/NOTICE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/DefaultOperationAndDataBinding.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSBindingBuilder.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSBindingDefinition.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSBindingException.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSBindingLoader.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSProxy.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSReferenceBinding.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSResourceFactory.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSServiceBinding.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSTargetInvoker.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/OperationAndDataBinding.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/SimpleJMSResourceFactory.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/AbstractJmsTransformer.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/Input2JmsInputTransformer.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/JmsInput2InputTransformer.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/JmsOutput2OutputTransformer.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/Output2JmsOutputTransformer.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/resources/META-INF/sca/binding.jms.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/resources/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/main/resources/META-INF/sca/extension.composite delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/GreetingService.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/GreetingServiceImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/HelloworldService.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/HelloworldServiceImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/IntroService.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/IntroServiceImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/JMSBindingLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/JMSBindingTestCaseX.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/JMSProxyTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/databinding/JmsTransformerTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/test/resources/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/jms/binding/src/test/resources/wsdl/helloworld.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/jms/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/src/main/java/helloworld/HelloWorldImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/src/main/java/helloworld/HelloWorldService.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/src/main/resources/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/src/test/java/helloworld/HelloWorldJmsClient.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/src/main/java/helloworld/HelloWorldImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/src/main/java/helloworld/HelloWorldService.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/src/main/resources/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/src/test/java/helloworld/HelloWorldJmsServer.java delete mode 100644 branches/sca-java-integration/sca/extensions/jms/samples/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/.ruleset delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingBuilder.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingDefinition.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingLoader.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCEntryPointServlet.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCServiceBinding.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/ScriptGetterServlet.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/util/JavaToSmd.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/resources/META-INF/sca/binding.jsonrpc.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/resources/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/resources/META-INF/sca/extension.composite delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/resources/org/apache/tuscany/binding/jsonrpc/jsonrpc.js delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingBuilderTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCEntryPointServletTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCServiceTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/ScriptGetterServletTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/TestInterface.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/util/JavaToSmdTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/.ruleset delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/build.xml delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/java/helloworldjsonrpc/HelloWorldService.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/java/helloworldjsonrpc/HelloWorldServiceImpl.java delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/HelloWorldJSONRPC.html delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/META-INF/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/META-INF/NOTICE delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/WEB-INF/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/WEB-INF/web.xml delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/style.css delete mode 100644 branches/sca-java-integration/sca/extensions/jsonrpc/samples/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/.ruleset delete mode 100755 branches/sca-java-integration/sca/extensions/script/container.bsf/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/NOTICE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptComponent.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptComponentBuilder.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptComponentType.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptComponentTypeLoader.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementation.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementationJavaScriptLoader.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementationLoader.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementationPythonLoader.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementationRubyLoader.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptInstance.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptInstanceFactory.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptTargetInvoker.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/resources/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/resources/META-INF/sca/extension.composite delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/resources/META-INF/sca/script.system.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptComponentBuilderTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptComponentTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptComponentTypeLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptComponentTypeTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptImplementationLoaderLoadingTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptImplementationLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptImplementationTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptInstanceFactoryTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptInstanceTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptInvokerTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/mock/MockBSFEngine.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/resources/org/apache/tuscany/container/script/foo.componentType delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/resources/org/apache/tuscany/container/script/foo.mock delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/resources/org/apache/tuscany/container/script/helper/foo.componentType delete mode 100644 branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/resources/org/apache/tuscany/container/script/helper/foo.mock delete mode 100644 branches/sca-java-integration/sca/extensions/script/databinding.e4x/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/script/databinding.e4x/NOTICE.txt delete mode 100644 branches/sca-java-integration/sca/extensions/script/databinding.e4x/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/E4X2OMElement.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/E4X2Object.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/E4XDataBinding.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/E4XWrapperHandler.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/OMElement2E4X.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/Object2E4X.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/resources/META-INF/sca/databinding.e4x.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/resources/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/resources/META-INF/sca/extension.composite delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/pom.xml delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/java/calculator/CalculatorService.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/java/calculator/DivideService.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/java/helloworld/HelloWorldService.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/META-INF/sca/helloworld.composite delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/META-INF/sca/properties.composite delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/META-INF/sca/references.composite delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/META-INF/sca/xml.composite delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/CalculatorImpl.componentType delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/CalculatorImpl.py delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/CalculatorImpl.rb delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/DivideImpl.componentType delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/DivideImpl.py delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/DivideImpl.rb delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/sample.calculator.composite delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.componentType delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.groovy delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.js delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.py delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.rb delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworld.componentType delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworld.js delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworld.py delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworld.rb delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworldDyn.componentType delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworldDyn.js delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworldDyn.py delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworldDyn.rb delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/references/helloworldProxy.componentType delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/references/helloworldProxy.js delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/references/helloworldProxy.py delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/references/helloworldProxy.rb delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/wsdl/helloworld.wsdl delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworld.componentType delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworld.js delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworldXML.componentType delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworldXML.js delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworldXMLProxy.componentType delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworldXMLProxy.js delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/test/java/calculator/CalculatorClientTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/HelloWorldClientTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/JavaScriptPropertiesTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/PythonPropertiesTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/ReferencesTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/RubyPropertiesTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/XMLTestCase.java delete mode 100644 branches/sca-java-integration/sca/extensions/script/pom.xml delete mode 100644 branches/sca-java-integration/sca/kernel/api/.checkstyle delete mode 100644 branches/sca-java-integration/sca/kernel/api/.pmd delete mode 100644 branches/sca-java-integration/sca/kernel/api/.ruleset delete mode 100644 branches/sca-java-integration/sca/kernel/api/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/kernel/api/NOTICE.txt delete mode 100644 branches/sca-java-integration/sca/kernel/api/pom.xml delete mode 100644 branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/SCARuntime.java delete mode 100644 branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/TuscanyException.java delete mode 100644 branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/TuscanyRuntimeException.java delete mode 100644 branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/DataType.java delete mode 100644 branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/IDLMapping.java delete mode 100644 branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/LogLevel.java delete mode 100644 branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/Monitor.java delete mode 100644 branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/Resource.java delete mode 100644 branches/sca-java-integration/sca/kernel/api/src/test/java/org/apache/tuscany/api/TuscanyExceptionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/api/src/test/java/org/apache/tuscany/api/TuscanyRuntimeExceptionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/.checkstyle delete mode 100644 branches/sca-java-integration/sca/kernel/core/.pmd delete mode 100644 branches/sca-java-integration/sca/kernel/core/.ruleset delete mode 100644 branches/sca-java-integration/sca/kernel/core/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/kernel/core/NOTICE.txt delete mode 100644 branches/sca-java-integration/sca/kernel/core/pom.xml delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/AbstractLocalTargetInvoker.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalBindingBuilder.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalBindingDefinition.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalBindingLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvoker.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalReferenceBinding.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalServiceBinding.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalTargetInvoker.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/Bootstrapper.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultBootstrapper.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultRuntime.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultSCARuntime.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/BuilderRegistryImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/IllegalCallbackException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/IncompatibleInterfacesException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/InvalidTargetTypeException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/NoCompatibleBindingsException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/NoConversationalContractException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/NoRegisteredBuilderException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/TargetServiceNotFoundException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/WireConnectException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/WirePostProcessorRegistryImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/WiringExceptionFormatter.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/ComponentContextImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/ScopeIdentifier.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/WorkContextImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/AbstractEvent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/AbstractRequestEvent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/CompositeEvent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/CompositeStart.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/CompositeStop.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/ConversationEnd.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/ConversationStart.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/ConversationalEvent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpRequestEnded.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpRequestStart.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpSessionEnd.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpSessionEvent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpSessionStart.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/RequestEnd.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/RequestEvent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/RequestStart.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/AbstractScopeContainer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/CompositeScopeContainer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/CompositeScopeObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/ConversationalScopeObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/HttpSessionScopeContainer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/HttpSessionScopeObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/InstanceWrapper.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/InstanceWrapperImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/RequestScopeContainer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/RequestScopeObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/ScopeRegistryImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/StatelessScopeContainer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/StatelessScopeObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingInteceptor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingJavaInterfaceProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingRegistryImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingWirePostProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataTypeLoader.java delete mode 100755 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DirectedGraph.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/Exception2ExceptionTransformer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/Group2GroupTransformer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/GroupDataBinding.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/Input2InputTransformer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/MediatorImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/Output2OutputTransformer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueInterceptor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessor.java delete mode 100755 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PipedTransformer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/SimpleDataBinding.java delete mode 100755 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/TransformationContextImpl.java delete mode 100755 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/TransformerRegistryImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/DOMNode2JavaBeanTransformer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/Java2XMLMapperException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/JavaBean2DOMNodeTransformer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/JavaBean2XMLStreamReader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/JavaBean2XMLTransformer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/JavaBeansDataBinding.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/XML2JavaBeanTransformer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/XML2JavaMapperException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/BeanUtil.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/DOMDataBinding.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/DOMWrapperHandler.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/DOMXMLStreamReader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/DelegatingNamespaceContext.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/InputSource2Node.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/InputSource2SAX.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/InputStream2Node.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/InputStream2SAX.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/NameValueArrayStreamReader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/NameValuePairStreamReader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/NamedProperty.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/NilElementStreamReader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Node2OutputStream.java delete mode 100755 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Node2String.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Node2Writer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Node2XMLStreamReader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Reader2Node.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Reader2SAX.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/SAX2DOM.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/SAX2DOMPipe.java delete mode 100755 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Source2ResultTransformer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/StAX2SAXAdapter.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/StAXDataBinding.java delete mode 100755 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/StAXHelper.java delete mode 100755 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/StreamDataPipe.java delete mode 100755 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/String2Node.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/String2SAX.java delete mode 100755 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/String2XMLStreamReader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/WrappingXMLStreamReader.java delete mode 100755 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Writer2ReaderDataPipe.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/XMLDocumentStreamReader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/XMLFragmentStreamReader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/XMLFragmentStreamReaderImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/XMLGroupDataBinding.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/XMLStreamReader2Node.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/XMLStreamReader2SAX.java delete mode 100755 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/XMLStreamReader2String.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/XMLStreamSerializer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/XMLStreamable.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/XMLStringDataBinding.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/deployer/AbstractDeploymentContext.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/deployer/ChildDeploymentContext.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/deployer/RootDeploymentContext.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/deployer/federation/FederatedDeployer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/idl/java/IllegalCallbackException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/idl/java/InterfaceJavaLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/idl/java/JavaInterfaceProcessorRegistryImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/IntrospectionRegistryImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/PojoAtomicComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/PojoConfiguration.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/AbstractCompositeBuilder.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/AbstractCompositeComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/AbstractCompositeContext.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/ComponentTimeoutException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/CompositeBuilder.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/CompositeComponentImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/CompositeComponentTypeLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/CompositeLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/Dependency.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/ImplementationCompositeLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/ManagedRequestContext.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/ReferenceImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/ServiceImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/SystemCompositeBuilder.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/composite/SystemSingletonAtomicComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/java/JavaAtomicComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/java/JavaComponentBuilder.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/java/JavaComponentTypeLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/java/JavaImplementation.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/java/JavaImplementationLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/java/JavaTargetInvoker.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/AllowsPassByReferenceProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/AmbiguousConstructorException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ConstructorProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ContextProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ConversationProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/DestroyProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/DuplicateConstructorException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/DuplicateDestructorException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/DuplicateInitException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/DuplicateReferenceException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/DuplicateResourceException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/EagerInitProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/HeuristicPojoProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalCallbackReferenceException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalContextException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalDestructorException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalInitException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalReferenceException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalResourceException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/IllegalServiceDefinitionException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InitProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidAutowireException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidConstructorException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidConversationalImplementation.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidPropertyException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidReferenceException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidResourceException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/InvalidServiceType.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/MonitorProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/NoConstructorException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/PropertyProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ReferenceProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ResourceProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ScopeProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ServiceProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/ServiceTypeNotFoundException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/UnknownContextTypeException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/system/builder/SystemComponentBuilder.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/system/component/SystemAtomicComponentImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/system/loader/SystemComponentTypeLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/system/loader/SystemCompositeComponentTypeLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/system/loader/SystemImplementationLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/system/model/SystemCompositeImplementation.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/system/model/SystemImplementation.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/ArrayMultiplicityObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/CallbackWireObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/CompositeContextObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/ContextInjector.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/ConversationIDObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/EventInvoker.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/FieldInjector.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/InjectionRuntimeException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/Injector.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/InvalidAccessorException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/InvalidResourceTypeException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/JNDIListObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/JNDIObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/ListMultiplicityObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/MethodEventInvoker.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/MethodInjector.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/NoAccessorException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/NoMultiplicityTypeException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/ObjectCallbackException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/PojoObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/RequestContextObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/ResourceNotFoundException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/ResourceObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/SingletonListObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/injection/SingletonObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/launcher/CompositeContextImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/launcher/LaunchException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/launcher/LauncherImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/launcher/LauncherRuntimeInfo.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/ComponentLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/ComponentTypeElementLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/DefaultPropertyValueLoaderException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/DependencyLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/IncludeLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/JNDIPropertyFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/LoaderExceptionFormatter.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/LoaderRegistryImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/ManyPropertyValueLoaderException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/MissingTypePropertyLoaderException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/PolicySetLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/PropertyLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/PropertyLoaderException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/ReferenceLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/ServiceLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/StringParserPropertyFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/WireLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/marshaller/ComponentDefinitionMarshaller.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/monitor/DefaultExceptionFormatter.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/monitor/InvalidLevelException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/monitor/JavaLoggingMonitorFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/monitor/MonitorFactoryUtil.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/monitor/NullMonitorFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/policy/IntentRegistryImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/policy/PolicyBuilderRegistryImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/policy/PolicyEngineImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/policy/PolicyHelper.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/property/PropertyHelper.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/property/PropertyObjectFactoryImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/property/SimpleMultivaluedPropertyObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/property/SimplePropertyObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/runtime/AbstractRuntime.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/runtime/mini/SimpleRuntime.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/runtime/mini/SimpleRuntimeImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/runtime/mini/SimpleRuntimeInfo.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/runtime/mini/SimpleRuntimeInfoImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/artifact/LocalMavenRepository.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ArtifactResolverRegistryImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/AssemblyServiceImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionDirectoryWatcher.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionProcessorRegistryImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionRepositoryImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionServiceImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/DomainUpdateException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/InvalidContributionMetadataException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/InvalidDocumentException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/XMLChangeSetHandler.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/CompositeContributionProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/FolderContributionProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/InvalidComponentDefinitionlException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/InvalidFolderContributionURIException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/InvalidPojoComponentDefinitionlException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/JarContributionProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/JavaContributionProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/MetadataContributionProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/resolver/ComponentDefinitionArtifactResolver.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/extension/AbstractExtensionDeployer.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/host/DelegatingResourceHostRegistry.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/store/memory/MemoryStore.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/work/jca/JcaWorkScheduler.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/work/jsr237/Jsr237WorkScheduler.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/work/jsr237/workmanager/DefaultWorkEvent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/work/jsr237/workmanager/DefaultWorkItem.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/work/jsr237/workmanager/ThreadPoolWorkManager.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/test/SCATestCaseRunner.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/util/ClassLoaderHelper.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/util/FileHelper.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/util/IOHelper.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/util/JavaIntrospectionHelper.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/util/ReferenceLoaderHelper.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/BridgingInterceptor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/CallbackInterfaceInterceptor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/InboundInvocationChainImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/InboundWireImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/IncompatibleServiceContractExceptionFormatter.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/InvocationChainImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/InvokerInterceptor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/LoopBackWire.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/NoMethodForOperationException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/NonBlockingBridgingInterceptor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/OptimizedWireObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/OutboundInvocationChainImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/OutboundWireImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/SynchronousBridgingInterceptor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/WireObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/WireServiceExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/WireUtils.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKCallbackInvocationHandler.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKInboundInvocationHandler.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKOutboundInvocationHandler.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKWireService.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/resources/META-INF/tuscany/default-system.composite delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/composite.scdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/databinding.scdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/deployment.scdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/formatters.scdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/implementation.scdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/interfaceJava.scdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/javaImplementation.scdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/loader.scdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/systemImplementation.scdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/binding/local/AbstractLocalTargetInvokerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/binding/local/LocalBindingBuilderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/binding/local/LocalBindingLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvokerInvocationExceptionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvokerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvokerThrowableTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/binding/local/LocalTargetInvokerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/bootstrap/BootstrapperTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/AbstractConnectorImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/AtomicConnectorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryNoBindingsTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ConnectorImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ConnectorPostProcessTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/IllegalCallbackExceptionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/InboundtoOutboundConnectTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/IncompatibleInterfacesExceptionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/InvalidTargetTypeExceptionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/LocalReferenceWiringTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/NonBlockingForwardNonBlockingCallbackConnectionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/NonBlockingForwardSyncCallbackConnectionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/OutboundToInboundConnectTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ReferenceConnectorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ServiceConnectorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/SynchronousForwardCallbackConnectionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/TargetServiceNotFoundExceptionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/WirePostProcessorRegistryImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/WiringExceptionFormatterTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/WorkContextImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/event/EventTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/AbstractScopeContainerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicCompositeScopeTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicConversationalScopeTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicHttpSessionScopeTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicRequestScopeTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/BasicStatelessScopeTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeInitDestroyErrorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeInstanceLifecycleTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeObjectFactoryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/CompositeScopeRestartTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerDestroyOnExpirationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerMaxAgeTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerMaxIdleTimeTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainerPersistenceTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeInstanceLifecycleTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/ConversationalScopeRestartTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/DependencyLifecycleTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/HttpSessionScopeInitDestroyErrorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/HttpSessionScopeInstanceLifecycleTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/HttpSessionScopeRestartTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/InstanceWrapperTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/MockFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/RequestScopeInitDestroyErrorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/RequestScopeInstanceLifecycleTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/RequestScopeRestartTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/ScopeRegistryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/StatelessScopeContainerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/StatelessScopeObjectFactoryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/component/scope/WorkContextTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/DataBindingInterceptorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/DataBindingJavaInterfaceProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/DataBindingLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/DataBindingRegistryImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/DataBindingTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/DataBindingWirePostProcessorOptimizationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/DataBindingWirePostProcessorTestCase.java delete mode 100755 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/DirectedGraphTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/IDLTransformerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/MediatorImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/PassByValueInterceptorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/TransformerRegistryImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/javabeans/DOMNode2JavaBeanTransformerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/javabeans/JavaBean2DOMNodeTransformerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/xml/DOM2StAXTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/xml/DataPipeTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/xml/JavaBean2XMLStreamReaderTestCase.java delete mode 100755 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/xml/Node2StringTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/xml/PushTransformationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/xml/StAXHelperTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/xml/TraxTransformerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/deployer/BootstrapDeployerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/idl/java/ConversationalIntrospectionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/idl/java/JavaInterfaceProcessorRegistryImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/IntrospectionRegistryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/PojoAtomicComponentTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/TestUtils.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/AutowireResolutionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/AutowireTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/CompositeBuilderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/CompositeComponentImplBasicTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/CompositeComponentImplSystemWireTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/CompositeComponentImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/CompositeComponentResolutionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/CompositeLifecycleTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/CompositeLoaderWireResolutionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/CompositePropagationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/DuplicateRegistrationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/ImplementationCompositeLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/JavaObjectRegistrationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/ManagedRequestContextTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/ReferenceImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/ServiceImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/SystemComponentBuilderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/composite/SystemSingletonAtomicComponentTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/JavaAtomicComponentMetadataInjectionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/JavaAtomicComponentNegativeMetadataTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/JavaBuilderPropertyTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/JavaComponentBuilderConversationIDTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/JavaComponentBuilderMetadataTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/JavaComponentBuilderReferenceTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/JavaComponentBuilderResourceTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/JavaComponentTypeLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/JavaReferenceWireTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/JavaTargetInvokerBasicInvocationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/JavaTargetInvokerMediationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/JavaTargetInvokerNonBlockingInvocationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/JavaTargetInvokerSequenceTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/JavaTargetInvokerStatelessDestroyTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/JavaTargetInvokerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/MultiplicityTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/ResourceInjectionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/integration/CallbackInvocationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/integration/OutboundWireToJavaTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/AllowsPassByReferenceProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ConstructorAutowireTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ConstructorProcessorExtensibilityTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ConstructorProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ConstructorPropertyTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ConstructorReferenceTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ConstructorResourceTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ContextProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ConversationProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ConvertTimeMillisTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/DestroyProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/EagerInitProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicAndPropertyTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicConstructorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeuristicPojoProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/HeutisticExtensibleConstructorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ImplementationProcessorServiceUniqueTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/InitProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/MonitorProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/PropertyProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ReferenceProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ResourceProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ScopeProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ServiceCallbackTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/ServiceProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/system/builder/SystemComponentBuilderResourceTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemAtomicComponentTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/system/component/SystemAtomicComponentWireInvocationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/system/loader/SystemComponentTypeLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/system/loader/SystemImplementationLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/injection/CallbackWireObjectFactoryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/injection/FieldInjectorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/injection/JNDIObjectFactoryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/injection/MethodEventInvokerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/injection/MethodInjectorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/injection/PojoObjectFactoryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/injection/RequestContextObjectFactoryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/injection/ResourceObjectFactoryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/injection/SingletonObjectFactoryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/integration/conversation/AbstractConversationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/integration/conversation/ConversationIdleExpireTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/integration/conversation/ConversationMaxAgeExpireTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/integration/conversation/ConversationStartStopEndTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/integration/implementation/IntrospectionRegistryIntegrationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/integration/implementation/system/builder/SystemBuilderPropertyTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/integration/mock/MockFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/integration/scope/ScopeReferenceTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/integration/wire/DifferentInterfaceWireTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/integration/wire/ReferenceInjectionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/integration/wire/oneway/OneWayWireToJavaInvocationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/ComponentLoaderNoBindingTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/ComponentLoaderPropertyTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/ComponentLoaderReferenceTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/ComponentLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/ComponentLoaderValidationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/ComponentReferenceOverridingTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/ComponentTypeElementLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/DependencyLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/IncludeLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/JNDIPropertyFactoryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/LoaderExceptionFormatterTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/MultivaluePropertyLoadingTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/PolicySetLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/PropertyLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/PropertyParsingTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/ReferenceLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/ServiceLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/StAXLoaderRegistryImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/StringParserPropertyFactoryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/loader/WireLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/binding/MockServiceBinding.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/AsyncTarget.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/BadContextPojo.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/BadNamePojo.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/BasicInterface.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/BasicInterfaceImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeComponentImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeDestroyOnlyComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeInitDestroyComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/CompositeScopeInitOnlyComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeComponentImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeDestroyOnlyComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeInitDestroyComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/ConversationalScopeInitOnlyComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/OrderException.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/OrderedDependentPojo.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/OrderedDependentPojoImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/OrderedEagerInitPojo.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/OrderedInitPojo.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/OrderedInitPojoImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/OtherTarget.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/OtherTargetImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeDestroyOnlyComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeInitDestroyComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/RequestScopeInitOnlyComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeComponentImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeInitDestroyComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/SessionScopeInitOnlyComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/SimpleTarget.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/SimpleTargetImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/Source.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/SourceImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/StatelessComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/StatelessComponentImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/Target.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/component/TargetImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/wire/MockStaticInvoker.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/wire/MockSyncInterceptor.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/mock/wire/MockTargetInvoker.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/monitor/DefaultExceptionFormatterTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/monitor/JavaLoggingTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/policy/IntentRegistryImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/policy/PolicyEngineImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/property/PropertyHelperTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/property/SimplePropertyObjectFactoryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/artifact/LocalMavenRepositoryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/AssemblyServiceImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/ContributionLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/ContributionRepositoryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/ContributionServiceImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/contribution/CompositeContributionProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/contribution/FolderContributionProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/contribution/JarContributionProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/contribution/JavaContributionProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/host/DelegatingResourceHostRegistryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/store/memory/MemoryStoreTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/work/jsr237/Jsr237WorkSchedulerTest.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/work/jsr237/Jsr237WorkSchedulerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/work/jsr237/workmanager/ThreadPoolWorkManagerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/util/Bean1.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/util/Bean2.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/util/JavaIntrospectionHelperTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/util/SuperBean.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/BasicReferenceInvocationHandlerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/CallbackInterfaceInterceptorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/ContractCompatibilityTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/InboundInvocationErrorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/IncompatibleServiceContractExceptionFormatterTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/InvocationChainImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/InvocationConfigurationErrorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/InvocationConfigurationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/NonBlockingBridgingInterceptorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/OptimizedWireObjectFactoryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/OutboundInvocationErrorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/OutboundInvocationHandlerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/OutboundWireTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/SynchronousBridgingInterceptorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/WireObjectFactoryTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/WireOptimizationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/WireServiceExtensionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/WireUtilsTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKCallbackInvocationHandlerSerializationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKCallbackInvocationHandlerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKInboundInvocationHandlerSerializationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKInboundInvocationHandlerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKOutboundInvocationHandlerProxyTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKOutboundInvocationHandlerSerializationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKOutboundInvocationHandlerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKProxyTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/resources/deployables/sample-calculator.jar delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/resources/org/apache/tuscany/core/databinding/impl/ipo.xsd delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/resources/org/apache/tuscany/core/databinding/impl/order.wsdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/resources/org/apache/tuscany/core/databinding/xml/foo.xml delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/resources/org/apache/tuscany/core/deployer/boot1-include.scdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/resources/org/apache/tuscany/core/deployer/boot1.scdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/resources/org/apache/tuscany/core/deployer/boot2.scdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/resources/org/apache/tuscany/core/loader/TestPolicy.scdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/resources/org/apache/tuscany/core/loader/test-include.scdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/resources/org/apache/tuscany/core/policy/PolicySet.scdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/resources/org/apache/tuscany/core/property/ipo.xml delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/resources/org/apache/tuscany/core/services/deployment/test.ext delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/resources/org/apache/tuscany/core/services/deployment/test.scdl delete mode 100644 branches/sca-java-integration/sca/kernel/core/src/test/resources/repository/sample-calculator.jar delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/.checkstyle delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/.pmd delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/.ruleset delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/NOTICE.txt delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/pom.xml delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/AbstractRuntimeInfo.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/MonitorFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/RuntimeInfo.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/AssemblyService.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContentTypes.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionProcessorException.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/DeploymentException.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/UnsupportedContentTypeException.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/launcher/Launcher.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/management/ManagementService.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/monitor/ExceptionFormatter.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/monitor/FormatterRegistry.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/rmi/RMIHost.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/rmi/RMIHostAdmin.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/rmi/RMIHostException.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/rmi/RMIHostRuntimeException.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/runtime/InitializationException.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/runtime/ShutdownException.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/runtime/TuscanyRuntime.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/servlet/ServletRequestInjector.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/test/java/org/apache/tuscany/host/rmi/RMIHostExceptionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/host-api/src/test/java/org/apache/tuscany/host/rmi/RMIHostRuntimeExceptionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/pom.xml delete mode 100644 branches/sca-java-integration/sca/kernel/spi/.checkstyle delete mode 100644 branches/sca-java-integration/sca/kernel/spi/.pmd delete mode 100644 branches/sca-java-integration/sca/kernel/spi/.ruleset delete mode 100644 branches/sca-java-integration/sca/kernel/spi/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/kernel/spi/NOTICE.txt delete mode 100644 branches/sca-java-integration/sca/kernel/spi/pom.xml delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/doc/Context Model.emx delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/AbstractLifecycle.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/CoreRuntimeException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/InvalidNameException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/Lifecycle.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/ObjectCreationException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/ObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/QualifiedName.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/annotation/Autowire.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/bootstrap/ComponentNames.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/bootstrap/RuntimeComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/BindingBuilder.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/Builder.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/BuilderConfigException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/BuilderException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/BuilderInstantiationException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/BuilderRegistry.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/ComponentBuilder.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/Connector.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/GenericBuilder.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/InvalidServiceInterfaceException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/MissingWireTargetException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/ScopeNotFoundException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/WiringException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/AbstractSCAObject.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/AtomicComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/Component.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ComponentException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ComponentRegistrationException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ComponentRuntimeException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/CompositeComponent.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/DuplicateNameException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/IllegalTargetException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/InvalidAutowireInterface.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/InvalidConversationSequenceException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/PersistenceException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/PrepareException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ReactivationException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/Reference.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ReferenceBinding.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/SCAExternalizable.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/SCAObject.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/SCAObjectStartException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/SCAObjectStopException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ScopeContainer.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ScopeContainerMonitor.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ScopeRegistry.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/Service.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ServiceBinding.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/TargetDestructionException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/TargetException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/TargetInitializationException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/TargetInvocationException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/TargetInvokerCreationException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/TargetNotFoundException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/TargetResolutionException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/WorkContext.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataBinding.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataBindingRegistry.java delete mode 100755 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/DataPipe.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/ExceptionHandler.java delete mode 100755 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/Mediator.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/PullTransformer.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/PushTransformer.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/SimpleTypeMapper.java delete mode 100755 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/TransformationContext.java delete mode 100755 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/TransformationException.java delete mode 100755 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/Transformer.java delete mode 100755 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/TransformerRegistry.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/WrapperHandler.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DOMHelper.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/Java2SimpleTypeTransformer.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/SimpleType2JavaTransformer.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/SimpleTypeMapperExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/TransformerExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/databinding/extension/XSDDataTypeConverter.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ArtifactResolver.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ArtifactResolverRegistry.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ChangeSetHandler.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ChangeSetHandlerRegistry.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/CompositeClassLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ContentType.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ContentTypeDescriber.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ContributionProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ContributionProcessorRegistry.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ContributionRepository.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/Deployer.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/DeploymentContext.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/DeploymentMonitor.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/event/AbstractEventPublisher.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/event/Event.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/event/EventFilter.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/event/EventPublisher.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/event/RuntimeEventListener.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/event/TrueFilter.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/AbstractComponentExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/ArtifactResolverExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/AtomicComponentExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/BindingBuilderExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/ComponentBuilderExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/ComponentTypeLoaderExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/CompositeComponentExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/ContributionProcessorExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/ExecutionMonitor.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/GenericBuilderExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/LoaderExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/ReferenceBindingExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/ServiceBindingExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/SystemAtomicComponentExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/TargetInvokerExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/host/ResourceHost.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/host/ResourceHostRegistry.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/host/ResourceResolutionException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/host/ServletHost.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/ElementInfo.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/InvalidConversationalOperationException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/InvalidServiceContractException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/OverloadedOperationException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/ServiceFaultException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/TypeInfo.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/XMLType.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/java/InterfaceJavaIntrospector.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/java/JavaIDLUtils.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/java/JavaInterfaceProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/java/JavaInterfaceProcessorExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/java/JavaInterfaceProcessorRegistry.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/java/JavaServiceContract.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/AbstractPropertyProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/ConstructorDefinition.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/DuplicatePropertyException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/IllegalPropertyException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/ImplementationProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/ImplementationProcessorExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/ImplementationProcessorService.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/IntrospectionRegistry.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/Introspector.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/JavaMappedComponentType.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/JavaMappedProperty.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/JavaMappedReference.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/JavaMappedService.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/PojoComponentType.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/ProcessingException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/Resource.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/ComponentTypeLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/DuplicateReferenceNameException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/IncompatibleOverridingServiceContractException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/InvalidConfigurationException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/InvalidPromotedReferenceException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/InvalidReferenceException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/InvalidServiceException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/InvalidValueException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/InvalidWireException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/Loader.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/LoaderException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/LoaderRegistry.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/LoaderUtil.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/MissingImplementationException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/MissingIncludeException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/MissingMustOverridePropertyException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/MissingPropertyValueException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/MissingReferenceException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/MissingResourceException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/MissingSideFileException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/NotOverridablePropertyException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/PropertyObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/ReferenceMultiplicityOverridingException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/ReferenceMultiplicityViolationException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/StAXElementLoader.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/UndefinedPropertyException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/UndefinedReferenceException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/UnrecognizedComponentTypeException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/UnrecognizedElementException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/marshaller/MarshalException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/marshaller/ModelMarshaller.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/AbstractReferenceDefinition.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/AtomicImplementation.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/BindingDefinition.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/ComponentDefinition.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/ComponentReferenceDefinition.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/ComponentType.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/ComponentTypeReferenceDefinition.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/CompositeComponentType.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/CompositeImplementation.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/CompositeReferenceDefinition.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Contribution.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/ContributionImport.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/DataType.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/DeployedArtifact.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Implementation.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Include.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Intent.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/IntentMap.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/IntentName.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/InteractionScope.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/ModelObject.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Multiplicity.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Operation.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/OverrideOptions.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/PolicyAttachable.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/PolicyAttachableModel.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/PolicyContentModel.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/PolicyModel.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/PolicySet.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/PolicySetReference.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Property.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/PropertyValue.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Qualifier.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/ReferenceTarget.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Scope.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/ServiceContract.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/ServiceDefinition.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/WSPolicyAttachment.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/WireDefinition.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/WrapperInfo.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/IntentRegistry.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/PolicyBuilderRegistry.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/PolicyEngine.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/PolicySetContainer.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/SCATypeManager.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/SourcePolicyBuilder.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/SourcePolicyBuilderExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/TargetPolicyBuilder.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/TargetPolicyBuilderExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/resolver/ResolutionException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/resolver/Resolver.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/resolver/ResolverRegistry.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/VoidService.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/artifact/Artifact.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/artifact/ArtifactRepository.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/discovery/AbstractDiscoveryService.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/discovery/DiscoveryException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/discovery/DiscoveryService.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/discovery/RequestListener.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/discovery/ResponseListener.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/management/TuscanyManagementService.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/store/DuplicateRecordException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/store/RecoveryListener.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/store/Store.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/store/StoreException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/store/StoreExpirationEvent.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/store/StoreMonitor.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/store/StoreReadException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/store/StoreWriteException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/work/NotificationListener.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/work/WorkScheduler.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/services/work/WorkSchedulerException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/util/SCAObjectInputStream.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/util/stax/StaxUtil.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/AbstractInboundInvocationHandler.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/AbstractOutboundInvocationHandler.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/InboundInvocationChain.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/InboundWire.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/IncompatibleServiceContractException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/Interceptor.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/InvocationChain.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/InvocationRuntimeException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/Message.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/MessageId.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/MessageImpl.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/OutboundChainHolder.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/OutboundInvocationChain.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/OutboundWire.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/ProxyCreationException.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/TargetInvoker.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/Wire.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WireInvocationHandler.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WireObjectFactory.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WirePostProcessor.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WirePostProcessorExtension.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WirePostProcessorRegistry.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WireService.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/AssertionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/QualifiedNameTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/TuscanyRuntimeExceptionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/annotation/ConstructorAnnotationTest.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/component/AbstractSCAObjectTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/DOMHelperTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/DataBindingExtensionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/SimpleTypeMapperExtensionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/TransformerExtensionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/databinding/extension/XSDDataTypeConverterTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/event/AbstractEventPublisherTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/AtomicComponentExtensionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/ComponentTypeLoaderExtensionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/CompositeComponentExtensionAutowireTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/CompositeComponentExtensionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/LoaderExtensionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/ReferenceBindingExtensionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/ReferenceTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/ServiceBindingExtensionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/TargetInvokerExtensionSequenceTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/TargetInvokerExtensionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/idl/java/JavaIDLUtilsTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/implementation/java/AbstractPropertyProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/loader/LoaderExceptionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/model/CompositeComponentTypeTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/model/IntentNameTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/model/OperationTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/model/ScopeTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/model/ServiceContractTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/policy/SourcePolicyBuilderExtensionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/policy/TargetPolicyBuilderExtensionTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/util/MockSCAExternalizable.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/util/MockSerializable.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/util/SCAObjectInputStreamTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/util/stax/StaxUtilTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/wire/AbstractInboundInvocationHandlerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/wire/AbstractOutboundInvocationHandlerTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/wire/OutboundChainHolderTestCase.java delete mode 100644 branches/sca-java-integration/sca/kernel/spi/src/test/resources/test.scdl delete mode 100644 branches/sca-java-integration/sca/pom.xml delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/.ruleset delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/NOTICE.txt delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/pom.xml delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/JAXB2Node.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/JAXBContextHelper.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/JAXBDataBinding.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/JAXBExceptionHandler.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/JAXBWrapperHandler.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/JAXWSJavaInterfaceProcessor.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/Node2JAXB.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/Reader2JAXB.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/main/java/org/apache/tuscany/databinding/jaxb/XMLStreamReader2JAXB.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/main/resources/META-INF/sca/databinding.jaxb.scdl delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/main/resources/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/main/resources/META-INF/sca/extension.composite delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBDataBindingTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBExceptionHandlerTestCase.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/JAXBWrapperHandlerTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/test/java/org/apache/tuscany/databinding/jaxb/fault/InvalidSymbolFault_Exception.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-jaxb/src/test/resources/ipo.xsd delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-json/.ruleset delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-json/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-json/NOTICE.txt delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-json/pom.xml delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-json/src/main/java/org/apache/tuscany/databinding/json/JSON2XMLStreamReader.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-json/src/main/java/org/apache/tuscany/databinding/json/JSONDataBinding.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-json/src/main/java/org/apache/tuscany/databinding/json/XMLStreamReader2JSON.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-json/src/main/java/org/apache/tuscany/databinding/json/XMLStreamSerializer.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-json/src/main/java/org/apache/tuscany/databinding/json/axiom/JSON2OMElement.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-json/src/main/java/org/apache/tuscany/databinding/json/axiom/JSONBadgerfishDataSource.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-json/src/main/java/org/apache/tuscany/databinding/json/axiom/JSONDataSource.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-json/src/main/resources/META-INF/sca/databinding.json.scdl delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-json/src/main/resources/META-INF/sca/extension.composite delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-json/src/test/java/org/apache/tuscany/databinding/json/JSONTransformerTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-json/src/test/resources/ipo.xsd delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/.checkstyle delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/.ruleset delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/NOTICE.txt delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/pom.xml delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/src/main/java/org/apache/tuscany/databinding/sdo2om/DataObject2OMElement.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/src/main/java/org/apache/tuscany/databinding/sdo2om/DataObjectSerializer.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/src/main/java/org/apache/tuscany/databinding/sdo2om/SDODataSource.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/src/main/java/org/apache/tuscany/databinding/sdo2om/XMLDocument2OMElement.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/src/main/resources/META-INF/sca/databinding.sdo-axiom.scdl delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/src/main/resources/META-INF/sca/extension.composite delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/src/test/java/org/apache/tuscany/databinding/sdo2om/DataObject2OMElementTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/src/test/java/org/apache/tuscany/databinding/sdo2om/MockTransformationContext.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/src/test/java/org/apache/tuscany/databinding/sdo2om/SDOTransformerTestCaseBase.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/src/test/java/org/apache/tuscany/databinding/sdo2om/XMLDocument2OMElementTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/src/test/resources/ipo.xsd delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo-axiom/src/test/resources/stock.xsd delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/.checkstyle delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/.ruleset delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-sdo/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/NOTICE.txt delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-sdo/pom.xml delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/DataObject2String.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/DataObject2XMLStreamReader.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/DataObjectLoader.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/ImportSDO.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/ImportSDOBuilder.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/ImportSDOLoader.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/ModelDataObject.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/SDOContextHelper.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/SDODataBinding.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/SDOExceptionHandler.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/SDOHelperContext.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/SDOSimpleTypeMapper.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/SDOWrapperHandler.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/String2DataObject.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/XMLDocument2String.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/XMLDocument2XMLStreamReader.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/XMLStreamReader2DataObject.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/java/org/apache/tuscany/databinding/sdo/XMLStreamReader2XMLDocument.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/resources/META-INF/sca/databinding.sdo.scdl delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/resources/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/main/resources/META-INF/sca/extension.composite delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/java/com/example/stock/sdo/fault/InvalidSymbolFault_Exception.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/java/org/apache/tuscany/databinding/sdo/DataObject2StringTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/java/org/apache/tuscany/databinding/sdo/DataObject2XMLStreamReaderTestCase.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/java/org/apache/tuscany/databinding/sdo/DataObjectLoaderTestCase.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/java/org/apache/tuscany/databinding/sdo/ImportSDOLoaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/java/org/apache/tuscany/databinding/sdo/SDODataBindingTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/java/org/apache/tuscany/databinding/sdo/SDOExceptionHandlerTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/java/org/apache/tuscany/databinding/sdo/SDOTransformerTestCaseBase.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/java/org/apache/tuscany/databinding/sdo/SDOWrapperHandlerTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/java/org/apache/tuscany/databinding/sdo/XMLDocument2XMLStreamReaderTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/resources/META-INF/tuscany/databinding.sdo.scdl delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/resources/ipo.xsd delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/resources/model/sca-core.xsd delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/resources/model/sca-implementation-mock.xsd delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/resources/stock.xsd delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/resources/wrapper.xml delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-sdo/src/test/resources/wrapper.xsd delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-xmlbeans/.ruleset delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-xmlbeans/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-xmlbeans/NOTICE.txt delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-xmlbeans/pom.xml delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-xmlbeans/src/main/java/org/apache/tuscany/databinding/xmlbeans/Node2XmlObject.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-xmlbeans/src/main/java/org/apache/tuscany/databinding/xmlbeans/XMLBeansDataBinding.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-xmlbeans/src/main/java/org/apache/tuscany/databinding/xmlbeans/XMLStreamReader2XmlObject.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-xmlbeans/src/main/java/org/apache/tuscany/databinding/xmlbeans/XmlObject2Node.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-xmlbeans/src/main/java/org/apache/tuscany/databinding/xmlbeans/XmlObject2XMLStreamReader.java delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-xmlbeans/src/main/resources/META-INF/sca/databinding.xmlbeans.scdl delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-xmlbeans/src/main/resources/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/services/databinding/databinding-xmlbeans/src/main/resources/META-INF/sca/extension.composite delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-xmlbeans/src/test/java/org/apache/tuscany/databinding/xmlbeans/XmlObjectTestCase.java delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-xmlbeans/src/test/resources/ipo.xsd delete mode 100755 branches/sca-java-integration/sca/services/databinding/databinding-xmlbeans/src/test/resources/ipo.xsdconfig delete mode 100644 branches/sca-java-integration/sca/services/databinding/pom.xml delete mode 100644 branches/sca-java-integration/sca/services/idl/pom.xml delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/.ruleset delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/NOTICE.txt delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/pom.xml delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/InterfaceWSDLIntrospector.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/InterfaceWSDLIntrospectorImpl.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/InterfaceWSDLLoader.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/InvalidFragmentException.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/InvalidWSDLContributionException.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/InvalidWSDLException.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/InvalidWSDLLocationException.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/NotSupportedWSDLException.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/UnresolveableResourceException.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLContributionProcessor.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistry.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistryImpl.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLLoader.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLLoaderException.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLLoaderImpl.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLLocation.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLOperation.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/WSDLServiceContract.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/XMLSchemaRegistry.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/XMLSchemaRegistryImpl.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/java/org/apache/tuscany/idl/wsdl/XSDContributionProcessor.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/resources/META-INF/sca/default.scdl delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/resources/META-INF/sca/extension.composite delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/main/resources/META-INF/sca/idl.wsdl.scdl delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/InterfaceWSDLIntrospectorImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLContributionProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLDefinitionRegistryTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLLoaderImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WSDLOperationTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/WrapperStyleOperationTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/XMLSchemaRegistryImplTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/test/java/org/apache/tuscany/idl/wsdl/XSDContributionProcessorTestCase.java delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/test/resources/org/apache/tuscany/idl/wsdl/example.wsdl delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/test/resources/org/apache/tuscany/idl/wsdl/invalid-stockquote.wsdl delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/test/resources/org/apache/tuscany/idl/wsdl/ipo.xsd delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/test/resources/org/apache/tuscany/idl/wsdl/stockquote.wsdl delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/test/resources/org/apache/tuscany/idl/wsdl/test1.wsdl delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/test/resources/org/apache/tuscany/idl/wsdl/test1.xsd delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/test/resources/org/apache/tuscany/idl/wsdl/test2.wsdl delete mode 100644 branches/sca-java-integration/sca/services/idl/wsdl/src/test/resources/org/apache/tuscany/idl/wsdl/unwrapped-stockquote.wsdl delete mode 100644 branches/sca-java-integration/sca/services/pom.xml delete mode 100644 branches/sca-java-integration/sca/services/transports/http.jetty/.ruleset delete mode 100644 branches/sca-java-integration/sca/services/transports/http.jetty/LICENSE.txt delete mode 100644 branches/sca-java-integration/sca/services/transports/http.jetty/NOTICE.txt delete mode 100644 branches/sca-java-integration/sca/services/transports/http.jetty/pom.xml delete mode 100644 branches/sca-java-integration/sca/services/transports/http.jetty/src/main/java/org/apache/tuscany/service/jetty/JettyLogger.java delete mode 100644 branches/sca-java-integration/sca/services/transports/http.jetty/src/main/java/org/apache/tuscany/service/jetty/JettyService.java delete mode 100644 branches/sca-java-integration/sca/services/transports/http.jetty/src/main/java/org/apache/tuscany/service/jetty/JettyServiceImpl.java delete mode 100644 branches/sca-java-integration/sca/services/transports/http.jetty/src/main/java/org/apache/tuscany/service/jetty/TransportMonitor.java delete mode 100644 branches/sca-java-integration/sca/services/transports/http.jetty/src/main/resources/META-INF/sca/http.jetty.scdl delete mode 100644 branches/sca-java-integration/sca/services/transports/http.jetty/src/main/resources/META-INF/sca/service.composite delete mode 100644 branches/sca-java-integration/sca/services/transports/http.jetty/src/test/java/org/apache/tuscany/service/jetty/JettyServiceImplTestCase.java (limited to 'branches/sca-java-integration/sca') diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/.ruleset b/branches/sca-java-integration/sca/extensions/axis2/binding/.ruleset deleted file mode 100644 index 70a035bc01..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/LICENSE.txt b/branches/sca-java-integration/sca/extensions/axis2/binding/LICENSE.txt deleted file mode 100644 index 0084319535..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/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-integration/sca/extensions/axis2/binding/NOTICE.txt b/branches/sca-java-integration/sca/extensions/axis2/binding/NOTICE.txt deleted file mode 100644 index d83ebbe236..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/NOTICE.txt +++ /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-integration/sca/extensions/axis2/binding/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/binding/pom.xml deleted file mode 100755 index d54d0558ad..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/pom.xml +++ /dev/null @@ -1,146 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2 - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - tuscany-axis2 - Apache Tuscany Binding for Axis2 - Implementation of the SCA Web Services binding using Axis2 - - - - org.apache.tuscany.sca.kernel - tuscany-spi - 0.1-integration-incubating-SNAPSHOT - compile - - - - org.apache.tuscany.sca.services.idl - tuscany-wsdl - ${scaKernelVersion} - compile - - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - - - org.apache.tuscany.sca.extensions.axis2 - databinding-axiom - ${extensionVersion} - runtime - - - - javax.servlet - servlet-api - 2.5 - - - - org.apache.axis2 - axis2-kernel - - - - org.apache.ws.commons.axiom - axiom-api - - - - org.apache.ws.commons.axiom - axiom-impl - - - - incubator-woden - woden - - - - org.codehaus.woodstox - wstx-asl - - - - commons-logging - commons-logging - - - - org.apache.neethi - neethi - - - - org.apache.ws.commons.schema - XmlSchema - - - - commons-httpclient - commons-httpclient - - - - javax.mail - mail - - - - backport-util-concurrent - backport-util-concurrent - - - - commons-codec - commons-codec - - - - httpcomponents-httpcore - jakarta-httpcore - - - - - org.easymock - easymock - - - - junit - junit - 4.2 - test - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/assembly/axis2.xml b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/assembly/axis2.xml deleted file mode 100644 index 7c835caa5c..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/assembly/axis2.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - bin - false - - zip - tar.gz - - - - - extension - - org.apache.tuscany.bindings:axis2 - - 644 - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2AsyncTargetInvoker.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2AsyncTargetInvoker.java deleted file mode 100644 index 90f37ba5fa..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2AsyncTargetInvoker.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.binding.axis2; - -import java.lang.reflect.InvocationTargetException; -import java.util.LinkedList; -import java.util.concurrent.CountDownLatch; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.wire.InvocationRuntimeException; -import org.apache.tuscany.spi.wire.Message; - -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 Axis2AsyncTargetInvoker extends Axis2TargetInvoker { - - private Axis2ReferenceCallbackTargetInvoker callbackInvoker; - - public Axis2AsyncTargetInvoker(ServiceClient serviceClient, - QName wsdlOperationName, - Options options, - SOAPFactory soapFactory, WorkContext workContext) { - super(serviceClient, wsdlOperationName, options, soapFactory, workContext); - } - - public Object invokeTarget(final Object payload, final short sequence) throws InvocationTargetException { - throw new InvocationTargetException(new InvocationRuntimeException("Operation not supported")); - } - - private Object invokeTarget(final Object payload, LinkedList callbackRoutingChain) - throws InvocationTargetException { - try { - Object[] args = (Object[]) payload; - OperationClient operationClient = createOperationClient(args); - callbackInvoker.setCallbackRoutingChain(callbackRoutingChain); - 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 Message invoke(Message msg) throws InvocationRuntimeException { - try { - Object resp = invokeTarget(msg.getBody(), msg.getCallbackRoutingChain()); - msg.setBody(resp); - } catch (Throwable e) { - msg.setBodyWithFault(e); - } - return msg; - } - - public void setCallbackTargetInvoker(Axis2ReferenceCallbackTargetInvoker callbackInvoker) { - this.callbackInvoker = callbackInvoker; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java deleted file mode 100755 index 56725fdf3e..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.axis2; - -import java.net.URI; - -import javax.wsdl.Port; -import javax.wsdl.PortType; - -import org.apache.axiom.om.OMElement; -import org.apache.axis2.AxisFault; -import org.apache.axis2.context.ConfigurationContext; -import org.apache.tuscany.binding.axis2.util.TuscanyAxisConfigurator; -import org.apache.tuscany.idl.wsdl.InterfaceWSDLIntrospector; -import org.apache.tuscany.idl.wsdl.WSDLDefinitionRegistry; -import org.apache.tuscany.idl.wsdl.WSDLServiceContract; -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.builder.BuilderConfigException; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.component.ReferenceBinding; -import org.apache.tuscany.spi.component.ServiceBinding; -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.extension.BindingBuilderExtension; -import org.apache.tuscany.spi.host.ServletHost; -import org.apache.tuscany.spi.idl.InvalidServiceContractException; -import org.apache.tuscany.spi.model.AbstractReferenceDefinition; -import org.apache.tuscany.spi.model.ServiceContract; -import org.apache.tuscany.spi.model.ServiceDefinition; -import org.apache.tuscany.spi.wire.IncompatibleServiceContractException; - -/** - * Builds a {@link org.osoa.sca.annotations.Service} or {@link org.apache.tuscany.spi.component.ReferenceBinding} configured - * with the Axis2 binding - * - * @version $Rev$ $Date$ - */ -@SuppressWarnings("deprecation") -public class Axis2BindingBuilder extends BindingBuilderExtension { - private static final String OM_DATA_BINDING = OMElement.class.getName(); - - // TODO: what to do about the base URI? - private static final String BASE_URI = "http://localhost:8080/"; - - private ServletHost servletHost; - - private ConfigurationContext configContext; - - private InterfaceWSDLIntrospector introspector; - - private WorkContext workContext; - - private WSDLDefinitionRegistry wsdlReg; - - public Axis2BindingBuilder() throws BuilderConfigException { - initAxis(); - } - - @Autowire(required = false) - public void setServletHost(ServletHost servletHost) { - this.servletHost = servletHost; - } - - /** - * @param introspector the introspector to set - */ - @Autowire - public void setIntrospector(InterfaceWSDLIntrospector introspector) { - this.introspector = introspector; - } - - @Autowire - public void setWorkContext(WorkContext workContext) { - this.workContext = workContext; - } - - @Autowire - public void setWSDLDefinitionRegistry(WSDLDefinitionRegistry wsdlReg) { - this.wsdlReg = wsdlReg; - } - - @SuppressWarnings("unchecked") - public ServiceBinding build( - CompositeComponent parent, - ServiceDefinition serviceDefinition, - WebServiceBindingDefinition wsBinding, DeploymentContext deploymentContext) { - - try { - // Set the default databinding - ServiceContract outboundContract = serviceDefinition.getServiceContract(); - if (outboundContract instanceof WSDLServiceContract) { - outboundContract.setDataBinding(OM_DATA_BINDING); - } - - // TODO: TUSCANY-1148, with no wsdl only works with - if (wsBinding.getWSDLDefinition() == null) { - if (outboundContract instanceof WSDLServiceContract) { - String ns = ((WSDLServiceContract)outboundContract).getPortType().getQName().getNamespaceURI(); - wsBinding.setWSDLDefinition(wsdlReg.getDefinition(ns)); - } else { - throw new IllegalStateException(" with no WSDL requires using "); - } - } - - // FIXME: We need to define how the WSDL PortType is honored in the case that - // both the service.ws and interface.wsdl are in place. - // The WSDL portType from the WSDL Port decides the incoming SOAP message format - // There are also cases that interface.java is used. - - ServiceContract inboundContract; - Port port = wsBinding.getWSDLPort(); - if (port == null) { - // FIXME: [rfeng] No WSDL is referenced by service.ws, we need to create one from - // the outbound service contract if it's JavaServiceContract - inboundContract = outboundContract; - } - - PortType portType = wsBinding.getWSDLPort().getBinding().getPortType(); - inboundContract = introspector.introspect(portType); - - // FIXME: - inboundContract.setInterfaceClass(serviceDefinition.getServiceContract().getInterfaceClass()); - inboundContract.setDataBinding(OM_DATA_BINDING); - inboundContract.setCallbackName(serviceDefinition.getServiceContract().getCallbackName()); - inboundContract.setInteractionScope(serviceDefinition.getServiceContract().getInteractionScope()); - try { - wireService.checkCompatibility(inboundContract, outboundContract, true); - } catch (IncompatibleServiceContractException e) { - throw new Axis2BindingBuilderRuntimeException(e); - } - - String axisServiceName; - if (wsBinding.isSpec10Compliant()) { - wsBinding.setActualURI(computeActualURI(wsBinding, BASE_URI, serviceDefinition.getTarget(), serviceDefinition.getName(), parent)); - axisServiceName = wsBinding.getActualURI().getPath(); - if (axisServiceName != null && axisServiceName.length() > 1 && axisServiceName.startsWith("/")) { - axisServiceName = axisServiceName.substring(1); - } - } else { - axisServiceName = serviceDefinition.getName(); - } - - ServiceBinding serviceBinding = - new Axis2ServiceBinding(axisServiceName, outboundContract, inboundContract, parent, wsBinding, - servletHost, configContext, workContext); - return serviceBinding; - - } catch (InvalidServiceContractException e) { - throw new Axis2BindingBuilderRuntimeException(e); - } - } - - @SuppressWarnings("unchecked") - public ReferenceBinding build( - CompositeComponent parent, - AbstractReferenceDefinition boundReferenceDefinition, - WebServiceBindingDefinition wsBinding, - DeploymentContext deploymentContext) { - - // Set the default binding - ServiceContract inboundContract = boundReferenceDefinition.getServiceContract(); - if (inboundContract instanceof WSDLServiceContract) { - inboundContract.setDataBinding(OM_DATA_BINDING); - } - - // TODO: TUSCANY-1148, with no wsdl only works with - if (wsBinding.getWSDLDefinition() == null) { - if (inboundContract instanceof WSDLServiceContract) { - String ns = ((WSDLServiceContract)inboundContract).getPortType().getQName().getNamespaceURI(); - wsBinding.setWSDLDefinition(wsdlReg.getDefinition(ns)); - } else { - throw new IllegalStateException(" with no WSDL requires using "); - } - } - - // FIXME: We need to define how the WSDL PortType is honored in the case that - // both the binding.ws and interface.wsdl are in place - // The WSDL portType from the WSDL Port decides the incoming SOAP message format - - ServiceContract outboundContract = inboundContract; - Port port = wsBinding.getWSDLPort(); - if (port == null) { - // FIXME: [rfeng] No WSDL is referenced by binding.ws, we need to create one from - // the inbound service contract if it's JavaServiceContract - outboundContract = inboundContract; - } - PortType portType = port.getBinding().getPortType(); - try { - outboundContract = introspector.introspect(portType); - } catch (InvalidServiceContractException e) { - new Axis2BindingBuilderRuntimeException(e); - } - - // Set the default databinding - outboundContract.setDataBinding(OM_DATA_BINDING); - //FIXME ... need to figure out how to specify scope on wsdl. - outboundContract.setInteractionScope(inboundContract.getInteractionScope()); - - try { - wireService.checkCompatibility(inboundContract, outboundContract, true); - } catch (IncompatibleServiceContractException e) { - throw new Axis2BindingBuilderRuntimeException(e); - } - - if (wsBinding.isSpec10Compliant()) { - wsBinding.setActualURI(computeActualURI(wsBinding, BASE_URI, null, boundReferenceDefinition.getName(), null)); - } - - return new Axis2ReferenceBinding(boundReferenceDefinition.getName(), parent, wsBinding, - inboundContract, outboundContract, workContext); - - } - - protected Class getBindingType() { - return WebServiceBindingDefinition.class; - } - - protected void initAxis() throws BuilderConfigException { - // TODO: consider having a system component wrapping the Axis2 ConfigContext - try { - this.configContext = new TuscanyAxisConfigurator().getConfigurationContext(); - } catch (AxisFault e) { - throw new BuilderConfigException(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(WebServiceBindingDefinition wsBinding, String baseURI, URI componentURI, String bindingName, CompositeComponent parent) { - URI wsdlURI = null; - if (wsBinding.getServiceName() != null && wsBinding.getBindingName() == null) { - // explicitly points at a wsdl port, may be a relative URI - wsdlURI = wsBinding.getPortURI(); - } - 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()); - } - - // 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()) { - if (wsdlURI != null) { - return URI.create(bindingURI + "/" + wsdlURI).normalize(); - } else { - return bindingURI; - } - } - - if (componentURI == null) { // null for references - wsdlURI = wsBinding.getPortURI(); - if (bindingURI != null) { - return URI.create(wsdlURI + "/" + bindingURI).normalize(); - } else { - return wsdlURI; - } - } - - - // TODO: TUSCANY-xxx, how to tell if component has multiple services using ? - // boolean singleService = (parent != null) && (((Component)parent.getChild(componentURI.toString())).getInboundWires().size() == 1); - // if (bindingURI == null && !singleService) { - - if (bindingURI == null) { - bindingURI = URI.create(bindingName); - } - - if (componentURI.isAbsolute()) { - if (bindingURI == null && wsdlURI == null) { - return componentURI; - } else if (wsdlURI == null) { - return URI.create(componentURI + "/" + bindingURI).normalize(); - } else if (bindingURI == null) { - return URI.create(componentURI + "/" + wsdlURI).normalize(); - } else { - return URI.create(componentURI + "/" + bindingURI + "/" + wsdlURI).normalize(); - } - } - - String actualURI = ""; - - if (bindingURI == null) { - actualURI = baseURI + "/" + componentURI + "/"; - } else { - actualURI = baseURI + "/" + componentURI + "/" + bindingURI + "/"; - } - - if (wsdlURI != null) { - actualURI = actualURI + wsdlURI.toString(); - } - - if (actualURI.endsWith("/")) { - actualURI = actualURI.substring(0, actualURI.length() -1); - } - - // normalize to handle any . or .. occurances - return URI.create(actualURI).normalize(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilderRuntimeException.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilderRuntimeException.java deleted file mode 100644 index a5743668a4..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilderRuntimeException.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.binding.axis2; - - -/** - * Base class for Exceptions raised during the loading process. Loader implementations should throw a subclass of this - * to indicate the actual problem. - * - * @version $Rev$ $Date$ - */ -public class Axis2BindingBuilderRuntimeException extends Axis2BindingRunTimeException { - private static final long serialVersionUID = -7459051598906813461L; - private String resourceURI; - - public Axis2BindingBuilderRuntimeException() { - } - - public Axis2BindingBuilderRuntimeException(String message) { - super(message); - } - - public Axis2BindingBuilderRuntimeException(String message, Throwable cause) { - super(message, cause); - } - - public Axis2BindingBuilderRuntimeException(Throwable cause) { - super(cause); - } - - /** - * Returns the location of the resource that was being loaded. - * - * @return the location of the resource that was being loaded - */ - public String getResourceURI() { - return resourceURI; - } - - /** - * Sets the location of the resource that was being loaded. - * - * @param resourceURI the location of the resource that was being loaded - */ - public void setResourceURI(String resourceURI) { - this.resourceURI = resourceURI; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingRunTimeException.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingRunTimeException.java deleted file mode 100644 index cd957c2ec6..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingRunTimeException.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.binding.axis2; - -import org.apache.tuscany.api.TuscanyRuntimeException; - -/** - * Denotes an error creating a new object instance - * - * @version $Rev$ $Date$ - */ -public class Axis2BindingRunTimeException extends TuscanyRuntimeException { - private static final long serialVersionUID = -6423113430265944499L; - - public Axis2BindingRunTimeException() { - super(); - } - - public Axis2BindingRunTimeException(String message) { - super(message); - } - - public Axis2BindingRunTimeException(String message, Throwable cause) { - super(message, cause); - } - - public Axis2BindingRunTimeException(Throwable cause) { - super(cause); - } - -} - diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2CallbackInvocationHandler.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2CallbackInvocationHandler.java deleted file mode 100644 index e9aefa7320..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2CallbackInvocationHandler.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.binding.axis2; - -import java.util.LinkedList; -import java.util.Map; - -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.wire.AbstractOutboundInvocationHandler; -import org.apache.tuscany.spi.wire.InboundWire; -import org.apache.tuscany.spi.wire.OutboundInvocationChain; -import org.apache.tuscany.spi.wire.TargetInvoker; - -public class Axis2CallbackInvocationHandler extends AbstractOutboundInvocationHandler { - - private InboundWire inboundWire; - - public Axis2CallbackInvocationHandler(InboundWire inboundWire) { - this.inboundWire = inboundWire; - } - - 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, OutboundInvocationChain> sourceCallbackInvocationChains = - inboundWire.getSourceCallbackInvocationChains(targetAddress); - OutboundInvocationChain chain = sourceCallbackInvocationChains.get(operation); - TargetInvoker invoker = chain.getTargetInvoker(); - return invoke(chain, invoker, args, null, callbackRoutingChain); - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2OneWayTargetInvoker.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2OneWayTargetInvoker.java deleted file mode 100644 index 23d0fa56de..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2OneWayTargetInvoker.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.binding.axis2; - -import java.lang.reflect.InvocationTargetException; -import javax.xml.namespace.QName; - -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.wire.InvocationRuntimeException; -import org.apache.tuscany.spi.wire.Message; - -import org.apache.axiom.om.OMElement; -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 Axis2OneWayTargetInvoker extends Axis2TargetInvoker { - - protected static final OMElement RESPONSE = null; - - public Axis2OneWayTargetInvoker(ServiceClient serviceClient, - QName wsdlOperationName, - Options options, - SOAPFactory soapFactory, WorkContext workContext) { - - super(serviceClient, wsdlOperationName, options, soapFactory, workContext); - } - - public Object invokeTarget(final Object payload, final short sequence) throws InvocationTargetException { - try { - Object[] args = (Object[]) payload; - OperationClient operationClient = createOperationClient(args); - - operationClient.execute(false); - - // REVIEW it seems ok to return null - return RESPONSE; - } catch (AxisFault e) { - throw new InvocationTargetException(e); - } catch (Throwable t) { - throw new Axis2BindingRunTimeException(t); - } - } - - public Message invoke(Message msg) throws InvocationRuntimeException { - try { - Object resp = invokeTarget(msg.getBody(), NONE); - msg.setBody(resp); - } catch (Throwable e) { - msg.setBodyWithFault(e); - } - return msg; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceBinding.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceBinding.java deleted file mode 100755 index b0ee16ba3a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceBinding.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.binding.axis2; - -import java.util.Collection; -import javax.wsdl.Definition; -import javax.xml.namespace.QName; - -import static org.osoa.sca.Constants.SCA_NS; - -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.extension.ReferenceBindingExtension; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.model.ServiceContract; -import org.apache.tuscany.spi.wire.TargetInvoker; - -import org.apache.axiom.om.OMAbstractFactory; -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.tuscany.binding.axis2.util.TuscanyAxisConfigurator; -import org.apache.tuscany.binding.axis2.util.WebServiceOperationMetaData; -import org.apache.tuscany.binding.axis2.util.WebServicePortMetaData; - -/** - * Axis2Reference uses Axis2 to invoke a remote web service - */ -public class Axis2ReferenceBinding extends ReferenceBindingExtension { - private static final QName BINDING_WS = new QName(SCA_NS, "binding.ws"); - - private WebServicePortMetaData wsPortMetaData; - private ServiceClient serviceClient; - private WorkContext workContext; - - @SuppressWarnings("unchecked") - public Axis2ReferenceBinding(String theName, - CompositeComponent parent, - WebServiceBindingDefinition wsBinding, - ServiceContract contract, - ServiceContract bindingServiceContract, - WorkContext workContext) { - super(theName, parent); - this.bindingServiceContract = bindingServiceContract; - this.workContext = workContext; - try { - Definition wsdlDefinition = wsBinding.getWSDLDefinition(); - if (wsBinding.isSpec10Compliant()) { - wsPortMetaData = - new WebServicePortMetaData(wsdlDefinition, wsBinding.getWSDLPort(), wsBinding.getActualURI().toString(), false); - } else { - wsPortMetaData = - new WebServicePortMetaData(wsdlDefinition, wsBinding.getWSDLPort(), wsBinding.getURI(), false); - } - serviceClient = createServiceClient(wsdlDefinition, wsPortMetaData); - } catch (AxisFault e) { - throw new Axis2BindingRunTimeException(e); - } - } - - public QName getBindingType() { - return BINDING_WS; - } - - public TargetInvoker createTargetInvoker(ServiceContract contract, Operation operation) { - Axis2TargetInvoker invoker; - try { - boolean operationHasCallback = contract.getCallbackName() != null; - if (operationHasCallback) { - // FIXME: SDODataBinding needs to pass in TypeHelper and classLoader - // as parameters. - Axis2AsyncTargetInvoker asyncInvoker = - (Axis2AsyncTargetInvoker) createOperationInvoker(serviceClient, - operation, - wsPortMetaData, - true, - false); - // 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 - Operation callbackOperation = findCallbackOperation(); - Axis2CallbackInvocationHandler invocationHandler = - new Axis2CallbackInvocationHandler(inboundWire); - Axis2ReferenceCallbackTargetInvoker callbackInvoker = - new Axis2ReferenceCallbackTargetInvoker(callbackOperation, inboundWire, invocationHandler); - asyncInvoker.setCallbackTargetInvoker(callbackInvoker); - - invoker = asyncInvoker; - } else { - boolean isOneWay = operation.isNonBlocking(); - invoker = createOperationInvoker(serviceClient, operation, wsPortMetaData, false, isOneWay); - } - } catch (AxisFault e) { - throw new Axis2BindingRunTimeException(e); - } - return invoker; - } - - private Operation findCallbackOperation() { - ServiceContract contract = inboundWire.getServiceContract(); - Operation callbackOperation = null; - Collection callbackOperations = contract.getCallbackOperations().values(); - if (callbackOperations.size() != 1) { - throw new Axis2BindingRunTimeException("Can only handle one callback operation"); - } else { - callbackOperation = (Operation) callbackOperations.iterator().next(); - } - return callbackOperation; - } - - /** - * Create an Axis2 ServiceClient - */ - private ServiceClient createServiceClient(Definition wsdlDefinition, WebServicePortMetaData wsPortMetaData) - throws AxisFault { - - TuscanyAxisConfigurator tuscanyAxisConfigurator = new TuscanyAxisConfigurator(); - ConfigurationContext configurationContext = tuscanyAxisConfigurator.getConfigurationContext(); - QName serviceQName = wsPortMetaData.getServiceName(); - String portName = wsPortMetaData.getPortName().getLocalPart(); - AxisService axisService = - AxisService.createClientSideAxisService(wsdlDefinition, serviceQName, portName, new Options()); - return new ServiceClient(configurationContext, axisService); - } - - /** - * Create and configure an Axis2TargetInvoker for each operations - */ - private Axis2TargetInvoker createOperationInvoker(ServiceClient serviceClient, - Operation m, - WebServicePortMetaData wsPortMetaData, - boolean hasCallback, - boolean isOneWay) throws AxisFault { - SOAPFactory soapFactory = OMAbstractFactory.getSOAP11Factory(); - String portTypeNS = wsPortMetaData.getPortTypeName().getNamespaceURI(); - - String methodName = m.getName(); - - WebServiceOperationMetaData operationMetaData = wsPortMetaData.getOperationMetaData(methodName); - - Options options = new Options(); - options.setTo(new EndpointReference(wsPortMetaData.getEndpoint())); - options.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE); - - String wsdlOperationName = operationMetaData.getBindingOperation().getOperation().getName(); - - String soapAction = wsPortMetaData.getOperationMetaData(wsdlOperationName).getSOAPAction(); - if (soapAction != null && soapAction.length() > 1) { - options.setAction(soapAction); - } - - options.setTimeOutInMilliSeconds(5 * 60 * 1000); - - QName wsdlOperationQName = new QName(portTypeNS, wsdlOperationName); - - Axis2TargetInvoker invoker; - if (hasCallback) { - invoker = - new Axis2AsyncTargetInvoker(serviceClient, wsdlOperationQName, options, soapFactory, workContext); - } else if (isOneWay) { - invoker = - new Axis2OneWayTargetInvoker(serviceClient, wsdlOperationQName, options, soapFactory, workContext); - } else { - invoker = new Axis2TargetInvoker(serviceClient, wsdlOperationQName, options, soapFactory, workContext); - } - - return invoker; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceCallback.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceCallback.java deleted file mode 100644 index ca129ca1cc..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceCallback.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.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; -import org.apache.tuscany.spi.wire.InvocationRuntimeException; -import org.apache.tuscany.spi.wire.TargetInvoker; - -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}, TargetInvoker.NONE); - } catch (InvocationTargetException e) { - // FIXME what is the appropriate exception here? - throw new InvocationRuntimeException(e); - } - } - - public void setComplete(boolean complete) { - super.setComplete(complete); - } - - public void onError(Exception e) { - throw new InvocationRuntimeException(e); - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceCallbackTargetInvoker.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceCallbackTargetInvoker.java deleted file mode 100644 index cdc975b54e..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ReferenceCallbackTargetInvoker.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.binding.axis2; - -import java.lang.reflect.InvocationTargetException; -import java.util.LinkedList; -import java.util.concurrent.CountDownLatch; - -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.wire.InboundWire; -import org.apache.tuscany.spi.wire.InvocationRuntimeException; -import org.apache.tuscany.spi.wire.Message; -import org.apache.tuscany.spi.wire.TargetInvoker; - -public class Axis2ReferenceCallbackTargetInvoker implements TargetInvoker { - - private Operation operation; - private InboundWire inboundWire; - private LinkedList callbackRoutingChain; - private boolean cacheable; - Axis2CallbackInvocationHandler invocationHandler; - private CountDownLatch signal; - private Object returnPayload; - - public Axis2ReferenceCallbackTargetInvoker(Operation operation, - InboundWire inboundWire, - Axis2CallbackInvocationHandler invocationHandler) { - - this.operation = operation; - this.inboundWire = inboundWire; - this.invocationHandler = invocationHandler; - } - - public Object invokeTarget(final Object payload, final short 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); - } catch (Throwable t) { - t.printStackTrace(); - throw new InvocationTargetException(t); - } - } - - public Message invoke(Message msg) throws InvocationRuntimeException { - try { - Object resp = invokeTarget(msg.getBody(), NONE); - msg.setBody(resp); - } catch (InvocationTargetException e) { - msg.setBodyWithFault(e.getCause()); - } catch (Throwable e) { - msg.setBodyWithFault(e); - } - return msg; - } - - public 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.callbackRoutingChain = this.callbackRoutingChain; - invoker.cacheable = this.cacheable; - invoker.invocationHandler = this.invocationHandler; - return invoker; - } - - public void setCallbackRoutingChain(LinkedList callbackRoutingChain) { - this.callbackRoutingChain = callbackRoutingChain; - } - - public void setSignal(CountDownLatch signal) { - this.signal = signal; - } - - public Object getReturnPayload() { - return returnPayload; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceBinding.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceBinding.java deleted file mode 100755 index d7e04ca917..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceBinding.java +++ /dev/null @@ -1,390 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.axis2; - -import static org.osoa.sca.Constants.SCA_NS; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.CountDownLatch; - -import javax.wsdl.Definition; -import javax.wsdl.Operation; -import javax.wsdl.PortType; -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.WSDLToAxisServiceBuilder; -import org.apache.axis2.engine.MessageReceiver; -import org.apache.axis2.wsdl.WSDLConstants; -import org.apache.axis2.wsdl.WSDLConstants.WSDL20_2004Constants; -import org.apache.tuscany.binding.axis2.util.WebServicePortMetaData; -import org.apache.tuscany.spi.builder.BuilderConfigException; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.component.TargetInvokerCreationException; -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.extension.ServiceBindingExtension; -import org.apache.tuscany.spi.host.ServletHost; -import org.apache.tuscany.spi.model.InteractionScope; -import org.apache.tuscany.spi.model.Scope; -import org.apache.tuscany.spi.model.ServiceContract; -import org.apache.tuscany.spi.wire.Interceptor; -import org.apache.tuscany.spi.wire.InvocationChain; -import org.apache.tuscany.spi.wire.Message; -import org.apache.tuscany.spi.wire.MessageImpl; -import org.apache.tuscany.spi.wire.TargetInvoker; -import org.osoa.sca.annotations.Destroy; - -// org.apache.tuscany.spi.model -/** - * An implementation of a {@link ServiceBindingExtension} configured with the Axis2 binding - * - * @version $Rev$ $Date$ - */ -public class Axis2ServiceBinding extends ServiceBindingExtension { - private static final QName BINDING_WS = new QName(SCA_NS, "binding.ws"); - - private ServiceContract serviceContract; - - private ServletHost servletHost; - - private ConfigurationContext configContext; - - private WebServiceBindingDefinition binding; - - private Map invCtxMap = new HashMap(); - - private String serviceName; - - private WorkContext workContext; - - private Boolean conversational = null; - - private Set seenConversations = Collections.synchronizedSet(new HashSet()); - - public Axis2ServiceBinding(String theName, - ServiceContract serviceContract, - ServiceContract serviceBindingContract, - CompositeComponent parent, - WebServiceBindingDefinition binding, - ServletHost servletHost, - ConfigurationContext configContext, - WorkContext workContext) { - - super(theName, parent); - - this.serviceContract = serviceContract; - this.bindingServiceContract = serviceBindingContract; - this.binding = binding; - this.servletHost = servletHost; - this.configContext = configContext; - this.serviceName = theName; - this.workContext = workContext; - } - - public void start() { - super.start(); - - try { - configContext.getAxisConfiguration().addService(createAxisService(binding)); - } catch (AxisFault e) { - throw new Axis2BindingRunTimeException(e); - } - - Axis2ServiceServlet servlet = new Axis2ServiceServlet(); - servlet.init(configContext); - configContext.setContextRoot(getName()); - if (binding.isSpec10Compliant()) { - // TODO: TUSCANY-xxx, sort out what to do with system base URI etc - servletHost.registerMapping(binding.getActualURI().getPath(), servlet); - } else { - servletHost.registerMapping("/services/" + getName(), servlet); - } - } - - @Destroy - public void stop() { - if (binding.isSpec10Compliant()) { - servletHost.unregisterMapping(binding.getActualURI().getPath()); - } else { - servletHost.unregisterMapping("/services/" + getName()); - } - try { - configContext.getAxisConfiguration().removeService(getName()); - } catch (AxisFault e) { - throw new Axis2BindingRunTimeException(e); - } - super.stop(); - } - - private AxisService createAxisService(WebServiceBindingDefinition wsBinding) throws AxisFault { - Definition definition = wsBinding.getWSDLDefinition(); - WebServicePortMetaData wsdlPortInfo = - new WebServicePortMetaData(definition, wsBinding.getWSDLPort(), null, false); - - // TODO investigate if this is 20 wsdl what todo? - WSDLToAxisServiceBuilder builder = - new WSDL11ToAxisServiceBuilder(definition, wsdlPortInfo.getServiceName(), wsdlPortInfo.getPort() - .getName()); - builder.setServerSide(true); - AxisService axisService = builder.populateService(); - - axisService.setName(this.getName()); - axisService.setServiceDescription("Tuscany configured AxisService for service: '" + this.getName() - + "'"); - - // 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); - - PortType wsdlPortType = wsdlPortInfo.getPortType(); - for (Object o : wsdlPortType.getOperations()) { - Operation wsdlOperation = (Operation) o; - String operationName = wsdlOperation.getName(); - QName operationQN = new QName(definition.getTargetNamespace(), operationName); - - org.apache.tuscany.spi.model.Operation op = serviceContract.getOperations().get(operationName); - - MessageReceiver msgrec = null; - boolean opIsNonBlocking = op.isNonBlocking(); - if (serviceContract.getCallbackName() != null) { - msgrec = new Axis2ServiceInOutAsyncMessageReceiver(this, op); - } else if (opIsNonBlocking) { - msgrec = new Axis2ServiceInMessageReceiver(this, op); - } else { - msgrec = new Axis2ServiceInOutSyncMessageReceiver(this, op); - } - - AxisOperation axisOp = axisService.getOperation(operationQN); - if (opIsNonBlocking) { - axisOp.setMessageExchangePattern(WSDL20_2004Constants.MEP_URI_IN_ONLY); - } else { - axisOp.setMessageExchangePattern(WSDL20_2004Constants.MEP_URI_IN_OUT); - } - axisOp.setMessageReceiver(msgrec); - } - - return axisService; - } - - public Object invokeTarget(org.apache.tuscany.spi.model.Operation op, Object[] args, Object messageId, - String conversationID) - throws InvocationTargetException { - InvocationChain chain = inboundWire.getInvocationChains().get(op); - Interceptor headInterceptor = chain.getHeadInterceptor(); - String oldConversationID = (String) workContext.getIdentifier(Scope.CONVERSATION); - if (isConversational() && conversationID != null) { - workContext.setIdentifier(Scope.CONVERSATION, conversationID); - } else { - workContext.clearIdentifier(Scope.CONVERSATION); - } - try { - if (headInterceptor == null) { - // short-circuit the dispatch and invoke the target directly - TargetInvoker targetInvoker = chain.getTargetInvoker(); - if (targetInvoker == null) { - throw new AssertionError("No target invoker [" + chain.getOperation().getName() + "]"); - } - return targetInvoker.invokeTarget(args, TargetInvoker.NONE); - } else { - - Message msg = new MessageImpl(); - msg.setTargetInvoker(chain.getTargetInvoker()); - msg.pushFromAddress(getFromAddress()); - if (messageId != null) { - msg.setMessageId(messageId); - } - msg.setBody(args); - Message resp; - - if (isConversational()) { - - - int opSeq = op.getConversationSequence(); - if (opSeq == org.apache.tuscany.spi.model.Operation.CONVERSATION_END) { - assert seenConversations - .contains(conversationID) : "End of conversation called when no conversation existed"; - msg.setConversationSequence(TargetInvoker.END); - seenConversations.remove(conversationID); //if a fault occurs does the conversation end? - //how do I know if a component called locally another opeation that ended this conversation? - - } else { - boolean ec = seenConversations.contains(conversationID); - if (ec) { - - msg.setConversationSequence(TargetInvoker.CONTINUE); - } else { - seenConversations.add(conversationID); - msg.setConversationSequence(TargetInvoker.START); - } - } - - } - // dispatch the wire down the chain and get the response - resp = headInterceptor.invoke(msg); - Object body = resp.getBody(); - if (resp.isFault()) { - throw new InvocationTargetException((Throwable) body); - } - return body; - } - } finally { - if (null != oldConversationID) { - workContext.setIdentifier(Scope.CONVERSATION, conversationID); - } else { - workContext.clearIdentifier(Scope.CONVERSATION); - } - } - } - - protected Object getFromAddress() { - return this.serviceName; - } - - /** - * Get the Method from an interface matching the WSDL operation name - */ - protected Method getMethod(Class serviceInterface, String operationName) throws BuilderConfigException { - // Note: this doesn't support overloaded operations - Method[] methods = serviceInterface.getMethods(); - for (Method m : methods) { - if (m.getName().equals(operationName)) { - return m; - } - // tolerate WSDL with capatalized operation name - StringBuilder sb = new StringBuilder(operationName); - sb.setCharAt(0, Character.toLowerCase(sb.charAt(0))); - if (m.getName().equals(sb.toString())) { - return m; - } - } - throw new BuilderConfigException("no operation named " + operationName - + " found on service interface: " - + serviceInterface.getName()); - } - - public QName getBindingType() { - return BINDING_WS; - } - - public TargetInvoker createTargetInvoker(ServiceContract contract, org.apache.tuscany.spi.model.Operation operation) - throws TargetInvokerCreationException { - if (!operation.isCallback()) { - 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(WebServiceBindingDefinition.CONVERSATION_ID_REFPARM_QN); - cidI.hasNext();) { - OMElement cidE = (OMElement) cidI.next(); - conversationID = cidE.getText(); - } - } - - } - - } - return conversationID; - } - - protected class InvocationContext { - public MessageContext inMessageContext; - - public org.apache.tuscany.spi.model.Operation operation; - - public SOAPFactory soapFactory; - - public CountDownLatch doneSignal; - - public InvocationContext(MessageContext messageCtx, - org.apache.tuscany.spi.model.Operation operation, - SOAPFactory soapFactory, - CountDownLatch doneSignal) { - this.inMessageContext = messageCtx; - this.operation = operation; - this.soapFactory = soapFactory; - this.doneSignal = doneSignal; - } - } - - WorkContext getWorkContext() { - return workContext; - } - - boolean isConversational() { - if (conversational == null) { - conversational = serviceContract.getInteractionScope() == InteractionScope.CONVERSATIONAL; - - } - return conversational; - } - - @Override - public boolean allowsPassByReference() { - return true; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceCallbackTargetInvoker.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceCallbackTargetInvoker.java deleted file mode 100644 index 7ec4a13669..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceCallbackTargetInvoker.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.axis2; - -import java.lang.reflect.InvocationTargetException; - -import org.apache.tuscany.spi.wire.InvocationRuntimeException; -import org.apache.tuscany.spi.wire.Message; -import org.apache.tuscany.spi.wire.TargetInvoker; - -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.binding.axis2.Axis2ServiceBinding.InvocationContext; - -public class Axis2ServiceCallbackTargetInvoker implements TargetInvoker { - - private Axis2ServiceBinding service; - - protected static final OMElement RESPONSE = null; - - public Axis2ServiceCallbackTargetInvoker(Axis2ServiceBinding service) { - this.service = service; - } - - public Object invokeTarget(final Object payload, final short sequence) throws InvocationTargetException { - throw new InvocationTargetException(new InvocationRuntimeException("Operation not supported")); - } - - 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 Axis2BindingRunTimeException(t); - } - - return RESPONSE; - } - - public Message invoke(Message msg) throws InvocationRuntimeException { - try { - Object correlationId = msg.getCorrelationId(); - if (correlationId == null) { - throw new InvocationRuntimeException("Missing correlation id"); - } - Object resp = invokeTarget(msg.getBody(), correlationId); - msg.setBody(resp); - } catch (Throwable e) { - msg.setBodyWithFault(e); - } - return msg; - } - - public Axis2ServiceCallbackTargetInvoker clone() throws CloneNotSupportedException { - try { - return (Axis2ServiceCallbackTargetInvoker) super.clone(); - } catch (CloneNotSupportedException e) { - // will not happen - return null; - } - } - - public boolean isCacheable() { - return true; - } - - public void setCacheable(boolean cacheable) { - - } - - public boolean isOptimizable() { - return false; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInMessageReceiver.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInMessageReceiver.java deleted file mode 100644 index 53b85ea887..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInMessageReceiver.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.binding.axis2; - -import java.lang.reflect.InvocationTargetException; - -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.spi.model.Operation; -import org.apache.tuscany.spi.wire.InvocationRuntimeException; - -public class Axis2ServiceInMessageReceiver extends AbstractInMessageReceiver { - - protected Operation operation; - - private Axis2ServiceBinding axis2Service; - - public Axis2ServiceInMessageReceiver(Axis2ServiceBinding service, Operation operation) { - this.axis2Service = service; - 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 = axis2Service.isConversational() ? Axis2ServiceBinding.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 Axis2BindingRunTimeException(t); - } - - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutAsyncMessageReceiver.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutAsyncMessageReceiver.java deleted file mode 100644 index 9d7b711701..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutAsyncMessageReceiver.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.binding.axis2; - -import java.lang.reflect.InvocationTargetException; -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.binding.axis2.Axis2ServiceBinding.InvocationContext; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.wire.InvocationRuntimeException; -import org.apache.tuscany.spi.wire.MessageId; - -public class Axis2ServiceInOutAsyncMessageReceiver extends AbstractMessageReceiver { - - private Operation operation; - - private Axis2ServiceBinding service; - - public Axis2ServiceInOutAsyncMessageReceiver(Axis2ServiceBinding service, - Operation operation) { - this.operation = operation; - this.service = service; - } - - 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 = service.isConversational() ? Axis2ServiceBinding.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); - } - - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutSyncMessageReceiver.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutSyncMessageReceiver.java deleted file mode 100644 index 8af613450d..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceInOutSyncMessageReceiver.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.binding.axis2; - -import java.lang.reflect.InvocationTargetException; - -import javax.xml.namespace.QName; - -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.spi.idl.ServiceFaultException; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.wire.InvocationRuntimeException; - -public class Axis2ServiceInOutSyncMessageReceiver extends AbstractInOutSyncMessageReceiver { - - protected Operation operation; - - private Axis2ServiceBinding axis2Service; - - public Axis2ServiceInOutSyncMessageReceiver(Axis2ServiceBinding service, Operation operation) { - this.axis2Service = service; - this.operation = operation; - } - - public Axis2ServiceInOutSyncMessageReceiver() { - - } - - @Override - public void invokeBusinessLogic(MessageContext inMC, MessageContext outMC) throws AxisFault { - QName envQName = null; - try { - envQName= inMC.getEnvelope().getQName(); - OMElement requestOM = inMC.getEnvelope().getBody().getFirstElement(); - Object[] args = new Object[] {requestOM}; - - String conversationID = axis2Service.isConversational() ? Axis2ServiceBinding.getConversationID(inMC) : null; - - OMElement responseOM = (OMElement)axis2Service.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(); - throw processMessageFault(envQName.getNamespaceURI(), e.getCause()); - } catch(InvocationRuntimeException e){ - // e.printStackTrace(); - throw processMessageFault(envQName.getNamespaceURI(), e.getCause()); - } catch (AxisFault e) { - // e.printStackTrace(); - throw e; - } catch (Exception e) { - // e.printStackTrace(); - throw AxisFault.makeFault(e); - } - } - - /** - * @param envQName - * @param e - * @throws AxisFault - */ - private AxisFault processMessageFault(String nsURI, Throwable t) { - - if (t instanceof ServiceFaultException) { //Business fault. - OMElement faultdetail = null; - String reason = ""; - - ServiceFaultException sfe = (ServiceFaultException)t; - reason= sfe.getMessage(); - reason = reason == null ? "" : reason; - Object finfo = sfe.getFaultInfo(); - - if (finfo instanceof OMElement) { - faultdetail = (OMElement)finfo; - - } - QName faultCode= new QName(nsURI , - org.apache.axiom.soap.SOAP12Constants.SOAP_FAULT_VALUE_SENDER); - return new AxisFault(faultCode, reason, null, null, faultdetail); - - - } else if ( t instanceof Exception) { - return AxisFault.makeFault((Exception) t); - } - - - return new AxisFault(t); - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceServlet.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceServlet.java deleted file mode 100644 index 74b79de3ed..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2ServiceServlet.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.binding.axis2; - -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -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.context.ConfigurationContext; -import org.apache.axis2.transport.http.AxisServlet; - -/** - * 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 { - - private static final long serialVersionUID = 1L; - - private static final ServletConfig DUMMY_CONFIG = createDummyServletConfig(); - - private boolean inited; - - public void init(ConfigurationContext configContext) { - this.configContext = configContext; - try { - super.init(DUMMY_CONFIG); - } catch (ServletException e) { - throw new RuntimeException(e); - } - } - - /** - * 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; - } - - /** - * 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); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2TargetInvoker.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2TargetInvoker.java deleted file mode 100755 index 52768b973c..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2TargetInvoker.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.axis2; - -import java.lang.reflect.InvocationTargetException; -import javax.xml.namespace.QName; - -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.idl.ServiceFaultException; -import org.apache.tuscany.spi.model.Scope; -import org.apache.tuscany.spi.wire.InvocationRuntimeException; -import org.apache.tuscany.spi.wire.Message; -import org.apache.tuscany.spi.wire.TargetInvoker; - -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.wsdl.WSDLConstants; - -/** - * Axis2TargetInvoker uses an Axis2 OperationClient to invoke a remote web - * service - */ -public class Axis2TargetInvoker implements TargetInvoker { - - private QName wsdlOperationName; - - private Options options; - - private SOAPFactory soapFactory; - - private ServiceClient serviceClient; - - private WorkContext workContext; - - public Axis2TargetInvoker(ServiceClient serviceClient, - QName wsdlOperationName, - Options options, - SOAPFactory soapFactory, - WorkContext workContext) { - this.wsdlOperationName = wsdlOperationName; - this.options = options; - this.soapFactory = soapFactory; - this.serviceClient = serviceClient; - this.workContext = workContext; - } - - /** - * Invoke a WS operation - * - * @param payload - * @param sequence - * @return - * @throws InvocationTargetException - */ - public Object invokeTarget(final Object payload, final short sequence) throws InvocationTargetException { - try { - Object[] args = (Object[])payload; - OperationClient operationClient = createOperationClient(args); - - operationClient.execute(true); - - MessageContext responseMC = operationClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE); - - return responseMC.getEnvelope().getBody().getFirstElement(); - - } catch (AxisFault e) { - // convert exception to an exception independent on Axis runtime. - Throwable cause = e.getCause(); - cause = cause == null ? e : cause; - ServiceFaultException serviceFaultException = - new ServiceFaultException(e.getMessage(), e.getDetail(), cause); - OMElement detail = e.getDetail(); - if (null != detail) { - detail.getQName(); - serviceFaultException.setLogical(detail.getQName()); - } - throw new InvocationTargetException(serviceFaultException); - - } - - } - - @SuppressWarnings("deprecation") - protected OperationClient createOperationClient(Object[] args) 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 (workContext != null) { - String conversationId = (String)workContext.getIdentifier(Scope.CONVERSATION); - if (conversationId != null && conversationId.length() != 0) { - EndpointReference fromEPR = new EndpointReference(AddressingConstants.Final.WSA_ANONYMOUS_URL); - fromEPR.addReferenceParameter(WebServiceBindingDefinition.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; - } - - public Message invoke(Message msg) throws InvocationRuntimeException { - try { - Object resp = invokeTarget(msg.getBody(), NONE); - msg.setBody(resp); - } catch (Throwable e) { - msg.setBodyWithFault(e); - } - return msg; - } - - public Axis2TargetInvoker clone() throws CloneNotSupportedException { - try { - return (Axis2TargetInvoker)super.clone(); - } catch (CloneNotSupportedException e) { - // will not happen - return null; - } - } - - public boolean isCacheable() { - return true; - } - - public void setCacheable(boolean cacheable) { - - } - - public boolean isOptimizable() { - return false; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/TuscanyDispatcher.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/TuscanyDispatcher.java deleted file mode 100644 index 64ccb94193..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/TuscanyDispatcher.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.binding.axis2; - -import java.net.URI; - -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.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - */ -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(); - - // remove the leading slash - if (path != null && path.length() > 1 && path.startsWith("/")) { - path = path.substring(1); - } - - ConfigurationContext configurationContext = messageContext.getConfigurationContext(); - AxisConfiguration registry = configurationContext.getAxisConfiguration(); - - return registry.getService(path); - - } else { - if(isDebugEnabled){ - log.debug("Attempted to check for Service using null target endpoint URI"); - } - return null; - } - } - - public void initDispatcher() { - init(new HandlerDescription(NAME)); - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/WebServiceBindingDefinition.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/WebServiceBindingDefinition.java deleted file mode 100755 index 3f59ec0130..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/WebServiceBindingDefinition.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.axis2; - - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.List; -import java.util.Map; - -import javax.wsdl.Binding; -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.Service; -import javax.wsdl.extensions.soap.SOAPAddress; -import javax.xml.namespace.QName; - -import org.apache.tuscany.spi.model.BindingDefinition; -import org.osoa.sca.Constants; - -/** - * Represents a Celtix binding configuration in an assembly - * - * @version $Rev$ $Date$ - */ -public class WebServiceBindingDefinition extends BindingDefinition { - public static final QName CONVERSATION_ID_REFPARM_QN = new QName(Constants.SCA_NS,"conversationID"); - private Definition definition; - private Port port; - private Service service; - private String uri; - private String namespace; - private String serviceName; - private String portName; - private String bindingName; - private Binding binding; - private boolean spec10Compliant; // hack just to allow any existing WS scdl to still work for now - private URI actualURI; - - /** - * @deprecated pre 1.0 binding.ws spec - */ - @Deprecated - public WebServiceBindingDefinition(Definition definition, Port port, String uri, String portURI, Service service) { - this.definition = definition; - this.port = port; - this.uri = uri; - this.service = service; - } - - public WebServiceBindingDefinition(String ns, Definition definition, String serviceName, String portName, String bindingName, String uri) { - this.namespace = ns; - this.definition = definition; - this.serviceName = serviceName; - this.portName = portName; - this.bindingName = bindingName; - this.uri = uri; - this.spec10Compliant = true; - } - - public Port getWSDLPort() { - if (port == null) { - Service service = getWSDLService(); - if (portName == null) { - Map ports = service.getPorts(); - if (ports.size() != 1) { - throw new IllegalStateException("when portName is null WSDL service must have exactly one WSDL port"); - } - port = (Port)ports.values().iterator().next(); - } else { - port = service.getPort(portName); - } - } - return port; - } - - public Service getWSDLService() { - if (service == null) { - if (definition == null) { - throw new IllegalStateException("WSDL definition is null"); - } - Map services = definition.getServices(); - if (serviceName != null) { - QName serviceQN = new QName(namespace, serviceName); - for (Object o : services.values()) { - Service s = (Service) o; - if (s.getQName().equals(serviceQN)) { - service = s; - break; - } - } - if (service == null) { - throw new IllegalStateException("no service: " + serviceQN); - } - } else { - service = (Service)services.values().iterator().next(); - } - } - return service; - } - - public void setWSDLPort(Port value) { - port = value; - } - - public Definition getWSDLDefinition() { - return definition; - } - - public void setWSDLDefinition(Definition def) { - definition = def; - } - - public String getURI() { - return uri; - } - - public URI getPortURI() { - URI portURI = null; - if (definition != null) { - Port port = getWSDLPort(); - final List wsdlPortExtensions = port.getExtensibilityElements(); - for (final Object extension : wsdlPortExtensions) { - if (extension instanceof SOAPAddress) { - try { - portURI = new URI(((SOAPAddress) extension).getLocationURI()); - } catch (URISyntaxException e) { - throw new RuntimeException(e); - } - break; - } - } - } - return portURI; - } - - public void setURI(String theUri) { - this.uri = theUri; - } - - public Binding getBinding() { - if (binding == null) { - if (definition == null) { - throw new IllegalStateException("WSDL definition is null"); - } - QName bindingQN = new QName(namespace, bindingName); - this.binding = definition.getBinding(bindingQN); - if (binding == null) { - throw new IllegalStateException("no binding: " + bindingQN); - } - } - return binding; - } - - public String getWSDLNamepace() { - return namespace; - } - - public String getPortName() { - return portName; - } - - public String getServiceName() { - return serviceName; - } - - public String getBindingName() { - return bindingName; - } - - public boolean isSpec10Compliant() { - return spec10Compliant; - } - - public URI getActualURI() { - return actualURI; - } - - public void setActualURI(URI actualURI) { - this.actualURI = actualURI; - } - - public Object clone() { - WebServiceBindingDefinition clone = - new WebServiceBindingDefinition(this.namespace, - this.definition, - this.serviceName, - this.portName, - this.bindingName, - this.uri); - - return clone; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/WebServiceBindingLoader.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/WebServiceBindingLoader.java deleted file mode 100755 index 15b58b4305..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/WebServiceBindingLoader.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.axis2; - -import static org.osoa.sca.Constants.SCA_NS; - -import java.io.IOException; -import java.util.Collection; - -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.Service; -import javax.wsdl.WSDLException; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.idl.wsdl.WSDLDefinitionRegistry; -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.extension.LoaderExtension; -import org.apache.tuscany.spi.loader.LoaderException; -import org.apache.tuscany.spi.loader.LoaderRegistry; -import org.apache.tuscany.spi.loader.LoaderUtil; -import org.apache.tuscany.spi.model.ModelObject; - -import org.osoa.sca.annotations.Constructor; -import org.osoa.sca.annotations.Scope; - -/** - * Parses a WebServiceBindingDefinition entry in an assembly XML file - * - * TODO: TUSCANY-1153 support - * - * @version $Rev$ $Date$ - */ -@Scope("COMPOSITE") -@SuppressWarnings("deprecation") -public class WebServiceBindingLoader extends LoaderExtension { - public static final QName BINDING_WS = new QName(SCA_NS, "binding.ws"); - - private WSDLDefinitionRegistry wsdlDefinitionRegistry; - - @Constructor( { "loaderRegistry", "wsdlDefinitionRegistry" }) - public WebServiceBindingLoader(@Autowire LoaderRegistry loaderRegistry, - @Autowire WSDLDefinitionRegistry wsdlDefinitionRegistry) { - super(loaderRegistry); - this.wsdlDefinitionRegistry = wsdlDefinitionRegistry; - } - - public QName getXMLType() { - return BINDING_WS; - } - - public WebServiceBindingDefinition load(CompositeComponent parent, ModelObject object, XMLStreamReader reader, - DeploymentContext deploymentContext) - throws XMLStreamException, LoaderException { - - String uri = reader.getAttributeValue(null, "uri"); - String wsdlElement = reader.getAttributeValue(null, "wsdlElement"); - String wsdliLocation = reader.getAttributeValue(null, "wsdlLocation"); - - // TODO: keep these old attributes for now for backward compatability - String endpoint = reader.getAttributeValue(null, "endpoint"); - String wsdlLocation = reader.getAttributeValue(null, "location"); - - // TODO: support wsa:endpointreference - - LoaderUtil.skipToEndElement(reader); - - WebServiceBindingDefinition wsBinding; - if (endpoint != null && endpoint.length() > 0) { - // TODO: support these old attributes for now for backward compatability - try { - wsBinding = createBindingOld(uri, endpoint, wsdlLocation, deploymentContext); - } catch (Exception e) { - throw new LoaderException(e); - } - } else { - wsBinding = createWSBinding(wsdlElement, wsdliLocation, uri, deploymentContext); - } - - return wsBinding; - } - - protected WebServiceBindingDefinition createWSBinding(String wsdlElement, String wsdliLocation, String uri, DeploymentContext deploymentContext) throws LoaderException { - String ns = null; - String serviceName = null; - String portName = null; - String bindingName = null; - - if (wsdlElement != null && wsdlElement.length() > 0) { - - ns = getWSDLNamespace(wsdlElement); - - String uriValue = getWSDLElementURIValue(wsdlElement, "wsdl.service"); - if (uriValue != null) { - serviceName = uriValue; - } else { - uriValue = getWSDLElementURIValue(wsdlElement, "wsdl.port"); - if (uriValue != null) { - int i = uriValue.lastIndexOf('/'); - if (i == -1) { - throw new IllegalArgumentException("Missing '/' seperator between service and port in wsdl.port() in wsdlElement attribute"); - } - serviceName = uriValue.substring(0, i); - portName = uriValue.substring(i+1); - } else { - uriValue = getWSDLElementURIValue(wsdlElement, "wsdl.endpoint"); - if (uriValue != null) { - throw new IllegalArgumentException("WSDL 2.0 not supported for '#wsdl.endpoint' in wsdlElement attribute"); - } - uriValue = getWSDLElementURIValue(wsdlElement, "wsdl.binding"); - if (uriValue == null) { - throw new IllegalArgumentException("missing '#wsdl.service' or '#wsdl.port' or '#wsdl.endpoint'or '#wsdl.binding' in wsdlElement attribute"); - } - bindingName = uriValue; - } - } - } - - Definition definition = null; - if (wsdliLocation != null && wsdliLocation.length() > 0) { - try { - definition = wsdlDefinitionRegistry.loadDefinition(wsdliLocation, deploymentContext.getClassLoader()); - } catch (Exception e) { - throw new LoaderException("Exception loading WSDL", e); - } - } else if (ns != null ){ - definition = wsdlDefinitionRegistry.getDefinition(ns); - } - - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition(ns, definition, serviceName, portName, bindingName, uri); - - return wsBinding; - } - - protected String getWSDLElementURIValue(String wsdlElement, String type) { - String value = null; - String fullType = "#" + type + "("; - int i = wsdlElement.indexOf(fullType); - if (i > -1) { - int j = wsdlElement.indexOf(')',i); - if (j < 0) { - throw new IllegalArgumentException("missing closing bracket ')' on " + fullType + " in wsdlElement attribute"); - } - value = wsdlElement.substring(i + fullType.length(), j); - } - return value; - } - - protected String getWSDLNamespace(String wsdlElement) { - String ns = null; - if (wsdlElement != null && wsdlElement.length() > 0) { - int i = wsdlElement.indexOf('#'); - if (i < 0) { - throw new IllegalArgumentException("missing '#' namespace delimiter in wsdlElement attribute"); - } - if (i == 0) { - throw new IllegalArgumentException("no namespace in wsdlElement attribute"); - } - ns = wsdlElement.substring(0, i); - } - return ns; - } - - @SuppressWarnings("unchecked") - private WebServiceBindingDefinition createBindingOld(String uri, String endpoint, String wsdlLocation, DeploymentContext deploymentContext) - throws WSDLException, IOException, LoaderException { - // Get the WSDL port namespace and name - if (endpoint != null) { - int h = endpoint.indexOf('#'); - String serviceName; - String portName; - - String namespace = endpoint.substring(0, h); - String fragment = endpoint.substring(h + 1); - if (fragment.startsWith("wsdl.endpoint(") && fragment.endsWith(")")) { - fragment = fragment.substring(14, fragment.length() - 1); - int slash = fragment.indexOf('/'); - if (slash != -1) { - serviceName = fragment.substring(0, slash); - portName = fragment.substring(slash + 1); - } else { - serviceName = null; - portName = fragment; - } - } else { - serviceName = null; - portName = fragment; - } - // FIXME need to find out how to get wsdl and what context to use --- terrible hack attack! - if (null == wsdlLocation) { - throw new Axis2BindingRunTimeException( - "Failed to determine wsdl location on binding. Try specifying 'location' attribute on binding."); - } - Definition definition = - wsdlDefinitionRegistry.loadDefinition(namespace+" "+wsdlLocation, deploymentContext.getClassLoader()); - - Port thePort = null; - Service service = null; - // Find the port with the given name - for (Service serv : (Collection) definition.getServices().values()) { - QName sqn = serv.getQName(); - if (serviceName != null && !serviceName.equals(sqn.getLocalPart())) { - continue; - } - - Port p = serv.getPort(portName); - if (p != null) { - service = serv; - thePort = p; - break; - } - } - if (thePort == null) { - throw new IllegalArgumentException("Cannot find WSDL port " + endpoint); - - } - return new WebServiceBindingDefinition(definition, thePort, uri, endpoint, service); - } - // FIXME: Find the first port? - throw new LoaderException("Web Service endpoint cannot be resolved: " + endpoint); - - } - -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/util/TuscanyAxisConfigurator.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/util/TuscanyAxisConfigurator.java deleted file mode 100755 index c0ef46fee3..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/util/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.binding.axis2.util; - -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/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-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/util/WebServiceOperationMetaData.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/util/WebServiceOperationMetaData.java deleted file mode 100755 index c5d3733d01..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/util/WebServiceOperationMetaData.java +++ /dev/null @@ -1,491 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.axis2.util; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import javax.wsdl.Binding; -import javax.wsdl.BindingInput; -import javax.wsdl.BindingOperation; -import javax.wsdl.BindingOutput; -import javax.wsdl.Input; -import javax.wsdl.Message; -import javax.wsdl.Operation; -import javax.wsdl.Output; -import javax.wsdl.Part; -import javax.wsdl.extensions.soap.SOAPBinding; -import javax.wsdl.extensions.soap.SOAPHeader; -import javax.wsdl.extensions.soap.SOAPOperation; -import javax.xml.namespace.QName; - -/** - * Metadata for a WSDL operation - */ -@SuppressWarnings({"all"}) -public class WebServiceOperationMetaData implements Serializable { - private static final long serialVersionUID = 2425306250256227724L; - - // WSDL BindingDefinition and BindingOperation - private Binding binding; - private BindingOperation bindingOperation; - // Fields to cache derived metadata - private transient Set inputHeaderParts; - private transient Set outputHeaderParts; - private transient String style; - private transient String use; - private transient String soapAction; - private transient List signature; - private String encoding; - private transient QName rpcOperationName; - - public WebServiceOperationMetaData(Binding binding, BindingOperation bindingOperation) { - this.binding = binding; - this.bindingOperation = bindingOperation; - } - - public WebServiceOperationMetaData(Binding binding, BindingOperation bindingOperation, String style, String use, - String encoding, - String soapAction) { - this.binding = binding; - this.bindingOperation = bindingOperation; - this.style = style; - this.use = use; - this.encoding = encoding; - this.soapAction = soapAction; - } - - public Set getInputHeaderParts() { - if (inputHeaderParts == null) { - // Build a set of header parts that we need to exclude - inputHeaderParts = new HashSet(); - BindingInput bindingInput = bindingOperation.getBindingInput(); - - if (bindingInput != null) { - Operation operation = bindingOperation.getOperation(); - javax.wsdl.Message message = operation.getInput().getMessage(); - List elements = bindingInput.getExtensibilityElements(); - for (Iterator i = elements.iterator(); i.hasNext();) { - Object extensibilityElement = i.next(); - Part part = getPartFromSOAPHeader(message, extensibilityElement); - if (part != null) { - inputHeaderParts.add(part); - } - } - } - } - return inputHeaderParts; - } - - public Set getOutputHeaderParts() { - if (outputHeaderParts == null) { - // Build a set of header parts that we need to exclude - outputHeaderParts = new HashSet(); - BindingOutput bindingOutput = bindingOperation.getBindingOutput(); - - if (bindingOutput != null) { - Operation operation = bindingOperation.getOperation(); - javax.wsdl.Message message = operation.getOutput().getMessage(); - List elements = bindingOutput.getExtensibilityElements(); - for (Iterator i = elements.iterator(); i.hasNext();) { - Object extensibilityElement = i.next(); - Part part = getPartFromSOAPHeader(message, extensibilityElement); - if (part != null) { - outputHeaderParts.add(part); - } - } - } - } - return outputHeaderParts; - } - - private Part getPartFromSOAPHeader(Message message, Object extensibilityElement) { - Part part = null; - if (extensibilityElement instanceof SOAPHeader) { - SOAPHeader soapHeader = (SOAPHeader) extensibilityElement; - QName msgName = soapHeader.getMessage(); - if (message.getQName().equals(msgName)) { - part = message.getPart(soapHeader.getPart()); - } - } else if (extensibilityElement instanceof SOAPHeader) { - SOAPHeader soapHeader = (SOAPHeader) extensibilityElement; - QName msgName = soapHeader.getMessage(); - if (message.getQName().equals(msgName)) { - part = message.getPart(soapHeader.getPart()); - } - } - return part; - } - - public String getStyle() { - if (style == null) { - SOAPOperation soapOperation = (SOAPOperation) WebServicePortMetaData - .getExtensibilityElement(bindingOperation.getExtensibilityElements(), - SOAPOperation.class); - if (soapOperation != null) { - style = soapOperation.getStyle(); - } - if (style == null) { - SOAPBinding soapBinding = WebServicePortMetaData - .getExtensibilityElement(binding.getExtensibilityElements(), SOAPBinding.class); - if (soapBinding != null) { - style = soapBinding.getStyle(); - } - } - if (style == null) { - style = "document"; - } - } - return style; - } - - /** - * Returns the SOAP action for the given operation. - */ - public String getSOAPAction() { - if (soapAction == null) { - final List wsdlBindingOperationExtensions = bindingOperation.getExtensibilityElements(); - final SOAPOperation soapOp = - WebServicePortMetaData.getExtensibilityElement(wsdlBindingOperationExtensions, SOAPOperation.class); - if (soapOp != null) { - soapAction = soapOp.getSoapActionURI(); - } - } - return soapAction; - } - - public QName getRPCOperationName() { - if (rpcOperationName == null) { - javax.wsdl.extensions.soap.SOAPBody soapBody = getSOAPBody(true); - String ns = - (soapBody != null) ? soapBody.getNamespaceURI() : binding.getPortType().getQName().getNamespaceURI(); - String name = bindingOperation.getOperation().getName(); - rpcOperationName = new QName(ns, name); - } - return rpcOperationName; - } - - private List getSOAPBodyParts(boolean input) { - javax.wsdl.extensions.soap.SOAPBody soapBody = getSOAPBody(input); - if (soapBody != null) { - List parts = soapBody.getParts(); - if (parts != null) { - List names = new ArrayList(); - for (Iterator i = parts.iterator(); i.hasNext();) { - Object part = i.next(); - if (part instanceof String) { - names.add((String) part); - } else if (part instanceof Part) { - names.add(((Part) part).getName()); - } - } - return names; - } else { - return null; - } - } else { - return null; - } - } - - private javax.wsdl.extensions.soap.SOAPBody getSOAPBody(boolean input) { - List elements = null; - if (input) { - BindingInput bindingInput = bindingOperation.getBindingInput(); - if (bindingInput == null) { - return null; - } - elements = bindingInput.getExtensibilityElements(); - } else { - BindingOutput bindingOutput = bindingOperation.getBindingOutput(); - if (bindingOutput == null) { - return null; - } - elements = bindingOutput.getExtensibilityElements(); - } - javax.wsdl.extensions.soap.SOAPBody soapBody = WebServicePortMetaData.getExtensibilityElement(elements, - javax.wsdl.extensions.soap.SOAPBody.class); - return soapBody; - } - - /** - * Returns the use attribute - */ - public String getUse() { - if (use == null) { - javax.wsdl.extensions.soap.SOAPBody soapBody = getSOAPBody(true); - if (soapBody != null) { - use = soapBody.getUse(); - } - if (use == null) { - use = "literal"; - } - } - return use; - } - - @SuppressWarnings("unchecked") - public String getEncoding() { - if (encoding == null) { - javax.wsdl.extensions.soap.SOAPBody soapBody = getSOAPBody(true); - if (soapBody != null) { - List styles = (List) soapBody.getEncodingStyles(); - if (styles != null && !styles.isEmpty()) { - encoding = styles.get(0); - } - } - if (encoding == null) { - encoding = ""; - } - } - return encoding; - } - - public boolean isDocLitWrapped() { - boolean flag = getStyle().equals("document") && getUse().equals("literal"); - if (!flag) { - return false; - } - Message msg = getMessage(true); - if (msg == null) { - return false; - } - List parts = msg.getOrderedParts(null); - if (parts.size() != 1) { - return false; - } - Part part = (Part) parts.get(0); - QName element = part.getElementName(); - if (element == null) { - return false; - } - return element.getLocalPart().equals(bindingOperation.getOperation().getName()); - } - - /* - * public SOAPMediator createMediator(boolean serverMode) throws SOAPException { - * // create a new mediator for each invoke for thread-safety - * boolean rpcStyle = getStyle().equals("rpc"); boolean rpcEncoded = isEncoded(); - * - * SOAPMediator mediator = null; - * - * if (!rpcStyle) { // Document mediator = new SOAPDocumentLiteralMediatorImpl(this, serverMode); - * } else { if (!rpcEncoded) mediator = new - * SOAPRPCLiteralMediatorImpl(this, serverMode); // RPC-literal else mediator = - * new SOAPRPCEncodedMediatorImpl(this, serverMode); // RPC-encoded } - * return mediator; } - */ - - /** - * Get the operation signature from the WSDL operation - */ - public List getOperationSignature() { - if (signature == null) { - signature = new ArrayList(); - - Operation operation = bindingOperation.getOperation(); - if (operation == null) { - return signature; - } - - final Input input = operation.getInput(); - if (input == null) { - return signature; - } - - String sstyle = getStyle(); - - if ("rpc".equals(sstyle)) { - Collection partNames = input.getMessage().getParts().values(); - for (Iterator i = partNames.iterator(); i.hasNext();) { - Part part = (Part) i.next(); - signature.add(part.getName()); - } - } else { - /* - * WS-I Basic Profile 1.1 4.7.6 Operation Signatures Definition: operation signature - * - * The profile defines the "operation signature" to be the fully qualified name of the child element of - * SOAP body of the SOAP input - * message described by an operation in a WSDL binding. - * - * In the case of rpc-literal binding, the operation name is used as a wrapper for the part accessors. - * In the document-literal case, designed so that they meet this requirement. - * - * An endpoint that supports multiple operations must unambiguously identify the operation being - * invoked based on the input message - * that it receives. This is only possible if all the operations specified in the wsdl:binding - * associated with an endpoint have a - * unique operation signature. - * - * R2710 The operations in a wsdl:binding in a DESCRIPTION MUST result in operation signatures that are - * different from one another. - */ - List bodyParts = getSOAPBodyParts(true); - - Collection parts = input.getMessage().getParts().values(); - // Exclude the parts to be transmitted in SOAP header - if (bodyParts == null) { - parts.removeAll(getInputHeaderParts()); - } - for (Iterator i = parts.iterator(); i.hasNext();) { - Part part = (Part) i.next(); - if (bodyParts == null) { - // All parts - QName elementName = part.getElementName(); - if (elementName == null) { - elementName = new QName("", part.getName()); - // TODO: [rfeng] throw new - // ServiceRuntimeException("Message part for - // document style must refer to an XSD element - // using a QName: " + part); - } - signature.add(elementName); - } else { - // "parts" in soap:body - if (bodyParts.contains(part.getName())) { - QName elementName = part.getElementName(); - if (elementName == null) { - elementName = new QName("", part.getName()); - // TODO: [rfeng] throw new - // ServiceRuntimeException("Message part for - // document style must refer to an XSD - // element using a QName: " + part); - } - signature.add(elementName); - } - - } - } - } - } - return signature; - } - - public Message getMessage(boolean isInput) { - Operation operation = bindingOperation.getOperation(); - if (operation == null) { - return null; - } - - if (isInput) { - final Input input = operation.getInput(); - return input == null ? null : input.getMessage(); - } else { - final Output output = operation.getOutput(); - return output == null ? null : output.getMessage(); - } - } - - public Part getInputPart(int index) { - Part part = null; - Message message = getMessage(true); - if (message == null) { - return part; - } - - List parts = message.getOrderedParts(null); - return (Part) parts.get(index); - - } - - public Part getOutputPart(int index) { - Part part = null; - Message message = getMessage(false); - if (message == null) { - return part; - } - - List parts = message.getOrderedParts(null); - return (Part) parts.get(index); - - } - - /** - * Get a list of indexes for each part in the SOAP body - * - * @param isInput - */ - public List getBodyPartIndexes(boolean isInput) { - List indexes = new ArrayList(); - - Message message = getMessage(isInput); - if (message == null) { - return indexes; - } - - List bodyParts = getSOAPBodyParts(isInput); - List parts = message.getOrderedParts(null); - Set headerParts = isInput ? getInputHeaderParts() : getOutputHeaderParts(); - - int index = 0; - for (Iterator i = parts.iterator(); i.hasNext(); index++) { - Part part = (Part) i.next(); - if (headerParts.contains(part)) { - continue; - } - if (bodyParts == null) { - // All parts - indexes.add(index); - } else { - // "parts" in soap:body - if (bodyParts.contains(part.getName())) { - indexes.add(index); - } - } - } - return indexes; - } - - /** - * Get the corresponding index for a part in the SOAP header by element name - * - * @param elementName - * @param isInput - */ - public int getHeaderPartIndex(QName elementName, boolean isInput) { - - Message message = getMessage(isInput); - if (message == null) { - return -1; - } - - List parts = message.getOrderedParts(null); - Set headerParts = isInput ? getInputHeaderParts() : getOutputHeaderParts(); - - int index = 0; - for (Iterator i = parts.iterator(); i.hasNext(); index++) { - Part part = (Part) i.next(); - // Test if the part is in header section - if (headerParts.contains(part) && elementName.equals(part.getElementName())) { - return index; - } - } - return -1; - } - - public BindingOperation getBindingOperation() { - return bindingOperation; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/util/WebServicePortMetaData.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/util/WebServicePortMetaData.java deleted file mode 100755 index a8d4f0f581..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/util/WebServicePortMetaData.java +++ /dev/null @@ -1,377 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.axis2.util; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import javax.wsdl.Binding; -import javax.wsdl.BindingOperation; -import javax.wsdl.Definition; -import javax.wsdl.Operation; -import javax.wsdl.Port; -import javax.wsdl.PortType; -import javax.wsdl.Service; -import javax.wsdl.extensions.soap.SOAPAddress; -import javax.wsdl.extensions.soap.SOAPBinding; -import javax.xml.namespace.QName; - -import org.apache.tuscany.idl.wsdl.WSDLServiceContract; - -/** - * Metadata for a WSDL port - * - */ -public class WebServicePortMetaData { - - private Service wsdlService; - private QName wsdlServiceName; - private Port wsdlPort; - private Binding wsdlBinding; - private QName wsdlPortName; - private PortType wsdlPortType; - private QName wsdlPortTypeName; - private String endpoint; - private boolean managed; - private List allOperationMetaData; - private WSDLServiceContract interfaceType; - - /** - * Constructor - * - * @param wsdlDefinition - */ - public WebServicePortMetaData(Definition wsdlDefinition, Port wsdlPort, String endpoint, boolean managed) { - - // Lookup the named port - this.wsdlPort = wsdlPort; - wsdlPortName = new QName(wsdlDefinition.getTargetNamespace(), wsdlPort.getName()); - Collection services = wsdlDefinition.getServices().values(); - for (Object serviceObj : services) { - Service service = (Service) serviceObj; - if (service.getPorts().containsValue(wsdlPort)) { - wsdlService = service; - wsdlServiceName = service.getQName(); - break; - } - } - - // Save the binding - wsdlBinding = wsdlPort.getBinding(); - if (wsdlBinding == null) { - throw new IllegalArgumentException("WSDL binding cannot be found for " + wsdlPortName); - } - - // Save the portType - wsdlPortType = wsdlBinding.getPortType(); - if (wsdlPortType == null) { - throw new IllegalArgumentException("WSDL portType cannot be found for " + wsdlPortName); - } - wsdlPortTypeName = wsdlPortType.getQName(); - - // Save the endpoint - this.endpoint = endpoint; - - // Track if this endpoint is managed or not - this.managed = managed; - } - - /** - * Constructor - * - * @param serviceName - * @param portName - * @param portTypeName - * @param endpoint - */ - public WebServicePortMetaData(QName serviceName, String portName, QName portTypeName, String endpoint) { - wsdlServiceName = serviceName; - wsdlPortName = new QName(serviceName.getNamespaceURI(), portName); - wsdlPortTypeName = portTypeName; - this.endpoint = endpoint; - } - - /** - * @return Returns the wsdlPort. - */ - public javax.wsdl.Port getPort() { - return wsdlPort; - } - - /** - * @return Returns the wsdlService. - */ - public QName getServiceName() { - return wsdlServiceName; - } - - /** - * @return Returns the wsdlService. - */ - public javax.wsdl.Service getService() { - return wsdlService; - } - - /** - * @return Returns the wsdlPortType. - */ - public PortType getPortType() { - return wsdlPortType; - } - - /** - * @return Returns the wsdlPortType. - */ - public QName getPortTypeName() { - return wsdlPortTypeName; - } - - /** - * @return Returns the wsdlBinding. - */ - public Binding getBinding() { - return wsdlBinding; - } - - /** - * @return Returns the wsdlPortName. - */ - public QName getPortName() { - return wsdlPortName; - } - - /** - * Returns the endpoint of a given port. - */ - public String getEndpoint() { - - // Return the specified endpoint - if (endpoint != null) { - return endpoint; - } - - // Find the target endpoint on the port - if (wsdlPort != null) { - final List wsdlPortExtensions = wsdlPort.getExtensibilityElements(); - for (final Object extension : wsdlPortExtensions) { - if (extension instanceof SOAPAddress) { - return ((SOAPAddress) extension).getLocationURI(); - } - } - } - - return null; - } - - /** - * Returns the SOAP binding style. - */ - public String getStyle() { - - // Find the binding style - String style = null; - if (wsdlBinding != null) { - final List wsdlBindingExtensions = wsdlBinding.getExtensibilityElements(); - SOAPBinding soapBinding = getExtensibilityElement(wsdlBindingExtensions, SOAPBinding.class); - if (soapBinding != null) { - style = soapBinding.getStyle(); - } - } - - // Default to document - return (style == null) ? "document" : style; - } - - /** - * Returns the use attribute - */ - public String getUse() { - List list = getAllOperationMetaData(); - return list.get(0).getUse(); - } - - /** - * Returns the encoding attribute - */ - public String getEncoding() { - List list = getAllOperationMetaData(); - return list.get(0).getEncoding(); - } - - /** - * @return Returns true if this is a managed web service. - */ - public boolean isManaged() { - return managed; - } - - /** - * Returns the first extensibility element of the given type. - * - * @param elements - * @param type - */ - public static T getExtensibilityElement(List elements, Class type) { - for (Object element : elements) { - if (type.isInstance(element)) { - return type.cast(element); - } - } - return null; - } - - /** - * Returns the extensibility elements of the given type. - * - * @param elements - * @param type - * @return List - */ - public static List getExtensibilityElements(List elements, Class type) { - List result = new ArrayList(); - for (Object element : elements) { - if (type.isInstance(element)) { - result.add(type.cast(element)); - } - } - return result; - } - - /** - * Get the operation signature from the SOAP Body - * - * @return A list of QNames - */ - // public static List getOperationSignature(javax.xml.soap.SOAPBody body) { - // List signature = new ArrayList(); - // for (Iterator i = body.getChildElements(); i.hasNext();) { - // Object child = i.next(); - // if (child instanceof SOAPBodyElement) { - // Name name = ((SOAPBodyElement) child).getElementName(); - // QName qname = new QName(name.getURI(), name.getLocalName(), name.getPrefix()); - // signature.add(qname); - // } - // } - // return signature; - // } - // public static List getRPCOperationSignature(javax.xml.soap.SOAPBody body) { - // List signature = new ArrayList(); - // for (Iterator i = body.getChildElements(); i.hasNext();) { - // Object child = i.next(); - // if (child instanceof SOAPBodyElement) { - // SOAPBodyElement op = ((SOAPBodyElement) child); - // for (Iterator j = op.getChildElements(); j.hasNext();) { - // Object part = i.next(); - // if (part instanceof SOAPElement) { - // SOAPElement p = (SOAPElement) part; - // signature.add(p.getLocalName()); - // } - // } - // } - // } - // return signature; - // } - // public WebServiceOperationMetaData getOperationMetaData(javax.xml.soap.SOAPBody body) { - // List s1 = getOperationSignature(body); - // // List rpcParts = getRPCOperationSignature(body); - // for (Iterator it = getAllOperationMetaData().iterator(); it.hasNext();) { - // WebServiceOperationMetaData descriptor = (WebServiceOperationMetaData) it.next(); - // - // String style = descriptor.getStyle(); - // - // if (style.equals("document")) { - // List s2 = descriptor.getOperationSignature(); - // if (s1.equals(s2)) - // return descriptor; - // } else { - // QName op1 = (QName) s1.get(0); - // QName op2 = descriptor.getRPCOperationName(); - // if (op1.equals(op2)) { - // /* - // * // FIXME: [rfeng] We don't support method overloading - // * List partNames = getOperationSignature(binding, - // * bindingOperation); if (rpcParts.equals(partNames)) - // */ - // return descriptor; - // } - // } - // } - // return null; - // } - public List getAllOperationMetaData() { - if (allOperationMetaData == null) { - allOperationMetaData = new ArrayList(); - for (Iterator it = wsdlBinding.getBindingOperations().iterator(); it.hasNext();) { - final BindingOperation bindingOperation = (BindingOperation) it.next(); - if (bindingOperation.getOperation() != null) { - allOperationMetaData.add(new WebServiceOperationMetaData(wsdlBinding, bindingOperation)); - } - } - } - return allOperationMetaData; - } - - public WebServiceOperationMetaData getOperationMetaData(String operationName) { - StringBuilder sb = new StringBuilder(operationName); - sb.setCharAt(0, Character.toUpperCase(sb.charAt(0))); - String capatalizedOpName = sb.toString(); - - for (WebServiceOperationMetaData webServiceOperationMetaData : getAllOperationMetaData()) { - WebServiceOperationMetaData descriptor = (WebServiceOperationMetaData) webServiceOperationMetaData; - String opName = descriptor.getBindingOperation().getOperation().getName(); - - if (opName.equals(operationName) || opName.equals(capatalizedOpName)) { - return descriptor; - } - } - return null; - } - - /** - * Returns the WSDL service contract - * - * @return WSDLServiceContract - */ - public WSDLServiceContract getInterfaceType() { - return interfaceType; - } - - /** - * Get the WSDL operation name for a Java method name - */ - public String getWSDLOperationName(String methodName) { - StringBuilder sb = new StringBuilder(methodName); - sb.setCharAt(0, Character.toUpperCase(sb.charAt(0))); - String capatalizedOpName = sb.toString(); - for (Object o : wsdlPortType.getOperations()) { - Operation operation = (Operation) o; - String wsdlOpName = operation.getName(); - if (wsdlOpName.equals(methodName)) { - return wsdlOpName; - } - if (wsdlOpName.equals(capatalizedOpName)) { - return wsdlOpName; - } - } - return null; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/resources/META-INF/sca/binding.axis2.scdl b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/resources/META-INF/sca/binding.axis2.scdl deleted file mode 100644 index ee1b8d9e81..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/resources/META-INF/sca/binding.axis2.scdl +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - org.apache.tuscany.sca.extensions.axis2 - tuscany-axis2 - 0.1-integration-incubating-SNAPSHOT - - - - org.apache.tuscany.sca.extensions.axis2 - databinding-axiom - 0.1-integration-incubating-SNAPSHOT - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/resources/META-INF/sca/default.scdl b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/resources/META-INF/sca/default.scdl deleted file mode 100644 index fd5c2f5baa..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/resources/META-INF/sca/default.scdl +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - org.apache.tuscany.sca.extensions.axis2 - tuscany-axis2 - 0.1-integration-incubating-SNAPSHOT - - - - org.apache.tuscany.sca.extensions.axis2 - databinding-axiom - 0.1-integration-incubating-SNAPSHOT - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/resources/META-INF/sca/extension.composite b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/resources/META-INF/sca/extension.composite deleted file mode 100644 index 10306d8968..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/resources/META-INF/sca/extension.composite +++ /dev/null @@ -1,22 +0,0 @@ - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml b/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/resources/org/apache/tuscany/binding/axis2/engine/config/axis2.xml deleted file mode 100755 index e4f6d699f9..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/resources/org/apache/tuscany/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-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilderTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilderTestCase.java deleted file mode 100644 index 4cb40b0a23..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilderTestCase.java +++ /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.binding.axis2; - -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; - -import java.net.URI; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.Service; -import javax.wsdl.extensions.soap.SOAPAddress; -import javax.xml.namespace.QName; - -import junit.framework.TestCase; - -import org.apache.tuscany.spi.component.Component; -import org.apache.tuscany.spi.component.CompositeComponent; - -/** - * Tests for the WebServicebindingLoader class - */ -@SuppressWarnings("deprecation") -public class Axis2BindingBuilderTestCase extends TestCase { - - private CompositeComponent parent; - - private static final String NAME = "MyService"; - private static final URI COMPOSITE_NAME = URI.create("MyComposite"); - private static final URI COMPOSITE_NAME2 = URI.create("MyComposite2"); - private static final String BASE_URI = "http://localhost/services"; - - public void testDefaultURI() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition(null, null, null, null, null, null); - URI uri = builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME, NAME, parent); - assertEquals("http://localhost/services/MyComposite/MyService", uri.toString()); - } - - public void testDefaultURIMultiServices() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition(null, null, null, null, null, null); - URI uri = builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME2, NAME, parent); - assertEquals("http://localhost/services/MyComposite2/MyService", uri.toString()); - } - - public void testExplicitURI() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition(null, null, null, null, null, "http://foo/bar"); - URI uri = builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME, NAME, parent); - assertEquals("http://foo/bar", uri.toString()); - } - - public void testExplicitWSDL() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition("myNS", createMockWSDL("http://my/wsdl/uri"), "myService", "myPort", null, null); - URI uri = builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME, NAME, parent); - assertEquals("http://my/wsdl/uri", uri.toString()); - } - - public void testExplicitWSDLExplicitURI() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition("myNS", createMockWSDL("http://my/wsdl/uri"), "myService", "myPort", null, "foo"); - try { - builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME, NAME, parent); - fail(); - } catch (IllegalArgumentException e) { - // expected - } - } - - public void testExplicitWSDLBindingExplicitURI() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition("myNS", createMockWSDLBinding("http://my/wsdl/uri"), null, null, "myBinding", "http://my/uri"); - URI uri = builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME, NAME, parent); - - // explicit URI should be used as the WSDL binding is used not the wsdl service/port - assertEquals("http://my/uri", uri.toString()); - } - - public void testExplicitWSDLBindingExplicitRelativeURI() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition("myNS", createMockWSDLBinding("http://my/wsdl/uri"), null, null, "myBinding", "x/y"); - URI uri = builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME, NAME, parent); - assertEquals("http://localhost/services/MyComposite/x/y", uri.toString()); - } - - public void testExplicitWSDLBindingExplicitRelativeURIWithDot() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition("myNS", createMockWSDLBinding("http://my/wsdl/uri"), null, null, "myBinding", "x/./y"); - URI uri = builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME, NAME, parent); - assertEquals("http://localhost/services/MyComposite/x/y", uri.toString()); - } - - public void testExplicitWSDLBindingExplicitRelativeURIWithDots() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition("myNS", createMockWSDLBinding("http://my/wsdl/uri"), null, null, "myBinding", "../x/y"); - URI uri = builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME, NAME, parent); - assertEquals("http://localhost/services/x/y", uri.toString()); - } - - public void testExplicitRelativeWSDL() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition("myNS", createMockWSDL("foo/bar"), "myService", "myPort", null, null); - URI uri = builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME, NAME, parent); - assertEquals("http://localhost/services/MyComposite/MyService/foo/bar", uri.toString()); - } - - public void testExplicitRelativeWSDLMultiServices() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition("myNS", createMockWSDL("foo/bar"), "myService", "myPort", null, null); - URI uri = builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME2, NAME, parent); - assertEquals("http://localhost/services/MyComposite2/MyService/foo/bar", uri.toString()); - } - - public void testExplicitRelativeWSDLWithDots() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition("myNS", createMockWSDL("../foo/bar"), "myService", "myPort", null, null); - URI uri = builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME, NAME, parent); - assertEquals("http://localhost/services/MyComposite/foo/bar", uri.toString()); - } - - public void testExplicitRelativeWSDLWithDotsMultiService() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition("myNS", createMockWSDL("../foo/bar"), "myService", "myPort", null, null); - URI uri = builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME2, NAME, parent); - assertEquals("http://localhost/services/MyComposite2/foo/bar", uri.toString()); - } - - public void testExplicitRelativeWSDLExplicitURI() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition("myNS", createMockWSDL("foo/bar"), "myService", "myPort", null, "http://my/wsdl/uri"); - URI uri = builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME, NAME, parent); - assertEquals("http://my/wsdl/uri/foo/bar", uri.toString()); - } - - public void testExplicitRelativeWSDLWithDotsExplicitURI() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition("myNS", createMockWSDL("../foo/bar"), "myService", "myPort", null, "http://my/wsdl/uri"); - URI uri = builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME, NAME, parent); - assertEquals("http://my/wsdl/foo/bar", uri.toString()); - } - - public void testExplicitRelativeWSDLExplicitRelativeURI() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition("myNS", createMockWSDL("foo/bar"), "myService", "myPort", null, "x/y"); - URI uri = builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME, NAME, parent); - assertEquals("http://localhost/services/MyComposite/x/y/foo/bar", uri.toString()); - } - - public void testExplicitRelativeWSDLExplicitRelativeURIWithDots() throws Exception { - Axis2BindingBuilder builder = new Axis2BindingBuilder(); - WebServiceBindingDefinition wsBinding = new WebServiceBindingDefinition("myNS", createMockWSDL("foo/bar"), "myService", "myPort", null, "../x/y"); - URI uri = builder.computeActualURI(wsBinding, BASE_URI, COMPOSITE_NAME, NAME, parent); - assertEquals("http://localhost/services/x/y/foo/bar", uri.toString()); - } - - protected Definition createMockWSDL(String endpoint) { - Definition mockDef = createMock(Definition.class); - - Service wsdlService = createMock(Service.class); - expect(wsdlService.getQName()).andReturn(new QName("myNS", "myService")); - - Port wsdlPort = createMock(Port.class); - List ees = new ArrayList(); - SOAPAddress sa = createMock(SOAPAddress.class); - expect(sa.getLocationURI()).andReturn(endpoint); - ees.add(sa); - expect(wsdlPort.getExtensibilityElements()).andReturn(ees); - - expect(wsdlService.getPort("myPort")).andReturn(wsdlPort); - - Map services = new HashMap(); - services.put("myService", wsdlService); - expect(mockDef.getServices()).andReturn(services); - - replay(mockDef); - replay(wsdlService); - replay(wsdlPort); - replay(sa); - return mockDef; - } - protected Definition createMockWSDLBinding(String endpoint) { - Definition mockDef = createMock(Definition.class); - replay(mockDef); - return mockDef; - } - - protected void setUp() { - parent = createMock(CompositeComponent.class); - Component comp1 = createMock(Component.class); - Component comp2 = createMock(Component.class); - Collection wires1 = new ArrayList(); - wires1.add("dummy1"); - Collection wires2 = new ArrayList(); - wires2.add("dummy1"); - wires2.add("dummy2"); - expect(comp1.getInboundWires()).andReturn(wires1); - expect(comp2.getInboundWires()).andReturn(wires2); - expect(parent.getChild(COMPOSITE_NAME.toString())).andReturn(comp1); - expect(parent.getChild(COMPOSITE_NAME2.toString())).andReturn(comp2); - replay(comp1); - replay(comp2); - replay(parent); - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/Axis2ReferenceTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/Axis2ReferenceTestCase.java deleted file mode 100755 index e8f1f29034..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/Axis2ReferenceTestCase.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.axis2; - -import static org.apache.tuscany.spi.model.Operation.NO_CONVERSATION; - -import java.lang.reflect.Type; -import java.net.URL; -import java.util.HashMap; - -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.Service; -import javax.wsdl.factory.WSDLFactory; -import javax.wsdl.xml.WSDLReader; -import javax.xml.namespace.QName; - -import junit.framework.TestCase; - -import org.apache.tuscany.idl.wsdl.WSDLServiceContract; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.idl.java.JavaServiceContract; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.model.ServiceContract; -import org.apache.tuscany.spi.wire.InboundWire; -import org.apache.tuscany.spi.wire.TargetInvoker; -import org.apache.tuscany.spi.wire.WireService; -import org.easymock.EasyMock; -import org.xml.sax.InputSource; - -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 - InboundWire inboundWire = EasyMock.createNiceMock(InboundWire.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.getServiceContract()).andReturn(contract).anyTimes(); - EasyMock.replay(inboundWire); - - axis2Reference.setInboundWire(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. - WireService wireService = EasyMock.createNiceMock(WireService.class); - EasyMock.replay(wireService); - CompositeComponent parent = EasyMock.createNiceMock(CompositeComponent.class); - // TODO figure out what to do with the service contract - ServiceContract contract = new WSDLServiceContract(); - contract.setInterfaceClass(Greeter.class); - return new Axis2ReferenceBinding(serviceName, - parent, - wsBinding, - contract, - null, - null); - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/Axis2ServiceTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/Axis2ServiceTestCase.java deleted file mode 100755 index 03340275b3..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/Axis2ServiceTestCase.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.axis2; - -import java.lang.reflect.Method; -import java.lang.reflect.Type; -import java.net.URL; -import java.util.HashMap; -import java.util.Map; -import javax.servlet.Servlet; -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.Service; -import javax.wsdl.factory.WSDLFactory; -import javax.wsdl.xml.WSDLReader; -import javax.xml.namespace.QName; - -import org.xml.sax.InputSource; - -import org.apache.tuscany.spi.host.ServletHost; -import org.apache.tuscany.spi.idl.java.JavaServiceContract; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.wire.InboundWire; -import org.apache.tuscany.spi.wire.OutboundInvocationChain; -import org.apache.tuscany.spi.wire.OutboundWire; -import org.apache.tuscany.spi.wire.WireService; - -import junit.framework.TestCase; -import org.apache.axis2.context.ConfigurationContext; -import org.apache.tuscany.binding.axis2.util.TuscanyAxisConfigurator; -import org.apache.tuscany.core.component.WorkContextImpl; -import org.easymock.EasyMock; - -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(InboundWire.class)); - EasyMock.expectLastCall().andReturn(null); - EasyMock.replay(wireService); - - //Create a mocked InboundWire, make the call of ServiceBindingExtension.getInterface() returns a Class - InboundWire inboundWire = EasyMock.createNiceMock(InboundWire.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.getServiceContract()).andReturn(contract).anyTimes(); - if (callback) { - contract.setCallbackName(""); - } - EasyMock.replay(inboundWire); - - OutboundWire outboundWire = EasyMock.createNiceMock(OutboundWire.class); - Map, OutboundInvocationChain> map = new HashMap, OutboundInvocationChain>(); - EasyMock.expect(outboundWire.getInvocationChains()).andReturn(map).once(); - EasyMock.replay(outboundWire); - - TuscanyAxisConfigurator tuscanyAxisConfigurator = new TuscanyAxisConfigurator(); - ConfigurationContext configurationContext = tuscanyAxisConfigurator.getConfigurationContext(); - Axis2ServiceBinding axis2Service = - new Axis2ServiceBinding(serviceName, - contract, - null, - null, - wsBinding, - tomcatHost, - configurationContext, new WorkContextImpl()); - axis2Service.setInboundWire(inboundWire); - axis2Service.setOutboundWire(outboundWire); - - return axis2Service; - } - - protected class TestServletHost implements ServletHost { - private Map mappings = new HashMap(); - - public void registerMapping(String mapping, Servlet servlet) { - mappings.put(mapping, servlet); - } - - public Servlet unregisterMapping(String mapping) { - return mappings.remove(mapping); - } - - public Servlet getMapping(String mapping) { - return mappings.get(mapping); - } - - public boolean isMappingRegistered(String mapping) { - return mappings.containsKey(mapping); - } - - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/Greeter.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/Greeter.java deleted file mode 100755 index 39fccdadd3..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/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.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-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/GreetingCallback.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/GreetingCallback.java deleted file mode 100644 index 4c3b3304ea..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/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.binding.axis2; - -public interface GreetingCallback { - - void greetMeCallback(String greetMeResponse); -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/WebServicebindingLoaderTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/WebServicebindingLoaderTestCase.java deleted file mode 100644 index 75a848b88e..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/java/org/apache/tuscany/binding/axis2/WebServicebindingLoaderTestCase.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.axis2; - -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; - -import java.util.HashMap; -import java.util.Map; - -import javax.wsdl.Binding; -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.Service; -import javax.xml.namespace.QName; - -import junit.framework.TestCase; - -import org.apache.tuscany.idl.wsdl.WSDLDefinitionRegistry; -import org.easymock.EasyMock; - -/** - * Tests for the WebServicebindingLoader class - */ -@SuppressWarnings("deprecation") -public class WebServicebindingLoaderTestCase extends TestCase { - - public void testCreateWSBinding() throws Exception { - WSDLDefinitionRegistry wsdlReg = createMock(WSDLDefinitionRegistry.class); - Definition mockDef = createMock(Definition.class); - expect(wsdlReg.getDefinition("myNS")).andReturn(mockDef); - replay(wsdlReg); - - WebServiceBindingLoader loader = new WebServiceBindingLoader(null, wsdlReg); - - WebServiceBindingDefinition binding = loader.createWSBinding("myNS#wsdl.service(myService)", null, null, null); - assertEquals(mockDef, binding.getWSDLDefinition()); - - EasyMock.verify(wsdlReg); - } - - public void testCreateWSBindingWsdlService() throws Exception { - WSDLDefinitionRegistry wsdlReg = createMock(WSDLDefinitionRegistry.class); - Definition mockDef = createMock(Definition.class); - - Service wsdlService = createMock(Service.class); - expect(wsdlService.getQName()).andReturn(new QName("myNS", "myService")); - - Map services = new HashMap(); - services.put("myService", wsdlService); - expect(mockDef.getServices()).andReturn(services); - - expect(wsdlReg.getDefinition("myNS")).andReturn(mockDef); - - replay(wsdlService); - replay(wsdlReg); - replay(mockDef); - - WebServiceBindingLoader loader = new WebServiceBindingLoader(null, wsdlReg); - - WebServiceBindingDefinition binding = loader.createWSBinding("myNS#wsdl.service(myService)", null, null, null); - assertEquals(mockDef, binding.getWSDLDefinition()); - - assertEquals(wsdlService, binding.getWSDLService()); - - EasyMock.verify(wsdlService); - EasyMock.verify(wsdlReg); - EasyMock.verify(mockDef); - } - - public void testCreateWSBindingWsdlPort() throws Exception { - WSDLDefinitionRegistry wsdlReg = createMock(WSDLDefinitionRegistry.class); - Definition mockDef = createMock(Definition.class); - - Service wsdlService = createMock(Service.class); - expect(wsdlService.getQName()).andReturn(new QName("myNS", "myService")); - - Port wsdlPort = createMock(Port.class); - expect(wsdlService.getPort("myPort")).andReturn(wsdlPort); - - Map services = new HashMap(); - services.put("myService", wsdlService); - expect(mockDef.getServices()).andReturn(services); - - expect(wsdlReg.getDefinition("myNS")).andReturn(mockDef); - - replay(wsdlService); - replay(wsdlReg); - replay(mockDef); - - WebServiceBindingLoader loader = new WebServiceBindingLoader(null, wsdlReg); - - WebServiceBindingDefinition binding = loader.createWSBinding("myNS#wsdl.port(myService/myPort)", null, null, null); - assertEquals(mockDef, binding.getWSDLDefinition()); - - assertEquals(wsdlPort, binding.getWSDLPort()); - - EasyMock.verify(wsdlService); - EasyMock.verify(wsdlReg); - EasyMock.verify(mockDef); - } - - public void testCreateWSBindingWsdlBinding() throws Exception { - WSDLDefinitionRegistry wsdlReg = createMock(WSDLDefinitionRegistry.class); - Definition mockDef = createMock(Definition.class); - - Binding wsdlBinding = createMock(Binding.class); - QName bindingQN = new QName("myNS", "myBinding"); - expect(mockDef.getBinding(bindingQN)).andReturn(wsdlBinding); - - expect(wsdlReg.getDefinition("myNS")).andReturn(mockDef); - - replay(wsdlReg); - replay(mockDef); - - WebServiceBindingLoader loader = new WebServiceBindingLoader(null, wsdlReg); - - WebServiceBindingDefinition binding = loader.createWSBinding("myNS#wsdl.binding(myBinding)", null, null, null); - assertEquals(mockDef, binding.getWSDLDefinition()); - - assertEquals(wsdlBinding, binding.getBinding()); - - EasyMock.verify(wsdlReg); - EasyMock.verify(mockDef); - } - - public void testGetWSDLElementURIValue() throws Exception { - WebServiceBindingLoader loader = new WebServiceBindingLoader(null, null); - assertEquals("myValue", loader.getWSDLElementURIValue("myNs#wsdl.foo(myValue)", "wsdl.foo")); - assertNull(loader.getWSDLElementURIValue("myNs#wsdl.XXX(myValue)", "wsdl.foo")); - } - - public void testBadGetWSDLElementURIValue() throws Exception { - WebServiceBindingLoader loader = new WebServiceBindingLoader(null, null); - try { - loader.getWSDLElementURIValue("myNs#wsdl.foo(myValue", "wsdl.foo"); - fail(); - } catch (IllegalArgumentException e) { - // expected - } - } - - public void testGetWSDLNamespace() throws Exception { - WebServiceBindingLoader loader = new WebServiceBindingLoader(null, null); - assertEquals("myNS", loader.getWSDLNamespace("myNS#bla")); - } - - public void testNullGetWSDLNamespace() throws Exception { - WebServiceBindingLoader loader = new WebServiceBindingLoader(null, null); - assertNull(loader.getWSDLNamespace("")); - assertNull(loader.getWSDLNamespace(null)); - } - - public void testBadGetWSDLNamespace() throws Exception { - WebServiceBindingLoader loader = new WebServiceBindingLoader(null, null); - try { - loader.getWSDLNamespace("bla"); - fail(); - } catch (IllegalArgumentException e) { - // expected - } - try { - loader.getWSDLNamespace("#bla"); - fail(); - } catch (IllegalArgumentException e) { - // expected - } - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/resources/wsdl/hello_world_doc_lit.wsdl b/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/resources/wsdl/hello_world_doc_lit.wsdl deleted file mode 100755 index d0958f282e..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/binding/src/test/resources/wsdl/hello_world_doc_lit.wsdl +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/databinding/.ruleset b/branches/sca-java-integration/sca/extensions/axis2/databinding/.ruleset deleted file mode 100644 index e615e93a4b..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/.ruleset +++ /dev/null @@ -1,172 +0,0 @@ - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/databinding/LICENSE.txt b/branches/sca-java-integration/sca/extensions/axis2/databinding/LICENSE.txt deleted file mode 100755 index d645695673..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/branches/sca-java-integration/sca/extensions/axis2/databinding/NOTICE.txt b/branches/sca-java-integration/sca/extensions/axis2/databinding/NOTICE.txt deleted file mode 100644 index d83ebbe236..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/NOTICE.txt +++ /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-integration/sca/extensions/axis2/databinding/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/databinding/pom.xml deleted file mode 100755 index 09dae91e74..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2 - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - databinding-axiom - Apache Tuscany Data Binding for Axiom - Tuscany Axiom Data Binding - - - - - org.apache.tuscany.sca.kernel - tuscany-spi - - - - org.apache.ws.commons.axiom - axiom-api - - - xerces - xercesImpl - - - - - - xerces - xercesImpl - - - - org.apache.ws.commons.axiom - axiom-impl - runtime - - - - junit - junit - - - - org.codehaus.woodstox - wstx-asl - - - - commons-logging - commons-logging - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/AxiomDataBinding.java b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/AxiomDataBinding.java deleted file mode 100644 index 68232cf2b8..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/AxiomDataBinding.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.databinding.axiom; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.spi.databinding.DataBinding; -import org.apache.tuscany.spi.databinding.ExceptionHandler; -import org.apache.tuscany.spi.databinding.WrapperHandler; -import org.apache.tuscany.spi.databinding.extension.DataBindingExtension; -import org.osoa.sca.annotations.Service; - -/** - * DataBinding for AXIOM - */ -@Service(DataBinding.class) -public class AxiomDataBinding extends DataBindingExtension { - - 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.spi.databinding.extension.DataBindingExtension#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-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/AxiomExceptionHandler.java b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/AxiomExceptionHandler.java deleted file mode 100644 index 64fd0221ff..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/AxiomExceptionHandler.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.databinding.axiom; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.spi.databinding.ExceptionHandler; -import org.apache.tuscany.spi.idl.ServiceFaultException; -import org.apache.tuscany.spi.idl.XMLType; -import org.apache.tuscany.spi.model.DataType; - -/** - * 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 ServiceFaultException(message, (OMElement)faultInfo, cause); - } - - public Object getFaultInfo(Exception exception) { - if (exception == null) { - return null; - } - ServiceFaultException faultException = (ServiceFaultException)exception; - return faultException.getFaultInfo(); - - } - - public DataType getFaultType(DataType exceptionType) { - if (ServiceFaultException.class == exceptionType.getPhysical()) { - XMLType type = XMLType.UNKNOWN; - if(exceptionType.getLogical() instanceof XMLType) { - type = (XMLType) exceptionType.getLogical(); - } - DataType faultType = new DataType(AxiomDataBinding.NAME, OMElement.class, type); - return faultType; - } else { - return null; - } - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/AxiomHelper.java b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/AxiomHelper.java deleted file mode 100644 index b5fb40fa86..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/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.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.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.idl.XMLType; -import org.apache.tuscany.spi.model.DataType; - -/** - * 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-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2Object.java b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2Object.java deleted file mode 100644 index 91b1f4da90..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2Object.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.databinding.axiom; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.SimpleType2JavaTransformer; -import org.osoa.sca.annotations.Service; - -/** - * Transformer to convert data from a simple java bject to OMElement - */ -@Service(Transformer.class) -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-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2String.java b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2String.java deleted file mode 100755 index 52be08537d..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2String.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.databinding.axiom; - -import java.io.StringWriter; - -import javax.xml.stream.XMLStreamException; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; - -/** - * Transformer to convert data from an OMElement to XML String - */ -@Service(Transformer.class) -public class OMElement2String extends TransformerExtension 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-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2XMLStreamReader.java b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2XMLStreamReader.java deleted file mode 100755 index 343408a027..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/OMElement2XMLStreamReader.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.databinding.axiom; - -import javax.xml.stream.XMLStreamReader; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; - -@Service(Transformer.class) -public class OMElement2XMLStreamReader extends TransformerExtension 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-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/OMElementWrapperHandler.java b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/OMElementWrapperHandler.java deleted file mode 100644 index 4afc067516..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/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.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.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.WrapperHandler; -import org.apache.tuscany.spi.idl.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-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/Object2OMElement.java b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/Object2OMElement.java deleted file mode 100644 index 8b226319ae..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/Object2OMElement.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.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.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.Java2SimpleTypeTransformer; -import org.osoa.sca.annotations.Service; - -/** - * Transformer to convert data from an simple OMElement to Java Object - */ -@Service(Transformer.class) -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-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/String2OMElement.java b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/String2OMElement.java deleted file mode 100755 index eb0869dfd7..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/String2OMElement.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.databinding.axiom; - -import java.io.ByteArrayInputStream; - -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.impl.builder.StAXOMBuilder; -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; - -@Service(Transformer.class) -public class String2OMElement extends TransformerExtension 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-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/XMLStreamReader2OMElement.java b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/XMLStreamReader2OMElement.java deleted file mode 100755 index e882d0f086..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/java/org/apache/tuscany/databinding/axiom/XMLStreamReader2OMElement.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.axiom; - -import javax.xml.stream.XMLStreamReader; - -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.impl.builder.StAXOMBuilder; -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; - -@Service(Transformer.class) -public class XMLStreamReader2OMElement extends TransformerExtension 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-integration/sca/extensions/axis2/databinding/src/main/resources/META-INF/sca/databinding.axiom.scdl b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/resources/META-INF/sca/databinding.axiom.scdl deleted file mode 100644 index 34ff82ddd5..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/resources/META-INF/sca/databinding.axiom.scdl +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - org.apache.tuscany.sca.extensions.axis2 - databinding-axiom - 0.1-integration-incubating-SNAPSHOT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/resources/META-INF/sca/default.scdl b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/resources/META-INF/sca/default.scdl deleted file mode 100644 index ac92746c8d..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/resources/META-INF/sca/default.scdl +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - org.apache.tuscany.sca.extensions.axis2 - databinding-axiom - 0.1-integration-incubating-SNAPSHOT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/resources/META-INF/sca/extension.composite b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/resources/META-INF/sca/extension.composite deleted file mode 100644 index 09cab77b5a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/main/resources/META-INF/sca/extension.composite +++ /dev/null @@ -1,22 +0,0 @@ - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/java/org/apache/tuscany/databinding/axiom/AxiomExceptionHandlerTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/java/org/apache/tuscany/databinding/axiom/AxiomExceptionHandlerTestCase.java deleted file mode 100644 index 2e7eccf620..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/java/org/apache/tuscany/databinding/axiom/AxiomExceptionHandlerTestCase.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.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.spi.idl.ServiceFaultException; -import org.apache.tuscany.spi.idl.XMLType; -import org.apache.tuscany.spi.model.DataType; - -/** - * 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 DataType(ServiceFaultException.class, null)); - assertEquals(OMElement.class, dataType.getPhysical()); - assertEquals(XMLType.UNKNOWN, dataType.getLogical()); - assertEquals(AxiomDataBinding.NAME, dataType.getDataBinding()); - dataType = handler.getFaultType(new DataType(Exception.class, null)); - assertNull(dataType); - } - - public void testCreate() { - - Exception ex = handler.createException(null, "Order", faultElement, null); - assertTrue(ex instanceof ServiceFaultException); - ServiceFaultException exception = (ServiceFaultException)ex; - assertEquals("Order", exception.getMessage()); - assertSame(faultElement, exception.getFaultInfo()); - } - - public void testGetFaultInfo() { - ServiceFaultException exception = new ServiceFaultException("Order", faultElement, null); - Object faultInfo = handler.getFaultInfo(exception); - assertSame(faultElement, faultInfo); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/java/org/apache/tuscany/databinding/axiom/OMElementTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/java/org/apache/tuscany/databinding/axiom/OMElementTestCase.java deleted file mode 100755 index 917d090fc7..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/java/org/apache/tuscany/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.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-integration/sca/extensions/axis2/databinding/src/test/resources/ipo.xml b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/resources/ipo.xml deleted file mode 100755 index 58058dbe1a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/resources/ipo.xml +++ /dev/null @@ -1,33 +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-integration/sca/extensions/axis2/databinding/src/test/resources/ipo.xsd b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/resources/ipo.xsd deleted file mode 100755 index 5468542693..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/resources/ipo.xsd +++ /dev/null @@ -1,118 +0,0 @@ - - - - - International Purchase order schema for Example.com - Copyright 2000 Example.com. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/resources/order.wsdl b/branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/resources/order.wsdl deleted file mode 100644 index cde45f12ae..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/databinding/src/test/resources/order.wsdl +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/pom.xml deleted file mode 100644 index b5c8de523a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/pom.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2 - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - org.apache.tuscany.testing - axis2-itest-old-style - ${testing.version} - jar - Apache Tuscany Axis2 itests old style scdl - - - - org.apache.tuscany.sca.kernel - tuscany-api - compile - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - org.apache.tuscany.sca.services.idl - tuscany-wsdl - 0.1-integration-incubating-SNAPSHOT - runtime - - - org.apache.tuscany.sca.extensions.axis2 - tuscany-axis2 - runtime - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sca.services - tuscany-http-jetty - runtime - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sdo - tuscany-sdo-impl - 1.0-incubator-SNAPSHOT - compile - - - org.apache.tuscany.sca.services.databinding - databinding-sdo - ${scaKernelVersion} - - - org.apache.tuscany.sca.extensions.axis2 - databinding-axiom - ${scaKernelVersion} - - - junit - junit - 4.2 - test - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/java/helloworld/HelloWorldImpl.java b/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/java/helloworld/HelloWorldImpl.java deleted file mode 100644 index c9076ebba6..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/java/helloworld/HelloWorldImpl.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 helloworld; - -import org.osoa.sca.annotations.Service; - -/** - * This class implements the HelloWorld service. - */ -@Service(HelloWorldService.class) -public class HelloWorldImpl implements HelloWorldService { - - public String getGreetings(String name) { - return "Hi " + name; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/java/helloworld/HelloWorldService.java b/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/java/helloworld/HelloWorldService.java deleted file mode 100644 index bd527ff8e2..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/java/helloworld/HelloWorldService.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 helloworld; - -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Service; - -/** - * This is the business interface of the HelloWorld greetings service. - */ -@Remotable -@Service -public interface HelloWorldService { - - public String getGreetings(String name); -} - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/java/helloworld/HelloWorldServiceComponent.java b/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/java/helloworld/HelloWorldServiceComponent.java deleted file mode 100644 index d706517b76..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/java/helloworld/HelloWorldServiceComponent.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 helloworld; - -import org.osoa.sca.annotations.Scope; - -/** - * This client program shows how to create an SCA runtime, start it, - * locate the HelloWorld service and invoke it. - */ -@Scope("COMPOSITE") -public class HelloWorldServiceComponent implements HelloWorldService { - - HelloWorldService helloWorldService; - - public String getGreetings(String name) { - return helloWorldService.getGreetings(name); - } - - public HelloWorldService getHelloWorldService() { - return helloWorldService; - } - - public void setHelloWorldService(HelloWorldService helloWorldService) { - this.helloWorldService = helloWorldService; - } -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/resources/OldStyleReference.composite b/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/resources/OldStyleReference.composite deleted file mode 100644 index 7b28443d0e..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/resources/OldStyleReference.composite +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - HelloworldClientRef - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/resources/OldStyleService.composite b/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/resources/OldStyleService.composite deleted file mode 100644 index 4a5c1a46b7..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/resources/OldStyleService.composite +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - HelloWorldServiceComponent - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/resources/wsdl/helloworld.wsdl b/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/resources/wsdl/helloworld.wsdl deleted file mode 100644 index 68174d1ecd..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/main/resources/wsdl/helloworld.wsdl +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.java b/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.java deleted file mode 100644 index ac586a940f..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.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.itest; - -import java.io.IOException; -import java.net.Socket; - -import org.apache.tuscany.test.SCATestCase; - -public class HelloWorldServer extends SCATestCase { - - private String composteFileName = "/OldStyleService.composite"; - - public HelloWorldServer(String composteFileName) { - this.composteFileName = composteFileName; - } - - @Override - protected void setUp() throws Exception { - setApplicationSCDL(composteFileName); - super.setUp(); - } - - public void testPing() throws IOException, InterruptedException { - new Socket("127.0.0.1", 8080); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/test/java/org/apache/tuscany/sca/itest/OldStyleTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/test/java/org/apache/tuscany/sca/itest/OldStyleTestCase.java deleted file mode 100644 index 843643370f..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/old-style/src/test/java/org/apache/tuscany/sca/itest/OldStyleTestCase.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.itest; - - -import helloworld.HelloWorldService; -import junit.framework.Assert; - -import org.apache.tuscany.test.SCATestCase; -import org.apache.tuscany.test.SCATestCaseRunner; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * Test case for binding.ws using pre-1.0 WS SCDL - */ -@SuppressWarnings("deprecation") -public class OldStyleTestCase extends SCATestCase { - - private SCATestCaseRunner server; - private CompositeContext compositeContext; - - private static final String CLIENT_COMPOSITE = "OldStyleReference.composite"; - private static final String SERVICE_COMPOSITE = "OldStyleService.composite"; - private static final String CLIENT_COMPONENT = "HelloworldClient"; - - public void testCallingWSWithOldStyleSCDL() throws Exception { - HelloWorldService helloWorldService = compositeContext.locateService(HelloWorldService.class, CLIENT_COMPONENT); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("Hi Petra", msg); - } - - @Override - protected void setUp() throws Exception { - setApplicationSCDL(CLIENT_COMPOSITE); - super.setUp(); - compositeContext = CurrentCompositeContext.getContext(); - - server = new SCATestCaseRunner(HelloWorldServer.class, SERVICE_COMPOSITE); - server.setUp(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - server.tearDown(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/itests/pom.xml deleted file mode 100644 index 78fce63c47..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/pom.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - org.apache.tuscany.sca.extensions.axis2 - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - org.apache.tuscany.sca.extensions.axis2.itests - parent - pom - Apache Tuscany Axis2 itests - - - old-style - simplest - service-explicit-uri - service-relative-uri - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/pom.xml deleted file mode 100644 index 9e87261c39..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/pom.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2 - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - org.apache.tuscany.testing - axis2-itest-service-explicit-uri - ${testing.version} - jar - Apache Tuscany Axis2 itests service explicit uri - - - - org.apache.tuscany.sca.kernel - tuscany-api - compile - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - org.apache.tuscany.sca.services.idl - tuscany-wsdl - 0.1-integration-incubating-SNAPSHOT - runtime - - - org.apache.tuscany.sca.extensions.axis2 - tuscany-axis2 - runtime - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sca.services - tuscany-http-jetty - runtime - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sdo - tuscany-sdo-impl - 1.0-incubator-SNAPSHOT - compile - - - org.apache.tuscany.sca.services.databinding - databinding-sdo - ${scaKernelVersion} - - - org.apache.tuscany.sca.extensions.axis2 - databinding-axiom - ${scaKernelVersion} - - - junit - junit - 4.2 - test - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/java/helloworld/HelloWorldImpl.java b/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/java/helloworld/HelloWorldImpl.java deleted file mode 100644 index c9076ebba6..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/java/helloworld/HelloWorldImpl.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 helloworld; - -import org.osoa.sca.annotations.Service; - -/** - * This class implements the HelloWorld service. - */ -@Service(HelloWorldService.class) -public class HelloWorldImpl implements HelloWorldService { - - public String getGreetings(String name) { - return "Hi " + name; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/java/helloworld/HelloWorldService.java b/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/java/helloworld/HelloWorldService.java deleted file mode 100644 index bd527ff8e2..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/java/helloworld/HelloWorldService.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 helloworld; - -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Service; - -/** - * This is the business interface of the HelloWorld greetings service. - */ -@Remotable -@Service -public interface HelloWorldService { - - public String getGreetings(String name); -} - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/java/helloworld/HelloWorldServiceComponent.java b/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/java/helloworld/HelloWorldServiceComponent.java deleted file mode 100644 index d706517b76..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/java/helloworld/HelloWorldServiceComponent.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 helloworld; - -import org.osoa.sca.annotations.Scope; - -/** - * This client program shows how to create an SCA runtime, start it, - * locate the HelloWorld service and invoke it. - */ -@Scope("COMPOSITE") -public class HelloWorldServiceComponent implements HelloWorldService { - - HelloWorldService helloWorldService; - - public String getGreetings(String name) { - return helloWorldService.getGreetings(name); - } - - public HelloWorldService getHelloWorldService() { - return helloWorldService; - } - - public void setHelloWorldService(HelloWorldService helloWorldService) { - this.helloWorldService = helloWorldService; - } -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/resources/client.composite b/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/resources/client.composite deleted file mode 100644 index 2638f12a38..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/resources/client.composite +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - HelloworldClientRefSimplest - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/resources/service.composite b/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/resources/service.composite deleted file mode 100644 index 0e3a86b017..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/resources/service.composite +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - HelloWorldServiceComponent - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/resources/wsdl/helloworld.wsdl b/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/resources/wsdl/helloworld.wsdl deleted file mode 100644 index d3e769d31c..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/main/resources/wsdl/helloworld.wsdl +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.java b/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.java deleted file mode 100644 index 8267488398..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.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.itest; - -import java.io.IOException; -import java.net.Socket; - -import org.apache.tuscany.test.SCATestCase; - -public class HelloWorldServer extends SCATestCase { - - private String composteFileName; - - public HelloWorldServer(String composteFileName) { - this.composteFileName = composteFileName; - } - - @Override - protected void setUp() throws Exception { - setApplicationSCDL(composteFileName); - super.setUp(); - } - - public void testPing() throws IOException, InterruptedException { - new Socket("127.0.0.1", 8080); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/test/java/org/apache/tuscany/sca/itest/ServiceExplicitURITestCase.java b/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/test/java/org/apache/tuscany/sca/itest/ServiceExplicitURITestCase.java deleted file mode 100644 index 6585037255..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-explicit-uri/src/test/java/org/apache/tuscany/sca/itest/ServiceExplicitURITestCase.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.itest; - - -import helloworld.HelloWorldService; -import junit.framework.Assert; - -import org.apache.tuscany.test.SCATestCase; -import org.apache.tuscany.test.SCATestCaseRunner; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * Test case for binding.ws using pre-1.0 WS SCDL - */ -@SuppressWarnings("deprecation") -public class ServiceExplicitURITestCase extends SCATestCase { - - private SCATestCaseRunner server; - private CompositeContext compositeContext; - - private static final String CLIENT_COMPOSITE = "client.composite"; - private static final String SERVICE_COMPOSITE = "service.composite"; - private static final String CLIENT_COMPONENT = "HelloworldClient"; - - public void testSimplestBinding() throws Exception { - HelloWorldService helloWorldService = compositeContext.locateService(HelloWorldService.class, CLIENT_COMPONENT); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("Hi Petra", msg); - } - - @Override - protected void setUp() throws Exception { - setApplicationSCDL(CLIENT_COMPOSITE); - super.setUp(); - compositeContext = CurrentCompositeContext.getContext(); - - server = new SCATestCaseRunner(HelloWorldServer.class, SERVICE_COMPOSITE); - server.setUp(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - server.tearDown(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/pom.xml deleted file mode 100644 index f9a636f552..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/pom.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2 - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - org.apache.tuscany.testing - axis2-itest-service-relative-uri - ${testing.version} - jar - Apache Tuscany Axis2 itests service relative uri - - - - org.apache.tuscany.sca.kernel - tuscany-api - compile - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - org.apache.tuscany.sca.services.idl - tuscany-wsdl - 0.1-integration-incubating-SNAPSHOT - runtime - - - org.apache.tuscany.sca.extensions.axis2 - tuscany-axis2 - runtime - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sca.services - tuscany-http-jetty - runtime - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sdo - tuscany-sdo-impl - 1.0-incubator-SNAPSHOT - compile - - - org.apache.tuscany.sca.services.databinding - databinding-sdo - ${scaKernelVersion} - - - org.apache.tuscany.sca.extensions.axis2 - databinding-axiom - ${scaKernelVersion} - - - junit - junit - 4.2 - test - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/java/helloworld/HelloWorldImpl.java b/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/java/helloworld/HelloWorldImpl.java deleted file mode 100644 index c9076ebba6..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/java/helloworld/HelloWorldImpl.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 helloworld; - -import org.osoa.sca.annotations.Service; - -/** - * This class implements the HelloWorld service. - */ -@Service(HelloWorldService.class) -public class HelloWorldImpl implements HelloWorldService { - - public String getGreetings(String name) { - return "Hi " + name; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/java/helloworld/HelloWorldService.java b/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/java/helloworld/HelloWorldService.java deleted file mode 100644 index bd527ff8e2..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/java/helloworld/HelloWorldService.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 helloworld; - -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Service; - -/** - * This is the business interface of the HelloWorld greetings service. - */ -@Remotable -@Service -public interface HelloWorldService { - - public String getGreetings(String name); -} - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/java/helloworld/HelloWorldServiceComponent.java b/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/java/helloworld/HelloWorldServiceComponent.java deleted file mode 100644 index d706517b76..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/java/helloworld/HelloWorldServiceComponent.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 helloworld; - -import org.osoa.sca.annotations.Scope; - -/** - * This client program shows how to create an SCA runtime, start it, - * locate the HelloWorld service and invoke it. - */ -@Scope("COMPOSITE") -public class HelloWorldServiceComponent implements HelloWorldService { - - HelloWorldService helloWorldService; - - public String getGreetings(String name) { - return helloWorldService.getGreetings(name); - } - - public HelloWorldService getHelloWorldService() { - return helloWorldService; - } - - public void setHelloWorldService(HelloWorldService helloWorldService) { - this.helloWorldService = helloWorldService; - } -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/resources/client.composite b/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/resources/client.composite deleted file mode 100644 index 2638f12a38..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/resources/client.composite +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - HelloworldClientRefSimplest - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/resources/service.composite b/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/resources/service.composite deleted file mode 100644 index f6bcc4a6fb..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/resources/service.composite +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - HelloWorldServiceComponent - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/resources/wsdl/helloworld.wsdl b/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/resources/wsdl/helloworld.wsdl deleted file mode 100644 index 766a7acd98..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/main/resources/wsdl/helloworld.wsdl +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.java b/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.java deleted file mode 100644 index 8267488398..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.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.itest; - -import java.io.IOException; -import java.net.Socket; - -import org.apache.tuscany.test.SCATestCase; - -public class HelloWorldServer extends SCATestCase { - - private String composteFileName; - - public HelloWorldServer(String composteFileName) { - this.composteFileName = composteFileName; - } - - @Override - protected void setUp() throws Exception { - setApplicationSCDL(composteFileName); - super.setUp(); - } - - public void testPing() throws IOException, InterruptedException { - new Socket("127.0.0.1", 8080); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/test/java/org/apache/tuscany/sca/itest/ServiceRelativeURITestCase.java b/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/test/java/org/apache/tuscany/sca/itest/ServiceRelativeURITestCase.java deleted file mode 100644 index dec0a45e3c..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/service-relative-uri/src/test/java/org/apache/tuscany/sca/itest/ServiceRelativeURITestCase.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.itest; - - -import helloworld.HelloWorldService; -import junit.framework.Assert; - -import org.apache.tuscany.test.SCATestCase; -import org.apache.tuscany.test.SCATestCaseRunner; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * Test case for binding.ws using pre-1.0 WS SCDL - */ -@SuppressWarnings("deprecation") -public class ServiceRelativeURITestCase extends SCATestCase { - - private SCATestCaseRunner server; - private CompositeContext compositeContext; - - private static final String CLIENT_COMPOSITE = "client.composite"; - private static final String SERVICE_COMPOSITE = "service.composite"; - private static final String CLIENT_COMPONENT = "HelloworldClient"; - - public void testSimplestBinding() throws Exception { - HelloWorldService helloWorldService = compositeContext.locateService(HelloWorldService.class, CLIENT_COMPONENT); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("Hi Petra", msg); - } - - @Override - protected void setUp() throws Exception { - setApplicationSCDL(CLIENT_COMPOSITE); - super.setUp(); - compositeContext = CurrentCompositeContext.getContext(); - - server = new SCATestCaseRunner(HelloWorldServer.class, SERVICE_COMPOSITE); - server.setUp(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - server.tearDown(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/pom.xml deleted file mode 100644 index 62e3a2ae46..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/pom.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2 - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - org.apache.tuscany.testing - axis2-itest-simplest - ${testing.version} - jar - Apache Tuscany Axis2 itests simplest binding.ws - - - - org.apache.tuscany.sca.kernel - tuscany-api - compile - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - org.apache.tuscany.sca.services.idl - tuscany-wsdl - 0.1-integration-incubating-SNAPSHOT - runtime - - - org.apache.tuscany.sca.extensions.axis2 - tuscany-axis2 - runtime - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sca.services - tuscany-http-jetty - runtime - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sdo - tuscany-sdo-impl - 1.0-incubator-SNAPSHOT - compile - - - org.apache.tuscany.sca.services.databinding - databinding-sdo - ${scaKernelVersion} - - - org.apache.tuscany.sca.extensions.axis2 - databinding-axiom - ${scaKernelVersion} - - - junit - junit - 4.2 - test - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/java/helloworld/HelloWorldImpl.java b/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/java/helloworld/HelloWorldImpl.java deleted file mode 100644 index c9076ebba6..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/java/helloworld/HelloWorldImpl.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 helloworld; - -import org.osoa.sca.annotations.Service; - -/** - * This class implements the HelloWorld service. - */ -@Service(HelloWorldService.class) -public class HelloWorldImpl implements HelloWorldService { - - public String getGreetings(String name) { - return "Hi " + name; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/java/helloworld/HelloWorldService.java b/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/java/helloworld/HelloWorldService.java deleted file mode 100644 index bd527ff8e2..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/java/helloworld/HelloWorldService.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 helloworld; - -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Service; - -/** - * This is the business interface of the HelloWorld greetings service. - */ -@Remotable -@Service -public interface HelloWorldService { - - public String getGreetings(String name); -} - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/java/helloworld/HelloWorldServiceComponent.java b/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/java/helloworld/HelloWorldServiceComponent.java deleted file mode 100644 index d706517b76..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/java/helloworld/HelloWorldServiceComponent.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 helloworld; - -import org.osoa.sca.annotations.Scope; - -/** - * This client program shows how to create an SCA runtime, start it, - * locate the HelloWorld service and invoke it. - */ -@Scope("COMPOSITE") -public class HelloWorldServiceComponent implements HelloWorldService { - - HelloWorldService helloWorldService; - - public String getGreetings(String name) { - return helloWorldService.getGreetings(name); - } - - public HelloWorldService getHelloWorldService() { - return helloWorldService; - } - - public void setHelloWorldService(HelloWorldService helloWorldService) { - this.helloWorldService = helloWorldService; - } -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/resources/client.composite b/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/resources/client.composite deleted file mode 100644 index 2638f12a38..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/resources/client.composite +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - HelloworldClientRefSimplest - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/resources/service.composite b/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/resources/service.composite deleted file mode 100644 index 5062dc282e..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/resources/service.composite +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - HelloWorldServiceComponent - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/resources/wsdl/helloworld.wsdl b/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/resources/wsdl/helloworld.wsdl deleted file mode 100644 index 446e269cd9..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/main/resources/wsdl/helloworld.wsdl +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.java b/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.java deleted file mode 100644 index 8267488398..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.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.itest; - -import java.io.IOException; -import java.net.Socket; - -import org.apache.tuscany.test.SCATestCase; - -public class HelloWorldServer extends SCATestCase { - - private String composteFileName; - - public HelloWorldServer(String composteFileName) { - this.composteFileName = composteFileName; - } - - @Override - protected void setUp() throws Exception { - setApplicationSCDL(composteFileName); - super.setUp(); - } - - public void testPing() throws IOException, InterruptedException { - new Socket("127.0.0.1", 8080); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/test/java/org/apache/tuscany/sca/itest/SimplestTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/test/java/org/apache/tuscany/sca/itest/SimplestTestCase.java deleted file mode 100644 index 79c1f067b5..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/simplest/src/test/java/org/apache/tuscany/sca/itest/SimplestTestCase.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.itest; - - -import helloworld.HelloWorldService; -import junit.framework.Assert; - -import org.apache.tuscany.test.SCATestCase; -import org.apache.tuscany.test.SCATestCaseRunner; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * Test case for binding.ws using pre-1.0 WS SCDL - */ -@SuppressWarnings("deprecation") -public class SimplestTestCase extends SCATestCase { - - private SCATestCaseRunner server; - private CompositeContext compositeContext; - - private static final String CLIENT_COMPOSITE = "client.composite"; - private static final String SERVICE_COMPOSITE = "service.composite"; - private static final String CLIENT_COMPONENT = "HelloworldClient"; - - public void testSimplestBinding() throws Exception { - HelloWorldService helloWorldService = compositeContext.locateService(HelloWorldService.class, CLIENT_COMPONENT); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("Hi Petra", msg); - } - - @Override - protected void setUp() throws Exception { - setApplicationSCDL(CLIENT_COMPOSITE); - super.setUp(); - compositeContext = CurrentCompositeContext.getContext(); - - server = new SCATestCaseRunner(HelloWorldServer.class, SERVICE_COMPOSITE); - server.setUp(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - server.tearDown(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/pom.xml deleted file mode 100644 index 6b9fb6694f..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/pom.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2 - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - org.apache.tuscany.testing - axis2-itest-wsdl-binding - ${testing.version} - jar - Apache Tuscany Axis2 itests service relative uri - - - - org.apache.tuscany.sca.kernel - tuscany-api - compile - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - org.apache.tuscany.sca.services.idl - tuscany-wsdl - 0.1-integration-incubating-SNAPSHOT - runtime - - - org.apache.tuscany.sca.extensions.axis2 - tuscany-axis2 - runtime - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sca.services - tuscany-http-jetty - runtime - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sdo - tuscany-sdo-impl - 1.0-incubator-SNAPSHOT - compile - - - org.apache.tuscany.sca.services.databinding - databinding-sdo - ${scaKernelVersion} - - - org.apache.tuscany.sca.extensions.axis2 - databinding-axiom - ${scaKernelVersion} - - - - junit - junit - 4.2 - test - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/java/helloworld/HelloWorldImpl.java b/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/java/helloworld/HelloWorldImpl.java deleted file mode 100644 index c9076ebba6..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/java/helloworld/HelloWorldImpl.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 helloworld; - -import org.osoa.sca.annotations.Service; - -/** - * This class implements the HelloWorld service. - */ -@Service(HelloWorldService.class) -public class HelloWorldImpl implements HelloWorldService { - - public String getGreetings(String name) { - return "Hi " + name; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/java/helloworld/HelloWorldService.java b/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/java/helloworld/HelloWorldService.java deleted file mode 100644 index bd527ff8e2..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/java/helloworld/HelloWorldService.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 helloworld; - -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Service; - -/** - * This is the business interface of the HelloWorld greetings service. - */ -@Remotable -@Service -public interface HelloWorldService { - - public String getGreetings(String name); -} - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/java/helloworld/HelloWorldServiceComponent.java b/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/java/helloworld/HelloWorldServiceComponent.java deleted file mode 100644 index d706517b76..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/java/helloworld/HelloWorldServiceComponent.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 helloworld; - -import org.osoa.sca.annotations.Scope; - -/** - * This client program shows how to create an SCA runtime, start it, - * locate the HelloWorld service and invoke it. - */ -@Scope("COMPOSITE") -public class HelloWorldServiceComponent implements HelloWorldService { - - HelloWorldService helloWorldService; - - public String getGreetings(String name) { - return helloWorldService.getGreetings(name); - } - - public HelloWorldService getHelloWorldService() { - return helloWorldService; - } - - public void setHelloWorldService(HelloWorldService helloWorldService) { - this.helloWorldService = helloWorldService; - } -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/resources/client.composite b/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/resources/client.composite deleted file mode 100644 index 889f69d1ca..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/resources/client.composite +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - HelloworldClientRefSimplest - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/resources/service.composite b/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/resources/service.composite deleted file mode 100644 index bd7479f429..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/resources/service.composite +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - HelloWorldServiceComponent - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/resources/wsdl/helloworld.wsdl b/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/resources/wsdl/helloworld.wsdl deleted file mode 100644 index 766a7acd98..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/main/resources/wsdl/helloworld.wsdl +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.java b/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.java deleted file mode 100644 index 8267488398..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/test/java/org/apache/tuscany/sca/itest/HelloWorldServer.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.itest; - -import java.io.IOException; -import java.net.Socket; - -import org.apache.tuscany.test.SCATestCase; - -public class HelloWorldServer extends SCATestCase { - - private String composteFileName; - - public HelloWorldServer(String composteFileName) { - this.composteFileName = composteFileName; - } - - @Override - protected void setUp() throws Exception { - setApplicationSCDL(composteFileName); - super.setUp(); - } - - public void testPing() throws IOException, InterruptedException { - new Socket("127.0.0.1", 8080); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/test/java/org/apache/tuscany/sca/itest/WsdlElementBindingTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/test/java/org/apache/tuscany/sca/itest/WsdlElementBindingTestCase.java deleted file mode 100644 index ac9f7a65c9..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/itests/wsdl-binidng/src/test/java/org/apache/tuscany/sca/itest/WsdlElementBindingTestCase.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.itest; - - -import helloworld.HelloWorldService; -import junit.framework.Assert; - -import org.apache.tuscany.test.SCATestCase; -import org.apache.tuscany.test.SCATestCaseRunner; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * Test case for binding.ws using wsdlElement pointing to a WSDl binding, - * so the uri element must be used to define the actual endpoint. - * The SCA service uses a relative uri, the reference uses an absolute uri. - */ -@SuppressWarnings("deprecation") -public class WsdlElementBindingTestCase extends SCATestCase { - - private SCATestCaseRunner server; - private CompositeContext compositeContext; - - private static final String CLIENT_COMPOSITE = "client.composite"; - private static final String SERVICE_COMPOSITE = "service.composite"; - private static final String CLIENT_COMPONENT = "HelloworldClient"; - - public void testWsdlElementBinding() throws Exception { - HelloWorldService helloWorldService = compositeContext.locateService(HelloWorldService.class, CLIENT_COMPONENT); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("Hi Petra", msg); - } - - @Override - protected void setUp() throws Exception { - setApplicationSCDL(CLIENT_COMPOSITE); - super.setUp(); - compositeContext = CurrentCompositeContext.getContext(); - - server = new SCATestCaseRunner(HelloWorldServer.class, SERVICE_COMPOSITE); - server.setUp(); - } - - @Override - protected void tearDown() throws Exception { - super.tearDown(); - server.tearDown(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/plugins/java2wsdl/LICENSE.txt b/branches/sca-java-integration/sca/extensions/axis2/plugins/java2wsdl/LICENSE.txt deleted file mode 100644 index 9601ead3f6..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/plugins/java2wsdl/LICENSE.txt +++ /dev/null @@ -1,1407 +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. - - -APACHE TUSCANY SUBCOMPONENTS: - -The Apache Tuscany distribution includes a number of subcomponents with -separate copyright notices and license terms. Your use of the source -code for the these subcomponents is subject to the terms and -conditions of the following licenses. - -=============================================================================== - -For the Eclipse Modeling Framework component and the Celtix binding: - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE -PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF -THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and -documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and - -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and -are distributed by that particular Contributor. A Contribution -'originates' from a Contributor if it was added to the Program by such -Contributor itself or anyone acting on such Contributor's behalf. -Contributions do not include additions to the Program which: (i) are -separate modules of software distributed in conjunction with the -Program under their own license agreement, and (ii) are not derivative -works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents " mean patent claims licensable by a Contributor -which are necessarily infringed by the use or sale of its Contribution -alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this -Agreement. - -"Recipient" means anyone who receives the Program under this -Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free copyright -license to reproduce, prepare derivative works of, publicly display, -publicly perform, distribute and sublicense the Contribution of such -Contributor, if any, and such derivative works, in source code and -object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free patent -license under Licensed Patents to make, use, sell, offer to sell, -import and otherwise transfer the Contribution of such Contributor, if -any, in source code and object code form. This patent license shall -apply to the combination of the Contribution and the Program if, at -the time the Contribution is added by the Contributor, such addition -of the Contribution causes such combination to be covered by the -Licensed Patents. The patent license shall not apply to any other -combinations which include the Contribution. No hardware per se is -licensed hereunder. - -c) Recipient understands that although each Contributor grants the -licenses to its Contributions set forth herein, no assurances are -provided by any Contributor that the Program does not infringe the -patent or other intellectual property rights of any other entity. Each -Contributor disclaims any liability to Recipient for claims brought by -any other entity based on infringement of intellectual property rights -or otherwise. As a condition to exercising the rights and licenses -granted hereunder, each Recipient hereby assumes sole responsibility -to secure any other intellectual property rights needed, if any. For -example, if a third party patent license is required to allow -Recipient to distribute the Program, it is Recipient's responsibility -to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient -copyright rights in its Contribution, if any, to grant the copyright -license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form -under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties -and conditions, express and implied, including warranties or -conditions of title and non-infringement, and implied warranties or -conditions of merchantability and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability -for damages, including direct, indirect, special, incidental and -consequential damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are -offered by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such -Contributor, and informs licensees how to obtain it in a reasonable -manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the -Program. - -Contributors may not remove or alter any copyright notices contained -within the Program. - -Each Contributor must identify itself as the originator of its -Contribution, if any, in a manner that reasonably allows subsequent -Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain -responsibilities with respect to end users, business partners and the -like. While this license is intended to facilitate the commercial use -of the Program, the Contributor who includes the Program in a -commercial product offering should do so in a manner which does not -create potential liability for other Contributors. Therefore, if a -Contributor includes the Program in a commercial product offering, -such Contributor ("Commercial Contributor") hereby agrees to defend -and indemnify every other Contributor ("Indemnified Contributor") -against any losses, damages and costs (collectively "Losses") arising -from claims, lawsuits and other legal actions brought by a third party -against the Indemnified Contributor to the extent caused by the acts -or omissions of such Commercial Contributor in connection with its -distribution of the Program in a commercial product offering. The -obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. -In order to qualify, an Indemnified Contributor must: a) promptly -notify the Commercial Contributor in writing of such claim, and b) -allow the Commercial Contributor to control, and cooperate with the -Commercial Contributor in, the defense and any related settlement -negotiations. The Indemnified Contributor may participate in any such -claim at its own expense. - -For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those -performance claims and warranties, and if a court requires any other -Contributor to pay any damages as a result, the Commercial Contributor -must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS -PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY -WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY -OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely -responsible for determining the appropriateness of using and -distributing the Program and assumes all risks associated with its -exercise of rights under this Agreement , including but not limited to -the risks and costs of program errors, compliance with applicable -laws, damage to or loss of data, programs or equipment, and -unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR -ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING -WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR -DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED -HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further -action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that -the Program itself (excluding combinations of the Program with other -software or hardware) infringes such Recipient's patent(s), then such -Recipient's rights granted under Section 2(b) shall terminate as of -the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of -time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use -and distribution of the Program as soon as reasonably practicable. -However, Recipient's obligations under this Agreement and any licenses -granted by Recipient relating to the Program shall continue and -survive. - -Everyone is permitted to copy and distribute copies of this Agreement, -but in order to avoid inconsistency the Agreement is copyrighted and -may only be modified in the following manner. The Agreement Steward -reserves the right to publish new versions (including revisions) of -this Agreement from time to time. No one other than the Agreement -Steward has the right to modify this Agreement. The Eclipse Foundation -is the initial Agreement Steward. The Eclipse Foundation may assign -the responsibility to serve as the Agreement Steward to a suitable -separate entity. Each new version of the Agreement will be given a -distinguishing version number. The Program (including Contributions) -may always be distributed subject to the version of the Agreement -under which it was received. In addition, after a new version of the -Agreement is published, Contributor may elect to distribute the -Program (including its Contributions) under the new version. Except as -expressly stated in Sections 2(a) and 2(b) above, Recipient receives -no rights or licenses to the intellectual property of any Contributor -under this Agreement, whether expressly, by implication, estoppel or -otherwise. All rights in the Program not expressly granted under this -Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and -the intellectual property laws of the United States of America. No -party to this Agreement will bring a legal action under this Agreement -more than one year after the cause of action arose. Each party waives -its rights to a jury trial in any resulting litigation. - -=============================================================================== - -For the Rhino JavaScript container component: - -Netscape Public License V1.1 - - AMENDMENTS - - The Netscape Public License Version 1.1 ("NPL") consists of the - Mozilla Public License Version 1.1 with the following Amendments, - including Exhibit A-Netscape Public License. Files identified with - "Exhibit A-Netscape Public License" are governed by the Netscape - Public License Version 1.1. - - Additional Terms applicable to the Netscape Public License. - I. Effect. - These additional terms described in this Netscape Public - License -- Amendments shall apply to the Mozilla Communicator - client code and to all Covered Code under this License. - - II. "Netscape's Branded Code" means Covered Code that Netscape - distributes and/or permits others to distribute under one or more - trademark(s) which are controlled by Netscape but which are not - licensed for use under this License. - - III. Netscape and logo. - This License does not grant any rights to use the trademarks - "Netscape", the "Netscape N and horizon" logo or the "Netscape - lighthouse" logo, "Netcenter", "Gecko", "Java" or "JavaScript", - "Smart Browsing" even if such marks are included in the Original - Code or Modifications. - - IV. Inability to Comply Due to Contractual Obligation. - Prior to licensing the Original Code under this License, Netscape - has licensed third party code for use in Netscape's Branded Code. - To the extent that Netscape is limited contractually from making - such third party code available under this License, Netscape may - choose to reintegrate such code into Covered Code without being - required to distribute such code in Source Code form, even if - such code would otherwise be considered "Modifications" under - this License. - - V. Use of Modifications and Covered Code by Initial Developer. - V.1. In General. - The obligations of Section 3 apply to Netscape, except to - the extent specified in this Amendment, Section V.2 and V.3. - - V.2. Other Products. - Netscape may include Covered Code in products other than the - Netscape's Branded Code which are released by Netscape - during the two (2) years following the release date of the - Original Code, without such additional products becoming - subject to the terms of this License, and may license such - additional products on different terms from those contained - in this License. - - V.3. Alternative Licensing. - Netscape may license the Source Code of Netscape's Branded - Code, including Modifications incorporated therein, without - such Netscape Branded Code becoming subject to the terms of - this License, and may license such Netscape Branded Code on - different terms from those contained in this License. - - VI. Litigation. - Notwithstanding the limitations of Section 11 above, the - provisions regarding litigation in Section 11(a), (b) and (c) of - the License shall apply to all disputes relating to this License. - - EXHIBIT A-Netscape Public License. - - "The contents of this file are subject to the Netscape Public - License Version 1.1 (the "License"); you may not use this file - except in compliance with the License. You may obtain a copy of - the License at http://www.mozilla.org/NPL/ - - Software distributed under the License is distributed on an "AS - IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - implied. See the License for the specific language governing - rights and limitations under the License. - - The Original Code is Mozilla Communicator client code, released - March 31, 1998. - - The Initial Developer of the Original Code is Netscape - Communications Corporation. Portions created by Netscape are - Copyright (C) 1998-1999 Netscape Communications Corporation. All - Rights Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the - terms of the _____ license (the "[___] License"), in which case - the provisions of [______] License are applicable instead of - those above. If you wish to allow use of your version of this - file only under the terms of the [____] License and not to allow - others to use your version of this file under the NPL, indicate - your decision by deleting the provisions above and replace them - with the notice and other provisions required by the [___] - License. If you do not delete the provisions above, a recipient - may use your version of this file under either the NPL or the - [___] License." - - ---------------------------------------------------------------------- - - MOZILLA PUBLIC LICENSE - Version 1.1 - - --------------- - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the - Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to - the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original - Code, prior Modifications used by a Contributor, and the Modifications - made by that particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the - combination of the Original Code and Modifications, in each case - including portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally - accepted in the software development community for the electronic - transfer of data. - - 1.5. "Executable" means Covered Code in any form other than Source - Code. - - 1.6. "Initial Developer" means the individual or entity identified - as the Initial Developer in the Source Code notice required by Exhibit - A. - - 1.7. "Larger Work" means a work which combines Covered Code or - portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum - extent possible, whether at the time of the initial grant or - subsequently acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the - substance or structure of either the Original Code or any previous - Modifications. When Covered Code is released as a series of files, a - Modification is: - A. Any addition to or deletion from the contents of a file - containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or - previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code - which is described in the Source Code notice required by Exhibit A as - Original Code, and which, at the time of its release under this - License is not already Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or - hereafter acquired, including without limitation, method, process, - and apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for - making modifications to it, including all modules it contains, plus - any associated interface definition files, scripts used to control - compilation and installation of an Executable, or source code - differential comparisons against either the Original Code or another - well known, available Covered Code of the Contributor's choice. The - Source Code can be in a compressed or archival form, provided the - appropriate decompression or de-archiving software is widely available - for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity - exercising rights under, and complying with all of the terms of, this - License or a future version of this License issued under Section 6.1. - For legal entities, "You" includes any entity which controls, is - controlled by, or is under common control with You. For purposes of - this definition, "control" means (a) the power, direct or indirect, - to cause the direction or management of such entity, whether by - contract or otherwise, or (b) ownership of more than fifty percent - (50%) of the outstanding shares or beneficial ownership of such - entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - The Initial Developer hereby grants You a world-wide, royalty-free, - non-exclusive license, subject to third party intellectual property - claims: - (a) under intellectual property rights (other than patent or - trademark) Licensable by Initial Developer to use, reproduce, - modify, display, perform, sublicense and distribute the Original - Code (or portions thereof) with or without Modifications, and/or - as part of a Larger Work; and - - (b) under Patents Claims infringed by the making, using or - selling of Original Code, to make, have made, use, practice, - sell, and offer for sale, and/or otherwise dispose of the - Original Code (or portions thereof). - - (c) the licenses granted in this Section 2.1(a) and (b) are - effective on the date Initial Developer first distributes - Original Code under the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is - granted: 1) for code that You delete from the Original Code; 2) - separate from the Original Code; or 3) for infringements caused - by: i) the modification of the Original Code or ii) the - combination of the Original Code with other software or devices. - - 2.2. Contributor Grant. - Subject to third party intellectual property claims, each Contributor - hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or - trademark) Licensable by Contributor, to use, reproduce, modify, - display, perform, sublicense and distribute the Modifications - created by such Contributor (or portions thereof) either on an - unmodified basis, with other Modifications, as Covered Code - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, using, or - selling of Modifications made by that Contributor either alone - and/or in combination with its Contributor Version (or portions - of such combination), to make, use, sell, offer for sale, have - made, and/or otherwise dispose of: 1) Modifications made by that - Contributor (or portions thereof); and 2) the combination of - Modifications made by that Contributor with its Contributor - Version (or portions of such combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are - effective on the date Contributor first makes Commercial Use of - the Covered Code. - - (d) Notwithstanding Section 2.2(b) above, no patent license is - granted: 1) for any code that Contributor has deleted from the - Contributor Version; 2) separate from the Contributor Version; - 3) for infringements caused by: i) third party modifications of - Contributor Version or ii) the combination of Modifications made - by that Contributor with other software (except as part of the - Contributor Version) or other devices; or 4) under Patent Claims - infringed by Covered Code in the absence of Modifications made by - that Contributor. - -3. Distribution Obligations. - - 3.1. Application of License. - The Modifications which You create or to which You contribute are - governed by the terms of this License, including without limitation - Section 2.2. The Source Code version of Covered Code may be - distributed only under the terms of this License or a future version - of this License released under Section 6.1, and You must include a - copy of this License with every copy of the Source Code You - distribute. You may not offer or impose any terms on any Source Code - version that alters or restricts the applicable version of this - License or the recipients' rights hereunder. However, You may include - an additional document offering the additional rights described in - Section 3.5. - - 3.2. Availability of Source Code. - Any Modification which You create or to which You contribute must be - made available in Source Code form under the terms of this License - either on the same media as an Executable version or via an accepted - Electronic Distribution Mechanism to anyone to whom you made an - Executable version available; and if made available via Electronic - Distribution Mechanism, must remain available for at least twelve (12) - months after the date it initially became available, or at least six - (6) months after a subsequent version of that particular Modification - has been made available to such recipients. You are responsible for - ensuring that the Source Code version remains available even if the - Electronic Distribution Mechanism is maintained by a third party. - - 3.3. Description of Modifications. - You must cause all Covered Code to which You contribute to contain a - file documenting the changes You made to create that Covered Code and - the date of any change. You must include a prominent statement that - the Modification is derived, directly or indirectly, from Original - Code provided by the Initial Developer and including the name of the - Initial Developer in (a) the Source Code, and (b) in any notice in an - Executable version or related documentation in which You describe the - origin or ownership of the Covered Code. - - 3.4. Intellectual Property Matters - (a) Third Party Claims. - If Contributor has knowledge that a license under a third party's - intellectual property rights is required to exercise the rights - granted by such Contributor under Sections 2.1 or 2.2, - Contributor must include a text file with the Source Code - distribution titled "LEGAL" which describes the claim and the - party making the claim in sufficient detail that a recipient will - know whom to contact. If Contributor obtains such knowledge after - the Modification is made available as described in Section 3.2, - Contributor shall promptly modify the LEGAL file in all copies - Contributor makes available thereafter and shall take other steps - (such as notifying appropriate mailing lists or newsgroups) - reasonably calculated to inform those who received the Covered - Code that new knowledge has been obtained. - - (b) Contributor APIs. - If Contributor's Modifications include an application programming - interface and Contributor has knowledge of patent licenses which - are reasonably necessary to implement that API, Contributor must - also include this information in the LEGAL file. - - (c) Representations. - Contributor represents that, except as disclosed pursuant to - Section 3.4(a) above, Contributor believes that Contributor's - Modifications are Contributor's original creation(s) and/or - Contributor has sufficient rights to grant the rights conveyed by - this License. - - 3.5. Required Notices. - You must duplicate the notice in Exhibit A in each file of the Source - Code. If it is not possible to put such notice in a particular Source - Code file due to its structure, then You must include such notice in a - location (such as a relevant directory) where a user would be likely - to look for such a notice. If You created one or more Modification(s) - You may add your name as a Contributor to the notice described in - Exhibit A. You must also duplicate this License in any documentation - for the Source Code where You describe recipients' rights or ownership - rights relating to Covered Code. You may choose to offer, and to - charge a fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Code. However, You - may do so only on Your own behalf, and not on behalf of the Initial - Developer or any Contributor. You must make it absolutely clear than - any such warranty, support, indemnity or liability obligation is - offered by You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred by the - Initial Developer or such Contributor as a result of warranty, - support, indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - You may distribute Covered Code in Executable form only if the - requirements of Section 3.1-3.5 have been met for that Covered Code, - and if You include a notice stating that the Source Code version of - the Covered Code is available under the terms of this License, - including a description of how and where You have fulfilled the - obligations of Section 3.2. The notice must be conspicuously included - in any notice in an Executable version, related documentation or - collateral in which You describe recipients' rights relating to the - Covered Code. You may distribute the Executable version of Covered - Code or ownership rights under a license of Your choice, which may - contain terms different from this License, provided that You are in - compliance with the terms of this License and that the license for the - Executable version does not attempt to limit or alter the recipient's - rights in the Source Code version from the rights set forth in this - License. If You distribute the Executable version under a different - license You must make it absolutely clear that any terms which differ - from this License are offered by You alone, not by the Initial - Developer or any Contributor. You hereby agree to indemnify the - Initial Developer and every Contributor for any liability incurred by - the Initial Developer or such Contributor as a result of any such - terms You offer. - - 3.7. Larger Works. - You may create a Larger Work by combining Covered Code with other code - not governed by the terms of this License and distribute the Larger - Work as a single product. In such a case, You must make sure the - requirements of this License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this - License with respect to some or all of the Covered Code due to - statute, judicial order, or regulation then You must: (a) comply with - the terms of this License to the maximum extent possible; and (b) - describe the limitations and the code they affect. Such description - must be included in the LEGAL file described in Section 3.4 and must - be included with all distributions of the Source Code. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has - attached the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - Netscape Communications Corporation ("Netscape") may publish revised - and/or new versions of the License from time to time. Each version - will be given a distinguishing version number. - - 6.2. Effect of New Versions. - Once Covered Code has been published under a particular version of the - License, You may always continue to use it under the terms of that - version. You may also choose to use such Covered Code under the terms - of any subsequent version of the License published by Netscape. No one - other than Netscape has the right to modify the terms applicable to - Covered Code created under this License. - - 6.3. Derivative Works. - If You create or use a modified version of this License (which you may - only do in order to apply it to code which is not already Covered Code - governed by this License), You must (a) rename Your license so that - the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", - "MPL", "NPL" or any confusingly similar phrase do not appear in your - license (except to note that your license differs from this License) - and (b) otherwise make it clear that Your version of the license - contains terms which differ from the Mozilla Public License and - Netscape Public License. (Filling in the name of the Initial - Developer, Original Code or Contributor in the notice described in - Exhibit A shall not of themselves be deemed to be modifications of - this License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF - DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. - THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE - IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, - YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE - COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER - OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate - automatically if You fail to comply with terms herein and fail to cure - such breach within 30 days of becoming aware of the breach. All - sublicenses to the Covered Code which are properly granted shall - survive any termination of this License. Provisions which, by their - nature, must remain in effect beyond the termination of this License - shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement - claim (excluding declatory judgment actions) against Initial Developer - or a Contributor (the Initial Developer or Contributor against whom - You file such action is referred to as "Participant") alleging that: - - (a) such Participant's Contributor Version directly or indirectly - infringes any patent, then any and all rights granted by such - Participant to You under Sections 2.1 and/or 2.2 of this License - shall, upon 60 days notice from Participant terminate prospectively, - unless if within 60 days after receipt of notice You either: (i) - agree in writing to pay Participant a mutually agreeable reasonable - royalty for Your past and future use of Modifications made by such - Participant, or (ii) withdraw Your litigation claim with respect to - the Contributor Version against such Participant. If within 60 days - of notice, a reasonable royalty and payment arrangement are not - mutually agreed upon in writing by the parties or the litigation claim - is not withdrawn, the rights granted by Participant to You under - Sections 2.1 and/or 2.2 automatically terminate at the expiration of - the 60 day notice period specified above. - - (b) any software, hardware, or device, other than such Participant's - Contributor Version, directly or indirectly infringes any patent, then - any rights granted to You by such Participant under Sections 2.1(b) - and 2.2(b) are revoked effective as of the date You first made, used, - sold, distributed, or had made, Modifications made by that - Participant. - - 8.3. If You assert a patent infringement claim against Participant - alleging that such Participant's Contributor Version directly or - indirectly infringes any patent where such claim is resolved (such as - by license or settlement) prior to the initiation of patent - infringement litigation, then the reasonable value of the licenses - granted by such Participant under Sections 2.1 or 2.2 shall be taken - into account in determining the amount or value of any payment or - license. - - 8.4. In the event of termination under Sections 8.1 or 8.2 above, - all end user license agreements (excluding distributors and resellers) - which have been validly granted by You or any distributor hereunder - prior to termination shall survive termination. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL - DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, - OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR - ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY - CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, - WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY - RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW - PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE - EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO - THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in - 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer - software" and "commercial computer software documentation," as such - terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 - C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), - all U.S. Government End Users acquire Covered Code with only those - rights set forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. This License shall be governed by - California law provisions (except to the extent applicable law, if - any, provides otherwise), excluding its conflict-of-law provisions. - With respect to disputes in which at least one party is a citizen of, - or an entity chartered or registered to do business in the United - States of America, any litigation relating to this License shall be - subject to the jurisdiction of the Federal Courts of the Northern - District of California, with venue lying in Santa Clara County, - California, with the losing party responsible for costs, including - without limitation, court costs and reasonable attorneys' fees and - expenses. The application of the United Nations Convention on - Contracts for the International Sale of Goods is expressly excluded. - Any law or regulation which provides that the language of a contract - shall be construed against the drafter shall not apply to this - License. - -12. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or indirectly, - out of its utilization of rights under this License and You agree to - work with Initial Developer and Contributors to distribute such - responsibility on an equitable basis. Nothing herein is intended or - shall be deemed to constitute any admission of liability. - -13. MULTIPLE-LICENSED CODE. - - Initial Developer may designate portions of the Covered Code as - "Multiple-Licensed". "Multiple-Licensed" means that the Initial - Developer permits you to utilize portions of the Covered Code under - Your choice of the NPL or the alternative licenses, if any, specified - by the Initial Developer in the file described in Exhibit A. - -EXHIBIT A -Mozilla Public License. - - ``The contents of this file are subject to the Mozilla Public License - Version 1.1 (the "License"); you may not use this file except in - compliance with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - License for the specific language governing rights and limitations - under the License. - - The Original Code is ______________________________________. - - The Initial Developer of the Original Code is ________________________. - Portions created by ______________________ are Copyright (C) ______ - _______________________. All Rights Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the terms - of the _____ license (the "[___] License"), in which case the - provisions of [______] License are applicable instead of those - above. If you wish to allow use of your version of this file only - under the terms of the [____] License and not to allow others to use - your version of this file under the MPL, indicate your decision by - deleting the provisions above and replace them with the notice and - other provisions required by the [___] License. If you do not delete - the provisions above, a recipient may use your version of this file - under either the MPL or the [___] License." - - [NOTE: The text of this Exhibit A may differ slightly from the text of - the notices in the Source Code files of the Original Code. You should - use the text of this Exhibit A rather than the text found in the - Original Code Source Code for Your Modifications.] - - -=============================================================================== - -For the JAX-WS Reference Implementation component: - -COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 - - - 1. Definitions. - - 1.1. "Contributor" means each individual or entity that - creates or contributes to the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the - Original Software, prior Modifications used by a - Contributor (if any), and the Modifications made by that - particular Contributor. - - 1.3. "Covered Software" means (a) the Original Software, or - (b) Modifications, or (c) the combination of files - containing Original Software with files containing - Modifications, in each case including portions thereof. - - 1.4. "Executable" means the Covered Software in any form - other than Source Code. - - 1.5. "Initial Developer" means the individual or entity - that first makes Original Software available under this - License. - - 1.6. "Larger Work" means a work which combines Covered - Software or portions thereof with code not governed by the - terms of this License. - - 1.7. "License" means this document. - - 1.8. "Licensable" means having the right to grant, to the - maximum extent possible, whether at the time of the initial - grant or subsequently acquired, any and all of the rights - conveyed herein. - - 1.9. "Modifications" means the Source Code and Executable - form of any of the following: - - A. Any file that results from an addition to, - deletion from or modification of the contents of a - file containing Original Software or previous - Modifications; - - B. Any new file that contains any part of the - Original Software or previous Modification; or - - C. Any new file that is contributed or otherwise made - available under the terms of this License. - - 1.10. "Original Software" means the Source Code and - Executable form of computer software code that is - originally released under this License. - - 1.11. "Patent Claims" means any patent claim(s), now owned - or hereafter acquired, including without limitation, - method, process, and apparatus claims, in any patent - Licensable by grantor. - - 1.12. "Source Code" means (a) the common form of computer - software code in which modifications are made and (b) - associated documentation included in or with such code. - - 1.13. "You" (or "Your") means an individual or a legal - entity exercising rights under, and complying with all of - the terms of, this License. For legal entities, "You" - includes any entity which controls, is controlled by, or is - under common control with You. For purposes of this - definition, "control" means (a) the power, direct or - indirect, to cause the direction or management of such - entity, whether by contract or otherwise, or (b) ownership - of more than fifty percent (50%) of the outstanding shares - or beneficial ownership of such entity. - - 2. License Grants. - - 2.1. The Initial Developer Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, the - Initial Developer hereby grants You a world-wide, - royalty-free, non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Initial Developer, - to use, reproduce, modify, display, perform, - sublicense and distribute the Original Software (or - portions thereof), with or without Modifications, - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, - using or selling of Original Software, to make, have - made, use, practice, sell, and offer for sale, and/or - otherwise dispose of the Original Software (or - portions thereof). - - (c) The licenses granted in Sections 2.1(a) and (b) - are effective on the date Initial Developer first - distributes or otherwise makes the Original Software - available to a third party under the terms of this - License. - - (d) Notwithstanding Section 2.1(b) above, no patent - license is granted: (1) for code that You delete from - the Original Software, or (2) for infringements - caused by: (i) the modification of the Original - Software, or (ii) the combination of the Original - Software with other software or devices. - - 2.2. Contributor Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, each - Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Contributor to - use, reproduce, modify, display, perform, sublicense - and distribute the Modifications created by such - Contributor (or portions thereof), either on an - unmodified basis, with other Modifications, as - Covered Software and/or as part of a Larger Work; and - - - (b) under Patent Claims infringed by the making, - using, or selling of Modifications made by that - Contributor either alone and/or in combination with - its Contributor Version (or portions of such - combination), to make, use, sell, offer for sale, - have made, and/or otherwise dispose of: (1) - Modifications made by that Contributor (or portions - thereof); and (2) the combination of Modifications - made by that Contributor with its Contributor Version - (or portions of such combination). - - (c) The licenses granted in Sections 2.2(a) and - 2.2(b) are effective on the date Contributor first - distributes or otherwise makes the Modifications - available to a third party. - - (d) Notwithstanding Section 2.2(b) above, no patent - license is granted: (1) for any code that Contributor - has deleted from the Contributor Version; (2) for - infringements caused by: (i) third party - modifications of Contributor Version, or (ii) the - combination of Modifications made by that Contributor - with other software (except as part of the - Contributor Version) or other devices; or (3) under - Patent Claims infringed by Covered Software in the - absence of Modifications made by that Contributor. - - 3. Distribution Obligations. - - 3.1. Availability of Source Code. - - Any Covered Software that You distribute or otherwise make - available in Executable form must also be made available in - Source Code form and that Source Code form must be - distributed only under the terms of this License. You must - include a copy of this License with every copy of the - Source Code form of the Covered Software You distribute or - otherwise make available. You must inform recipients of any - such Covered Software in Executable form as to how they can - obtain such Covered Software in Source Code form in a - reasonable manner on or through a medium customarily used - for software exchange. - - 3.2. Modifications. - - The Modifications that You create or to which You - contribute are governed by the terms of this License. You - represent that You believe Your Modifications are Your - original creation(s) and/or You have sufficient rights to - grant the rights conveyed by this License. - - 3.3. Required Notices. - - You must include a notice in each of Your Modifications - that identifies You as the Contributor of the Modification. - You may not remove or alter any copyright, patent or - trademark notices contained within the Covered Software, or - any notices of licensing or any descriptive text giving - attribution to any Contributor or the Initial Developer. - - 3.4. Application of Additional Terms. - - You may not offer or impose any terms on any Covered - Software in Source Code form that alters or restricts the - applicable version of this License or the recipients' - rights hereunder. You may choose to offer, and to charge a - fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Software. - However, you may do so only on Your own behalf, and not on - behalf of the Initial Developer or any Contributor. You - must make it absolutely clear that any such warranty, - support, indemnity or liability obligation is offered by - You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred - by the Initial Developer or such Contributor as a result of - warranty, support, indemnity or liability terms You offer. - - - 3.5. Distribution of Executable Versions. - - You may distribute the Executable form of the Covered - Software under the terms of this License or under the terms - of a license of Your choice, which may contain terms - different from this License, provided that You are in - compliance with the terms of this License and that the - license for the Executable form does not attempt to limit - or alter the recipient's rights in the Source Code form - from the rights set forth in this License. If You - distribute the Covered Software in Executable form under a - different license, You must make it absolutely clear that - any terms which differ from this License are offered by You - alone, not by the Initial Developer or Contributor. You - hereby agree to indemnify the Initial Developer and every - Contributor for any liability incurred by the Initial - Developer or such Contributor as a result of any such terms - You offer. - - 3.6. Larger Works. - - You may create a Larger Work by combining Covered Software - with other code not governed by the terms of this License - and distribute the Larger Work as a single product. In such - a case, You must make sure the requirements of this License - are fulfilled for the Covered Software. - - 4. Versions of the License. - - 4.1. New Versions. - - Sun Microsystems, Inc. is the initial license steward and - may publish revised and/or new versions of this License - from time to time. Each version will be given a - distinguishing version number. Except as provided in - Section 4.3, no one other than the license steward has the - right to modify this License. - - 4.2. Effect of New Versions. - - You may always continue to use, distribute or otherwise - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. If the Initial Developer includes a - notice in the Original Software prohibiting it from being - distributed or otherwise made available under any - subsequent version of the License, You must distribute and - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. Otherwise, You may also choose to - use, distribute or otherwise make the Covered Software - available under the terms of any subsequent version of the - License published by the license steward. - - 4.3. Modified Versions. - - When You are an Initial Developer and You want to create a - new license for Your Original Software, You may create and - use a modified version of this License if You: (a) rename - the license and remove any references to the name of the - license steward (except to note that the license differs - from this License); and (b) otherwise make it clear that - the license contains terms which differ from this License. - - - 5. DISCLAIMER OF WARRANTY. - - COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" - BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, - INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED - SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR - PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND - PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY - COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE - INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF - ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF - WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS - DISCLAIMER. - - 6. TERMINATION. - - 6.1. This License and the rights granted hereunder will - terminate automatically if You fail to comply with terms - herein and fail to cure such breach within 30 days of - becoming aware of the breach. Provisions which, by their - nature, must remain in effect beyond the termination of - this License shall survive. - - 6.2. If You assert a patent infringement claim (excluding - declaratory judgment actions) against Initial Developer or - a Contributor (the Initial Developer or Contributor against - whom You assert such claim is referred to as "Participant") - alleging that the Participant Software (meaning the - Contributor Version where the Participant is a Contributor - or the Original Software where the Participant is the - Initial Developer) directly or indirectly infringes any - patent, then any and all rights granted directly or - indirectly to You by such Participant, the Initial - Developer (if the Initial Developer is not the Participant) - and all Contributors under Sections 2.1 and/or 2.2 of this - License shall, upon 60 days notice from Participant - terminate prospectively and automatically at the expiration - of such 60 day notice period, unless if within such 60 day - period You withdraw Your claim with respect to the - Participant Software against such Participant either - unilaterally or pursuant to a written agreement with - Participant. - - 6.3. In the event of termination under Sections 6.1 or 6.2 - above, all end user licenses that have been validly granted - by You or any distributor hereunder prior to termination - (excluding licenses granted to You by any distributor) - shall survive termination. - - 7. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE - INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF - COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE - LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR - CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT - LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK - STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL - INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT - APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO - NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR - CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT - APPLY TO YOU. - - 8. U.S. GOVERNMENT END USERS. - - The Covered Software is a "commercial item," as that term is - defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial - computer software" (as that term is defined at 48 C.F.R. - 252.227-7014(a)(1)) and "commercial computer software - documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. - 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 - through 227.7202-4 (June 1995), all U.S. Government End Users - acquire Covered Software with only those rights set forth herein. - This U.S. Government Rights clause is in lieu of, and supersedes, - any other FAR, DFAR, or other clause or provision that addresses - Government rights in computer software under this License. - - 9. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the - extent necessary to make it enforceable. This License shall be - governed by the law of the jurisdiction specified in a notice - contained within the Original Software (except to the extent - applicable law, if any, provides otherwise), excluding such - jurisdiction's conflict-of-law provisions. Any litigation - relating to this License shall be subject to the jurisdiction of - the courts located in the jurisdiction and venue specified in a - notice contained within the Original Software, with the losing - party responsible for costs, including, without limitation, court - costs and reasonable attorneys' fees and expenses. The - application of the United Nations Convention on Contracts for the - International Sale of Goods is expressly excluded. Any law or - regulation which provides that the language of a contract shall - be construed against the drafter shall not apply to this License. - You agree that You alone are responsible for compliance with the - United States export administration regulations (and the export - control laws and regulation of any other countries) when You use, - distribute or otherwise make available any Covered Software. - - 10. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or - indirectly, out of its utilization of rights under this License - and You agree to work with Initial Developer and Contributors to - distribute such responsibility on an equitable basis. Nothing - herein is intended or shall be deemed to constitute any admission - of liability. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/plugins/java2wsdl/NOTICE.txt b/branches/sca-java-integration/sca/extensions/axis2/plugins/java2wsdl/NOTICE.txt deleted file mode 100644 index d83ebbe236..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/plugins/java2wsdl/NOTICE.txt +++ /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-integration/sca/extensions/axis2/plugins/java2wsdl/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/plugins/java2wsdl/pom.xml deleted file mode 100644 index b722951bc1..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/plugins/java2wsdl/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2.plugins - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - tuscany-plugin-java2wsdl - maven-plugin - Apache Tuscany Axis2 Maven Plugin for Java2WSDL - Implementation of Java2WSDL Generator - - - - org.apache.maven - maven-plugin-api - 2.0 - - - org.apache.tuscany.sca.extensions.axis2.tools - tuscany-java2wsdl - ${extensionVersion} - compile - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/plugins/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/plugin/Java2WSDLGeneratorMojo.java b/branches/sca-java-integration/sca/extensions/axis2/plugins/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/plugin/Java2WSDLGeneratorMojo.java deleted file mode 100644 index a5f6158dcd..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/plugins/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/plugin/Java2WSDLGeneratorMojo.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.java2wsdl.plugin; - -import java.util.Hashtable; -import java.util.Map; - -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.tuscany.tools.java2wsdl.generate.Java2WSDLGeneratorFactory; -import org.apache.ws.java2wsdl.Java2WSDLConstants; -import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption; - -/** - * @version $Rev$ $Date$ - * @goal generate - * @phase generate-sources - * @description Generate WSDL from a given Java class / interface - */ -public class Java2WSDLGeneratorMojo extends AbstractMojo -{ - - /** - * The name of the class for which the WSDL must be generated - * @parameter - * - */ - private String sourceClassName; - - /** - * The location where the wsdls should be generated into - * @parameter expression="${project.build.directory}\\java2wsdl-wsdl" - */ - private String targetLocation; - - /** - * The name of the wsdl file - * @parameter - */ - private String wsdlFilename; - - - /** - * Classpaths to be included - * @parameter - * - */ - String[] classpaths; - - /** - * The name of the service - * @parameter - */ - private String serviceName; - - /** - * The binding style for the service - * @parameter - */ - private String bindingStyle; - - /** - * The binding use option - * @parameter - */ - private String bindingUse; - - /** - * The soap address - * @parameter - */ - private String soapAddress; - - public void execute() throws MojoExecutionException - { - try - { - Java2WSDLGeneratorFactory.getInstance().createGenerator().generateWSDL(createOptionsMap ()); - } - catch ( Exception e ) - { - throw new MojoExecutionException("Exception in Java2WSDL Maven Plugin ", e); - } - } - - protected Map createOptionsMap() - { - Map optionsMap = new Hashtable(); - - optionsMap.put(Java2WSDLConstants.CLASSNAME_OPTION, - new Java2WSDLCommandLineOption(Java2WSDLConstants.CLASSNAME_OPTION, new String[]{sourceClassName})); - - if ( targetLocation != null ) - { - optionsMap.put(Java2WSDLConstants.OUTPUT_LOCATION_OPTION, - new Java2WSDLCommandLineOption(Java2WSDLConstants.OUTPUT_LOCATION_OPTION, new String[]{targetLocation})); - } - - if ( wsdlFilename != null ) - { - optionsMap.put(Java2WSDLConstants.OUTPUT_FILENAME_OPTION, - new Java2WSDLCommandLineOption(Java2WSDLConstants.OUTPUT_FILENAME_OPTION, new String[]{wsdlFilename})); - } - - if ( classpaths != null && classpaths.length > 0 ) - { - optionsMap.put(Java2WSDLConstants.CLASSPATH_OPTION, - new Java2WSDLCommandLineOption(Java2WSDLConstants.CLASSPATH_OPTION, classpaths)); - } - - if ( serviceName != null ) - { - optionsMap.put(Java2WSDLConstants.SERVICE_NAME_OPTION, - new Java2WSDLCommandLineOption(Java2WSDLConstants.SERVICE_NAME_OPTION, new String[]{serviceName})); - } - - if ( bindingStyle != null ) - { - optionsMap.put(Java2WSDLConstants.STYLE_OPTION, - new Java2WSDLCommandLineOption(Java2WSDLConstants.STYLE_OPTION, new String[]{bindingStyle})); - } - - if ( bindingUse != null ) - { - optionsMap.put(Java2WSDLConstants.USE_OPTION, - new Java2WSDLCommandLineOption(Java2WSDLConstants.USE_OPTION, new String[]{bindingUse})); - } - - if ( soapAddress != null ) - { - optionsMap.put(Java2WSDLConstants.LOCATION_OPTION, - new Java2WSDLCommandLineOption(Java2WSDLConstants.LOCATION_OPTION, new String[]{soapAddress})); - } - - return optionsMap; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/plugins/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/plugins/pom.xml deleted file mode 100644 index 6561cf45c3..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/plugins/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2 - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - org.apache.tuscany.sca.extensions.axis2.plugins - parent - pom - Apache Tuscany Axis2 Maven Plugins - Maven plugins for the Axis2 extension - - - java2wsdl - wsdl2java - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/LICENSE.txt b/branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/LICENSE.txt deleted file mode 100644 index 9601ead3f6..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/LICENSE.txt +++ /dev/null @@ -1,1407 +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. - - -APACHE TUSCANY SUBCOMPONENTS: - -The Apache Tuscany distribution includes a number of subcomponents with -separate copyright notices and license terms. Your use of the source -code for the these subcomponents is subject to the terms and -conditions of the following licenses. - -=============================================================================== - -For the Eclipse Modeling Framework component and the Celtix binding: - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE -PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF -THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and -documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and - -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and -are distributed by that particular Contributor. A Contribution -'originates' from a Contributor if it was added to the Program by such -Contributor itself or anyone acting on such Contributor's behalf. -Contributions do not include additions to the Program which: (i) are -separate modules of software distributed in conjunction with the -Program under their own license agreement, and (ii) are not derivative -works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents " mean patent claims licensable by a Contributor -which are necessarily infringed by the use or sale of its Contribution -alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this -Agreement. - -"Recipient" means anyone who receives the Program under this -Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free copyright -license to reproduce, prepare derivative works of, publicly display, -publicly perform, distribute and sublicense the Contribution of such -Contributor, if any, and such derivative works, in source code and -object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free patent -license under Licensed Patents to make, use, sell, offer to sell, -import and otherwise transfer the Contribution of such Contributor, if -any, in source code and object code form. This patent license shall -apply to the combination of the Contribution and the Program if, at -the time the Contribution is added by the Contributor, such addition -of the Contribution causes such combination to be covered by the -Licensed Patents. The patent license shall not apply to any other -combinations which include the Contribution. No hardware per se is -licensed hereunder. - -c) Recipient understands that although each Contributor grants the -licenses to its Contributions set forth herein, no assurances are -provided by any Contributor that the Program does not infringe the -patent or other intellectual property rights of any other entity. Each -Contributor disclaims any liability to Recipient for claims brought by -any other entity based on infringement of intellectual property rights -or otherwise. As a condition to exercising the rights and licenses -granted hereunder, each Recipient hereby assumes sole responsibility -to secure any other intellectual property rights needed, if any. For -example, if a third party patent license is required to allow -Recipient to distribute the Program, it is Recipient's responsibility -to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient -copyright rights in its Contribution, if any, to grant the copyright -license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form -under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties -and conditions, express and implied, including warranties or -conditions of title and non-infringement, and implied warranties or -conditions of merchantability and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability -for damages, including direct, indirect, special, incidental and -consequential damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are -offered by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such -Contributor, and informs licensees how to obtain it in a reasonable -manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the -Program. - -Contributors may not remove or alter any copyright notices contained -within the Program. - -Each Contributor must identify itself as the originator of its -Contribution, if any, in a manner that reasonably allows subsequent -Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain -responsibilities with respect to end users, business partners and the -like. While this license is intended to facilitate the commercial use -of the Program, the Contributor who includes the Program in a -commercial product offering should do so in a manner which does not -create potential liability for other Contributors. Therefore, if a -Contributor includes the Program in a commercial product offering, -such Contributor ("Commercial Contributor") hereby agrees to defend -and indemnify every other Contributor ("Indemnified Contributor") -against any losses, damages and costs (collectively "Losses") arising -from claims, lawsuits and other legal actions brought by a third party -against the Indemnified Contributor to the extent caused by the acts -or omissions of such Commercial Contributor in connection with its -distribution of the Program in a commercial product offering. The -obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. -In order to qualify, an Indemnified Contributor must: a) promptly -notify the Commercial Contributor in writing of such claim, and b) -allow the Commercial Contributor to control, and cooperate with the -Commercial Contributor in, the defense and any related settlement -negotiations. The Indemnified Contributor may participate in any such -claim at its own expense. - -For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those -performance claims and warranties, and if a court requires any other -Contributor to pay any damages as a result, the Commercial Contributor -must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS -PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY -WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY -OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely -responsible for determining the appropriateness of using and -distributing the Program and assumes all risks associated with its -exercise of rights under this Agreement , including but not limited to -the risks and costs of program errors, compliance with applicable -laws, damage to or loss of data, programs or equipment, and -unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR -ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING -WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR -DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED -HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further -action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that -the Program itself (excluding combinations of the Program with other -software or hardware) infringes such Recipient's patent(s), then such -Recipient's rights granted under Section 2(b) shall terminate as of -the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of -time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use -and distribution of the Program as soon as reasonably practicable. -However, Recipient's obligations under this Agreement and any licenses -granted by Recipient relating to the Program shall continue and -survive. - -Everyone is permitted to copy and distribute copies of this Agreement, -but in order to avoid inconsistency the Agreement is copyrighted and -may only be modified in the following manner. The Agreement Steward -reserves the right to publish new versions (including revisions) of -this Agreement from time to time. No one other than the Agreement -Steward has the right to modify this Agreement. The Eclipse Foundation -is the initial Agreement Steward. The Eclipse Foundation may assign -the responsibility to serve as the Agreement Steward to a suitable -separate entity. Each new version of the Agreement will be given a -distinguishing version number. The Program (including Contributions) -may always be distributed subject to the version of the Agreement -under which it was received. In addition, after a new version of the -Agreement is published, Contributor may elect to distribute the -Program (including its Contributions) under the new version. Except as -expressly stated in Sections 2(a) and 2(b) above, Recipient receives -no rights or licenses to the intellectual property of any Contributor -under this Agreement, whether expressly, by implication, estoppel or -otherwise. All rights in the Program not expressly granted under this -Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and -the intellectual property laws of the United States of America. No -party to this Agreement will bring a legal action under this Agreement -more than one year after the cause of action arose. Each party waives -its rights to a jury trial in any resulting litigation. - -=============================================================================== - -For the Rhino JavaScript container component: - -Netscape Public License V1.1 - - AMENDMENTS - - The Netscape Public License Version 1.1 ("NPL") consists of the - Mozilla Public License Version 1.1 with the following Amendments, - including Exhibit A-Netscape Public License. Files identified with - "Exhibit A-Netscape Public License" are governed by the Netscape - Public License Version 1.1. - - Additional Terms applicable to the Netscape Public License. - I. Effect. - These additional terms described in this Netscape Public - License -- Amendments shall apply to the Mozilla Communicator - client code and to all Covered Code under this License. - - II. "Netscape's Branded Code" means Covered Code that Netscape - distributes and/or permits others to distribute under one or more - trademark(s) which are controlled by Netscape but which are not - licensed for use under this License. - - III. Netscape and logo. - This License does not grant any rights to use the trademarks - "Netscape", the "Netscape N and horizon" logo or the "Netscape - lighthouse" logo, "Netcenter", "Gecko", "Java" or "JavaScript", - "Smart Browsing" even if such marks are included in the Original - Code or Modifications. - - IV. Inability to Comply Due to Contractual Obligation. - Prior to licensing the Original Code under this License, Netscape - has licensed third party code for use in Netscape's Branded Code. - To the extent that Netscape is limited contractually from making - such third party code available under this License, Netscape may - choose to reintegrate such code into Covered Code without being - required to distribute such code in Source Code form, even if - such code would otherwise be considered "Modifications" under - this License. - - V. Use of Modifications and Covered Code by Initial Developer. - V.1. In General. - The obligations of Section 3 apply to Netscape, except to - the extent specified in this Amendment, Section V.2 and V.3. - - V.2. Other Products. - Netscape may include Covered Code in products other than the - Netscape's Branded Code which are released by Netscape - during the two (2) years following the release date of the - Original Code, without such additional products becoming - subject to the terms of this License, and may license such - additional products on different terms from those contained - in this License. - - V.3. Alternative Licensing. - Netscape may license the Source Code of Netscape's Branded - Code, including Modifications incorporated therein, without - such Netscape Branded Code becoming subject to the terms of - this License, and may license such Netscape Branded Code on - different terms from those contained in this License. - - VI. Litigation. - Notwithstanding the limitations of Section 11 above, the - provisions regarding litigation in Section 11(a), (b) and (c) of - the License shall apply to all disputes relating to this License. - - EXHIBIT A-Netscape Public License. - - "The contents of this file are subject to the Netscape Public - License Version 1.1 (the "License"); you may not use this file - except in compliance with the License. You may obtain a copy of - the License at http://www.mozilla.org/NPL/ - - Software distributed under the License is distributed on an "AS - IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - implied. See the License for the specific language governing - rights and limitations under the License. - - The Original Code is Mozilla Communicator client code, released - March 31, 1998. - - The Initial Developer of the Original Code is Netscape - Communications Corporation. Portions created by Netscape are - Copyright (C) 1998-1999 Netscape Communications Corporation. All - Rights Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the - terms of the _____ license (the "[___] License"), in which case - the provisions of [______] License are applicable instead of - those above. If you wish to allow use of your version of this - file only under the terms of the [____] License and not to allow - others to use your version of this file under the NPL, indicate - your decision by deleting the provisions above and replace them - with the notice and other provisions required by the [___] - License. If you do not delete the provisions above, a recipient - may use your version of this file under either the NPL or the - [___] License." - - ---------------------------------------------------------------------- - - MOZILLA PUBLIC LICENSE - Version 1.1 - - --------------- - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the - Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to - the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original - Code, prior Modifications used by a Contributor, and the Modifications - made by that particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the - combination of the Original Code and Modifications, in each case - including portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally - accepted in the software development community for the electronic - transfer of data. - - 1.5. "Executable" means Covered Code in any form other than Source - Code. - - 1.6. "Initial Developer" means the individual or entity identified - as the Initial Developer in the Source Code notice required by Exhibit - A. - - 1.7. "Larger Work" means a work which combines Covered Code or - portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum - extent possible, whether at the time of the initial grant or - subsequently acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the - substance or structure of either the Original Code or any previous - Modifications. When Covered Code is released as a series of files, a - Modification is: - A. Any addition to or deletion from the contents of a file - containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or - previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code - which is described in the Source Code notice required by Exhibit A as - Original Code, and which, at the time of its release under this - License is not already Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or - hereafter acquired, including without limitation, method, process, - and apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for - making modifications to it, including all modules it contains, plus - any associated interface definition files, scripts used to control - compilation and installation of an Executable, or source code - differential comparisons against either the Original Code or another - well known, available Covered Code of the Contributor's choice. The - Source Code can be in a compressed or archival form, provided the - appropriate decompression or de-archiving software is widely available - for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity - exercising rights under, and complying with all of the terms of, this - License or a future version of this License issued under Section 6.1. - For legal entities, "You" includes any entity which controls, is - controlled by, or is under common control with You. For purposes of - this definition, "control" means (a) the power, direct or indirect, - to cause the direction or management of such entity, whether by - contract or otherwise, or (b) ownership of more than fifty percent - (50%) of the outstanding shares or beneficial ownership of such - entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - The Initial Developer hereby grants You a world-wide, royalty-free, - non-exclusive license, subject to third party intellectual property - claims: - (a) under intellectual property rights (other than patent or - trademark) Licensable by Initial Developer to use, reproduce, - modify, display, perform, sublicense and distribute the Original - Code (or portions thereof) with or without Modifications, and/or - as part of a Larger Work; and - - (b) under Patents Claims infringed by the making, using or - selling of Original Code, to make, have made, use, practice, - sell, and offer for sale, and/or otherwise dispose of the - Original Code (or portions thereof). - - (c) the licenses granted in this Section 2.1(a) and (b) are - effective on the date Initial Developer first distributes - Original Code under the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is - granted: 1) for code that You delete from the Original Code; 2) - separate from the Original Code; or 3) for infringements caused - by: i) the modification of the Original Code or ii) the - combination of the Original Code with other software or devices. - - 2.2. Contributor Grant. - Subject to third party intellectual property claims, each Contributor - hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or - trademark) Licensable by Contributor, to use, reproduce, modify, - display, perform, sublicense and distribute the Modifications - created by such Contributor (or portions thereof) either on an - unmodified basis, with other Modifications, as Covered Code - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, using, or - selling of Modifications made by that Contributor either alone - and/or in combination with its Contributor Version (or portions - of such combination), to make, use, sell, offer for sale, have - made, and/or otherwise dispose of: 1) Modifications made by that - Contributor (or portions thereof); and 2) the combination of - Modifications made by that Contributor with its Contributor - Version (or portions of such combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are - effective on the date Contributor first makes Commercial Use of - the Covered Code. - - (d) Notwithstanding Section 2.2(b) above, no patent license is - granted: 1) for any code that Contributor has deleted from the - Contributor Version; 2) separate from the Contributor Version; - 3) for infringements caused by: i) third party modifications of - Contributor Version or ii) the combination of Modifications made - by that Contributor with other software (except as part of the - Contributor Version) or other devices; or 4) under Patent Claims - infringed by Covered Code in the absence of Modifications made by - that Contributor. - -3. Distribution Obligations. - - 3.1. Application of License. - The Modifications which You create or to which You contribute are - governed by the terms of this License, including without limitation - Section 2.2. The Source Code version of Covered Code may be - distributed only under the terms of this License or a future version - of this License released under Section 6.1, and You must include a - copy of this License with every copy of the Source Code You - distribute. You may not offer or impose any terms on any Source Code - version that alters or restricts the applicable version of this - License or the recipients' rights hereunder. However, You may include - an additional document offering the additional rights described in - Section 3.5. - - 3.2. Availability of Source Code. - Any Modification which You create or to which You contribute must be - made available in Source Code form under the terms of this License - either on the same media as an Executable version or via an accepted - Electronic Distribution Mechanism to anyone to whom you made an - Executable version available; and if made available via Electronic - Distribution Mechanism, must remain available for at least twelve (12) - months after the date it initially became available, or at least six - (6) months after a subsequent version of that particular Modification - has been made available to such recipients. You are responsible for - ensuring that the Source Code version remains available even if the - Electronic Distribution Mechanism is maintained by a third party. - - 3.3. Description of Modifications. - You must cause all Covered Code to which You contribute to contain a - file documenting the changes You made to create that Covered Code and - the date of any change. You must include a prominent statement that - the Modification is derived, directly or indirectly, from Original - Code provided by the Initial Developer and including the name of the - Initial Developer in (a) the Source Code, and (b) in any notice in an - Executable version or related documentation in which You describe the - origin or ownership of the Covered Code. - - 3.4. Intellectual Property Matters - (a) Third Party Claims. - If Contributor has knowledge that a license under a third party's - intellectual property rights is required to exercise the rights - granted by such Contributor under Sections 2.1 or 2.2, - Contributor must include a text file with the Source Code - distribution titled "LEGAL" which describes the claim and the - party making the claim in sufficient detail that a recipient will - know whom to contact. If Contributor obtains such knowledge after - the Modification is made available as described in Section 3.2, - Contributor shall promptly modify the LEGAL file in all copies - Contributor makes available thereafter and shall take other steps - (such as notifying appropriate mailing lists or newsgroups) - reasonably calculated to inform those who received the Covered - Code that new knowledge has been obtained. - - (b) Contributor APIs. - If Contributor's Modifications include an application programming - interface and Contributor has knowledge of patent licenses which - are reasonably necessary to implement that API, Contributor must - also include this information in the LEGAL file. - - (c) Representations. - Contributor represents that, except as disclosed pursuant to - Section 3.4(a) above, Contributor believes that Contributor's - Modifications are Contributor's original creation(s) and/or - Contributor has sufficient rights to grant the rights conveyed by - this License. - - 3.5. Required Notices. - You must duplicate the notice in Exhibit A in each file of the Source - Code. If it is not possible to put such notice in a particular Source - Code file due to its structure, then You must include such notice in a - location (such as a relevant directory) where a user would be likely - to look for such a notice. If You created one or more Modification(s) - You may add your name as a Contributor to the notice described in - Exhibit A. You must also duplicate this License in any documentation - for the Source Code where You describe recipients' rights or ownership - rights relating to Covered Code. You may choose to offer, and to - charge a fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Code. However, You - may do so only on Your own behalf, and not on behalf of the Initial - Developer or any Contributor. You must make it absolutely clear than - any such warranty, support, indemnity or liability obligation is - offered by You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred by the - Initial Developer or such Contributor as a result of warranty, - support, indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - You may distribute Covered Code in Executable form only if the - requirements of Section 3.1-3.5 have been met for that Covered Code, - and if You include a notice stating that the Source Code version of - the Covered Code is available under the terms of this License, - including a description of how and where You have fulfilled the - obligations of Section 3.2. The notice must be conspicuously included - in any notice in an Executable version, related documentation or - collateral in which You describe recipients' rights relating to the - Covered Code. You may distribute the Executable version of Covered - Code or ownership rights under a license of Your choice, which may - contain terms different from this License, provided that You are in - compliance with the terms of this License and that the license for the - Executable version does not attempt to limit or alter the recipient's - rights in the Source Code version from the rights set forth in this - License. If You distribute the Executable version under a different - license You must make it absolutely clear that any terms which differ - from this License are offered by You alone, not by the Initial - Developer or any Contributor. You hereby agree to indemnify the - Initial Developer and every Contributor for any liability incurred by - the Initial Developer or such Contributor as a result of any such - terms You offer. - - 3.7. Larger Works. - You may create a Larger Work by combining Covered Code with other code - not governed by the terms of this License and distribute the Larger - Work as a single product. In such a case, You must make sure the - requirements of this License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this - License with respect to some or all of the Covered Code due to - statute, judicial order, or regulation then You must: (a) comply with - the terms of this License to the maximum extent possible; and (b) - describe the limitations and the code they affect. Such description - must be included in the LEGAL file described in Section 3.4 and must - be included with all distributions of the Source Code. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has - attached the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - Netscape Communications Corporation ("Netscape") may publish revised - and/or new versions of the License from time to time. Each version - will be given a distinguishing version number. - - 6.2. Effect of New Versions. - Once Covered Code has been published under a particular version of the - License, You may always continue to use it under the terms of that - version. You may also choose to use such Covered Code under the terms - of any subsequent version of the License published by Netscape. No one - other than Netscape has the right to modify the terms applicable to - Covered Code created under this License. - - 6.3. Derivative Works. - If You create or use a modified version of this License (which you may - only do in order to apply it to code which is not already Covered Code - governed by this License), You must (a) rename Your license so that - the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", - "MPL", "NPL" or any confusingly similar phrase do not appear in your - license (except to note that your license differs from this License) - and (b) otherwise make it clear that Your version of the license - contains terms which differ from the Mozilla Public License and - Netscape Public License. (Filling in the name of the Initial - Developer, Original Code or Contributor in the notice described in - Exhibit A shall not of themselves be deemed to be modifications of - this License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF - DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. - THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE - IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, - YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE - COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER - OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate - automatically if You fail to comply with terms herein and fail to cure - such breach within 30 days of becoming aware of the breach. All - sublicenses to the Covered Code which are properly granted shall - survive any termination of this License. Provisions which, by their - nature, must remain in effect beyond the termination of this License - shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement - claim (excluding declatory judgment actions) against Initial Developer - or a Contributor (the Initial Developer or Contributor against whom - You file such action is referred to as "Participant") alleging that: - - (a) such Participant's Contributor Version directly or indirectly - infringes any patent, then any and all rights granted by such - Participant to You under Sections 2.1 and/or 2.2 of this License - shall, upon 60 days notice from Participant terminate prospectively, - unless if within 60 days after receipt of notice You either: (i) - agree in writing to pay Participant a mutually agreeable reasonable - royalty for Your past and future use of Modifications made by such - Participant, or (ii) withdraw Your litigation claim with respect to - the Contributor Version against such Participant. If within 60 days - of notice, a reasonable royalty and payment arrangement are not - mutually agreed upon in writing by the parties or the litigation claim - is not withdrawn, the rights granted by Participant to You under - Sections 2.1 and/or 2.2 automatically terminate at the expiration of - the 60 day notice period specified above. - - (b) any software, hardware, or device, other than such Participant's - Contributor Version, directly or indirectly infringes any patent, then - any rights granted to You by such Participant under Sections 2.1(b) - and 2.2(b) are revoked effective as of the date You first made, used, - sold, distributed, or had made, Modifications made by that - Participant. - - 8.3. If You assert a patent infringement claim against Participant - alleging that such Participant's Contributor Version directly or - indirectly infringes any patent where such claim is resolved (such as - by license or settlement) prior to the initiation of patent - infringement litigation, then the reasonable value of the licenses - granted by such Participant under Sections 2.1 or 2.2 shall be taken - into account in determining the amount or value of any payment or - license. - - 8.4. In the event of termination under Sections 8.1 or 8.2 above, - all end user license agreements (excluding distributors and resellers) - which have been validly granted by You or any distributor hereunder - prior to termination shall survive termination. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL - DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, - OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR - ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY - CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, - WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY - RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW - PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE - EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO - THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in - 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer - software" and "commercial computer software documentation," as such - terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 - C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), - all U.S. Government End Users acquire Covered Code with only those - rights set forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. This License shall be governed by - California law provisions (except to the extent applicable law, if - any, provides otherwise), excluding its conflict-of-law provisions. - With respect to disputes in which at least one party is a citizen of, - or an entity chartered or registered to do business in the United - States of America, any litigation relating to this License shall be - subject to the jurisdiction of the Federal Courts of the Northern - District of California, with venue lying in Santa Clara County, - California, with the losing party responsible for costs, including - without limitation, court costs and reasonable attorneys' fees and - expenses. The application of the United Nations Convention on - Contracts for the International Sale of Goods is expressly excluded. - Any law or regulation which provides that the language of a contract - shall be construed against the drafter shall not apply to this - License. - -12. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or indirectly, - out of its utilization of rights under this License and You agree to - work with Initial Developer and Contributors to distribute such - responsibility on an equitable basis. Nothing herein is intended or - shall be deemed to constitute any admission of liability. - -13. MULTIPLE-LICENSED CODE. - - Initial Developer may designate portions of the Covered Code as - "Multiple-Licensed". "Multiple-Licensed" means that the Initial - Developer permits you to utilize portions of the Covered Code under - Your choice of the NPL or the alternative licenses, if any, specified - by the Initial Developer in the file described in Exhibit A. - -EXHIBIT A -Mozilla Public License. - - ``The contents of this file are subject to the Mozilla Public License - Version 1.1 (the "License"); you may not use this file except in - compliance with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - License for the specific language governing rights and limitations - under the License. - - The Original Code is ______________________________________. - - The Initial Developer of the Original Code is ________________________. - Portions created by ______________________ are Copyright (C) ______ - _______________________. All Rights Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the terms - of the _____ license (the "[___] License"), in which case the - provisions of [______] License are applicable instead of those - above. If you wish to allow use of your version of this file only - under the terms of the [____] License and not to allow others to use - your version of this file under the MPL, indicate your decision by - deleting the provisions above and replace them with the notice and - other provisions required by the [___] License. If you do not delete - the provisions above, a recipient may use your version of this file - under either the MPL or the [___] License." - - [NOTE: The text of this Exhibit A may differ slightly from the text of - the notices in the Source Code files of the Original Code. You should - use the text of this Exhibit A rather than the text found in the - Original Code Source Code for Your Modifications.] - - -=============================================================================== - -For the JAX-WS Reference Implementation component: - -COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 - - - 1. Definitions. - - 1.1. "Contributor" means each individual or entity that - creates or contributes to the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the - Original Software, prior Modifications used by a - Contributor (if any), and the Modifications made by that - particular Contributor. - - 1.3. "Covered Software" means (a) the Original Software, or - (b) Modifications, or (c) the combination of files - containing Original Software with files containing - Modifications, in each case including portions thereof. - - 1.4. "Executable" means the Covered Software in any form - other than Source Code. - - 1.5. "Initial Developer" means the individual or entity - that first makes Original Software available under this - License. - - 1.6. "Larger Work" means a work which combines Covered - Software or portions thereof with code not governed by the - terms of this License. - - 1.7. "License" means this document. - - 1.8. "Licensable" means having the right to grant, to the - maximum extent possible, whether at the time of the initial - grant or subsequently acquired, any and all of the rights - conveyed herein. - - 1.9. "Modifications" means the Source Code and Executable - form of any of the following: - - A. Any file that results from an addition to, - deletion from or modification of the contents of a - file containing Original Software or previous - Modifications; - - B. Any new file that contains any part of the - Original Software or previous Modification; or - - C. Any new file that is contributed or otherwise made - available under the terms of this License. - - 1.10. "Original Software" means the Source Code and - Executable form of computer software code that is - originally released under this License. - - 1.11. "Patent Claims" means any patent claim(s), now owned - or hereafter acquired, including without limitation, - method, process, and apparatus claims, in any patent - Licensable by grantor. - - 1.12. "Source Code" means (a) the common form of computer - software code in which modifications are made and (b) - associated documentation included in or with such code. - - 1.13. "You" (or "Your") means an individual or a legal - entity exercising rights under, and complying with all of - the terms of, this License. For legal entities, "You" - includes any entity which controls, is controlled by, or is - under common control with You. For purposes of this - definition, "control" means (a) the power, direct or - indirect, to cause the direction or management of such - entity, whether by contract or otherwise, or (b) ownership - of more than fifty percent (50%) of the outstanding shares - or beneficial ownership of such entity. - - 2. License Grants. - - 2.1. The Initial Developer Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, the - Initial Developer hereby grants You a world-wide, - royalty-free, non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Initial Developer, - to use, reproduce, modify, display, perform, - sublicense and distribute the Original Software (or - portions thereof), with or without Modifications, - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, - using or selling of Original Software, to make, have - made, use, practice, sell, and offer for sale, and/or - otherwise dispose of the Original Software (or - portions thereof). - - (c) The licenses granted in Sections 2.1(a) and (b) - are effective on the date Initial Developer first - distributes or otherwise makes the Original Software - available to a third party under the terms of this - License. - - (d) Notwithstanding Section 2.1(b) above, no patent - license is granted: (1) for code that You delete from - the Original Software, or (2) for infringements - caused by: (i) the modification of the Original - Software, or (ii) the combination of the Original - Software with other software or devices. - - 2.2. Contributor Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, each - Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Contributor to - use, reproduce, modify, display, perform, sublicense - and distribute the Modifications created by such - Contributor (or portions thereof), either on an - unmodified basis, with other Modifications, as - Covered Software and/or as part of a Larger Work; and - - - (b) under Patent Claims infringed by the making, - using, or selling of Modifications made by that - Contributor either alone and/or in combination with - its Contributor Version (or portions of such - combination), to make, use, sell, offer for sale, - have made, and/or otherwise dispose of: (1) - Modifications made by that Contributor (or portions - thereof); and (2) the combination of Modifications - made by that Contributor with its Contributor Version - (or portions of such combination). - - (c) The licenses granted in Sections 2.2(a) and - 2.2(b) are effective on the date Contributor first - distributes or otherwise makes the Modifications - available to a third party. - - (d) Notwithstanding Section 2.2(b) above, no patent - license is granted: (1) for any code that Contributor - has deleted from the Contributor Version; (2) for - infringements caused by: (i) third party - modifications of Contributor Version, or (ii) the - combination of Modifications made by that Contributor - with other software (except as part of the - Contributor Version) or other devices; or (3) under - Patent Claims infringed by Covered Software in the - absence of Modifications made by that Contributor. - - 3. Distribution Obligations. - - 3.1. Availability of Source Code. - - Any Covered Software that You distribute or otherwise make - available in Executable form must also be made available in - Source Code form and that Source Code form must be - distributed only under the terms of this License. You must - include a copy of this License with every copy of the - Source Code form of the Covered Software You distribute or - otherwise make available. You must inform recipients of any - such Covered Software in Executable form as to how they can - obtain such Covered Software in Source Code form in a - reasonable manner on or through a medium customarily used - for software exchange. - - 3.2. Modifications. - - The Modifications that You create or to which You - contribute are governed by the terms of this License. You - represent that You believe Your Modifications are Your - original creation(s) and/or You have sufficient rights to - grant the rights conveyed by this License. - - 3.3. Required Notices. - - You must include a notice in each of Your Modifications - that identifies You as the Contributor of the Modification. - You may not remove or alter any copyright, patent or - trademark notices contained within the Covered Software, or - any notices of licensing or any descriptive text giving - attribution to any Contributor or the Initial Developer. - - 3.4. Application of Additional Terms. - - You may not offer or impose any terms on any Covered - Software in Source Code form that alters or restricts the - applicable version of this License or the recipients' - rights hereunder. You may choose to offer, and to charge a - fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Software. - However, you may do so only on Your own behalf, and not on - behalf of the Initial Developer or any Contributor. You - must make it absolutely clear that any such warranty, - support, indemnity or liability obligation is offered by - You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred - by the Initial Developer or such Contributor as a result of - warranty, support, indemnity or liability terms You offer. - - - 3.5. Distribution of Executable Versions. - - You may distribute the Executable form of the Covered - Software under the terms of this License or under the terms - of a license of Your choice, which may contain terms - different from this License, provided that You are in - compliance with the terms of this License and that the - license for the Executable form does not attempt to limit - or alter the recipient's rights in the Source Code form - from the rights set forth in this License. If You - distribute the Covered Software in Executable form under a - different license, You must make it absolutely clear that - any terms which differ from this License are offered by You - alone, not by the Initial Developer or Contributor. You - hereby agree to indemnify the Initial Developer and every - Contributor for any liability incurred by the Initial - Developer or such Contributor as a result of any such terms - You offer. - - 3.6. Larger Works. - - You may create a Larger Work by combining Covered Software - with other code not governed by the terms of this License - and distribute the Larger Work as a single product. In such - a case, You must make sure the requirements of this License - are fulfilled for the Covered Software. - - 4. Versions of the License. - - 4.1. New Versions. - - Sun Microsystems, Inc. is the initial license steward and - may publish revised and/or new versions of this License - from time to time. Each version will be given a - distinguishing version number. Except as provided in - Section 4.3, no one other than the license steward has the - right to modify this License. - - 4.2. Effect of New Versions. - - You may always continue to use, distribute or otherwise - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. If the Initial Developer includes a - notice in the Original Software prohibiting it from being - distributed or otherwise made available under any - subsequent version of the License, You must distribute and - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. Otherwise, You may also choose to - use, distribute or otherwise make the Covered Software - available under the terms of any subsequent version of the - License published by the license steward. - - 4.3. Modified Versions. - - When You are an Initial Developer and You want to create a - new license for Your Original Software, You may create and - use a modified version of this License if You: (a) rename - the license and remove any references to the name of the - license steward (except to note that the license differs - from this License); and (b) otherwise make it clear that - the license contains terms which differ from this License. - - - 5. DISCLAIMER OF WARRANTY. - - COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" - BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, - INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED - SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR - PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND - PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY - COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE - INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF - ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF - WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS - DISCLAIMER. - - 6. TERMINATION. - - 6.1. This License and the rights granted hereunder will - terminate automatically if You fail to comply with terms - herein and fail to cure such breach within 30 days of - becoming aware of the breach. Provisions which, by their - nature, must remain in effect beyond the termination of - this License shall survive. - - 6.2. If You assert a patent infringement claim (excluding - declaratory judgment actions) against Initial Developer or - a Contributor (the Initial Developer or Contributor against - whom You assert such claim is referred to as "Participant") - alleging that the Participant Software (meaning the - Contributor Version where the Participant is a Contributor - or the Original Software where the Participant is the - Initial Developer) directly or indirectly infringes any - patent, then any and all rights granted directly or - indirectly to You by such Participant, the Initial - Developer (if the Initial Developer is not the Participant) - and all Contributors under Sections 2.1 and/or 2.2 of this - License shall, upon 60 days notice from Participant - terminate prospectively and automatically at the expiration - of such 60 day notice period, unless if within such 60 day - period You withdraw Your claim with respect to the - Participant Software against such Participant either - unilaterally or pursuant to a written agreement with - Participant. - - 6.3. In the event of termination under Sections 6.1 or 6.2 - above, all end user licenses that have been validly granted - by You or any distributor hereunder prior to termination - (excluding licenses granted to You by any distributor) - shall survive termination. - - 7. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE - INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF - COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE - LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR - CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT - LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK - STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL - INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT - APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO - NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR - CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT - APPLY TO YOU. - - 8. U.S. GOVERNMENT END USERS. - - The Covered Software is a "commercial item," as that term is - defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial - computer software" (as that term is defined at 48 C.F.R. - 252.227-7014(a)(1)) and "commercial computer software - documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. - 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 - through 227.7202-4 (June 1995), all U.S. Government End Users - acquire Covered Software with only those rights set forth herein. - This U.S. Government Rights clause is in lieu of, and supersedes, - any other FAR, DFAR, or other clause or provision that addresses - Government rights in computer software under this License. - - 9. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the - extent necessary to make it enforceable. This License shall be - governed by the law of the jurisdiction specified in a notice - contained within the Original Software (except to the extent - applicable law, if any, provides otherwise), excluding such - jurisdiction's conflict-of-law provisions. Any litigation - relating to this License shall be subject to the jurisdiction of - the courts located in the jurisdiction and venue specified in a - notice contained within the Original Software, with the losing - party responsible for costs, including, without limitation, court - costs and reasonable attorneys' fees and expenses. The - application of the United Nations Convention on Contracts for the - International Sale of Goods is expressly excluded. Any law or - regulation which provides that the language of a contract shall - be construed against the drafter shall not apply to this License. - You agree that You alone are responsible for compliance with the - United States export administration regulations (and the export - control laws and regulation of any other countries) when You use, - distribute or otherwise make available any Covered Software. - - 10. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or - indirectly, out of its utilization of rights under this License - and You agree to work with Initial Developer and Contributors to - distribute such responsibility on an equitable basis. Nothing - herein is intended or shall be deemed to constitute any admission - of liability. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/NOTICE.txt b/branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/NOTICE.txt deleted file mode 100644 index d83ebbe236..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/NOTICE.txt +++ /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-integration/sca/extensions/axis2/plugins/wsdl2java/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/pom.xml deleted file mode 100644 index c82dd860ed..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2.plugins - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - tuscany-plugin-wsdl2java - maven-plugin - Apache Tuscany Axis2 Maven Plugin for WSDL2Java - Implementation of WSDL2Java Generator - - - - org.apache.maven - maven-plugin-api - 2.0 - - - org.apache.tuscany.sca.extensions.axis2.tools - tuscany-wsdl2java - ${extensionVersion} - compile - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDL2JavaGeneratorMojo.java b/branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDL2JavaGeneratorMojo.java deleted file mode 100644 index 2d08c31326..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDL2JavaGeneratorMojo.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.wsdl2java.plugin; - -import java.io.File; -import java.io.FileFilter; -import java.io.IOException; -import java.util.List; - -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator; - -/** - * @version $Rev$ $Date$ - * @goal generate - * @phase generate-sources - * @description Generate SDO interface classes from an XML Schema - */ -public class WSDL2JavaGeneratorMojo extends AbstractMojo { - /** - * The directory containing wsdl files; defaults to ${basedir}/src/main/wsdl - * @parameter expression="${basedir}/src/main/wsdl" - */ - private String wsdlDir; - - /** - * Name of the wsdl file; if omitted all files in the directory are processed - * @parameter - */ - private File wsdlFile; - - /** - * The Java package to generate into. By default the value is derived from the schema URI. - * - * @parameter - */ - private String javaPackage; - - /** - * The directory to generate into; defaults to ${project.build.directory}/wsdl2java-source - * - * @parameter expression="${project.build.directory}/wsdl2java-source" - */ - private String targetDirectory; - - /** - * The directory to generate into; defaults to ${project.build.directory}/wsdl2java-source - * - * @parameter - */ - private WSDLFileOption[] wsdlFiles; - - /** - * @parameter expression="${project.compileSourceRoots}" - * @readonly - */ - private List compilerSourceRoots; - - public void execute() throws MojoExecutionException { - - if(null != wsdlFiles){ - for(int i=0; i< wsdlFiles.length ; ++i ){ - System.err.println("wsdlFiles" + wsdlFiles[i].getFileName()); - WSDLFileOption wf = wsdlFiles[i]; - - if(null == wf.getTargetDirectory()) - wf.setTargetDirectory(targetDirectory); - if(null == wf.getJavaPackage()){ - wf.setJavaPackage(javaPackage); - } - if(wf.getFileName() == null || wf.getFileName().length() ==0){ - throw new MojoExecutionException("no fileName specfied for wsdl."); - } - if(!wf.getFileName().canRead() || !wf.getFileName().isFile()){ - - throw new MojoExecutionException("file can not be read:"+wf.getFileName()); - } - - } - }else{ - - - - if (wsdlFile == null) { - - File[] files = new File(wsdlDir).listFiles(FILTER); - - wsdlFiles= new WSDLFileOption[files.length]; - for(int i= files.length -1; i> -1; --i){ - - - wsdlFiles[i] = new WSDLFileOption(); - wsdlFiles[i].setFileName(files[i]); - wsdlFiles[i].setJavaPackage(javaPackage); - wsdlFiles[i].setPorts(null); - wsdlFiles[i].setTargetDirectory(targetDirectory); - - - } - - } else { - wsdlFiles= new WSDLFileOption[]{new WSDLFileOption()}; - wsdlFiles[0].setFileName(wsdlFile); - wsdlFiles[0].setJavaPackage(javaPackage); - wsdlFiles[0].setPorts(null); - wsdlFiles[0].setTargetDirectory(targetDirectory); - } - } - - int genOptions = 0; - - for (int i = 0; i < wsdlFiles.length; i++) { - File file = wsdlFiles[i].getFileName(); - File marker = new File(targetDirectory, ".gen#" + file.getName()+".wsdl2java"); - if (file.lastModified() > marker.lastModified()) { - getLog().info("Generating Java service interfaces from " + file); - WSDL2JavaGenerator.generateFromWSDL(file.toString(), wsdlFiles[i].getPorts(), wsdlFiles[i].getTargetDirectory(), wsdlFiles[i].getJavaPackage(), null, genOptions); - } - try { - marker.createNewFile(); - } catch (IOException e) { - throw new MojoExecutionException(e.getMessage(), e); - } - marker.setLastModified(System.currentTimeMillis()); - } - - compilerSourceRoots.add(targetDirectory); - } - - private static final FileFilter FILTER = new FileFilter() { - public boolean accept(File pathname) { - return (pathname.isFile() || !pathname.isHidden()); - } - }; -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDLFileOption.java b/branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDLFileOption.java deleted file mode 100644 index 3e6ebf0acc..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/plugins/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/plugin/WSDLFileOption.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.tools.wsdl2java.plugin; - -import java.io.File; - -public class WSDLFileOption { - /** - * Name of the wsdl file; if omitted all files in the directory are processed - * - */ - private File fileName; - - /** - * The Java package to generate into. By default the value is derived from the schema URI. - * - * - */ - private String javaPackage; - - /** - * The directory to generate into; defaults to ${project.build.directory}/wsdl2java-source - * - * - */ - private String targetDirectory; - - /** - * @parameter expression="${project.compileSourceRoots}" - * @readonly - */ - - private String ports[]; - - /** - * @parameter expression="${project.compileSourceRoots}" - * @readonly - */ - - - public WSDLFileOption(){} - - public String getJavaPackage() { - return javaPackage; - } - - public void setJavaPackage(String javaPackage) { - this.javaPackage = javaPackage; - } - - - public String[] getPorts() { - return ports; - } - - public void setPorts(String[] ports) { - this.ports = ports; - } - - public String getTargetDirectory() { - return targetDirectory; - } - - public void setTargetDirectory(String targetDirectory) { - this.targetDirectory = targetDirectory; - } - - public File getFileName() { - return fileName; - } - - public void setFileName(File fileName) { - this.fileName = fileName; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/pom.xml deleted file mode 100644 index a84a04565a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/pom.xml +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - org.apache.tuscany.sca.extensions - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - org.apache.tuscany.sca.extensions.axis2 - parent - pom - Apache Tuscany SCA Extensions for Axis2 - - - - apache.ws - Apache WebServices Repository - http://ws.zones.apache.org/repository/ - legacy - - - - - - stable - - true - - - binding - databinding - tools - plugins - - samples - - - - - integration - - binding - databinding - tools - plugins - itests - samples - - - - - unstable - - binding - databinding - tools - plugins - itests - samples - - - - - - - - - - org.apache.axis2 - axis2-kernel - 1.1.1 - compile - - - - org.apache.ws.commons.axiom - axiom-api - 1.2.2 - compile - - - - org.apache.ws.commons.axiom - axiom-impl - 1.2.2 - compile - - - - incubator-woden - woden - 1.0.0M6 - runtime - - - - commons-logging - commons-logging - 1.1 - compile - - - - org.apache.neethi - neethi - 2.0 - runtime - - - - org.apache.ws.commons.schema - XmlSchema - 1.2 - compile - - - - commons-httpclient - commons-httpclient - 3.0.1 - runtime - - - - javax.mail - mail - 1.4 - compile - - - - backport-util-concurrent - backport-util-concurrent - 2.2 - runtime - - - - commons-codec - commons-codec - 1.3 - runtime - - - - httpcomponents-httpcore - jakarta-httpcore - 4.0-alpha2 - runtime - - - - xerces - xercesImpl - 2.8.1 - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/LICENSE.txt b/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/LICENSE.txt deleted file mode 100644 index 0084319535..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/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-integration/sca/extensions/axis2/samples/calculator-ws/NOTICE.txt b/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/NOTICE.txt deleted file mode 100644 index d83ebbe236..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/NOTICE.txt +++ /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-integration/sca/extensions/axis2/samples/calculator-ws/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/pom.xml deleted file mode 100644 index 22dc92db52..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - org.apache.tuscany.samples.sca - parent - 0.1-integration-incubating-SNAPSHOT - - 4.0.0 - tuscany-sample-calculator-ws - war - Apache Tuscany Simple WebApp Sample - A sample WebApplication showing how to include a Tuscany runtime. - - - - org.apache.tuscany.samples.sca - sample-calculator - ${tuscanyVersion} - - - - org.apache.tuscany.sca.runtime.webapp - webapp-api - ${tuscanyVersion} - - - - calculator - - - org.apache.tuscany.sca.runtime.webapp - tuscany-war-plugin - - - tuscany-war - - tuscany-war - - - - - - - org.apache.tuscany.sca.services.idl - tuscany-wsdl - ${tuscanyVersion} - - - org.apache.tuscany.sca.services.bindings - axis2 - ${tuscanyVersion} - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/readme.html b/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/readme.html deleted file mode 100644 index 5d4e2cfcfb..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/readme.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - Tuscany Simple Calculator Sample - - - - - -

Tuscany Simple Calculator Sample

- -

Overview

- -

This sample illustrates the use of SCA to wire components together inside a composite. -All connections between the components are local and are defined using Java interfaces.

- -

Location

- -

This sample is located  in the - samples\standalone\calculator directory. All the - following commands should be issued while working in the sample - directory.

- -

Prerequisites

- -

Obtain the following prerequisites and install according to - their documentation.

- - - -

Building

- -

To build the sample  issue :

-
-mvn
-
- -

The result after executing is in the target subdirectory the sample-calculator.jar

- -

Setup

- -

Set up the Tuscany standalone runtime environment using the - following command:

-
-mvn dependency:unpack 
-
- -

After completion there should be a target\distribution subdirectory - created that has the Tuscany standalone runtime.

- -

Running

- -

Execute the following command: (cut and paste to command line)

-
-java -jar target/distribution/bin/launcher.jar target/sample-calculator.jar
-
- -

Results

- -

The sample when run should simply display to the standard - output:
- -
3 + 2=5.0 -
3 - 2=1.0 -
3 * 2=6.0 -
3 / 2=1.5 -
-

- - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/resources/calculator.wsdl b/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/resources/calculator.wsdl deleted file mode 100644 index 0b97576479..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/resources/calculator.wsdl +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/webapp/WEB-INF/default.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/webapp/WEB-INF/default.scdl deleted file mode 100644 index deab967a2d..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/webapp/WEB-INF/default.scdl +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - CalculatorServiceComponent - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/webapp/WEB-INF/web.xml b/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 200a448d24..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - Apache Tuscany Simple Webapp Sample - - - TuscanyFilter - org.apache.tuscany.runtime.webapp.TuscanyFilter - - - TuscanyFilter - /* - - - - org.apache.tuscany.runtime.webapp.TuscanyContextListener - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/webapp/calc.jsp b/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/webapp/calc.jsp deleted file mode 100644 index 7122eca852..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/webapp/calc.jsp +++ /dev/null @@ -1,43 +0,0 @@ -<%@ page import="calculator.CalculatorService" %> -<%@ page import="org.osoa.sca.CompositeContext" %> -<%@ page import="org.osoa.sca.CurrentCompositeContext" %> -<%-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---%> -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<% - CompositeContext context = CurrentCompositeContext.getContext(); - CalculatorService calc = context.locateService(CalculatorService.class, "CalculatorServiceComponent"); -%> - -Calculator sample - - - - - - - - - - - - -
ExpressionResult
2 + 3<%= calc.add(2, 3) %>
3 - 2<%= calc.subtract(3, 2) %>
- - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/webapp/index.html b/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/webapp/index.html deleted file mode 100644 index 695c7a7f73..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/calculator-ws/src/main/webapp/index.html +++ /dev/null @@ -1,5 +0,0 @@ - - -Hello World - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/.ruleset b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/.ruleset deleted file mode 100644 index 2a06794776..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/.ruleset +++ /dev/null @@ -1,172 +0,0 @@ - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/pom.xml deleted file mode 100644 index 25ee6eff03..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - org.apache.tuscany.samples.sca - parent - 0.1-integration-incubating-SNAPSHOT - ../pom.xml - - 4.0.0 - tuscany-sample-helloworld-async-ws - jar - Apache Tuscany HelloWorld Web Service Sample - A sample HelloWorld Async Web Service. - - - - org.apache.tuscany.sca.kernel - tuscany-api - compile - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - org.apache.tuscany.sca.extensions.axis2 - tuscany-axis2 - runtime - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sca.services - tuscany-http-jetty - runtime - 0.1-integration-incubating-SNAPSHOT - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - helloworld.HelloWorldServer - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/readme.htm b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/readme.htm deleted file mode 100644 index 00494c1ec8..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/readme.htm +++ /dev/null @@ -1,66 +0,0 @@ - - - -Tuscany -Hello World Web Service Sample - -

Tuscany -Hello World WS Sample

-

Overview

-

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

-

Location

-This sample is located  in the samples\sca\helloworldws -directory.
-

Setup

-Set up your server as described in the Tomcat -Setup.  If you are not using the pre-configured Tomcat server from the binary distribution, you will need to add - sample-helloworldws-incubating-M1.war -to your Tomcat's webapp directory. -

Running

-This service can be invoked by the Tuscany SCA helloworldwsclient or helloworldjsclient -sample.
-

Code Overview

-The source files are physically organized as shown below:
-
-
+---main
+---resources
¦ ¦ sca.module
¦ ¦
¦ +---wsdl
¦ helloworld.wsdl
¦
+---webapp
+---WEB-INF
web.xml
-

- - - - - - - -
sca.moduleDefines the SCA module, -entryPoint and component. Defines for the HelloWorldServiceComponent -component and the Java class that implements the component For the -entryPoint it defines WSDL for the service, the Java interface provided -by the service, and wires the service to -the HelloWorldServiceComponent
helloworld.wsdlWSDL for the service.
web.xmlStandard J2EE web application's web.xml
-

You may have noticed that there is no Java source for this -components implementation.  There reason is this sample reuses -the code from the helloworld sample to implement the service. -

diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/setup.bat b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/setup.bat deleted file mode 100644 index 74dca40d4c..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/setup.bat +++ /dev/null @@ -1,16 +0,0 @@ -@echo off -pushd target -jar -xf ..\apache-tomcat-5.5.17.zip -popd -copy target\sample-helloworldws-1.0-SNAPSHOT.war target\apache-tomcat-5.5.17\webapps -rem pushd target\apache-tomcat-5.5.17\webapps -rem md sample-helloworldws-1.0-SNAPSHOT -rem cd sample-helloworldws-1.0-SNAPSHOT -rem jar -xf ..\sample-helloworldws-1.0-SNAPSHOT.war -pushd target\apache-tomcat-5.5.17\shared -rem jar -xf "%USERPROFILE%\.m2\repository\org\apache\tuscany\web\1.0-SNAPSHOT\web-1.0-SNAPSHOT-bin.zip" -jar -xf "%USERPROFILE%\.m2\repository\org\apache\tuscany\web\1.0-SNAPSHOT\web-1.0-SNAPSHOT-bin.zip" -popd -rem hack -mkdir target\apache-tomcat-5.5.17\shared\extension -copy target\apache-tomcat-5.5.17\shared\lib\axis2-1.0-SNAPSHOT.jar target\apache-tomcat-5.5.17\shared\extension diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/java/helloworld/HelloWorldCallback.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/java/helloworld/HelloWorldCallback.java deleted file mode 100644 index adc48e85a4..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/java/helloworld/HelloWorldCallback.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 helloworld; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface HelloWorldCallback { - - public void getGreetingsCallback(String getGreetingsReturn); -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/java/helloworld/HelloWorldImpl.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/java/helloworld/HelloWorldImpl.java deleted file mode 100644 index bfea7039ad..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/java/helloworld/HelloWorldImpl.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 helloworld; - -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -import commonj.sdo.DataObject; - -/** - * This class implements the HelloWorld service. - */ -@Service(HelloWorldService.class) -@Scope("COMPOSITE") -public class HelloWorldImpl implements HelloWorldService { - - private HelloWorldCallback helloWorldCallback; - - @Callback - public void setHelloWorldCallback(HelloWorldCallback helloWorldCallback) { - this.helloWorldCallback = helloWorldCallback; - } - - public String getGreetings(String name) { - try { - helloWorldCallback.getGreetingsCallback("Hola " + name); - } catch (Throwable t) { - t.printStackTrace(); - } - return "This should not be seen"; - } - - public String getGreetings1(DataObject name) { - String firstName = name.getString("firstName"); - String lastName = name.getString("lastName"); - return "Hi " + firstName + " " + lastName; - } - - public void getGreetingsWithCallback(String name) { - try { - helloWorldCallback.getGreetingsCallback("Alo " + name); - } catch (Throwable t) { - t.printStackTrace(); - } - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/java/helloworld/HelloWorldService.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/java/helloworld/HelloWorldService.java deleted file mode 100644 index 3db3b0cae4..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/java/helloworld/HelloWorldService.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 helloworld; - -import org.apache.tuscany.api.annotation.DataType; -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Service; - -import commonj.sdo.DataObject; - -/** - * This is the business interface of the HelloWorld greetings service. - */ -@Remotable -@Service -@Callback(HelloWorldCallback.class) -public interface HelloWorldService { - - public String getGreetings(String name); - @DataType(name="commonj.sdo.DataObject") - public String getGreetings1(DataObject name); - - public void getGreetingsWithCallback(String name); - -} - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/resources/META-INF/LICENSE.txt b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/resources/META-INF/LICENSE.txt deleted file mode 100644 index 25d78feeac..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/resources/META-INF/LICENSE.txt +++ /dev/null @@ -1,1277 +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. - - -APACHE TUSCANY SUBCOMPONENTS: - -The Apache Tuscany distribution includes a number of subcomponents with -separate copyright notices and license terms. Your use of the source -code for the these subcomponents is subject to the terms and -conditions of the following licenses. - -=============================================================================== - -For the Eclipse Modeling Framework component and the Celtix binding: - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE -PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF -THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and -documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and - -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and -are distributed by that particular Contributor. A Contribution -'originates' from a Contributor if it was added to the Program by such -Contributor itself or anyone acting on such Contributor's behalf. -Contributions do not include additions to the Program which: (i) are -separate modules of software distributed in conjunction with the -Program under their own license agreement, and (ii) are not derivative -works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents " mean patent claims licensable by a Contributor -which are necessarily infringed by the use or sale of its Contribution -alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this -Agreement. - -"Recipient" means anyone who receives the Program under this -Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free copyright -license to reproduce, prepare derivative works of, publicly display, -publicly perform, distribute and sublicense the Contribution of such -Contributor, if any, and such derivative works, in source code and -object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free patent -license under Licensed Patents to make, use, sell, offer to sell, -import and otherwise transfer the Contribution of such Contributor, if -any, in source code and object code form. This patent license shall -apply to the combination of the Contribution and the Program if, at -the time the Contribution is added by the Contributor, such addition -of the Contribution causes such combination to be covered by the -Licensed Patents. The patent license shall not apply to any other -combinations which include the Contribution. No hardware per se is -licensed hereunder. - -c) Recipient understands that although each Contributor grants the -licenses to its Contributions set forth herein, no assurances are -provided by any Contributor that the Program does not infringe the -patent or other intellectual property rights of any other entity. Each -Contributor disclaims any liability to Recipient for claims brought by -any other entity based on infringement of intellectual property rights -or otherwise. As a condition to exercising the rights and licenses -granted hereunder, each Recipient hereby assumes sole responsibility -to secure any other intellectual property rights needed, if any. For -example, if a third party patent license is required to allow -Recipient to distribute the Program, it is Recipient's responsibility -to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient -copyright rights in its Contribution, if any, to grant the copyright -license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form -under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties -and conditions, express and implied, including warranties or -conditions of title and non-infringement, and implied warranties or -conditions of merchantability and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability -for damages, including direct, indirect, special, incidental and -consequential damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are -offered by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such -Contributor, and informs licensees how to obtain it in a reasonable -manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the -Program. - -Contributors may not remove or alter any copyright notices contained -within the Program. - -Each Contributor must identify itself as the originator of its -Contribution, if any, in a manner that reasonably allows subsequent -Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain -responsibilities with respect to end users, business partners and the -like. While this license is intended to facilitate the commercial use -of the Program, the Contributor who includes the Program in a -commercial product offering should do so in a manner which does not -create potential liability for other Contributors. Therefore, if a -Contributor includes the Program in a commercial product offering, -such Contributor ("Commercial Contributor") hereby agrees to defend -and indemnify every other Contributor ("Indemnified Contributor") -against any losses, damages and costs (collectively "Losses") arising -from claims, lawsuits and other legal actions brought by a third party -against the Indemnified Contributor to the extent caused by the acts -or omissions of such Commercial Contributor in connection with its -distribution of the Program in a commercial product offering. The -obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. -In order to qualify, an Indemnified Contributor must: a) promptly -notify the Commercial Contributor in writing of such claim, and b) -allow the Commercial Contributor to control, and cooperate with the -Commercial Contributor in, the defense and any related settlement -negotiations. The Indemnified Contributor may participate in any such -claim at its own expense. - -For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those -performance claims and warranties, and if a court requires any other -Contributor to pay any damages as a result, the Commercial Contributor -must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS -PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY -WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY -OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely -responsible for determining the appropriateness of using and -distributing the Program and assumes all risks associated with its -exercise of rights under this Agreement , including but not limited to -the risks and costs of program errors, compliance with applicable -laws, damage to or loss of data, programs or equipment, and -unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR -ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING -WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR -DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED -HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further -action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that -the Program itself (excluding combinations of the Program with other -software or hardware) infringes such Recipient's patent(s), then such -Recipient's rights granted under Section 2(b) shall terminate as of -the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of -time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use -and distribution of the Program as soon as reasonably practicable. -However, Recipient's obligations under this Agreement and any licenses -granted by Recipient relating to the Program shall continue and -survive. - -Everyone is permitted to copy and distribute copies of this Agreement, -but in order to avoid inconsistency the Agreement is copyrighted and -may only be modified in the following manner. The Agreement Steward -reserves the right to publish new versions (including revisions) of -this Agreement from time to time. No one other than the Agreement -Steward has the right to modify this Agreement. The Eclipse Foundation -is the initial Agreement Steward. The Eclipse Foundation may assign -the responsibility to serve as the Agreement Steward to a suitable -separate entity. Each new version of the Agreement will be given a -distinguishing version number. The Program (including Contributions) -may always be distributed subject to the version of the Agreement -under which it was received. In addition, after a new version of the -Agreement is published, Contributor may elect to distribute the -Program (including its Contributions) under the new version. Except as -expressly stated in Sections 2(a) and 2(b) above, Recipient receives -no rights or licenses to the intellectual property of any Contributor -under this Agreement, whether expressly, by implication, estoppel or -otherwise. All rights in the Program not expressly granted under this -Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and -the intellectual property laws of the United States of America. No -party to this Agreement will bring a legal action under this Agreement -more than one year after the cause of action arose. Each party waives -its rights to a jury trial in any resulting litigation. - -=============================================================================== - -For the Rhino JavaScript container component: - -Mozilla Public License 1.1 (MPL 1.1) - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the -Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to -the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original Code, -prior Modifications used by a Contributor, and the Modifications made by that -particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the -combination of the Original Code and Modifications, in each case including -portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally -accepted in the software development community for the electronic transfer of -data. - - 1.5. "Executable" means Covered Code in any form other than Source -Code. - - 1.6. "Initial Developer" means the individual or entity identified as -the Initial Developer in the Source Code notice required by Exhibit A. - - 1.7. "Larger Work" means a work which combines Covered Code or -portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum -extent possible, whether at the time of the initial grant or subsequently -acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the -substance or structure of either the Original Code or any previous -Modifications. When Covered Code is released as a series of files, a -Modification is: - A. Any addition to or deletion from the contents of a file -containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or -previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code -which is described in the Source Code notice required by Exhibit A as Original -Code, and which, at the time of its release under this License is not already -Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or -hereafter acquired, including without limitation, method, process, and -apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for -making modifications to it, including all modules it contains, plus any -associated interface definition files, scripts used to control compilation and -installation of an Executable, or source code differential comparisons against -either the Original Code or another well known, available Covered Code of the -Contributor's choice. The Source Code can be in a compressed or archival form, -provided the appropriate decompression or de-archiving software is widely -available for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity -exercising rights under, and complying with all of the terms of, this License -or a future version of this License issued under Section 6.1. For legal -entities, "You" includes any entity which controls, is controlled by, or is -under common control with You. For purposes of this definition, "control" -means (a) the power, direct or indirect, to cause the direction or management -of such entity, whether by contract or otherwise, or (b) ownership of more -than fifty percent (50%) of the outstanding shares or beneficial ownership of -such entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - The Initial Developer hereby grants You a world-wide, royalty-free, -non-exclusive license, subject to third party intellectual property claims: - (a) under intellectual property rights (other than patent or -trademark) Licensable by Initial Developer to use, reproduce, modify, display, -perform, sublicense and distribute the Original Code (or portions thereof) -with or without Modifications, and/or as part of a Larger Work; and - - (b) under Patents Claims infringed by the making, using or selling -of Original Code, to make, have made, use, practice, sell, and offer for sale, -and/or otherwise dispose of the Original Code (or portions thereof). - (c) the licenses granted in this Section 2.1(a) and -(b) are effective on the date Initial Developer first distributes Original -Code under the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is -granted: 1) for code that You delete from the Original Code; 2) separate from -the Original Code; or 3) for infringements caused by: i) the modification of -the Original Code or ii) the combination of the Original Code with other -software or devices. - - 2.2. Contributor Grant. - Subject to third party intellectual property claims, each Contributor -hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or -trademark) Licensable by Contributor, to use, reproduce, modify, display, -perform, sublicense and distribute the Modifications created by such -Contributor (or portions thereof) either on an unmodified basis, with other -Modifications, as Covered Code and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, using, or selling -of Modifications made by that Contributor either alone and/or in combination -with its Contributor Version (or portions of such combination), to make, use, -sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications -made by that Contributor (or portions thereof); and 2) the combination of -Modifications made by that Contributor with its Contributor Version (or -portions of such combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are -effective on the date Contributor first makes Commercial Use of the Covered -Code. - - (d) Notwithstanding Section 2.2(b) above, no patent license is -granted: 1) for any code that Contributor has deleted from the Contributor -Version; 2) separate from the Contributor Version; 3) for infringements -caused by: i) third party modifications of Contributor Version or ii) the -combination of Modifications made by that Contributor with other software -(except as part of the Contributor Version) or other devices; or 4) under -Patent Claims infringed by Covered Code in the absence of Modifications made -by that Contributor. - - -3. Distribution Obligations. - - 3.1. Application of License. - The Modifications which You create or to which You contribute are -governed by the terms of this License, including without limitation Section -2.2. The Source Code version of Covered Code may be distributed only under the -terms of this License or a future version of this License released under -Section 6.1, and You must include a copy of this License with every copy of -the Source Code You distribute. You may not offer or impose any terms on any -Source Code version that alters or restricts the applicable version of this -License or the recipients' rights hereunder. However, You may include an -additional document offering the additional rights described in Section 3.5. - - 3.2. Availability of Source Code. - Any Modification which You create or to which You contribute must be -made available in Source Code form under the terms of this License either on -the same media as an Executable version or via an accepted Electronic -Distribution Mechanism to anyone to whom you made an Executable version -available; and if made available via Electronic Distribution Mechanism, must -remain available for at least twelve (12) months after the date it initially -became available, or at least six (6) months after a subsequent version of -that particular Modification has been made available to such recipients. You -are responsible for ensuring that the Source Code version remains available -even if the Electronic Distribution Mechanism is maintained by a third party. - - 3.3. Description of Modifications. - You must cause all Covered Code to which You contribute to contain a -file documenting the changes You made to create that Covered Code and the date -of any change. You must include a prominent statement that the Modification is -derived, directly or indirectly, from Original Code provided by the Initial -Developer and including the name of the Initial Developer in (a) the Source -Code, and (b) in any notice in an Executable version or related documentation -in which You describe the origin or ownership of the Covered Code. - - 3.4. Intellectual Property Matters - (a) Third Party Claims. - If Contributor has knowledge that a license under a third party's -intellectual property rights is required to exercise the rights granted by -such Contributor under Sections 2.1 or 2.2, Contributor must include a text -file with the Source Code distribution titled "LEGAL" which describes the -claim and the party making the claim in sufficient detail that a recipient -will know whom to contact. If Contributor obtains such knowledge after the -Modification is made available as described in Section 3.2, Contributor shall -promptly modify the LEGAL file in all copies Contributor makes available -thereafter and shall take other steps (such as notifying appropriate mailing -lists or newsgroups) reasonably calculated to inform those who received the -Covered Code that new knowledge has been obtained. - - (b) Contributor APIs. - If Contributor's Modifications include an application programming -interface and Contributor has knowledge of patent licenses which are -reasonably necessary to implement that API, Contributor must also include this -information in the LEGAL file. - - (c) Representations. - Contributor represents that, except as disclosed pursuant to -Section 3.4(a) above, Contributor believes that Contributor's Modifications -are Contributor's original creation(s) and/or Contributor has sufficient -rights to grant the rights conveyed by this License. - - - 3.5. Required Notices. - You must duplicate the notice in Exhibit A in each file of the Source -Code. If it is not possible to put such notice in a particular Source Code -file due to its structure, then You must include such notice in a location -(such as a relevant directory) where a user would be likely to look for such a -notice. If You created one or more Modification(s) You may add your name as a -Contributor to the notice described in Exhibit A. You must also duplicate -this License in any documentation for the Source Code where You describe -recipients' rights or ownership rights relating to Covered Code. You may -choose to offer, and to charge a fee for, warranty, support, indemnity or -liability obligations to one or more recipients of Covered Code. However, You -may do so only on Your own behalf, and not on behalf of the Initial Developer -or any Contributor. You must make it absolutely clear than any such warranty, -support, indemnity or liability obligation is offered by You alone, and You -hereby agree to indemnify the Initial Developer and every Contributor for any -liability incurred by the Initial Developer or such Contributor as a result of -warranty, support, indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - You may distribute Covered Code in Executable form only if the -requirements of Section 3.1-3.5 have been met for that Covered Code, and if -You include a notice stating that the Source Code version of the Covered Code -is available under the terms of this License, including a description of how -and where You have fulfilled the obligations of Section 3.2. The notice must -be conspicuously included in any notice in an Executable version, related -documentation or collateral in which You describe recipients' rights relating -to the Covered Code. You may distribute the Executable version of Covered Code -or ownership rights under a license of Your choice, which may contain terms -different from this License, provided that You are in compliance with the -terms of this License and that the license for the Executable version does not -attempt to limit or alter the recipient's rights in the Source Code version -from the rights set forth in this License. If You distribute the Executable -version under a different license You must make it absolutely clear that any -terms which differ from this License are offered by You alone, not by the -Initial Developer or any Contributor. You hereby agree to indemnify the -Initial Developer and every Contributor for any liability incurred by the -Initial Developer or such Contributor as a result of any such terms You offer. - - 3.7. Larger Works. - You may create a Larger Work by combining Covered Code with other code -not governed by the terms of this License and distribute the Larger Work as a -single product. In such a case, You must make sure the requirements of this -License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Code due to statute, -judicial order, or regulation then You must: (a) comply with the terms of this -License to the maximum extent possible; and (b) describe the limitations and -the code they affect. Such description must be included in the LEGAL file -described in Section 3.4 and must be included with all distributions of the -Source Code. Except to the extent prohibited by statute or regulation, such -description must be sufficiently detailed for a recipient of ordinary skill to -be able to understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has attached -the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - Netscape Communications Corporation ("Netscape") may publish revised -and/or new versions of the License from time to time. Each version will be -given a distinguishing version number. - - 6.2. Effect of New Versions. - Once Covered Code has been published under a particular version of the -License, You may always continue to use it under the terms of that version. -You may also choose to use such Covered Code under the terms of any subsequent -version of the License published by Netscape. No one other than Netscape has -the right to modify the terms applicable to Covered Code created under this -License. - - 6.3. Derivative Works. - If You create or use a modified version of this License (which you may -only do in order to apply it to code which is not already Covered Code -governed by this License), You must (a) rename Your license so that the -phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or -any confusingly similar phrase do not appear in your license (except to note -that your license differs from this License) and (b) otherwise make it clear -that Your version of the license contains terms which differ from the Mozilla -Public License and Netscape Public License. (Filling in the name of the -Initial Developer, Original Code or Contributor in the notice described in -Exhibit A shall not of themselves be deemed to be modifications of this -License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT -LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, -FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE -QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED -CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY -OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR -CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS -LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS -DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate -automatically if You fail to comply with terms herein and fail to cure such -breach within 30 days of becoming aware of the breach. All sublicenses to the -Covered Code which are properly granted shall survive any termination of this -License. Provisions which, by their nature, must remain in effect beyond the -termination of this License shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement -claim (excluding declatory judgment actions) against Initial Developer or a -Contributor (the Initial Developer or Contributor against whom You file such -action is referred to as "Participant") alleging that: - - (a) such Participant's Contributor Version directly or indirectly -infringes any patent, then any and all rights granted by such Participant to -You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice -from Participant terminate prospectively, unless if within 60 days after -receipt of notice You either: (i) agree in writing to pay Participant a -mutually agreeable reasonable royalty for Your past and future use of -Modifications made by such Participant, or (ii) withdraw Your litigation claim -with respect to the Contributor Version against such Participant. If within -60 days of notice, a reasonable royalty and payment arrangement are not -mutually agreed upon in writing by the parties or the litigation claim is not -withdrawn, the rights granted by Participant to You under Sections 2.1 and/or -2.2 automatically terminate at the expiration of the 60 day notice period -specified above. - - (b) any software, hardware, or device, other than such Participant's -Contributor Version, directly or indirectly infringes any patent, then any -rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are -revoked effective as of the date You first made, used, sold, distributed, or -had made, Modifications made by that Participant. - - 8.3. If You assert a patent infringement claim against Participant -alleging that such Participant's Contributor Version directly or indirectly -infringes any patent where such claim is resolved (such as by license or -settlement) prior to the initiation of patent infringement litigation, then -the reasonable value of the licenses granted by such Participant under -Sections 2.1 or 2.2 shall be taken into account in determining the amount or -value of any payment or license. - - 8.4. In the event of termination under Sections 8.1 or 8.2 above, all -end user license agreements (excluding distributors and resellers) which have -been validly granted by You or any distributor hereunder prior to termination -shall survive termination. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT -(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL -DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY -SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, -SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, -WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER -FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, -EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH -DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH -OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT -APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE -EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS -EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in 48 -C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and -"commercial computer software documentation," as such terms are used in 48 -C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. -227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users -acquire Covered Code with only those rights set forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject matter -hereof. If any provision of this License is held to be unenforceable, such -provision shall be reformed only to the extent necessary to make it -enforceable. This License shall be governed by California law provisions -(except to the extent applicable law, if any, provides otherwise), excluding -its conflict-of-law provisions. With respect to disputes in which at least one -party is a citizen of, or an entity chartered or registered to do business in -the United States of America, any litigation relating to this License shall be -subject to the jurisdiction of the Federal Courts of the Northern District of -California, with venue lying in Santa Clara County, California, with the -losing party responsible for costs, including without limitation, court costs -and reasonable attorneys' fees and expenses. The application of the United -Nations Convention on Contracts for the International Sale of Goods is -expressly excluded. Any law or regulation which provides that the language of -a contract shall be construed against the drafter shall not apply to this -License. - -12. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is -responsible for claims and damages arising, directly or indirectly, out of its -utilization of rights under this License and You agree to work with Initial -Developer and Contributors to distribute such responsibility on an equitable -basis. Nothing herein is intended or shall be deemed to constitute any -admission of liability. - -13. MULTIPLE-LICENSED CODE. - - Initial Developer may designate portions of the Covered Code as -Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits -you to utilize portions of the Covered Code under Your choice of the MPL or -the alternative licenses, if any, specified by the Initial Developer in the -file described in Exhibit A. - - -EXHIBIT A -Mozilla Public License. - - ``The contents of this file are subject to the Mozilla Public License -Version 1.1 (the "License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF - ANY KIND, either express or implied. See the License for the specific -language governing rights and - limitations under the License. - - The Original Code is ______________________________________. - - The Initial Developer of the Original Code is ________________________. -Portions created by - ______________________ are Copyright (C) ______ -_______________________. All Rights - Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the terms of -the _____ license (the [___] License), in which case the provisions of -[______] License are applicable instead of those above. If you wish to allow -use of your version of this file only under the terms of the [____] License -and not to allow others to use your version of this file under the MPL, -indicate your decision by deleting the provisions above and replace them -with the notice and other provisions required by the [___] License. If you do -not delete the provisions above, a recipient may use your version of this file -under either the MPL or the [___] License." - - [NOTE: The text of this Exhibit A may differ slightly from the text of -the notices in the Source Code files of the Original Code. You should use the -text of this Exhibit A rather than the text found in the Original Code Source -Code for Your Modifications.] - - -=============================================================================== - -For the JAX-WS Reference Implementation component: - -COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 - - - 1. Definitions. - - 1.1. "Contributor" means each individual or entity that - creates or contributes to the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the - Original Software, prior Modifications used by a - Contributor (if any), and the Modifications made by that - particular Contributor. - - 1.3. "Covered Software" means (a) the Original Software, or - (b) Modifications, or (c) the combination of files - containing Original Software with files containing - Modifications, in each case including portions thereof. - - 1.4. "Executable" means the Covered Software in any form - other than Source Code. - - 1.5. "Initial Developer" means the individual or entity - that first makes Original Software available under this - License. - - 1.6. "Larger Work" means a work which combines Covered - Software or portions thereof with code not governed by the - terms of this License. - - 1.7. "License" means this document. - - 1.8. "Licensable" means having the right to grant, to the - maximum extent possible, whether at the time of the initial - grant or subsequently acquired, any and all of the rights - conveyed herein. - - 1.9. "Modifications" means the Source Code and Executable - form of any of the following: - - A. Any file that results from an addition to, - deletion from or modification of the contents of a - file containing Original Software or previous - Modifications; - - B. Any new file that contains any part of the - Original Software or previous Modification; or - - C. Any new file that is contributed or otherwise made - available under the terms of this License. - - 1.10. "Original Software" means the Source Code and - Executable form of computer software code that is - originally released under this License. - - 1.11. "Patent Claims" means any patent claim(s), now owned - or hereafter acquired, including without limitation, - method, process, and apparatus claims, in any patent - Licensable by grantor. - - 1.12. "Source Code" means (a) the common form of computer - software code in which modifications are made and (b) - associated documentation included in or with such code. - - 1.13. "You" (or "Your") means an individual or a legal - entity exercising rights under, and complying with all of - the terms of, this License. For legal entities, "You" - includes any entity which controls, is controlled by, or is - under common control with You. For purposes of this - definition, "control" means (a) the power, direct or - indirect, to cause the direction or management of such - entity, whether by contract or otherwise, or (b) ownership - of more than fifty percent (50%) of the outstanding shares - or beneficial ownership of such entity. - - 2. License Grants. - - 2.1. The Initial Developer Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, the - Initial Developer hereby grants You a world-wide, - royalty-free, non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Initial Developer, - to use, reproduce, modify, display, perform, - sublicense and distribute the Original Software (or - portions thereof), with or without Modifications, - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, - using or selling of Original Software, to make, have - made, use, practice, sell, and offer for sale, and/or - otherwise dispose of the Original Software (or - portions thereof). - - (c) The licenses granted in Sections 2.1(a) and (b) - are effective on the date Initial Developer first - distributes or otherwise makes the Original Software - available to a third party under the terms of this - License. - - (d) Notwithstanding Section 2.1(b) above, no patent - license is granted: (1) for code that You delete from - the Original Software, or (2) for infringements - caused by: (i) the modification of the Original - Software, or (ii) the combination of the Original - Software with other software or devices. - - 2.2. Contributor Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, each - Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Contributor to - use, reproduce, modify, display, perform, sublicense - and distribute the Modifications created by such - Contributor (or portions thereof), either on an - unmodified basis, with other Modifications, as - Covered Software and/or as part of a Larger Work; and - - - (b) under Patent Claims infringed by the making, - using, or selling of Modifications made by that - Contributor either alone and/or in combination with - its Contributor Version (or portions of such - combination), to make, use, sell, offer for sale, - have made, and/or otherwise dispose of: (1) - Modifications made by that Contributor (or portions - thereof); and (2) the combination of Modifications - made by that Contributor with its Contributor Version - (or portions of such combination). - - (c) The licenses granted in Sections 2.2(a) and - 2.2(b) are effective on the date Contributor first - distributes or otherwise makes the Modifications - available to a third party. - - (d) Notwithstanding Section 2.2(b) above, no patent - license is granted: (1) for any code that Contributor - has deleted from the Contributor Version; (2) for - infringements caused by: (i) third party - modifications of Contributor Version, or (ii) the - combination of Modifications made by that Contributor - with other software (except as part of the - Contributor Version) or other devices; or (3) under - Patent Claims infringed by Covered Software in the - absence of Modifications made by that Contributor. - - 3. Distribution Obligations. - - 3.1. Availability of Source Code. - - Any Covered Software that You distribute or otherwise make - available in Executable form must also be made available in - Source Code form and that Source Code form must be - distributed only under the terms of this License. You must - include a copy of this License with every copy of the - Source Code form of the Covered Software You distribute or - otherwise make available. You must inform recipients of any - such Covered Software in Executable form as to how they can - obtain such Covered Software in Source Code form in a - reasonable manner on or through a medium customarily used - for software exchange. - - 3.2. Modifications. - - The Modifications that You create or to which You - contribute are governed by the terms of this License. You - represent that You believe Your Modifications are Your - original creation(s) and/or You have sufficient rights to - grant the rights conveyed by this License. - - 3.3. Required Notices. - - You must include a notice in each of Your Modifications - that identifies You as the Contributor of the Modification. - You may not remove or alter any copyright, patent or - trademark notices contained within the Covered Software, or - any notices of licensing or any descriptive text giving - attribution to any Contributor or the Initial Developer. - - 3.4. Application of Additional Terms. - - You may not offer or impose any terms on any Covered - Software in Source Code form that alters or restricts the - applicable version of this License or the recipients' - rights hereunder. You may choose to offer, and to charge a - fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Software. - However, you may do so only on Your own behalf, and not on - behalf of the Initial Developer or any Contributor. You - must make it absolutely clear that any such warranty, - support, indemnity or liability obligation is offered by - You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred - by the Initial Developer or such Contributor as a result of - warranty, support, indemnity or liability terms You offer. - - - 3.5. Distribution of Executable Versions. - - You may distribute the Executable form of the Covered - Software under the terms of this License or under the terms - of a license of Your choice, which may contain terms - different from this License, provided that You are in - compliance with the terms of this License and that the - license for the Executable form does not attempt to limit - or alter the recipient's rights in the Source Code form - from the rights set forth in this License. If You - distribute the Covered Software in Executable form under a - different license, You must make it absolutely clear that - any terms which differ from this License are offered by You - alone, not by the Initial Developer or Contributor. You - hereby agree to indemnify the Initial Developer and every - Contributor for any liability incurred by the Initial - Developer or such Contributor as a result of any such terms - You offer. - - 3.6. Larger Works. - - You may create a Larger Work by combining Covered Software - with other code not governed by the terms of this License - and distribute the Larger Work as a single product. In such - a case, You must make sure the requirements of this License - are fulfilled for the Covered Software. - - 4. Versions of the License. - - 4.1. New Versions. - - Sun Microsystems, Inc. is the initial license steward and - may publish revised and/or new versions of this License - from time to time. Each version will be given a - distinguishing version number. Except as provided in - Section 4.3, no one other than the license steward has the - right to modify this License. - - 4.2. Effect of New Versions. - - You may always continue to use, distribute or otherwise - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. If the Initial Developer includes a - notice in the Original Software prohibiting it from being - distributed or otherwise made available under any - subsequent version of the License, You must distribute and - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. Otherwise, You may also choose to - use, distribute or otherwise make the Covered Software - available under the terms of any subsequent version of the - License published by the license steward. - - 4.3. Modified Versions. - - When You are an Initial Developer and You want to create a - new license for Your Original Software, You may create and - use a modified version of this License if You: (a) rename - the license and remove any references to the name of the - license steward (except to note that the license differs - from this License); and (b) otherwise make it clear that - the license contains terms which differ from this License. - - - 5. DISCLAIMER OF WARRANTY. - - COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" - BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, - INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED - SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR - PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND - PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY - COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE - INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF - ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF - WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS - DISCLAIMER. - - 6. TERMINATION. - - 6.1. This License and the rights granted hereunder will - terminate automatically if You fail to comply with terms - herein and fail to cure such breach within 30 days of - becoming aware of the breach. Provisions which, by their - nature, must remain in effect beyond the termination of - this License shall survive. - - 6.2. If You assert a patent infringement claim (excluding - declaratory judgment actions) against Initial Developer or - a Contributor (the Initial Developer or Contributor against - whom You assert such claim is referred to as "Participant") - alleging that the Participant Software (meaning the - Contributor Version where the Participant is a Contributor - or the Original Software where the Participant is the - Initial Developer) directly or indirectly infringes any - patent, then any and all rights granted directly or - indirectly to You by such Participant, the Initial - Developer (if the Initial Developer is not the Participant) - and all Contributors under Sections 2.1 and/or 2.2 of this - License shall, upon 60 days notice from Participant - terminate prospectively and automatically at the expiration - of such 60 day notice period, unless if within such 60 day - period You withdraw Your claim with respect to the - Participant Software against such Participant either - unilaterally or pursuant to a written agreement with - Participant. - - 6.3. In the event of termination under Sections 6.1 or 6.2 - above, all end user licenses that have been validly granted - by You or any distributor hereunder prior to termination - (excluding licenses granted to You by any distributor) - shall survive termination. - - 7. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE - INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF - COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE - LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR - CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT - LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK - STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL - INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT - APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO - NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR - CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT - APPLY TO YOU. - - 8. U.S. GOVERNMENT END USERS. - - The Covered Software is a "commercial item," as that term is - defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial - computer software" (as that term is defined at 48 C.F.R. - 252.227-7014(a)(1)) and "commercial computer software - documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. - 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 - through 227.7202-4 (June 1995), all U.S. Government End Users - acquire Covered Software with only those rights set forth herein. - This U.S. Government Rights clause is in lieu of, and supersedes, - any other FAR, DFAR, or other clause or provision that addresses - Government rights in computer software under this License. - - 9. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the - extent necessary to make it enforceable. This License shall be - governed by the law of the jurisdiction specified in a notice - contained within the Original Software (except to the extent - applicable law, if any, provides otherwise), excluding such - jurisdiction's conflict-of-law provisions. Any litigation - relating to this License shall be subject to the jurisdiction of - the courts located in the jurisdiction and venue specified in a - notice contained within the Original Software, with the losing - party responsible for costs, including, without limitation, court - costs and reasonable attorneys' fees and expenses. The - application of the United Nations Convention on Contracts for the - International Sale of Goods is expressly excluded. Any law or - regulation which provides that the language of a contract shall - be construed against the drafter shall not apply to this License. - You agree that You alone are responsible for compliance with the - United States export administration regulations (and the export - control laws and regulation of any other countries) when You use, - distribute or otherwise make available any Covered Software. - - 10. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or - indirectly, out of its utilization of rights under this License - and You agree to work with Initial Developer and Contributors to - distribute such responsibility on an equitable basis. Nothing - herein is intended or shall be deemed to constitute any admission - of liability. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/resources/META-INF/NOTICE b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/resources/META-INF/NOTICE deleted file mode 100644 index 11c564eb19..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/resources/META-INF/NOTICE +++ /dev/null @@ -1,18 +0,0 @@ -========================================================================= -== NOTICE file corresponding to the section 4 d of == -== the Apache License, Version 2.0, == -== in this case for the Apache Tuscany distribution. == -========================================================================= - -This product includes software developed by the Apache Software Foundation -(http://www.apache.org/). - -This product also includes software developed by: -- the Eclipse Modeling Framework project (http://www.eclipse.org/emf/) -- the Celtix project (http://celtix.objectweb.org/) -- the Mozilla Rhino project (http://www.mozilla.org/rhino/) -- the GlassFish JAX-WS project (https://jax-ws.dev.java.net/) - -Please read the LICENSE.txt file present in the root directory of this -distribution. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/resources/META-INF/README.txt b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/resources/META-INF/README.txt deleted file mode 100644 index 9b26d1690a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/resources/META-INF/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -Apache Tuscany M1 build (May, 2006) -=================================== - -http://incubator.apache.org/tuscany/ - -Tuscany is an effort undergoing incubation at the Apache Software Foundation -(ASF), sponsored by the Web Services PMC. - -Incubation is required of all newly accepted projects until a further review -indicates that the infrastructure, communications, and decision making process -have stabilized in a manner consistent with other successful ASF projects. - -While incubation status is not necessarily a reflection of the completeness or -stability of the code, it does indicate that the project has yet to be fully -endorsed by the ASF. - - -Support -------- - -Any problem with this release can be reported to the Tuscany mailing list -or in the JIRA issue tracker. - -Mailing list subscription: - tuscany-dev-subscribe@ws.apache.org - -Jira: - http://issues.apache.org/jira/browse/Tuscany - - -Thank you for using Tuscany! - - -The Tuscany Team. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/resources/wsdl/helloworld.wsdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/resources/wsdl/helloworld.wsdl deleted file mode 100644 index 9428cd047c..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/resources/wsdl/helloworld.wsdl +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/sca/default.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/sca/default.scdl deleted file mode 100644 index 8d619ea894..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/sca/default.scdl +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - HelloWorldServiceComponent - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/binding.axis2.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/binding.axis2.scdl deleted file mode 100644 index 852f36e10d..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/binding.axis2.scdl +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/databinding.axiom.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/databinding.axiom.scdl deleted file mode 100644 index 49e8926aab..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/databinding.axiom.scdl +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/databinding.sdo.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/databinding.sdo.scdl deleted file mode 100644 index 8c1c36d466..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/databinding.sdo.scdl +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/interface.wsdl.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/interface.wsdl.scdl deleted file mode 100644 index 9a15675f9f..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/interface.wsdl.scdl +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/webapp.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/webapp.scdl deleted file mode 100644 index 123bef83ff..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/META-INF/tuscany/webapp.scdl +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 10 - - - - - - - - - - - - - - - - - - - - - - - . - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/WEB-INF/web.xml b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 1ffda4a82a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-ws/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - Tuscany HelloWorld Web Service Sample - - - tuscany.systemScdlPath - /META-INF/tuscany/webapp.scdl - - - - tuscany.applicationScdlPath - /META-INF/sca/default.scdl - - - - org.apache.tuscany.runtime.webapp.TuscanyContextListener - - - - TuscanyServlet - Tuscany Servlet - org.apache.tuscany.runtime.webapp.TuscanyServlet - - - - TuscanyServlet - /* - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/pom.xml deleted file mode 100644 index fb92f856c3..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - org.apache.tuscany.samples.sca - parent - 0.1-integration-incubating-SNAPSHOT - ../pom.xml - - 4.0.0 - tuscany-sample-helloworld-async-wsclient - jar - Apache Tuscany HelloWorld Web Service Async Client Sample - A sample client for a HelloWorld Web Service. - - - - org.apache.tuscany.sca.kernel - tuscany-api - compile - 0.1-integration-incubating-SNAPSHOT - - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - - org.apache.tuscany.sca.extensions.axis2 - tuscany-axis2 - runtime - 0.1-integration-incubating-SNAPSHOT - - - - org.apache.tuscany.sca.extensions.axis2.samples - tuscany-sample-helloworld-async-ws - test - 0.1-integration-incubating-SNAPSHOT - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - helloworld.HelloWorldClient - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/run.bat b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/run.bat deleted file mode 100644 index 0b9f69d8bd..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/run.bat +++ /dev/null @@ -1,53 +0,0 @@ -@echo off -rem set java_debug_set=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=3720,server=y,suspend=y -mkdir target\standalone -pushd target\standalone -jar -xf "%USERPROFILE%\.m2\repository\org\apache\tuscany\standalone\1.0-SNAPSHOT\standalone-1.0-SNAPSHOT-bin.zip" -popd -rem move target\standalone\extension\axiom-api-1.0.jar target\standalone\boot -rem move target\standalone\extension\axiom-impl-1.0.jar target\standalone\boot -rem move target\standalone\extension\axis2-kernel-1.0.jar target\standalone\boot -rem move target\standalone\extension\common-2.2.1-SNAPSHOT.jar target\standalone\boot -rem move target\standalone\extension\commons-codec-1.3.jar target\standalone\boot -rem move target\standalone\extension\commons-httpclient-3.0.jar target\standalone\boot -rem move target\standalone\extension\ecore-2.2.1-SNAPSHOT.jar target\standalone\boot -rem move target\standalone\extension\ecore-change-2.2.1-SNAPSHOT.jar target\standalone\boot -rem move target\standalone\extension\ecore-xmi-2.2.1-SNAPSHOT.jar target\standalone\boot -rem move target\standalone\extension\junit-3.8.1.jar target\standalone\boot -rem move target\standalone\extension\neethi-1.0.1.jar target\standalone\boot -rem move target\standalone\extension\sdo-api-1.0-SNAPSHOT.jar target\standalone\boot -rem move target\standalone\extension\tuscany-sdo-impl-1.0-SNAPSHOT.jar target\standalone\boot -rem move target\standalone\extension\XmlSchema-1.0.2.jar target\standalone\boot -rem move target\standalone\extension\xsd-2.2.1-SNAPSHOT.jar target\standalone\boot -rem move target\standalone\extension\wstx-asl-2.9.3.jar target\standalone\boot -rem move target\standalone\extension\commons-logging-1.0.3.jar target\standalone\boot - - -move target\standalone\extension\axiom-api-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\axiom-impl-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\axis2-common-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\axis2-core-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\woden-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\wsdl-1.0-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\wsdl4j-1.5.2.jar target\standalone\boot -move target\standalone\extension\avalon-framework-4.1.3.jar target\standalone\boot -move target\standalone\extension\common-2.2.1-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\commons-codec-1.2.jar target\standalone\boot -move target\standalone\extension\commons-httpclient-3.0.jar target\standalone\boot -move target\standalone\extension\commons-logging-1.1.jar target\standalone\boot -move target\standalone\extension\ecore-2.2.1-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\ecore-change-2.2.1-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\ecore-xmi-2.2.1-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\junit-3.8.1.jar target\standalone\boot -move target\standalone\extension\log4j-1.2.12.jar target\standalone\boot -move target\standalone\extension\logkit-1.0.1.jar target\standalone\boot -move target\standalone\extension\neethi-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\sdo-api-1.0-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\servlet-api-2.3.jar target\standalone\boot -move target\standalone\extension\tuscany-sdo-impl-1.0-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\XmlSchema-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\xsd-2.2.1-SNAPSHOT.jar target\standalone\boot - - - -java %java_debug_set% -jar target\standalone\bin\launcher.jar --classpath "%USERPROFILE%\.m2\repository\org\apache\tuscany\samples\sca\sample-helloworldwsclient\1.0-SNAPSHOT\sample-helloworldwsclient-1.0-SNAPSHOT.jar" %* diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/run_celtix.bat b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/run_celtix.bat deleted file mode 100644 index 4b687a6aab..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/run_celtix.bat +++ /dev/null @@ -1,16 +0,0 @@ -@echo off -rem set java_debug_set=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=3720,server=y,suspend=y -mkdir target\standalone -pushd target\standalone -jar -xf "%USERPROFILE%\.m2\repository\org\apache\tuscany\standalone\1.0-SNAPSHOT\standalone-1.0-SNAPSHOT-bin.zip" -jar -xf "%USERPROFILE%\.m2\repository\org\apache\tuscany\bindings\celtix\1.0-SNAPSHOT\celtix-1.0-SNAPSHOT-bin.zip" -rem jar -xf "%USERPROFILE%\.m2\repository\org\apache\tuscany\bindings\axis2\1.0-SNAPSHOT\axis2-1.0-SNAPSHOT-bin.zip" - -popd -move target\standalone\extension\*.jar target\standalone\boot -copy "%USERPROFILE%\.m2\repository\org\apache\tuscany\bindings\celtix\1.0-SNAPSHOT\celtix-1.0-SNAPSHOT.jar" target\standalone\extension -copy "%USERPROFILE%\.m2\repository\org\apache\tuscany\databinding\databinding-sdo\1.0-SNAPSHOT\databinding-sdo-1.0-SNAPSHOT.jar" target\standalone\extension -rem copy "%USERPROFILE%\.m2\repository\org\apache\tuscany\bindings\axis2\1.0-SNAPSHOT\axis2-1.0-SNAPSHOT.jar" target\standalone\extension - - -java %java_debug_set% -jar target\standalone\bin\launcher.jar --classpath "%USERPROFILE%\.m2\repository\org\apache\tuscany\samples\sca\sample-helloworldwsclient\1.0-SNAPSHOT\sample-helloworldwsclient-1.0-SNAPSHOT.jar" %* diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldCallback.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldCallback.java deleted file mode 100644 index adc48e85a4..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldCallback.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 helloworld; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface HelloWorldCallback { - - public void getGreetingsCallback(String getGreetingsReturn); -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldClient.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldClient.java deleted file mode 100644 index f59c409f45..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldClient.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 helloworld; - -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * This client program shows how to invoke a web service asynchronously with a callback - */ - -public class HelloWorldClient { - - public final static void main(String[] args) throws Exception { - - CompositeContext compositeContext = CurrentCompositeContext.getContext(); - HelloWorldLocal helloWorldLocal = - compositeContext.locateService(HelloWorldLocal.class, "HelloWorldServiceComponent"); - helloWorldLocal.getGreetings("John"); - - // Sleep for 5 seconds to wait the callback to happen - Thread.sleep(5000); - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldLocal.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldLocal.java deleted file mode 100644 index a5b9074af0..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldLocal.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 helloworld; - -import org.apache.tuscany.api.annotation.DataType; -import org.osoa.sca.annotations.Service; - -import commonj.sdo.DataObject; - -@Service -public interface HelloWorldLocal { - - public String getGreetings(String name); - @DataType(name="commonj.sdo.DataObject") - public String getGreetings1(DataObject name); - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldService.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldService.java deleted file mode 100644 index fc64f62a7b..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldService.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 helloworld; - -import org.apache.tuscany.api.annotation.DataType; -import org.osoa.sca.annotations.Callback; -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Service; - -import commonj.sdo.DataObject; - -@Remotable -@Service -@Callback(HelloWorldCallback.class) -public interface HelloWorldService { - - public String getGreetings(String name); - @DataType(name="commonj.sdo.DataObject") - public String getGreetings1(DataObject name); - - public void getGreetingsWithCallback(String name); -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldServiceComponent.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldServiceComponent.java deleted file mode 100644 index 132b44efd8..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/java/helloworld/HelloWorldServiceComponent.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 helloworld; - -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -import commonj.sdo.DataObject; - - -/** - * This client program shows how to create an SCA runtime, start it, - * locate the HelloWorld service and invoke it. - */ - -@Service(HelloWorldLocal.class) -@Scope("COMPOSITE") -public class HelloWorldServiceComponent implements HelloWorldLocal, HelloWorldCallback { - - HelloWorldService helloWorldService; - - public String getGreetings(String name) { - - return helloWorldService.getGreetings(name); - } - - public HelloWorldService getHelloWorldService() { - return helloWorldService; - } - - public void setHelloWorldService(HelloWorldService helloWorldService) { - this.helloWorldService = helloWorldService; - } - - public String getGreetings1(DataObject name) { - return helloWorldService.getGreetings1(name); - } - - public void getGreetingsCallback(String getGreetingsReturn) { - System.out.println("Callback: " + getGreetingsReturn); - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/META-INF/LICENSE.txt b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/META-INF/LICENSE.txt deleted file mode 100644 index 25d78feeac..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/META-INF/LICENSE.txt +++ /dev/null @@ -1,1277 +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. - - -APACHE TUSCANY SUBCOMPONENTS: - -The Apache Tuscany distribution includes a number of subcomponents with -separate copyright notices and license terms. Your use of the source -code for the these subcomponents is subject to the terms and -conditions of the following licenses. - -=============================================================================== - -For the Eclipse Modeling Framework component and the Celtix binding: - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE -PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF -THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and -documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and - -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and -are distributed by that particular Contributor. A Contribution -'originates' from a Contributor if it was added to the Program by such -Contributor itself or anyone acting on such Contributor's behalf. -Contributions do not include additions to the Program which: (i) are -separate modules of software distributed in conjunction with the -Program under their own license agreement, and (ii) are not derivative -works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents " mean patent claims licensable by a Contributor -which are necessarily infringed by the use or sale of its Contribution -alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this -Agreement. - -"Recipient" means anyone who receives the Program under this -Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free copyright -license to reproduce, prepare derivative works of, publicly display, -publicly perform, distribute and sublicense the Contribution of such -Contributor, if any, and such derivative works, in source code and -object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free patent -license under Licensed Patents to make, use, sell, offer to sell, -import and otherwise transfer the Contribution of such Contributor, if -any, in source code and object code form. This patent license shall -apply to the combination of the Contribution and the Program if, at -the time the Contribution is added by the Contributor, such addition -of the Contribution causes such combination to be covered by the -Licensed Patents. The patent license shall not apply to any other -combinations which include the Contribution. No hardware per se is -licensed hereunder. - -c) Recipient understands that although each Contributor grants the -licenses to its Contributions set forth herein, no assurances are -provided by any Contributor that the Program does not infringe the -patent or other intellectual property rights of any other entity. Each -Contributor disclaims any liability to Recipient for claims brought by -any other entity based on infringement of intellectual property rights -or otherwise. As a condition to exercising the rights and licenses -granted hereunder, each Recipient hereby assumes sole responsibility -to secure any other intellectual property rights needed, if any. For -example, if a third party patent license is required to allow -Recipient to distribute the Program, it is Recipient's responsibility -to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient -copyright rights in its Contribution, if any, to grant the copyright -license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form -under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties -and conditions, express and implied, including warranties or -conditions of title and non-infringement, and implied warranties or -conditions of merchantability and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability -for damages, including direct, indirect, special, incidental and -consequential damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are -offered by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such -Contributor, and informs licensees how to obtain it in a reasonable -manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the -Program. - -Contributors may not remove or alter any copyright notices contained -within the Program. - -Each Contributor must identify itself as the originator of its -Contribution, if any, in a manner that reasonably allows subsequent -Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain -responsibilities with respect to end users, business partners and the -like. While this license is intended to facilitate the commercial use -of the Program, the Contributor who includes the Program in a -commercial product offering should do so in a manner which does not -create potential liability for other Contributors. Therefore, if a -Contributor includes the Program in a commercial product offering, -such Contributor ("Commercial Contributor") hereby agrees to defend -and indemnify every other Contributor ("Indemnified Contributor") -against any losses, damages and costs (collectively "Losses") arising -from claims, lawsuits and other legal actions brought by a third party -against the Indemnified Contributor to the extent caused by the acts -or omissions of such Commercial Contributor in connection with its -distribution of the Program in a commercial product offering. The -obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. -In order to qualify, an Indemnified Contributor must: a) promptly -notify the Commercial Contributor in writing of such claim, and b) -allow the Commercial Contributor to control, and cooperate with the -Commercial Contributor in, the defense and any related settlement -negotiations. The Indemnified Contributor may participate in any such -claim at its own expense. - -For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those -performance claims and warranties, and if a court requires any other -Contributor to pay any damages as a result, the Commercial Contributor -must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS -PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY -WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY -OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely -responsible for determining the appropriateness of using and -distributing the Program and assumes all risks associated with its -exercise of rights under this Agreement , including but not limited to -the risks and costs of program errors, compliance with applicable -laws, damage to or loss of data, programs or equipment, and -unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR -ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING -WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR -DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED -HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further -action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that -the Program itself (excluding combinations of the Program with other -software or hardware) infringes such Recipient's patent(s), then such -Recipient's rights granted under Section 2(b) shall terminate as of -the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of -time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use -and distribution of the Program as soon as reasonably practicable. -However, Recipient's obligations under this Agreement and any licenses -granted by Recipient relating to the Program shall continue and -survive. - -Everyone is permitted to copy and distribute copies of this Agreement, -but in order to avoid inconsistency the Agreement is copyrighted and -may only be modified in the following manner. The Agreement Steward -reserves the right to publish new versions (including revisions) of -this Agreement from time to time. No one other than the Agreement -Steward has the right to modify this Agreement. The Eclipse Foundation -is the initial Agreement Steward. The Eclipse Foundation may assign -the responsibility to serve as the Agreement Steward to a suitable -separate entity. Each new version of the Agreement will be given a -distinguishing version number. The Program (including Contributions) -may always be distributed subject to the version of the Agreement -under which it was received. In addition, after a new version of the -Agreement is published, Contributor may elect to distribute the -Program (including its Contributions) under the new version. Except as -expressly stated in Sections 2(a) and 2(b) above, Recipient receives -no rights or licenses to the intellectual property of any Contributor -under this Agreement, whether expressly, by implication, estoppel or -otherwise. All rights in the Program not expressly granted under this -Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and -the intellectual property laws of the United States of America. No -party to this Agreement will bring a legal action under this Agreement -more than one year after the cause of action arose. Each party waives -its rights to a jury trial in any resulting litigation. - -=============================================================================== - -For the Rhino JavaScript container component: - -Mozilla Public License 1.1 (MPL 1.1) - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the -Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to -the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original Code, -prior Modifications used by a Contributor, and the Modifications made by that -particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the -combination of the Original Code and Modifications, in each case including -portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally -accepted in the software development community for the electronic transfer of -data. - - 1.5. "Executable" means Covered Code in any form other than Source -Code. - - 1.6. "Initial Developer" means the individual or entity identified as -the Initial Developer in the Source Code notice required by Exhibit A. - - 1.7. "Larger Work" means a work which combines Covered Code or -portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum -extent possible, whether at the time of the initial grant or subsequently -acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the -substance or structure of either the Original Code or any previous -Modifications. When Covered Code is released as a series of files, a -Modification is: - A. Any addition to or deletion from the contents of a file -containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or -previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code -which is described in the Source Code notice required by Exhibit A as Original -Code, and which, at the time of its release under this License is not already -Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or -hereafter acquired, including without limitation, method, process, and -apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for -making modifications to it, including all modules it contains, plus any -associated interface definition files, scripts used to control compilation and -installation of an Executable, or source code differential comparisons against -either the Original Code or another well known, available Covered Code of the -Contributor's choice. The Source Code can be in a compressed or archival form, -provided the appropriate decompression or de-archiving software is widely -available for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity -exercising rights under, and complying with all of the terms of, this License -or a future version of this License issued under Section 6.1. For legal -entities, "You" includes any entity which controls, is controlled by, or is -under common control with You. For purposes of this definition, "control" -means (a) the power, direct or indirect, to cause the direction or management -of such entity, whether by contract or otherwise, or (b) ownership of more -than fifty percent (50%) of the outstanding shares or beneficial ownership of -such entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - The Initial Developer hereby grants You a world-wide, royalty-free, -non-exclusive license, subject to third party intellectual property claims: - (a) under intellectual property rights (other than patent or -trademark) Licensable by Initial Developer to use, reproduce, modify, display, -perform, sublicense and distribute the Original Code (or portions thereof) -with or without Modifications, and/or as part of a Larger Work; and - - (b) under Patents Claims infringed by the making, using or selling -of Original Code, to make, have made, use, practice, sell, and offer for sale, -and/or otherwise dispose of the Original Code (or portions thereof). - (c) the licenses granted in this Section 2.1(a) and -(b) are effective on the date Initial Developer first distributes Original -Code under the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is -granted: 1) for code that You delete from the Original Code; 2) separate from -the Original Code; or 3) for infringements caused by: i) the modification of -the Original Code or ii) the combination of the Original Code with other -software or devices. - - 2.2. Contributor Grant. - Subject to third party intellectual property claims, each Contributor -hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or -trademark) Licensable by Contributor, to use, reproduce, modify, display, -perform, sublicense and distribute the Modifications created by such -Contributor (or portions thereof) either on an unmodified basis, with other -Modifications, as Covered Code and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, using, or selling -of Modifications made by that Contributor either alone and/or in combination -with its Contributor Version (or portions of such combination), to make, use, -sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications -made by that Contributor (or portions thereof); and 2) the combination of -Modifications made by that Contributor with its Contributor Version (or -portions of such combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are -effective on the date Contributor first makes Commercial Use of the Covered -Code. - - (d) Notwithstanding Section 2.2(b) above, no patent license is -granted: 1) for any code that Contributor has deleted from the Contributor -Version; 2) separate from the Contributor Version; 3) for infringements -caused by: i) third party modifications of Contributor Version or ii) the -combination of Modifications made by that Contributor with other software -(except as part of the Contributor Version) or other devices; or 4) under -Patent Claims infringed by Covered Code in the absence of Modifications made -by that Contributor. - - -3. Distribution Obligations. - - 3.1. Application of License. - The Modifications which You create or to which You contribute are -governed by the terms of this License, including without limitation Section -2.2. The Source Code version of Covered Code may be distributed only under the -terms of this License or a future version of this License released under -Section 6.1, and You must include a copy of this License with every copy of -the Source Code You distribute. You may not offer or impose any terms on any -Source Code version that alters or restricts the applicable version of this -License or the recipients' rights hereunder. However, You may include an -additional document offering the additional rights described in Section 3.5. - - 3.2. Availability of Source Code. - Any Modification which You create or to which You contribute must be -made available in Source Code form under the terms of this License either on -the same media as an Executable version or via an accepted Electronic -Distribution Mechanism to anyone to whom you made an Executable version -available; and if made available via Electronic Distribution Mechanism, must -remain available for at least twelve (12) months after the date it initially -became available, or at least six (6) months after a subsequent version of -that particular Modification has been made available to such recipients. You -are responsible for ensuring that the Source Code version remains available -even if the Electronic Distribution Mechanism is maintained by a third party. - - 3.3. Description of Modifications. - You must cause all Covered Code to which You contribute to contain a -file documenting the changes You made to create that Covered Code and the date -of any change. You must include a prominent statement that the Modification is -derived, directly or indirectly, from Original Code provided by the Initial -Developer and including the name of the Initial Developer in (a) the Source -Code, and (b) in any notice in an Executable version or related documentation -in which You describe the origin or ownership of the Covered Code. - - 3.4. Intellectual Property Matters - (a) Third Party Claims. - If Contributor has knowledge that a license under a third party's -intellectual property rights is required to exercise the rights granted by -such Contributor under Sections 2.1 or 2.2, Contributor must include a text -file with the Source Code distribution titled "LEGAL" which describes the -claim and the party making the claim in sufficient detail that a recipient -will know whom to contact. If Contributor obtains such knowledge after the -Modification is made available as described in Section 3.2, Contributor shall -promptly modify the LEGAL file in all copies Contributor makes available -thereafter and shall take other steps (such as notifying appropriate mailing -lists or newsgroups) reasonably calculated to inform those who received the -Covered Code that new knowledge has been obtained. - - (b) Contributor APIs. - If Contributor's Modifications include an application programming -interface and Contributor has knowledge of patent licenses which are -reasonably necessary to implement that API, Contributor must also include this -information in the LEGAL file. - - (c) Representations. - Contributor represents that, except as disclosed pursuant to -Section 3.4(a) above, Contributor believes that Contributor's Modifications -are Contributor's original creation(s) and/or Contributor has sufficient -rights to grant the rights conveyed by this License. - - - 3.5. Required Notices. - You must duplicate the notice in Exhibit A in each file of the Source -Code. If it is not possible to put such notice in a particular Source Code -file due to its structure, then You must include such notice in a location -(such as a relevant directory) where a user would be likely to look for such a -notice. If You created one or more Modification(s) You may add your name as a -Contributor to the notice described in Exhibit A. You must also duplicate -this License in any documentation for the Source Code where You describe -recipients' rights or ownership rights relating to Covered Code. You may -choose to offer, and to charge a fee for, warranty, support, indemnity or -liability obligations to one or more recipients of Covered Code. However, You -may do so only on Your own behalf, and not on behalf of the Initial Developer -or any Contributor. You must make it absolutely clear than any such warranty, -support, indemnity or liability obligation is offered by You alone, and You -hereby agree to indemnify the Initial Developer and every Contributor for any -liability incurred by the Initial Developer or such Contributor as a result of -warranty, support, indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - You may distribute Covered Code in Executable form only if the -requirements of Section 3.1-3.5 have been met for that Covered Code, and if -You include a notice stating that the Source Code version of the Covered Code -is available under the terms of this License, including a description of how -and where You have fulfilled the obligations of Section 3.2. The notice must -be conspicuously included in any notice in an Executable version, related -documentation or collateral in which You describe recipients' rights relating -to the Covered Code. You may distribute the Executable version of Covered Code -or ownership rights under a license of Your choice, which may contain terms -different from this License, provided that You are in compliance with the -terms of this License and that the license for the Executable version does not -attempt to limit or alter the recipient's rights in the Source Code version -from the rights set forth in this License. If You distribute the Executable -version under a different license You must make it absolutely clear that any -terms which differ from this License are offered by You alone, not by the -Initial Developer or any Contributor. You hereby agree to indemnify the -Initial Developer and every Contributor for any liability incurred by the -Initial Developer or such Contributor as a result of any such terms You offer. - - 3.7. Larger Works. - You may create a Larger Work by combining Covered Code with other code -not governed by the terms of this License and distribute the Larger Work as a -single product. In such a case, You must make sure the requirements of this -License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Code due to statute, -judicial order, or regulation then You must: (a) comply with the terms of this -License to the maximum extent possible; and (b) describe the limitations and -the code they affect. Such description must be included in the LEGAL file -described in Section 3.4 and must be included with all distributions of the -Source Code. Except to the extent prohibited by statute or regulation, such -description must be sufficiently detailed for a recipient of ordinary skill to -be able to understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has attached -the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - Netscape Communications Corporation ("Netscape") may publish revised -and/or new versions of the License from time to time. Each version will be -given a distinguishing version number. - - 6.2. Effect of New Versions. - Once Covered Code has been published under a particular version of the -License, You may always continue to use it under the terms of that version. -You may also choose to use such Covered Code under the terms of any subsequent -version of the License published by Netscape. No one other than Netscape has -the right to modify the terms applicable to Covered Code created under this -License. - - 6.3. Derivative Works. - If You create or use a modified version of this License (which you may -only do in order to apply it to code which is not already Covered Code -governed by this License), You must (a) rename Your license so that the -phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or -any confusingly similar phrase do not appear in your license (except to note -that your license differs from this License) and (b) otherwise make it clear -that Your version of the license contains terms which differ from the Mozilla -Public License and Netscape Public License. (Filling in the name of the -Initial Developer, Original Code or Contributor in the notice described in -Exhibit A shall not of themselves be deemed to be modifications of this -License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT -LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, -FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE -QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED -CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY -OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR -CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS -LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS -DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate -automatically if You fail to comply with terms herein and fail to cure such -breach within 30 days of becoming aware of the breach. All sublicenses to the -Covered Code which are properly granted shall survive any termination of this -License. Provisions which, by their nature, must remain in effect beyond the -termination of this License shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement -claim (excluding declatory judgment actions) against Initial Developer or a -Contributor (the Initial Developer or Contributor against whom You file such -action is referred to as "Participant") alleging that: - - (a) such Participant's Contributor Version directly or indirectly -infringes any patent, then any and all rights granted by such Participant to -You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice -from Participant terminate prospectively, unless if within 60 days after -receipt of notice You either: (i) agree in writing to pay Participant a -mutually agreeable reasonable royalty for Your past and future use of -Modifications made by such Participant, or (ii) withdraw Your litigation claim -with respect to the Contributor Version against such Participant. If within -60 days of notice, a reasonable royalty and payment arrangement are not -mutually agreed upon in writing by the parties or the litigation claim is not -withdrawn, the rights granted by Participant to You under Sections 2.1 and/or -2.2 automatically terminate at the expiration of the 60 day notice period -specified above. - - (b) any software, hardware, or device, other than such Participant's -Contributor Version, directly or indirectly infringes any patent, then any -rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are -revoked effective as of the date You first made, used, sold, distributed, or -had made, Modifications made by that Participant. - - 8.3. If You assert a patent infringement claim against Participant -alleging that such Participant's Contributor Version directly or indirectly -infringes any patent where such claim is resolved (such as by license or -settlement) prior to the initiation of patent infringement litigation, then -the reasonable value of the licenses granted by such Participant under -Sections 2.1 or 2.2 shall be taken into account in determining the amount or -value of any payment or license. - - 8.4. In the event of termination under Sections 8.1 or 8.2 above, all -end user license agreements (excluding distributors and resellers) which have -been validly granted by You or any distributor hereunder prior to termination -shall survive termination. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT -(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL -DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY -SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, -SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, -WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER -FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, -EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH -DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH -OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT -APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE -EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS -EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in 48 -C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and -"commercial computer software documentation," as such terms are used in 48 -C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. -227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users -acquire Covered Code with only those rights set forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject matter -hereof. If any provision of this License is held to be unenforceable, such -provision shall be reformed only to the extent necessary to make it -enforceable. This License shall be governed by California law provisions -(except to the extent applicable law, if any, provides otherwise), excluding -its conflict-of-law provisions. With respect to disputes in which at least one -party is a citizen of, or an entity chartered or registered to do business in -the United States of America, any litigation relating to this License shall be -subject to the jurisdiction of the Federal Courts of the Northern District of -California, with venue lying in Santa Clara County, California, with the -losing party responsible for costs, including without limitation, court costs -and reasonable attorneys' fees and expenses. The application of the United -Nations Convention on Contracts for the International Sale of Goods is -expressly excluded. Any law or regulation which provides that the language of -a contract shall be construed against the drafter shall not apply to this -License. - -12. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is -responsible for claims and damages arising, directly or indirectly, out of its -utilization of rights under this License and You agree to work with Initial -Developer and Contributors to distribute such responsibility on an equitable -basis. Nothing herein is intended or shall be deemed to constitute any -admission of liability. - -13. MULTIPLE-LICENSED CODE. - - Initial Developer may designate portions of the Covered Code as -Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits -you to utilize portions of the Covered Code under Your choice of the MPL or -the alternative licenses, if any, specified by the Initial Developer in the -file described in Exhibit A. - - -EXHIBIT A -Mozilla Public License. - - ``The contents of this file are subject to the Mozilla Public License -Version 1.1 (the "License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF - ANY KIND, either express or implied. See the License for the specific -language governing rights and - limitations under the License. - - The Original Code is ______________________________________. - - The Initial Developer of the Original Code is ________________________. -Portions created by - ______________________ are Copyright (C) ______ -_______________________. All Rights - Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the terms of -the _____ license (the [___] License), in which case the provisions of -[______] License are applicable instead of those above. If you wish to allow -use of your version of this file only under the terms of the [____] License -and not to allow others to use your version of this file under the MPL, -indicate your decision by deleting the provisions above and replace them -with the notice and other provisions required by the [___] License. If you do -not delete the provisions above, a recipient may use your version of this file -under either the MPL or the [___] License." - - [NOTE: The text of this Exhibit A may differ slightly from the text of -the notices in the Source Code files of the Original Code. You should use the -text of this Exhibit A rather than the text found in the Original Code Source -Code for Your Modifications.] - - -=============================================================================== - -For the JAX-WS Reference Implementation component: - -COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 - - - 1. Definitions. - - 1.1. "Contributor" means each individual or entity that - creates or contributes to the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the - Original Software, prior Modifications used by a - Contributor (if any), and the Modifications made by that - particular Contributor. - - 1.3. "Covered Software" means (a) the Original Software, or - (b) Modifications, or (c) the combination of files - containing Original Software with files containing - Modifications, in each case including portions thereof. - - 1.4. "Executable" means the Covered Software in any form - other than Source Code. - - 1.5. "Initial Developer" means the individual or entity - that first makes Original Software available under this - License. - - 1.6. "Larger Work" means a work which combines Covered - Software or portions thereof with code not governed by the - terms of this License. - - 1.7. "License" means this document. - - 1.8. "Licensable" means having the right to grant, to the - maximum extent possible, whether at the time of the initial - grant or subsequently acquired, any and all of the rights - conveyed herein. - - 1.9. "Modifications" means the Source Code and Executable - form of any of the following: - - A. Any file that results from an addition to, - deletion from or modification of the contents of a - file containing Original Software or previous - Modifications; - - B. Any new file that contains any part of the - Original Software or previous Modification; or - - C. Any new file that is contributed or otherwise made - available under the terms of this License. - - 1.10. "Original Software" means the Source Code and - Executable form of computer software code that is - originally released under this License. - - 1.11. "Patent Claims" means any patent claim(s), now owned - or hereafter acquired, including without limitation, - method, process, and apparatus claims, in any patent - Licensable by grantor. - - 1.12. "Source Code" means (a) the common form of computer - software code in which modifications are made and (b) - associated documentation included in or with such code. - - 1.13. "You" (or "Your") means an individual or a legal - entity exercising rights under, and complying with all of - the terms of, this License. For legal entities, "You" - includes any entity which controls, is controlled by, or is - under common control with You. For purposes of this - definition, "control" means (a) the power, direct or - indirect, to cause the direction or management of such - entity, whether by contract or otherwise, or (b) ownership - of more than fifty percent (50%) of the outstanding shares - or beneficial ownership of such entity. - - 2. License Grants. - - 2.1. The Initial Developer Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, the - Initial Developer hereby grants You a world-wide, - royalty-free, non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Initial Developer, - to use, reproduce, modify, display, perform, - sublicense and distribute the Original Software (or - portions thereof), with or without Modifications, - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, - using or selling of Original Software, to make, have - made, use, practice, sell, and offer for sale, and/or - otherwise dispose of the Original Software (or - portions thereof). - - (c) The licenses granted in Sections 2.1(a) and (b) - are effective on the date Initial Developer first - distributes or otherwise makes the Original Software - available to a third party under the terms of this - License. - - (d) Notwithstanding Section 2.1(b) above, no patent - license is granted: (1) for code that You delete from - the Original Software, or (2) for infringements - caused by: (i) the modification of the Original - Software, or (ii) the combination of the Original - Software with other software or devices. - - 2.2. Contributor Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, each - Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Contributor to - use, reproduce, modify, display, perform, sublicense - and distribute the Modifications created by such - Contributor (or portions thereof), either on an - unmodified basis, with other Modifications, as - Covered Software and/or as part of a Larger Work; and - - - (b) under Patent Claims infringed by the making, - using, or selling of Modifications made by that - Contributor either alone and/or in combination with - its Contributor Version (or portions of such - combination), to make, use, sell, offer for sale, - have made, and/or otherwise dispose of: (1) - Modifications made by that Contributor (or portions - thereof); and (2) the combination of Modifications - made by that Contributor with its Contributor Version - (or portions of such combination). - - (c) The licenses granted in Sections 2.2(a) and - 2.2(b) are effective on the date Contributor first - distributes or otherwise makes the Modifications - available to a third party. - - (d) Notwithstanding Section 2.2(b) above, no patent - license is granted: (1) for any code that Contributor - has deleted from the Contributor Version; (2) for - infringements caused by: (i) third party - modifications of Contributor Version, or (ii) the - combination of Modifications made by that Contributor - with other software (except as part of the - Contributor Version) or other devices; or (3) under - Patent Claims infringed by Covered Software in the - absence of Modifications made by that Contributor. - - 3. Distribution Obligations. - - 3.1. Availability of Source Code. - - Any Covered Software that You distribute or otherwise make - available in Executable form must also be made available in - Source Code form and that Source Code form must be - distributed only under the terms of this License. You must - include a copy of this License with every copy of the - Source Code form of the Covered Software You distribute or - otherwise make available. You must inform recipients of any - such Covered Software in Executable form as to how they can - obtain such Covered Software in Source Code form in a - reasonable manner on or through a medium customarily used - for software exchange. - - 3.2. Modifications. - - The Modifications that You create or to which You - contribute are governed by the terms of this License. You - represent that You believe Your Modifications are Your - original creation(s) and/or You have sufficient rights to - grant the rights conveyed by this License. - - 3.3. Required Notices. - - You must include a notice in each of Your Modifications - that identifies You as the Contributor of the Modification. - You may not remove or alter any copyright, patent or - trademark notices contained within the Covered Software, or - any notices of licensing or any descriptive text giving - attribution to any Contributor or the Initial Developer. - - 3.4. Application of Additional Terms. - - You may not offer or impose any terms on any Covered - Software in Source Code form that alters or restricts the - applicable version of this License or the recipients' - rights hereunder. You may choose to offer, and to charge a - fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Software. - However, you may do so only on Your own behalf, and not on - behalf of the Initial Developer or any Contributor. You - must make it absolutely clear that any such warranty, - support, indemnity or liability obligation is offered by - You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred - by the Initial Developer or such Contributor as a result of - warranty, support, indemnity or liability terms You offer. - - - 3.5. Distribution of Executable Versions. - - You may distribute the Executable form of the Covered - Software under the terms of this License or under the terms - of a license of Your choice, which may contain terms - different from this License, provided that You are in - compliance with the terms of this License and that the - license for the Executable form does not attempt to limit - or alter the recipient's rights in the Source Code form - from the rights set forth in this License. If You - distribute the Covered Software in Executable form under a - different license, You must make it absolutely clear that - any terms which differ from this License are offered by You - alone, not by the Initial Developer or Contributor. You - hereby agree to indemnify the Initial Developer and every - Contributor for any liability incurred by the Initial - Developer or such Contributor as a result of any such terms - You offer. - - 3.6. Larger Works. - - You may create a Larger Work by combining Covered Software - with other code not governed by the terms of this License - and distribute the Larger Work as a single product. In such - a case, You must make sure the requirements of this License - are fulfilled for the Covered Software. - - 4. Versions of the License. - - 4.1. New Versions. - - Sun Microsystems, Inc. is the initial license steward and - may publish revised and/or new versions of this License - from time to time. Each version will be given a - distinguishing version number. Except as provided in - Section 4.3, no one other than the license steward has the - right to modify this License. - - 4.2. Effect of New Versions. - - You may always continue to use, distribute or otherwise - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. If the Initial Developer includes a - notice in the Original Software prohibiting it from being - distributed or otherwise made available under any - subsequent version of the License, You must distribute and - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. Otherwise, You may also choose to - use, distribute or otherwise make the Covered Software - available under the terms of any subsequent version of the - License published by the license steward. - - 4.3. Modified Versions. - - When You are an Initial Developer and You want to create a - new license for Your Original Software, You may create and - use a modified version of this License if You: (a) rename - the license and remove any references to the name of the - license steward (except to note that the license differs - from this License); and (b) otherwise make it clear that - the license contains terms which differ from this License. - - - 5. DISCLAIMER OF WARRANTY. - - COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" - BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, - INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED - SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR - PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND - PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY - COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE - INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF - ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF - WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS - DISCLAIMER. - - 6. TERMINATION. - - 6.1. This License and the rights granted hereunder will - terminate automatically if You fail to comply with terms - herein and fail to cure such breach within 30 days of - becoming aware of the breach. Provisions which, by their - nature, must remain in effect beyond the termination of - this License shall survive. - - 6.2. If You assert a patent infringement claim (excluding - declaratory judgment actions) against Initial Developer or - a Contributor (the Initial Developer or Contributor against - whom You assert such claim is referred to as "Participant") - alleging that the Participant Software (meaning the - Contributor Version where the Participant is a Contributor - or the Original Software where the Participant is the - Initial Developer) directly or indirectly infringes any - patent, then any and all rights granted directly or - indirectly to You by such Participant, the Initial - Developer (if the Initial Developer is not the Participant) - and all Contributors under Sections 2.1 and/or 2.2 of this - License shall, upon 60 days notice from Participant - terminate prospectively and automatically at the expiration - of such 60 day notice period, unless if within such 60 day - period You withdraw Your claim with respect to the - Participant Software against such Participant either - unilaterally or pursuant to a written agreement with - Participant. - - 6.3. In the event of termination under Sections 6.1 or 6.2 - above, all end user licenses that have been validly granted - by You or any distributor hereunder prior to termination - (excluding licenses granted to You by any distributor) - shall survive termination. - - 7. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE - INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF - COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE - LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR - CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT - LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK - STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL - INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT - APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO - NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR - CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT - APPLY TO YOU. - - 8. U.S. GOVERNMENT END USERS. - - The Covered Software is a "commercial item," as that term is - defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial - computer software" (as that term is defined at 48 C.F.R. - 252.227-7014(a)(1)) and "commercial computer software - documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. - 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 - through 227.7202-4 (June 1995), all U.S. Government End Users - acquire Covered Software with only those rights set forth herein. - This U.S. Government Rights clause is in lieu of, and supersedes, - any other FAR, DFAR, or other clause or provision that addresses - Government rights in computer software under this License. - - 9. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the - extent necessary to make it enforceable. This License shall be - governed by the law of the jurisdiction specified in a notice - contained within the Original Software (except to the extent - applicable law, if any, provides otherwise), excluding such - jurisdiction's conflict-of-law provisions. Any litigation - relating to this License shall be subject to the jurisdiction of - the courts located in the jurisdiction and venue specified in a - notice contained within the Original Software, with the losing - party responsible for costs, including, without limitation, court - costs and reasonable attorneys' fees and expenses. The - application of the United Nations Convention on Contracts for the - International Sale of Goods is expressly excluded. Any law or - regulation which provides that the language of a contract shall - be construed against the drafter shall not apply to this License. - You agree that You alone are responsible for compliance with the - United States export administration regulations (and the export - control laws and regulation of any other countries) when You use, - distribute or otherwise make available any Covered Software. - - 10. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or - indirectly, out of its utilization of rights under this License - and You agree to work with Initial Developer and Contributors to - distribute such responsibility on an equitable basis. Nothing - herein is intended or shall be deemed to constitute any admission - of liability. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/META-INF/NOTICE b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/META-INF/NOTICE deleted file mode 100644 index 11c564eb19..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/META-INF/NOTICE +++ /dev/null @@ -1,18 +0,0 @@ -========================================================================= -== NOTICE file corresponding to the section 4 d of == -== the Apache License, Version 2.0, == -== in this case for the Apache Tuscany distribution. == -========================================================================= - -This product includes software developed by the Apache Software Foundation -(http://www.apache.org/). - -This product also includes software developed by: -- the Eclipse Modeling Framework project (http://www.eclipse.org/emf/) -- the Celtix project (http://celtix.objectweb.org/) -- the Mozilla Rhino project (http://www.mozilla.org/rhino/) -- the GlassFish JAX-WS project (https://jax-ws.dev.java.net/) - -Please read the LICENSE.txt file present in the root directory of this -distribution. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/META-INF/README.txt b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/META-INF/README.txt deleted file mode 100644 index 9b26d1690a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/META-INF/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -Apache Tuscany M1 build (May, 2006) -=================================== - -http://incubator.apache.org/tuscany/ - -Tuscany is an effort undergoing incubation at the Apache Software Foundation -(ASF), sponsored by the Web Services PMC. - -Incubation is required of all newly accepted projects until a further review -indicates that the infrastructure, communications, and decision making process -have stabilized in a manner consistent with other successful ASF projects. - -While incubation status is not necessarily a reflection of the completeness or -stability of the code, it does indicate that the project has yet to be fully -endorsed by the ASF. - - -Support -------- - -Any problem with this release can be reported to the Tuscany mailing list -or in the JIRA issue tracker. - -Mailing list subscription: - tuscany-dev-subscribe@ws.apache.org - -Jira: - http://issues.apache.org/jira/browse/Tuscany - - -Thank you for using Tuscany! - - -The Tuscany Team. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/META-INF/sca/default.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/META-INF/sca/default.scdl deleted file mode 100644 index b0936e9916..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/META-INF/sca/default.scdl +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - HelloWorldService - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/logging.properties b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/logging.properties deleted file mode 100644 index 78e24f1633..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/logging.properties +++ /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. -# $Rev$ $Date$ -# - -# Custom logging configuration for Tuscany samples -# By default, only INFO level logging is enabled and ALL messages get sent to the console -# For more messages from the runtime, uncomment specific settings at the end of this file -handlers = java.util.logging.ConsoleHandler -java.util.logging.ConsoleHandler.level = ALL -java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter -.level=INFO - -# Uncomment the next setting to get all Tuscany messages (this will be a lot) -#org.apache.tuscany.level=FINEST diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/wsdl/helloworld.wsdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/wsdl/helloworld.wsdl deleted file mode 100644 index 9822287a85..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/main/resources/wsdl/helloworld.wsdl +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/test/java/helloworld/HelloWorldWSAsyncClient.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/test/java/helloworld/HelloWorldWSAsyncClient.java deleted file mode 100644 index 535258f780..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/test/java/helloworld/HelloWorldWSAsyncClient.java +++ /dev/null @@ -1,46 +0,0 @@ -package helloworld; - -import junit.framework.Assert; - -import org.apache.tuscany.test.SCATestCase; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * Test case for helloworld web service client - */ -public class HelloWorldWSAsyncClient extends SCATestCase { - - private HelloWorldLocal helloWorldLocal; - - @Override - protected void setUp() throws Exception { - try { - setApplicationSCDL(HelloWorldCallback.class, "META-INF/sca/default.scdl"); - ClassLoader classLoader = getClass().getClassLoader(); - addExtension("test.extensions", classLoader.getResource("META-INF/tuscany/test-extensions.scdl")); - - super.setUp(); - CompositeContext compositeContext = CurrentCompositeContext.getContext(); - helloWorldLocal = - compositeContext.locateService(HelloWorldLocal.class, "HelloWorldServiceComponent"); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - public void testWSClient() throws Exception { - try { - String msg = helloWorldLocal.getGreetings("John"); - Assert.assertEquals(msg, "Hola John"); - - // Sleep for 2 seconds to wait the callback to happen - Thread.sleep(2000); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/test/resources/META-INF/tuscany/test-extensions.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/test/resources/META-INF/tuscany/test-extensions.scdl deleted file mode 100644 index ec3643cf00..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-async-wsclient/src/test/resources/META-INF/tuscany/test-extensions.scdl +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/pom.xml deleted file mode 100644 index 2bc95796db..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/pom.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2.samples - parent - 0.1-integration-incubating-SNAPSHOT - ../pom.xml - - - 4.0.0 - tuscany-sample-helloworld-om-ws - jar - Tuscany HelloWorld Axiom Web Service Sample - A sample HelloWorld Web Service using Axiom OM. - - - - org.apache.tuscany.sca.kernel - tuscany-api - compile - 0.1-integration-incubating-SNAPSHOT - - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - - org.apache.tuscany.sca.extensions.axis2 - tuscany-axis2 - runtime - 0.1-integration-incubating-SNAPSHOT - - - - org.apache.tuscany.sca.services - tuscany-http-jetty - runtime - 0.1-integration-incubating-SNAPSHOT - - - - org.apache.ws.commons.axiom - axiom-api - 1.2.2 - compile - - - - junit - junit - 4.2 - test - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - helloworld.om.HelloWorldServer - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/readme.htm b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/readme.htm deleted file mode 100644 index 2c0f3c2eb1..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/readme.htm +++ /dev/null @@ -1,48 +0,0 @@ - - -Tuscany -Hello World Web Service Sample - -

Tuscany -Hello World WS Sample

-

Overview

-

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

-

Location

-This sample is located  in the samples\sca\helloworldws -directory.
-

Setup

-Set up your server as described in the Tomcat -Setup.  If you are not using the pre-configured Tomcat server from the binary distribution, you will need to add - sample-helloworldws-incubating-M1.war -to your Tomcat's webapp directory. -

Running

-This service can be invoked by the Tuscany SCA helloworldwsclient or helloworldjsclient -sample.
-

Code Overview

-The source files are physically organized as shown below:
-
-
+---main
+---resources
¦ ¦ sca.module
¦ ¦
¦ +---wsdl
¦ helloworldOM.wsdl
¦
+---webapp
+---WEB-INF
web.xml
-

- - - - - - - -
sca.moduleDefines the SCA module, -entryPoint and component. Defines for the HelloWorldServiceComponent -component and the Java class that implements the component For the -entryPoint it defines WSDL for the service, the Java interface provided -by the service, and wires the service to -the HelloWorldServiceComponent
helloworldOM.wsdlWSDL for the service.
web.xmlStandard J2EE web application's web.xml
-

You may have noticed that there is no Java source for this -components implementation.  There reason is this sample reuses -the code from the helloworldOM sample to implement the service. -

diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/setup.bat b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/setup.bat deleted file mode 100755 index f612aabb75..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/setup.bat +++ /dev/null @@ -1,16 +0,0 @@ -@echo off -pushd target -jar -xf ..\apache-tomcat-5.5.17.zip -popd -copy target\sample-helloworldws-1.0-SNAPSHOT.war target\apache-tomcat-5.5.17\webapps -rem pushd target\apache-tomcat-5.5.17\webapps -rem md sample-helloworldws-1.0-SNAPSHOT -rem cd sample-helloworldws-1.0-SNAPSHOT -rem jar -xf ..\sample-helloworldws-1.0-SNAPSHOT.war -pushd target\apache-tomcat-5.5.17\shared -rem jar -xf "%USERPROFILE%\.m2\repository\org\apache\tuscany\web\1.0-SNAPSHOT\web-1.0-SNAPSHOT-bin.zip" -jar -xf "%USERPROFILE%\.m2\repository\org\apache\tuscany\web\1.0-SNAPSHOT\web-1.0-SNAPSHOT-bin.zip" -popd -rem hack -mkdir target\apache-tomcat-5.5.17\shared\extension -copy target\apache-tomcat-5.5.17\shared\lib\axis2-1.0-SNAPSHOT.jar target\apache-tomcat-5.5.17\shared\extension diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldImpl.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldImpl.java deleted file mode 100644 index 6705ec5a4a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldImpl.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 helloworld.om; - - -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.OMFactory; -import org.osoa.sca.annotations.Service; - -/** - * This class implements the HelloWorld service. - */ -@Service(HelloWorldService.class) -public class HelloWorldImpl implements HelloWorldService { - - 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-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldServer.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldServer.java deleted file mode 100644 index d68a6a39ad..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldServer.java +++ /dev/null @@ -1,28 +0,0 @@ -package helloworld.om; - - -import java.io.IOException; - -import org.apache.tuscany.api.SCARuntime; - -public class HelloWorldServer { - - /** - * @param args - */ - public static void main(String[] args) { - - SCARuntime.start("helloworldws-om.composite"); - - try { - System.out.println("HelloWorld server started"); - System.in.read(); - } catch (IOException e) { - e.printStackTrace(); - } - - SCARuntime.stop(); - System.out.println("HelloWorld server stopped"); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldService.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldService.java deleted file mode 100644 index 8c17d68a4d..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/java/helloworld/om/HelloWorldService.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 helloworld.om; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.api.annotation.DataType; -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Service; - -/** - * This is the business interface of the HelloWorld greetings service. - */ -@Service -@Remotable -@DataType(name="org.apache.axiom.om.OMElement") -public interface HelloWorldService { - - public OMElement getGreetings(OMElement name); - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/META-INF/LICENSE.txt b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/META-INF/LICENSE.txt deleted file mode 100644 index 25d78feeac..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/META-INF/LICENSE.txt +++ /dev/null @@ -1,1277 +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. - - -APACHE TUSCANY SUBCOMPONENTS: - -The Apache Tuscany distribution includes a number of subcomponents with -separate copyright notices and license terms. Your use of the source -code for the these subcomponents is subject to the terms and -conditions of the following licenses. - -=============================================================================== - -For the Eclipse Modeling Framework component and the Celtix binding: - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE -PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF -THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and -documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and - -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and -are distributed by that particular Contributor. A Contribution -'originates' from a Contributor if it was added to the Program by such -Contributor itself or anyone acting on such Contributor's behalf. -Contributions do not include additions to the Program which: (i) are -separate modules of software distributed in conjunction with the -Program under their own license agreement, and (ii) are not derivative -works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents " mean patent claims licensable by a Contributor -which are necessarily infringed by the use or sale of its Contribution -alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this -Agreement. - -"Recipient" means anyone who receives the Program under this -Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free copyright -license to reproduce, prepare derivative works of, publicly display, -publicly perform, distribute and sublicense the Contribution of such -Contributor, if any, and such derivative works, in source code and -object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free patent -license under Licensed Patents to make, use, sell, offer to sell, -import and otherwise transfer the Contribution of such Contributor, if -any, in source code and object code form. This patent license shall -apply to the combination of the Contribution and the Program if, at -the time the Contribution is added by the Contributor, such addition -of the Contribution causes such combination to be covered by the -Licensed Patents. The patent license shall not apply to any other -combinations which include the Contribution. No hardware per se is -licensed hereunder. - -c) Recipient understands that although each Contributor grants the -licenses to its Contributions set forth herein, no assurances are -provided by any Contributor that the Program does not infringe the -patent or other intellectual property rights of any other entity. Each -Contributor disclaims any liability to Recipient for claims brought by -any other entity based on infringement of intellectual property rights -or otherwise. As a condition to exercising the rights and licenses -granted hereunder, each Recipient hereby assumes sole responsibility -to secure any other intellectual property rights needed, if any. For -example, if a third party patent license is required to allow -Recipient to distribute the Program, it is Recipient's responsibility -to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient -copyright rights in its Contribution, if any, to grant the copyright -license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form -under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties -and conditions, express and implied, including warranties or -conditions of title and non-infringement, and implied warranties or -conditions of merchantability and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability -for damages, including direct, indirect, special, incidental and -consequential damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are -offered by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such -Contributor, and informs licensees how to obtain it in a reasonable -manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the -Program. - -Contributors may not remove or alter any copyright notices contained -within the Program. - -Each Contributor must identify itself as the originator of its -Contribution, if any, in a manner that reasonably allows subsequent -Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain -responsibilities with respect to end users, business partners and the -like. While this license is intended to facilitate the commercial use -of the Program, the Contributor who includes the Program in a -commercial product offering should do so in a manner which does not -create potential liability for other Contributors. Therefore, if a -Contributor includes the Program in a commercial product offering, -such Contributor ("Commercial Contributor") hereby agrees to defend -and indemnify every other Contributor ("Indemnified Contributor") -against any losses, damages and costs (collectively "Losses") arising -from claims, lawsuits and other legal actions brought by a third party -against the Indemnified Contributor to the extent caused by the acts -or omissions of such Commercial Contributor in connection with its -distribution of the Program in a commercial product offering. The -obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. -In order to qualify, an Indemnified Contributor must: a) promptly -notify the Commercial Contributor in writing of such claim, and b) -allow the Commercial Contributor to control, and cooperate with the -Commercial Contributor in, the defense and any related settlement -negotiations. The Indemnified Contributor may participate in any such -claim at its own expense. - -For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those -performance claims and warranties, and if a court requires any other -Contributor to pay any damages as a result, the Commercial Contributor -must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS -PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY -WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY -OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely -responsible for determining the appropriateness of using and -distributing the Program and assumes all risks associated with its -exercise of rights under this Agreement , including but not limited to -the risks and costs of program errors, compliance with applicable -laws, damage to or loss of data, programs or equipment, and -unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR -ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING -WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR -DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED -HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further -action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that -the Program itself (excluding combinations of the Program with other -software or hardware) infringes such Recipient's patent(s), then such -Recipient's rights granted under Section 2(b) shall terminate as of -the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of -time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use -and distribution of the Program as soon as reasonably practicable. -However, Recipient's obligations under this Agreement and any licenses -granted by Recipient relating to the Program shall continue and -survive. - -Everyone is permitted to copy and distribute copies of this Agreement, -but in order to avoid inconsistency the Agreement is copyrighted and -may only be modified in the following manner. The Agreement Steward -reserves the right to publish new versions (including revisions) of -this Agreement from time to time. No one other than the Agreement -Steward has the right to modify this Agreement. The Eclipse Foundation -is the initial Agreement Steward. The Eclipse Foundation may assign -the responsibility to serve as the Agreement Steward to a suitable -separate entity. Each new version of the Agreement will be given a -distinguishing version number. The Program (including Contributions) -may always be distributed subject to the version of the Agreement -under which it was received. In addition, after a new version of the -Agreement is published, Contributor may elect to distribute the -Program (including its Contributions) under the new version. Except as -expressly stated in Sections 2(a) and 2(b) above, Recipient receives -no rights or licenses to the intellectual property of any Contributor -under this Agreement, whether expressly, by implication, estoppel or -otherwise. All rights in the Program not expressly granted under this -Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and -the intellectual property laws of the United States of America. No -party to this Agreement will bring a legal action under this Agreement -more than one year after the cause of action arose. Each party waives -its rights to a jury trial in any resulting litigation. - -=============================================================================== - -For the Rhino JavaScript container component: - -Mozilla Public License 1.1 (MPL 1.1) - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the -Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to -the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original Code, -prior Modifications used by a Contributor, and the Modifications made by that -particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the -combination of the Original Code and Modifications, in each case including -portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally -accepted in the software development community for the electronic transfer of -data. - - 1.5. "Executable" means Covered Code in any form other than Source -Code. - - 1.6. "Initial Developer" means the individual or entity identified as -the Initial Developer in the Source Code notice required by Exhibit A. - - 1.7. "Larger Work" means a work which combines Covered Code or -portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum -extent possible, whether at the time of the initial grant or subsequently -acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the -substance or structure of either the Original Code or any previous -Modifications. When Covered Code is released as a series of files, a -Modification is: - A. Any addition to or deletion from the contents of a file -containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or -previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code -which is described in the Source Code notice required by Exhibit A as Original -Code, and which, at the time of its release under this License is not already -Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or -hereafter acquired, including without limitation, method, process, and -apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for -making modifications to it, including all modules it contains, plus any -associated interface definition files, scripts used to control compilation and -installation of an Executable, or source code differential comparisons against -either the Original Code or another well known, available Covered Code of the -Contributor's choice. The Source Code can be in a compressed or archival form, -provided the appropriate decompression or de-archiving software is widely -available for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity -exercising rights under, and complying with all of the terms of, this License -or a future version of this License issued under Section 6.1. For legal -entities, "You" includes any entity which controls, is controlled by, or is -under common control with You. For purposes of this definition, "control" -means (a) the power, direct or indirect, to cause the direction or management -of such entity, whether by contract or otherwise, or (b) ownership of more -than fifty percent (50%) of the outstanding shares or beneficial ownership of -such entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - The Initial Developer hereby grants You a world-wide, royalty-free, -non-exclusive license, subject to third party intellectual property claims: - (a) under intellectual property rights (other than patent or -trademark) Licensable by Initial Developer to use, reproduce, modify, display, -perform, sublicense and distribute the Original Code (or portions thereof) -with or without Modifications, and/or as part of a Larger Work; and - - (b) under Patents Claims infringed by the making, using or selling -of Original Code, to make, have made, use, practice, sell, and offer for sale, -and/or otherwise dispose of the Original Code (or portions thereof). - (c) the licenses granted in this Section 2.1(a) and -(b) are effective on the date Initial Developer first distributes Original -Code under the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is -granted: 1) for code that You delete from the Original Code; 2) separate from -the Original Code; or 3) for infringements caused by: i) the modification of -the Original Code or ii) the combination of the Original Code with other -software or devices. - - 2.2. Contributor Grant. - Subject to third party intellectual property claims, each Contributor -hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or -trademark) Licensable by Contributor, to use, reproduce, modify, display, -perform, sublicense and distribute the Modifications created by such -Contributor (or portions thereof) either on an unmodified basis, with other -Modifications, as Covered Code and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, using, or selling -of Modifications made by that Contributor either alone and/or in combination -with its Contributor Version (or portions of such combination), to make, use, -sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications -made by that Contributor (or portions thereof); and 2) the combination of -Modifications made by that Contributor with its Contributor Version (or -portions of such combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are -effective on the date Contributor first makes Commercial Use of the Covered -Code. - - (d) Notwithstanding Section 2.2(b) above, no patent license is -granted: 1) for any code that Contributor has deleted from the Contributor -Version; 2) separate from the Contributor Version; 3) for infringements -caused by: i) third party modifications of Contributor Version or ii) the -combination of Modifications made by that Contributor with other software -(except as part of the Contributor Version) or other devices; or 4) under -Patent Claims infringed by Covered Code in the absence of Modifications made -by that Contributor. - - -3. Distribution Obligations. - - 3.1. Application of License. - The Modifications which You create or to which You contribute are -governed by the terms of this License, including without limitation Section -2.2. The Source Code version of Covered Code may be distributed only under the -terms of this License or a future version of this License released under -Section 6.1, and You must include a copy of this License with every copy of -the Source Code You distribute. You may not offer or impose any terms on any -Source Code version that alters or restricts the applicable version of this -License or the recipients' rights hereunder. However, You may include an -additional document offering the additional rights described in Section 3.5. - - 3.2. Availability of Source Code. - Any Modification which You create or to which You contribute must be -made available in Source Code form under the terms of this License either on -the same media as an Executable version or via an accepted Electronic -Distribution Mechanism to anyone to whom you made an Executable version -available; and if made available via Electronic Distribution Mechanism, must -remain available for at least twelve (12) months after the date it initially -became available, or at least six (6) months after a subsequent version of -that particular Modification has been made available to such recipients. You -are responsible for ensuring that the Source Code version remains available -even if the Electronic Distribution Mechanism is maintained by a third party. - - 3.3. Description of Modifications. - You must cause all Covered Code to which You contribute to contain a -file documenting the changes You made to create that Covered Code and the date -of any change. You must include a prominent statement that the Modification is -derived, directly or indirectly, from Original Code provided by the Initial -Developer and including the name of the Initial Developer in (a) the Source -Code, and (b) in any notice in an Executable version or related documentation -in which You describe the origin or ownership of the Covered Code. - - 3.4. Intellectual Property Matters - (a) Third Party Claims. - If Contributor has knowledge that a license under a third party's -intellectual property rights is required to exercise the rights granted by -such Contributor under Sections 2.1 or 2.2, Contributor must include a text -file with the Source Code distribution titled "LEGAL" which describes the -claim and the party making the claim in sufficient detail that a recipient -will know whom to contact. If Contributor obtains such knowledge after the -Modification is made available as described in Section 3.2, Contributor shall -promptly modify the LEGAL file in all copies Contributor makes available -thereafter and shall take other steps (such as notifying appropriate mailing -lists or newsgroups) reasonably calculated to inform those who received the -Covered Code that new knowledge has been obtained. - - (b) Contributor APIs. - If Contributor's Modifications include an application programming -interface and Contributor has knowledge of patent licenses which are -reasonably necessary to implement that API, Contributor must also include this -information in the LEGAL file. - - (c) Representations. - Contributor represents that, except as disclosed pursuant to -Section 3.4(a) above, Contributor believes that Contributor's Modifications -are Contributor's original creation(s) and/or Contributor has sufficient -rights to grant the rights conveyed by this License. - - - 3.5. Required Notices. - You must duplicate the notice in Exhibit A in each file of the Source -Code. If it is not possible to put such notice in a particular Source Code -file due to its structure, then You must include such notice in a location -(such as a relevant directory) where a user would be likely to look for such a -notice. If You created one or more Modification(s) You may add your name as a -Contributor to the notice described in Exhibit A. You must also duplicate -this License in any documentation for the Source Code where You describe -recipients' rights or ownership rights relating to Covered Code. You may -choose to offer, and to charge a fee for, warranty, support, indemnity or -liability obligations to one or more recipients of Covered Code. However, You -may do so only on Your own behalf, and not on behalf of the Initial Developer -or any Contributor. You must make it absolutely clear than any such warranty, -support, indemnity or liability obligation is offered by You alone, and You -hereby agree to indemnify the Initial Developer and every Contributor for any -liability incurred by the Initial Developer or such Contributor as a result of -warranty, support, indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - You may distribute Covered Code in Executable form only if the -requirements of Section 3.1-3.5 have been met for that Covered Code, and if -You include a notice stating that the Source Code version of the Covered Code -is available under the terms of this License, including a description of how -and where You have fulfilled the obligations of Section 3.2. The notice must -be conspicuously included in any notice in an Executable version, related -documentation or collateral in which You describe recipients' rights relating -to the Covered Code. You may distribute the Executable version of Covered Code -or ownership rights under a license of Your choice, which may contain terms -different from this License, provided that You are in compliance with the -terms of this License and that the license for the Executable version does not -attempt to limit or alter the recipient's rights in the Source Code version -from the rights set forth in this License. If You distribute the Executable -version under a different license You must make it absolutely clear that any -terms which differ from this License are offered by You alone, not by the -Initial Developer or any Contributor. You hereby agree to indemnify the -Initial Developer and every Contributor for any liability incurred by the -Initial Developer or such Contributor as a result of any such terms You offer. - - 3.7. Larger Works. - You may create a Larger Work by combining Covered Code with other code -not governed by the terms of this License and distribute the Larger Work as a -single product. In such a case, You must make sure the requirements of this -License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Code due to statute, -judicial order, or regulation then You must: (a) comply with the terms of this -License to the maximum extent possible; and (b) describe the limitations and -the code they affect. Such description must be included in the LEGAL file -described in Section 3.4 and must be included with all distributions of the -Source Code. Except to the extent prohibited by statute or regulation, such -description must be sufficiently detailed for a recipient of ordinary skill to -be able to understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has attached -the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - Netscape Communications Corporation ("Netscape") may publish revised -and/or new versions of the License from time to time. Each version will be -given a distinguishing version number. - - 6.2. Effect of New Versions. - Once Covered Code has been published under a particular version of the -License, You may always continue to use it under the terms of that version. -You may also choose to use such Covered Code under the terms of any subsequent -version of the License published by Netscape. No one other than Netscape has -the right to modify the terms applicable to Covered Code created under this -License. - - 6.3. Derivative Works. - If You create or use a modified version of this License (which you may -only do in order to apply it to code which is not already Covered Code -governed by this License), You must (a) rename Your license so that the -phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or -any confusingly similar phrase do not appear in your license (except to note -that your license differs from this License) and (b) otherwise make it clear -that Your version of the license contains terms which differ from the Mozilla -Public License and Netscape Public License. (Filling in the name of the -Initial Developer, Original Code or Contributor in the notice described in -Exhibit A shall not of themselves be deemed to be modifications of this -License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT -LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, -FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE -QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED -CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY -OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR -CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS -LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS -DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate -automatically if You fail to comply with terms herein and fail to cure such -breach within 30 days of becoming aware of the breach. All sublicenses to the -Covered Code which are properly granted shall survive any termination of this -License. Provisions which, by their nature, must remain in effect beyond the -termination of this License shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement -claim (excluding declatory judgment actions) against Initial Developer or a -Contributor (the Initial Developer or Contributor against whom You file such -action is referred to as "Participant") alleging that: - - (a) such Participant's Contributor Version directly or indirectly -infringes any patent, then any and all rights granted by such Participant to -You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice -from Participant terminate prospectively, unless if within 60 days after -receipt of notice You either: (i) agree in writing to pay Participant a -mutually agreeable reasonable royalty for Your past and future use of -Modifications made by such Participant, or (ii) withdraw Your litigation claim -with respect to the Contributor Version against such Participant. If within -60 days of notice, a reasonable royalty and payment arrangement are not -mutually agreed upon in writing by the parties or the litigation claim is not -withdrawn, the rights granted by Participant to You under Sections 2.1 and/or -2.2 automatically terminate at the expiration of the 60 day notice period -specified above. - - (b) any software, hardware, or device, other than such Participant's -Contributor Version, directly or indirectly infringes any patent, then any -rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are -revoked effective as of the date You first made, used, sold, distributed, or -had made, Modifications made by that Participant. - - 8.3. If You assert a patent infringement claim against Participant -alleging that such Participant's Contributor Version directly or indirectly -infringes any patent where such claim is resolved (such as by license or -settlement) prior to the initiation of patent infringement litigation, then -the reasonable value of the licenses granted by such Participant under -Sections 2.1 or 2.2 shall be taken into account in determining the amount or -value of any payment or license. - - 8.4. In the event of termination under Sections 8.1 or 8.2 above, all -end user license agreements (excluding distributors and resellers) which have -been validly granted by You or any distributor hereunder prior to termination -shall survive termination. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT -(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL -DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY -SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, -SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, -WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER -FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, -EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH -DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH -OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT -APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE -EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS -EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in 48 -C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and -"commercial computer software documentation," as such terms are used in 48 -C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. -227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users -acquire Covered Code with only those rights set forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject matter -hereof. If any provision of this License is held to be unenforceable, such -provision shall be reformed only to the extent necessary to make it -enforceable. This License shall be governed by California law provisions -(except to the extent applicable law, if any, provides otherwise), excluding -its conflict-of-law provisions. With respect to disputes in which at least one -party is a citizen of, or an entity chartered or registered to do business in -the United States of America, any litigation relating to this License shall be -subject to the jurisdiction of the Federal Courts of the Northern District of -California, with venue lying in Santa Clara County, California, with the -losing party responsible for costs, including without limitation, court costs -and reasonable attorneys' fees and expenses. The application of the United -Nations Convention on Contracts for the International Sale of Goods is -expressly excluded. Any law or regulation which provides that the language of -a contract shall be construed against the drafter shall not apply to this -License. - -12. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is -responsible for claims and damages arising, directly or indirectly, out of its -utilization of rights under this License and You agree to work with Initial -Developer and Contributors to distribute such responsibility on an equitable -basis. Nothing herein is intended or shall be deemed to constitute any -admission of liability. - -13. MULTIPLE-LICENSED CODE. - - Initial Developer may designate portions of the Covered Code as -Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits -you to utilize portions of the Covered Code under Your choice of the MPL or -the alternative licenses, if any, specified by the Initial Developer in the -file described in Exhibit A. - - -EXHIBIT A -Mozilla Public License. - - ``The contents of this file are subject to the Mozilla Public License -Version 1.1 (the "License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF - ANY KIND, either express or implied. See the License for the specific -language governing rights and - limitations under the License. - - The Original Code is ______________________________________. - - The Initial Developer of the Original Code is ________________________. -Portions created by - ______________________ are Copyright (C) ______ -_______________________. All Rights - Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the terms of -the _____ license (the [___] License), in which case the provisions of -[______] License are applicable instead of those above. If you wish to allow -use of your version of this file only under the terms of the [____] License -and not to allow others to use your version of this file under the MPL, -indicate your decision by deleting the provisions above and replace them -with the notice and other provisions required by the [___] License. If you do -not delete the provisions above, a recipient may use your version of this file -under either the MPL or the [___] License." - - [NOTE: The text of this Exhibit A may differ slightly from the text of -the notices in the Source Code files of the Original Code. You should use the -text of this Exhibit A rather than the text found in the Original Code Source -Code for Your Modifications.] - - -=============================================================================== - -For the JAX-WS Reference Implementation component: - -COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 - - - 1. Definitions. - - 1.1. "Contributor" means each individual or entity that - creates or contributes to the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the - Original Software, prior Modifications used by a - Contributor (if any), and the Modifications made by that - particular Contributor. - - 1.3. "Covered Software" means (a) the Original Software, or - (b) Modifications, or (c) the combination of files - containing Original Software with files containing - Modifications, in each case including portions thereof. - - 1.4. "Executable" means the Covered Software in any form - other than Source Code. - - 1.5. "Initial Developer" means the individual or entity - that first makes Original Software available under this - License. - - 1.6. "Larger Work" means a work which combines Covered - Software or portions thereof with code not governed by the - terms of this License. - - 1.7. "License" means this document. - - 1.8. "Licensable" means having the right to grant, to the - maximum extent possible, whether at the time of the initial - grant or subsequently acquired, any and all of the rights - conveyed herein. - - 1.9. "Modifications" means the Source Code and Executable - form of any of the following: - - A. Any file that results from an addition to, - deletion from or modification of the contents of a - file containing Original Software or previous - Modifications; - - B. Any new file that contains any part of the - Original Software or previous Modification; or - - C. Any new file that is contributed or otherwise made - available under the terms of this License. - - 1.10. "Original Software" means the Source Code and - Executable form of computer software code that is - originally released under this License. - - 1.11. "Patent Claims" means any patent claim(s), now owned - or hereafter acquired, including without limitation, - method, process, and apparatus claims, in any patent - Licensable by grantor. - - 1.12. "Source Code" means (a) the common form of computer - software code in which modifications are made and (b) - associated documentation included in or with such code. - - 1.13. "You" (or "Your") means an individual or a legal - entity exercising rights under, and complying with all of - the terms of, this License. For legal entities, "You" - includes any entity which controls, is controlled by, or is - under common control with You. For purposes of this - definition, "control" means (a) the power, direct or - indirect, to cause the direction or management of such - entity, whether by contract or otherwise, or (b) ownership - of more than fifty percent (50%) of the outstanding shares - or beneficial ownership of such entity. - - 2. License Grants. - - 2.1. The Initial Developer Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, the - Initial Developer hereby grants You a world-wide, - royalty-free, non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Initial Developer, - to use, reproduce, modify, display, perform, - sublicense and distribute the Original Software (or - portions thereof), with or without Modifications, - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, - using or selling of Original Software, to make, have - made, use, practice, sell, and offer for sale, and/or - otherwise dispose of the Original Software (or - portions thereof). - - (c) The licenses granted in Sections 2.1(a) and (b) - are effective on the date Initial Developer first - distributes or otherwise makes the Original Software - available to a third party under the terms of this - License. - - (d) Notwithstanding Section 2.1(b) above, no patent - license is granted: (1) for code that You delete from - the Original Software, or (2) for infringements - caused by: (i) the modification of the Original - Software, or (ii) the combination of the Original - Software with other software or devices. - - 2.2. Contributor Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, each - Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Contributor to - use, reproduce, modify, display, perform, sublicense - and distribute the Modifications created by such - Contributor (or portions thereof), either on an - unmodified basis, with other Modifications, as - Covered Software and/or as part of a Larger Work; and - - - (b) under Patent Claims infringed by the making, - using, or selling of Modifications made by that - Contributor either alone and/or in combination with - its Contributor Version (or portions of such - combination), to make, use, sell, offer for sale, - have made, and/or otherwise dispose of: (1) - Modifications made by that Contributor (or portions - thereof); and (2) the combination of Modifications - made by that Contributor with its Contributor Version - (or portions of such combination). - - (c) The licenses granted in Sections 2.2(a) and - 2.2(b) are effective on the date Contributor first - distributes or otherwise makes the Modifications - available to a third party. - - (d) Notwithstanding Section 2.2(b) above, no patent - license is granted: (1) for any code that Contributor - has deleted from the Contributor Version; (2) for - infringements caused by: (i) third party - modifications of Contributor Version, or (ii) the - combination of Modifications made by that Contributor - with other software (except as part of the - Contributor Version) or other devices; or (3) under - Patent Claims infringed by Covered Software in the - absence of Modifications made by that Contributor. - - 3. Distribution Obligations. - - 3.1. Availability of Source Code. - - Any Covered Software that You distribute or otherwise make - available in Executable form must also be made available in - Source Code form and that Source Code form must be - distributed only under the terms of this License. You must - include a copy of this License with every copy of the - Source Code form of the Covered Software You distribute or - otherwise make available. You must inform recipients of any - such Covered Software in Executable form as to how they can - obtain such Covered Software in Source Code form in a - reasonable manner on or through a medium customarily used - for software exchange. - - 3.2. Modifications. - - The Modifications that You create or to which You - contribute are governed by the terms of this License. You - represent that You believe Your Modifications are Your - original creation(s) and/or You have sufficient rights to - grant the rights conveyed by this License. - - 3.3. Required Notices. - - You must include a notice in each of Your Modifications - that identifies You as the Contributor of the Modification. - You may not remove or alter any copyright, patent or - trademark notices contained within the Covered Software, or - any notices of licensing or any descriptive text giving - attribution to any Contributor or the Initial Developer. - - 3.4. Application of Additional Terms. - - You may not offer or impose any terms on any Covered - Software in Source Code form that alters or restricts the - applicable version of this License or the recipients' - rights hereunder. You may choose to offer, and to charge a - fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Software. - However, you may do so only on Your own behalf, and not on - behalf of the Initial Developer or any Contributor. You - must make it absolutely clear that any such warranty, - support, indemnity or liability obligation is offered by - You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred - by the Initial Developer or such Contributor as a result of - warranty, support, indemnity or liability terms You offer. - - - 3.5. Distribution of Executable Versions. - - You may distribute the Executable form of the Covered - Software under the terms of this License or under the terms - of a license of Your choice, which may contain terms - different from this License, provided that You are in - compliance with the terms of this License and that the - license for the Executable form does not attempt to limit - or alter the recipient's rights in the Source Code form - from the rights set forth in this License. If You - distribute the Covered Software in Executable form under a - different license, You must make it absolutely clear that - any terms which differ from this License are offered by You - alone, not by the Initial Developer or Contributor. You - hereby agree to indemnify the Initial Developer and every - Contributor for any liability incurred by the Initial - Developer or such Contributor as a result of any such terms - You offer. - - 3.6. Larger Works. - - You may create a Larger Work by combining Covered Software - with other code not governed by the terms of this License - and distribute the Larger Work as a single product. In such - a case, You must make sure the requirements of this License - are fulfilled for the Covered Software. - - 4. Versions of the License. - - 4.1. New Versions. - - Sun Microsystems, Inc. is the initial license steward and - may publish revised and/or new versions of this License - from time to time. Each version will be given a - distinguishing version number. Except as provided in - Section 4.3, no one other than the license steward has the - right to modify this License. - - 4.2. Effect of New Versions. - - You may always continue to use, distribute or otherwise - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. If the Initial Developer includes a - notice in the Original Software prohibiting it from being - distributed or otherwise made available under any - subsequent version of the License, You must distribute and - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. Otherwise, You may also choose to - use, distribute or otherwise make the Covered Software - available under the terms of any subsequent version of the - License published by the license steward. - - 4.3. Modified Versions. - - When You are an Initial Developer and You want to create a - new license for Your Original Software, You may create and - use a modified version of this License if You: (a) rename - the license and remove any references to the name of the - license steward (except to note that the license differs - from this License); and (b) otherwise make it clear that - the license contains terms which differ from this License. - - - 5. DISCLAIMER OF WARRANTY. - - COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" - BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, - INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED - SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR - PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND - PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY - COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE - INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF - ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF - WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS - DISCLAIMER. - - 6. TERMINATION. - - 6.1. This License and the rights granted hereunder will - terminate automatically if You fail to comply with terms - herein and fail to cure such breach within 30 days of - becoming aware of the breach. Provisions which, by their - nature, must remain in effect beyond the termination of - this License shall survive. - - 6.2. If You assert a patent infringement claim (excluding - declaratory judgment actions) against Initial Developer or - a Contributor (the Initial Developer or Contributor against - whom You assert such claim is referred to as "Participant") - alleging that the Participant Software (meaning the - Contributor Version where the Participant is a Contributor - or the Original Software where the Participant is the - Initial Developer) directly or indirectly infringes any - patent, then any and all rights granted directly or - indirectly to You by such Participant, the Initial - Developer (if the Initial Developer is not the Participant) - and all Contributors under Sections 2.1 and/or 2.2 of this - License shall, upon 60 days notice from Participant - terminate prospectively and automatically at the expiration - of such 60 day notice period, unless if within such 60 day - period You withdraw Your claim with respect to the - Participant Software against such Participant either - unilaterally or pursuant to a written agreement with - Participant. - - 6.3. In the event of termination under Sections 6.1 or 6.2 - above, all end user licenses that have been validly granted - by You or any distributor hereunder prior to termination - (excluding licenses granted to You by any distributor) - shall survive termination. - - 7. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE - INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF - COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE - LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR - CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT - LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK - STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL - INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT - APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO - NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR - CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT - APPLY TO YOU. - - 8. U.S. GOVERNMENT END USERS. - - The Covered Software is a "commercial item," as that term is - defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial - computer software" (as that term is defined at 48 C.F.R. - 252.227-7014(a)(1)) and "commercial computer software - documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. - 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 - through 227.7202-4 (June 1995), all U.S. Government End Users - acquire Covered Software with only those rights set forth herein. - This U.S. Government Rights clause is in lieu of, and supersedes, - any other FAR, DFAR, or other clause or provision that addresses - Government rights in computer software under this License. - - 9. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the - extent necessary to make it enforceable. This License shall be - governed by the law of the jurisdiction specified in a notice - contained within the Original Software (except to the extent - applicable law, if any, provides otherwise), excluding such - jurisdiction's conflict-of-law provisions. Any litigation - relating to this License shall be subject to the jurisdiction of - the courts located in the jurisdiction and venue specified in a - notice contained within the Original Software, with the losing - party responsible for costs, including, without limitation, court - costs and reasonable attorneys' fees and expenses. The - application of the United Nations Convention on Contracts for the - International Sale of Goods is expressly excluded. Any law or - regulation which provides that the language of a contract shall - be construed against the drafter shall not apply to this License. - You agree that You alone are responsible for compliance with the - United States export administration regulations (and the export - control laws and regulation of any other countries) when You use, - distribute or otherwise make available any Covered Software. - - 10. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or - indirectly, out of its utilization of rights under this License - and You agree to work with Initial Developer and Contributors to - distribute such responsibility on an equitable basis. Nothing - herein is intended or shall be deemed to constitute any admission - of liability. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/META-INF/NOTICE b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/META-INF/NOTICE deleted file mode 100644 index d48810c0ec..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/META-INF/NOTICE +++ /dev/null @@ -1,18 +0,0 @@ -========================================================================= -== NOTICE file corresponding to the section 4 d of == -== the Apache License, Version 2.0, == -== in this case for the Apache Tuscany distribution. == -========================================================================= - -This product includes software developed by the Apache Software Foundation -(http://www.apache.org/). - -This product also includes software developed by: -- the Eclipse Modeling Framework project (http://www.eclipse.org/emf/) -- the Celtix project (http://celtix.objectweb.org/) -- the Mozilla Rhino project (http://www.mozilla.org/rhino/) -- the GlassFish JAX-WS project (https://jax-ws.dev.java.net/) - -Please read the LICENSE.txt file present in the root directory of this -distribution. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/META-INF/README.txt b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/META-INF/README.txt deleted file mode 100644 index 9b26d1690a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/META-INF/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -Apache Tuscany M1 build (May, 2006) -=================================== - -http://incubator.apache.org/tuscany/ - -Tuscany is an effort undergoing incubation at the Apache Software Foundation -(ASF), sponsored by the Web Services PMC. - -Incubation is required of all newly accepted projects until a further review -indicates that the infrastructure, communications, and decision making process -have stabilized in a manner consistent with other successful ASF projects. - -While incubation status is not necessarily a reflection of the completeness or -stability of the code, it does indicate that the project has yet to be fully -endorsed by the ASF. - - -Support -------- - -Any problem with this release can be reported to the Tuscany mailing list -or in the JIRA issue tracker. - -Mailing list subscription: - tuscany-dev-subscribe@ws.apache.org - -Jira: - http://issues.apache.org/jira/browse/Tuscany - - -Thank you for using Tuscany! - - -The Tuscany Team. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/helloworldws-om.composite b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/helloworldws-om.composite deleted file mode 100644 index e881aa2c70..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/helloworldws-om.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - HelloWorldServiceComponent - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/wsdl/helloworld-om.wsdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/wsdl/helloworld-om.wsdl deleted file mode 100644 index 2c23e45e31..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/main/resources/wsdl/helloworld-om.wsdl +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/test/java/helloworld/om/HelloWorldServerTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/test/java/helloworld/om/HelloWorldServerTestCase.java deleted file mode 100644 index f14dd65ff3..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-ws/src/test/java/helloworld/om/HelloWorldServerTestCase.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 helloworld.om; - -import java.io.IOException; -import java.net.Socket; - -import org.apache.tuscany.api.SCARuntime; - -import junit.framework.TestCase; - -public class HelloWorldServerTestCase extends TestCase { - - @Override - protected void setUp() throws Exception { - SCARuntime.start("helloworldws-om.composite"); - } - - public void testPing() throws IOException { - new Socket("127.0.0.1", 8080); - } - - @Override - protected void tearDown() throws Exception { - SCARuntime.stop(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/pom.xml deleted file mode 100644 index 18a7213ee9..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/pom.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2.samples - parent - 0.1-integration-incubating-SNAPSHOT - ../pom.xml - - - 4.0.0 - tuscany-sample-helloworld-om-wsclient - jar - Tuscany HelloWorld Axiom Web Service Client Sample - A sample client for a HelloWorld Web Service using Axiom. - - - - org.apache.tuscany.sca.kernel - tuscany-api - compile - 0.1-integration-incubating-SNAPSHOT - - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - - org.apache.tuscany.sca.extensions.axis2 - tuscany-axis2 - runtime - 0.1-integration-incubating-SNAPSHOT - - - - org.apache.ws.commons.axiom - axiom-api - 1.2.2 - compile - - - - org.apache.tuscany.sca.extensions.axis2.samples - tuscany-sample-helloworld-om-ws - runtime - 0.1-integration-incubating-SNAPSHOT - - - - junit - junit - 4.2 - test - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - helloworld.om.HelloWorldClient - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/run.bat b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/run.bat deleted file mode 100755 index 51079f2443..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/run.bat +++ /dev/null @@ -1,53 +0,0 @@ -@echo off -rem set java_debug_set=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=3720,server=y,suspend=y -mkdir target\standalone -pushd target\standalone -jar -xf "%USERPROFILE%\.m2\repository\org\apache\tuscany\standalone\1.0-SNAPSHOT\standalone-1.0-SNAPSHOT-bin.zip" -popd -rem move target\standalone\extension\axiom-api-1.0.jar target\standalone\boot -rem move target\standalone\extension\axiom-impl-1.0.jar target\standalone\boot -rem move target\standalone\extension\axis2-kernel-1.0.jar target\standalone\boot -rem move target\standalone\extension\common-2.2.1-SNAPSHOT.jar target\standalone\boot -rem move target\standalone\extension\commons-codec-1.3.jar target\standalone\boot -rem move target\standalone\extension\commons-httpclient-3.0.jar target\standalone\boot -rem move target\standalone\extension\ecore-2.2.1-SNAPSHOT.jar target\standalone\boot -rem move target\standalone\extension\ecore-change-2.2.1-SNAPSHOT.jar target\standalone\boot -rem move target\standalone\extension\ecore-xmi-2.2.1-SNAPSHOT.jar target\standalone\boot -rem move target\standalone\extension\junit-3.8.1.jar target\standalone\boot -rem move target\standalone\extension\neethi-1.0.1.jar target\standalone\boot -rem move target\standalone\extension\sdo-api-1.0-SNAPSHOT.jar target\standalone\boot -rem move target\standalone\extension\tuscany-sdo-impl-1.0-SNAPSHOT.jar target\standalone\boot -rem move target\standalone\extension\XmlSchema-1.0.2.jar target\standalone\boot -rem move target\standalone\extension\xsd-2.2.1-SNAPSHOT.jar target\standalone\boot -rem move target\standalone\extension\wstx-asl-2.9.3.jar target\standalone\boot -rem move target\standalone\extension\commons-logging-1.0.3.jar target\standalone\boot - - -move target\standalone\extension\axiom-api-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\axiom-impl-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\axis2-common-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\axis2-core-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\woden-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\wsdl-1.0-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\wsdl4j-1.5.2.jar target\standalone\boot -move target\standalone\extension\avalon-framework-4.1.3.jar target\standalone\boot -move target\standalone\extension\common-2.2.1-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\commons-codec-1.2.jar target\standalone\boot -move target\standalone\extension\commons-httpclient-3.0.jar target\standalone\boot -move target\standalone\extension\commons-logging-1.1.jar target\standalone\boot -move target\standalone\extension\ecore-2.2.1-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\ecore-change-2.2.1-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\ecore-xmi-2.2.1-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\junit-3.8.1.jar target\standalone\boot -move target\standalone\extension\log4j-1.2.12.jar target\standalone\boot -move target\standalone\extension\logkit-1.0.1.jar target\standalone\boot -move target\standalone\extension\neethi-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\sdo-api-1.0-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\servlet-api-2.3.jar target\standalone\boot -move target\standalone\extension\tuscany-sdo-impl-1.0-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\XmlSchema-SNAPSHOT.jar target\standalone\boot -move target\standalone\extension\xsd-2.2.1-SNAPSHOT.jar target\standalone\boot - - - -java %java_debug_set% -jar target\standalone\bin\launcher.jar --classpath "%USERPROFILE%\.m2\repository\org\apache\tuscany\samples\sca\sample-helloworldwsclient\1.0-SNAPSHOT\sample-helloworldwsclient-1.0-SNAPSHOT.jar" %* diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/java/helloworld/om/HelloWorldClient.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/java/helloworld/om/HelloWorldClient.java deleted file mode 100644 index d0b3cef2af..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/java/helloworld/om/HelloWorldClient.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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.om; - -import helloworld.om.HelloWorldService; - -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.OMFactory; -import org.apache.axiom.om.OMNode; -import org.apache.tuscany.api.SCARuntime; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; -import static java.lang.System.out; - - -/** - * This client program shows how to create an SCA runtime, start it, - * locate the HelloWorld service and invoke it. - */ - - - -public class HelloWorldClient { - - private static final String TARGET_NAMESPACE = "http://helloworld-om"; - - public final static void main(String[] args) throws Exception { - - SCARuntime.start("helloworldwsclient-om.composite"); - - // Invoke the HelloWorld service - CompositeContext compositeContext = CurrentCompositeContext.getContext(); - HelloWorldService helloWorldService= compositeContext.locateService(HelloWorldService.class, "HelloWorldServiceComponent"); - OMFactory fac= OMAbstractFactory.getOMFactory(); - - //create operation - OMElement opE = fac.createOMElement("getGreetings", TARGET_NAMESPACE, "helloworld"); - //create parm - OMElement parmE = fac.createOMElement("name", TARGET_NAMESPACE, "helloworld"); - //and value. - opE.addChild(parmE); - StringBuilder sb= new StringBuilder(1000); - for(String s : args){ - sb.append(s); - } - parmE.addChild(fac.createOMText(sb.toString())); - - OMElement value = helloWorldService.getGreetings(parmE); - printTRee(value); - - out.println(value); - out.flush(); - - SCARuntime.stop(); - } - - private static void printTRee(OMElement value) { - - out.println(value); - for(OMNode n = value.getFirstOMChild(); n != null; n= n.getNextOMSibling()){ - if(n instanceof OMElement) printTRee((OMElement) n); - else out.println(n); - } - out.flush(); - - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/java/helloworld/om/HelloWorldService.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/java/helloworld/om/HelloWorldService.java deleted file mode 100644 index dfeac6a8d8..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/java/helloworld/om/HelloWorldService.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 helloworld.om; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.api.annotation.DataType; -import org.osoa.sca.annotations.Service; -import org.osoa.sca.annotations.Remotable; - - -@Service -@Remotable -@DataType(name="org.apache.axiom.om.OMElement") -public interface HelloWorldService { - - public OMElement getGreetings(OMElement parmE); - -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/java/helloworld/om/HelloWorldServiceComponent.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/java/helloworld/om/HelloWorldServiceComponent.java deleted file mode 100644 index 740ac68f7f..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/java/helloworld/om/HelloWorldServiceComponent.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 helloworld.om; - -import helloworld.om.HelloWorldService; - -import org.apache.axiom.om.OMElement; -import org.osoa.sca.annotations.Scope; - -/** - * This client program shows how to create an SCA runtime, start it, - * locate the HelloWorld service and invoke it. - */ - - -@Scope("COMPOSITE") -public class HelloWorldServiceComponent implements HelloWorldService { - - HelloWorldService helloWorldService; - - public void setHelloWorldService(HelloWorldService helloWorldService) { - - this.helloWorldService = helloWorldService; - } - - public OMElement getGreetings(OMElement name) { - - return helloWorldService.getGreetings(name); - } - -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/META-INF/LICENSE.txt b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/META-INF/LICENSE.txt deleted file mode 100644 index 25d78feeac..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/META-INF/LICENSE.txt +++ /dev/null @@ -1,1277 +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. - - -APACHE TUSCANY SUBCOMPONENTS: - -The Apache Tuscany distribution includes a number of subcomponents with -separate copyright notices and license terms. Your use of the source -code for the these subcomponents is subject to the terms and -conditions of the following licenses. - -=============================================================================== - -For the Eclipse Modeling Framework component and the Celtix binding: - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE -PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF -THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and -documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and - -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and -are distributed by that particular Contributor. A Contribution -'originates' from a Contributor if it was added to the Program by such -Contributor itself or anyone acting on such Contributor's behalf. -Contributions do not include additions to the Program which: (i) are -separate modules of software distributed in conjunction with the -Program under their own license agreement, and (ii) are not derivative -works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents " mean patent claims licensable by a Contributor -which are necessarily infringed by the use or sale of its Contribution -alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this -Agreement. - -"Recipient" means anyone who receives the Program under this -Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free copyright -license to reproduce, prepare derivative works of, publicly display, -publicly perform, distribute and sublicense the Contribution of such -Contributor, if any, and such derivative works, in source code and -object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free patent -license under Licensed Patents to make, use, sell, offer to sell, -import and otherwise transfer the Contribution of such Contributor, if -any, in source code and object code form. This patent license shall -apply to the combination of the Contribution and the Program if, at -the time the Contribution is added by the Contributor, such addition -of the Contribution causes such combination to be covered by the -Licensed Patents. The patent license shall not apply to any other -combinations which include the Contribution. No hardware per se is -licensed hereunder. - -c) Recipient understands that although each Contributor grants the -licenses to its Contributions set forth herein, no assurances are -provided by any Contributor that the Program does not infringe the -patent or other intellectual property rights of any other entity. Each -Contributor disclaims any liability to Recipient for claims brought by -any other entity based on infringement of intellectual property rights -or otherwise. As a condition to exercising the rights and licenses -granted hereunder, each Recipient hereby assumes sole responsibility -to secure any other intellectual property rights needed, if any. For -example, if a third party patent license is required to allow -Recipient to distribute the Program, it is Recipient's responsibility -to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient -copyright rights in its Contribution, if any, to grant the copyright -license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form -under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties -and conditions, express and implied, including warranties or -conditions of title and non-infringement, and implied warranties or -conditions of merchantability and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability -for damages, including direct, indirect, special, incidental and -consequential damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are -offered by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such -Contributor, and informs licensees how to obtain it in a reasonable -manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the -Program. - -Contributors may not remove or alter any copyright notices contained -within the Program. - -Each Contributor must identify itself as the originator of its -Contribution, if any, in a manner that reasonably allows subsequent -Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain -responsibilities with respect to end users, business partners and the -like. While this license is intended to facilitate the commercial use -of the Program, the Contributor who includes the Program in a -commercial product offering should do so in a manner which does not -create potential liability for other Contributors. Therefore, if a -Contributor includes the Program in a commercial product offering, -such Contributor ("Commercial Contributor") hereby agrees to defend -and indemnify every other Contributor ("Indemnified Contributor") -against any losses, damages and costs (collectively "Losses") arising -from claims, lawsuits and other legal actions brought by a third party -against the Indemnified Contributor to the extent caused by the acts -or omissions of such Commercial Contributor in connection with its -distribution of the Program in a commercial product offering. The -obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. -In order to qualify, an Indemnified Contributor must: a) promptly -notify the Commercial Contributor in writing of such claim, and b) -allow the Commercial Contributor to control, and cooperate with the -Commercial Contributor in, the defense and any related settlement -negotiations. The Indemnified Contributor may participate in any such -claim at its own expense. - -For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those -performance claims and warranties, and if a court requires any other -Contributor to pay any damages as a result, the Commercial Contributor -must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS -PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY -WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY -OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely -responsible for determining the appropriateness of using and -distributing the Program and assumes all risks associated with its -exercise of rights under this Agreement , including but not limited to -the risks and costs of program errors, compliance with applicable -laws, damage to or loss of data, programs or equipment, and -unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR -ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING -WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR -DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED -HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further -action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that -the Program itself (excluding combinations of the Program with other -software or hardware) infringes such Recipient's patent(s), then such -Recipient's rights granted under Section 2(b) shall terminate as of -the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of -time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use -and distribution of the Program as soon as reasonably practicable. -However, Recipient's obligations under this Agreement and any licenses -granted by Recipient relating to the Program shall continue and -survive. - -Everyone is permitted to copy and distribute copies of this Agreement, -but in order to avoid inconsistency the Agreement is copyrighted and -may only be modified in the following manner. The Agreement Steward -reserves the right to publish new versions (including revisions) of -this Agreement from time to time. No one other than the Agreement -Steward has the right to modify this Agreement. The Eclipse Foundation -is the initial Agreement Steward. The Eclipse Foundation may assign -the responsibility to serve as the Agreement Steward to a suitable -separate entity. Each new version of the Agreement will be given a -distinguishing version number. The Program (including Contributions) -may always be distributed subject to the version of the Agreement -under which it was received. In addition, after a new version of the -Agreement is published, Contributor may elect to distribute the -Program (including its Contributions) under the new version. Except as -expressly stated in Sections 2(a) and 2(b) above, Recipient receives -no rights or licenses to the intellectual property of any Contributor -under this Agreement, whether expressly, by implication, estoppel or -otherwise. All rights in the Program not expressly granted under this -Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and -the intellectual property laws of the United States of America. No -party to this Agreement will bring a legal action under this Agreement -more than one year after the cause of action arose. Each party waives -its rights to a jury trial in any resulting litigation. - -=============================================================================== - -For the Rhino JavaScript container component: - -Mozilla Public License 1.1 (MPL 1.1) - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the -Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to -the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original Code, -prior Modifications used by a Contributor, and the Modifications made by that -particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the -combination of the Original Code and Modifications, in each case including -portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally -accepted in the software development community for the electronic transfer of -data. - - 1.5. "Executable" means Covered Code in any form other than Source -Code. - - 1.6. "Initial Developer" means the individual or entity identified as -the Initial Developer in the Source Code notice required by Exhibit A. - - 1.7. "Larger Work" means a work which combines Covered Code or -portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum -extent possible, whether at the time of the initial grant or subsequently -acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the -substance or structure of either the Original Code or any previous -Modifications. When Covered Code is released as a series of files, a -Modification is: - A. Any addition to or deletion from the contents of a file -containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or -previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code -which is described in the Source Code notice required by Exhibit A as Original -Code, and which, at the time of its release under this License is not already -Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or -hereafter acquired, including without limitation, method, process, and -apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for -making modifications to it, including all modules it contains, plus any -associated interface definition files, scripts used to control compilation and -installation of an Executable, or source code differential comparisons against -either the Original Code or another well known, available Covered Code of the -Contributor's choice. The Source Code can be in a compressed or archival form, -provided the appropriate decompression or de-archiving software is widely -available for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity -exercising rights under, and complying with all of the terms of, this License -or a future version of this License issued under Section 6.1. For legal -entities, "You" includes any entity which controls, is controlled by, or is -under common control with You. For purposes of this definition, "control" -means (a) the power, direct or indirect, to cause the direction or management -of such entity, whether by contract or otherwise, or (b) ownership of more -than fifty percent (50%) of the outstanding shares or beneficial ownership of -such entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - The Initial Developer hereby grants You a world-wide, royalty-free, -non-exclusive license, subject to third party intellectual property claims: - (a) under intellectual property rights (other than patent or -trademark) Licensable by Initial Developer to use, reproduce, modify, display, -perform, sublicense and distribute the Original Code (or portions thereof) -with or without Modifications, and/or as part of a Larger Work; and - - (b) under Patents Claims infringed by the making, using or selling -of Original Code, to make, have made, use, practice, sell, and offer for sale, -and/or otherwise dispose of the Original Code (or portions thereof). - (c) the licenses granted in this Section 2.1(a) and -(b) are effective on the date Initial Developer first distributes Original -Code under the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is -granted: 1) for code that You delete from the Original Code; 2) separate from -the Original Code; or 3) for infringements caused by: i) the modification of -the Original Code or ii) the combination of the Original Code with other -software or devices. - - 2.2. Contributor Grant. - Subject to third party intellectual property claims, each Contributor -hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or -trademark) Licensable by Contributor, to use, reproduce, modify, display, -perform, sublicense and distribute the Modifications created by such -Contributor (or portions thereof) either on an unmodified basis, with other -Modifications, as Covered Code and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, using, or selling -of Modifications made by that Contributor either alone and/or in combination -with its Contributor Version (or portions of such combination), to make, use, -sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications -made by that Contributor (or portions thereof); and 2) the combination of -Modifications made by that Contributor with its Contributor Version (or -portions of such combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are -effective on the date Contributor first makes Commercial Use of the Covered -Code. - - (d) Notwithstanding Section 2.2(b) above, no patent license is -granted: 1) for any code that Contributor has deleted from the Contributor -Version; 2) separate from the Contributor Version; 3) for infringements -caused by: i) third party modifications of Contributor Version or ii) the -combination of Modifications made by that Contributor with other software -(except as part of the Contributor Version) or other devices; or 4) under -Patent Claims infringed by Covered Code in the absence of Modifications made -by that Contributor. - - -3. Distribution Obligations. - - 3.1. Application of License. - The Modifications which You create or to which You contribute are -governed by the terms of this License, including without limitation Section -2.2. The Source Code version of Covered Code may be distributed only under the -terms of this License or a future version of this License released under -Section 6.1, and You must include a copy of this License with every copy of -the Source Code You distribute. You may not offer or impose any terms on any -Source Code version that alters or restricts the applicable version of this -License or the recipients' rights hereunder. However, You may include an -additional document offering the additional rights described in Section 3.5. - - 3.2. Availability of Source Code. - Any Modification which You create or to which You contribute must be -made available in Source Code form under the terms of this License either on -the same media as an Executable version or via an accepted Electronic -Distribution Mechanism to anyone to whom you made an Executable version -available; and if made available via Electronic Distribution Mechanism, must -remain available for at least twelve (12) months after the date it initially -became available, or at least six (6) months after a subsequent version of -that particular Modification has been made available to such recipients. You -are responsible for ensuring that the Source Code version remains available -even if the Electronic Distribution Mechanism is maintained by a third party. - - 3.3. Description of Modifications. - You must cause all Covered Code to which You contribute to contain a -file documenting the changes You made to create that Covered Code and the date -of any change. You must include a prominent statement that the Modification is -derived, directly or indirectly, from Original Code provided by the Initial -Developer and including the name of the Initial Developer in (a) the Source -Code, and (b) in any notice in an Executable version or related documentation -in which You describe the origin or ownership of the Covered Code. - - 3.4. Intellectual Property Matters - (a) Third Party Claims. - If Contributor has knowledge that a license under a third party's -intellectual property rights is required to exercise the rights granted by -such Contributor under Sections 2.1 or 2.2, Contributor must include a text -file with the Source Code distribution titled "LEGAL" which describes the -claim and the party making the claim in sufficient detail that a recipient -will know whom to contact. If Contributor obtains such knowledge after the -Modification is made available as described in Section 3.2, Contributor shall -promptly modify the LEGAL file in all copies Contributor makes available -thereafter and shall take other steps (such as notifying appropriate mailing -lists or newsgroups) reasonably calculated to inform those who received the -Covered Code that new knowledge has been obtained. - - (b) Contributor APIs. - If Contributor's Modifications include an application programming -interface and Contributor has knowledge of patent licenses which are -reasonably necessary to implement that API, Contributor must also include this -information in the LEGAL file. - - (c) Representations. - Contributor represents that, except as disclosed pursuant to -Section 3.4(a) above, Contributor believes that Contributor's Modifications -are Contributor's original creation(s) and/or Contributor has sufficient -rights to grant the rights conveyed by this License. - - - 3.5. Required Notices. - You must duplicate the notice in Exhibit A in each file of the Source -Code. If it is not possible to put such notice in a particular Source Code -file due to its structure, then You must include such notice in a location -(such as a relevant directory) where a user would be likely to look for such a -notice. If You created one or more Modification(s) You may add your name as a -Contributor to the notice described in Exhibit A. You must also duplicate -this License in any documentation for the Source Code where You describe -recipients' rights or ownership rights relating to Covered Code. You may -choose to offer, and to charge a fee for, warranty, support, indemnity or -liability obligations to one or more recipients of Covered Code. However, You -may do so only on Your own behalf, and not on behalf of the Initial Developer -or any Contributor. You must make it absolutely clear than any such warranty, -support, indemnity or liability obligation is offered by You alone, and You -hereby agree to indemnify the Initial Developer and every Contributor for any -liability incurred by the Initial Developer or such Contributor as a result of -warranty, support, indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - You may distribute Covered Code in Executable form only if the -requirements of Section 3.1-3.5 have been met for that Covered Code, and if -You include a notice stating that the Source Code version of the Covered Code -is available under the terms of this License, including a description of how -and where You have fulfilled the obligations of Section 3.2. The notice must -be conspicuously included in any notice in an Executable version, related -documentation or collateral in which You describe recipients' rights relating -to the Covered Code. You may distribute the Executable version of Covered Code -or ownership rights under a license of Your choice, which may contain terms -different from this License, provided that You are in compliance with the -terms of this License and that the license for the Executable version does not -attempt to limit or alter the recipient's rights in the Source Code version -from the rights set forth in this License. If You distribute the Executable -version under a different license You must make it absolutely clear that any -terms which differ from this License are offered by You alone, not by the -Initial Developer or any Contributor. You hereby agree to indemnify the -Initial Developer and every Contributor for any liability incurred by the -Initial Developer or such Contributor as a result of any such terms You offer. - - 3.7. Larger Works. - You may create a Larger Work by combining Covered Code with other code -not governed by the terms of this License and distribute the Larger Work as a -single product. In such a case, You must make sure the requirements of this -License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Code due to statute, -judicial order, or regulation then You must: (a) comply with the terms of this -License to the maximum extent possible; and (b) describe the limitations and -the code they affect. Such description must be included in the LEGAL file -described in Section 3.4 and must be included with all distributions of the -Source Code. Except to the extent prohibited by statute or regulation, such -description must be sufficiently detailed for a recipient of ordinary skill to -be able to understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has attached -the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - Netscape Communications Corporation ("Netscape") may publish revised -and/or new versions of the License from time to time. Each version will be -given a distinguishing version number. - - 6.2. Effect of New Versions. - Once Covered Code has been published under a particular version of the -License, You may always continue to use it under the terms of that version. -You may also choose to use such Covered Code under the terms of any subsequent -version of the License published by Netscape. No one other than Netscape has -the right to modify the terms applicable to Covered Code created under this -License. - - 6.3. Derivative Works. - If You create or use a modified version of this License (which you may -only do in order to apply it to code which is not already Covered Code -governed by this License), You must (a) rename Your license so that the -phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or -any confusingly similar phrase do not appear in your license (except to note -that your license differs from this License) and (b) otherwise make it clear -that Your version of the license contains terms which differ from the Mozilla -Public License and Netscape Public License. (Filling in the name of the -Initial Developer, Original Code or Contributor in the notice described in -Exhibit A shall not of themselves be deemed to be modifications of this -License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT -LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, -FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE -QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED -CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY -OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR -CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS -LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS -DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate -automatically if You fail to comply with terms herein and fail to cure such -breach within 30 days of becoming aware of the breach. All sublicenses to the -Covered Code which are properly granted shall survive any termination of this -License. Provisions which, by their nature, must remain in effect beyond the -termination of this License shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement -claim (excluding declatory judgment actions) against Initial Developer or a -Contributor (the Initial Developer or Contributor against whom You file such -action is referred to as "Participant") alleging that: - - (a) such Participant's Contributor Version directly or indirectly -infringes any patent, then any and all rights granted by such Participant to -You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice -from Participant terminate prospectively, unless if within 60 days after -receipt of notice You either: (i) agree in writing to pay Participant a -mutually agreeable reasonable royalty for Your past and future use of -Modifications made by such Participant, or (ii) withdraw Your litigation claim -with respect to the Contributor Version against such Participant. If within -60 days of notice, a reasonable royalty and payment arrangement are not -mutually agreed upon in writing by the parties or the litigation claim is not -withdrawn, the rights granted by Participant to You under Sections 2.1 and/or -2.2 automatically terminate at the expiration of the 60 day notice period -specified above. - - (b) any software, hardware, or device, other than such Participant's -Contributor Version, directly or indirectly infringes any patent, then any -rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are -revoked effective as of the date You first made, used, sold, distributed, or -had made, Modifications made by that Participant. - - 8.3. If You assert a patent infringement claim against Participant -alleging that such Participant's Contributor Version directly or indirectly -infringes any patent where such claim is resolved (such as by license or -settlement) prior to the initiation of patent infringement litigation, then -the reasonable value of the licenses granted by such Participant under -Sections 2.1 or 2.2 shall be taken into account in determining the amount or -value of any payment or license. - - 8.4. In the event of termination under Sections 8.1 or 8.2 above, all -end user license agreements (excluding distributors and resellers) which have -been validly granted by You or any distributor hereunder prior to termination -shall survive termination. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT -(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL -DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY -SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, -SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, -WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER -FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, -EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH -DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH -OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT -APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE -EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS -EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in 48 -C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and -"commercial computer software documentation," as such terms are used in 48 -C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. -227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users -acquire Covered Code with only those rights set forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject matter -hereof. If any provision of this License is held to be unenforceable, such -provision shall be reformed only to the extent necessary to make it -enforceable. This License shall be governed by California law provisions -(except to the extent applicable law, if any, provides otherwise), excluding -its conflict-of-law provisions. With respect to disputes in which at least one -party is a citizen of, or an entity chartered or registered to do business in -the United States of America, any litigation relating to this License shall be -subject to the jurisdiction of the Federal Courts of the Northern District of -California, with venue lying in Santa Clara County, California, with the -losing party responsible for costs, including without limitation, court costs -and reasonable attorneys' fees and expenses. The application of the United -Nations Convention on Contracts for the International Sale of Goods is -expressly excluded. Any law or regulation which provides that the language of -a contract shall be construed against the drafter shall not apply to this -License. - -12. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is -responsible for claims and damages arising, directly or indirectly, out of its -utilization of rights under this License and You agree to work with Initial -Developer and Contributors to distribute such responsibility on an equitable -basis. Nothing herein is intended or shall be deemed to constitute any -admission of liability. - -13. MULTIPLE-LICENSED CODE. - - Initial Developer may designate portions of the Covered Code as -Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits -you to utilize portions of the Covered Code under Your choice of the MPL or -the alternative licenses, if any, specified by the Initial Developer in the -file described in Exhibit A. - - -EXHIBIT A -Mozilla Public License. - - ``The contents of this file are subject to the Mozilla Public License -Version 1.1 (the "License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF - ANY KIND, either express or implied. See the License for the specific -language governing rights and - limitations under the License. - - The Original Code is ______________________________________. - - The Initial Developer of the Original Code is ________________________. -Portions created by - ______________________ are Copyright (C) ______ -_______________________. All Rights - Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the terms of -the _____ license (the [___] License), in which case the provisions of -[______] License are applicable instead of those above. If you wish to allow -use of your version of this file only under the terms of the [____] License -and not to allow others to use your version of this file under the MPL, -indicate your decision by deleting the provisions above and replace them -with the notice and other provisions required by the [___] License. If you do -not delete the provisions above, a recipient may use your version of this file -under either the MPL or the [___] License." - - [NOTE: The text of this Exhibit A may differ slightly from the text of -the notices in the Source Code files of the Original Code. You should use the -text of this Exhibit A rather than the text found in the Original Code Source -Code for Your Modifications.] - - -=============================================================================== - -For the JAX-WS Reference Implementation component: - -COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 - - - 1. Definitions. - - 1.1. "Contributor" means each individual or entity that - creates or contributes to the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the - Original Software, prior Modifications used by a - Contributor (if any), and the Modifications made by that - particular Contributor. - - 1.3. "Covered Software" means (a) the Original Software, or - (b) Modifications, or (c) the combination of files - containing Original Software with files containing - Modifications, in each case including portions thereof. - - 1.4. "Executable" means the Covered Software in any form - other than Source Code. - - 1.5. "Initial Developer" means the individual or entity - that first makes Original Software available under this - License. - - 1.6. "Larger Work" means a work which combines Covered - Software or portions thereof with code not governed by the - terms of this License. - - 1.7. "License" means this document. - - 1.8. "Licensable" means having the right to grant, to the - maximum extent possible, whether at the time of the initial - grant or subsequently acquired, any and all of the rights - conveyed herein. - - 1.9. "Modifications" means the Source Code and Executable - form of any of the following: - - A. Any file that results from an addition to, - deletion from or modification of the contents of a - file containing Original Software or previous - Modifications; - - B. Any new file that contains any part of the - Original Software or previous Modification; or - - C. Any new file that is contributed or otherwise made - available under the terms of this License. - - 1.10. "Original Software" means the Source Code and - Executable form of computer software code that is - originally released under this License. - - 1.11. "Patent Claims" means any patent claim(s), now owned - or hereafter acquired, including without limitation, - method, process, and apparatus claims, in any patent - Licensable by grantor. - - 1.12. "Source Code" means (a) the common form of computer - software code in which modifications are made and (b) - associated documentation included in or with such code. - - 1.13. "You" (or "Your") means an individual or a legal - entity exercising rights under, and complying with all of - the terms of, this License. For legal entities, "You" - includes any entity which controls, is controlled by, or is - under common control with You. For purposes of this - definition, "control" means (a) the power, direct or - indirect, to cause the direction or management of such - entity, whether by contract or otherwise, or (b) ownership - of more than fifty percent (50%) of the outstanding shares - or beneficial ownership of such entity. - - 2. License Grants. - - 2.1. The Initial Developer Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, the - Initial Developer hereby grants You a world-wide, - royalty-free, non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Initial Developer, - to use, reproduce, modify, display, perform, - sublicense and distribute the Original Software (or - portions thereof), with or without Modifications, - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, - using or selling of Original Software, to make, have - made, use, practice, sell, and offer for sale, and/or - otherwise dispose of the Original Software (or - portions thereof). - - (c) The licenses granted in Sections 2.1(a) and (b) - are effective on the date Initial Developer first - distributes or otherwise makes the Original Software - available to a third party under the terms of this - License. - - (d) Notwithstanding Section 2.1(b) above, no patent - license is granted: (1) for code that You delete from - the Original Software, or (2) for infringements - caused by: (i) the modification of the Original - Software, or (ii) the combination of the Original - Software with other software or devices. - - 2.2. Contributor Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, each - Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Contributor to - use, reproduce, modify, display, perform, sublicense - and distribute the Modifications created by such - Contributor (or portions thereof), either on an - unmodified basis, with other Modifications, as - Covered Software and/or as part of a Larger Work; and - - - (b) under Patent Claims infringed by the making, - using, or selling of Modifications made by that - Contributor either alone and/or in combination with - its Contributor Version (or portions of such - combination), to make, use, sell, offer for sale, - have made, and/or otherwise dispose of: (1) - Modifications made by that Contributor (or portions - thereof); and (2) the combination of Modifications - made by that Contributor with its Contributor Version - (or portions of such combination). - - (c) The licenses granted in Sections 2.2(a) and - 2.2(b) are effective on the date Contributor first - distributes or otherwise makes the Modifications - available to a third party. - - (d) Notwithstanding Section 2.2(b) above, no patent - license is granted: (1) for any code that Contributor - has deleted from the Contributor Version; (2) for - infringements caused by: (i) third party - modifications of Contributor Version, or (ii) the - combination of Modifications made by that Contributor - with other software (except as part of the - Contributor Version) or other devices; or (3) under - Patent Claims infringed by Covered Software in the - absence of Modifications made by that Contributor. - - 3. Distribution Obligations. - - 3.1. Availability of Source Code. - - Any Covered Software that You distribute or otherwise make - available in Executable form must also be made available in - Source Code form and that Source Code form must be - distributed only under the terms of this License. You must - include a copy of this License with every copy of the - Source Code form of the Covered Software You distribute or - otherwise make available. You must inform recipients of any - such Covered Software in Executable form as to how they can - obtain such Covered Software in Source Code form in a - reasonable manner on or through a medium customarily used - for software exchange. - - 3.2. Modifications. - - The Modifications that You create or to which You - contribute are governed by the terms of this License. You - represent that You believe Your Modifications are Your - original creation(s) and/or You have sufficient rights to - grant the rights conveyed by this License. - - 3.3. Required Notices. - - You must include a notice in each of Your Modifications - that identifies You as the Contributor of the Modification. - You may not remove or alter any copyright, patent or - trademark notices contained within the Covered Software, or - any notices of licensing or any descriptive text giving - attribution to any Contributor or the Initial Developer. - - 3.4. Application of Additional Terms. - - You may not offer or impose any terms on any Covered - Software in Source Code form that alters or restricts the - applicable version of this License or the recipients' - rights hereunder. You may choose to offer, and to charge a - fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Software. - However, you may do so only on Your own behalf, and not on - behalf of the Initial Developer or any Contributor. You - must make it absolutely clear that any such warranty, - support, indemnity or liability obligation is offered by - You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred - by the Initial Developer or such Contributor as a result of - warranty, support, indemnity or liability terms You offer. - - - 3.5. Distribution of Executable Versions. - - You may distribute the Executable form of the Covered - Software under the terms of this License or under the terms - of a license of Your choice, which may contain terms - different from this License, provided that You are in - compliance with the terms of this License and that the - license for the Executable form does not attempt to limit - or alter the recipient's rights in the Source Code form - from the rights set forth in this License. If You - distribute the Covered Software in Executable form under a - different license, You must make it absolutely clear that - any terms which differ from this License are offered by You - alone, not by the Initial Developer or Contributor. You - hereby agree to indemnify the Initial Developer and every - Contributor for any liability incurred by the Initial - Developer or such Contributor as a result of any such terms - You offer. - - 3.6. Larger Works. - - You may create a Larger Work by combining Covered Software - with other code not governed by the terms of this License - and distribute the Larger Work as a single product. In such - a case, You must make sure the requirements of this License - are fulfilled for the Covered Software. - - 4. Versions of the License. - - 4.1. New Versions. - - Sun Microsystems, Inc. is the initial license steward and - may publish revised and/or new versions of this License - from time to time. Each version will be given a - distinguishing version number. Except as provided in - Section 4.3, no one other than the license steward has the - right to modify this License. - - 4.2. Effect of New Versions. - - You may always continue to use, distribute or otherwise - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. If the Initial Developer includes a - notice in the Original Software prohibiting it from being - distributed or otherwise made available under any - subsequent version of the License, You must distribute and - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. Otherwise, You may also choose to - use, distribute or otherwise make the Covered Software - available under the terms of any subsequent version of the - License published by the license steward. - - 4.3. Modified Versions. - - When You are an Initial Developer and You want to create a - new license for Your Original Software, You may create and - use a modified version of this License if You: (a) rename - the license and remove any references to the name of the - license steward (except to note that the license differs - from this License); and (b) otherwise make it clear that - the license contains terms which differ from this License. - - - 5. DISCLAIMER OF WARRANTY. - - COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" - BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, - INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED - SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR - PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND - PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY - COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE - INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF - ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF - WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS - DISCLAIMER. - - 6. TERMINATION. - - 6.1. This License and the rights granted hereunder will - terminate automatically if You fail to comply with terms - herein and fail to cure such breach within 30 days of - becoming aware of the breach. Provisions which, by their - nature, must remain in effect beyond the termination of - this License shall survive. - - 6.2. If You assert a patent infringement claim (excluding - declaratory judgment actions) against Initial Developer or - a Contributor (the Initial Developer or Contributor against - whom You assert such claim is referred to as "Participant") - alleging that the Participant Software (meaning the - Contributor Version where the Participant is a Contributor - or the Original Software where the Participant is the - Initial Developer) directly or indirectly infringes any - patent, then any and all rights granted directly or - indirectly to You by such Participant, the Initial - Developer (if the Initial Developer is not the Participant) - and all Contributors under Sections 2.1 and/or 2.2 of this - License shall, upon 60 days notice from Participant - terminate prospectively and automatically at the expiration - of such 60 day notice period, unless if within such 60 day - period You withdraw Your claim with respect to the - Participant Software against such Participant either - unilaterally or pursuant to a written agreement with - Participant. - - 6.3. In the event of termination under Sections 6.1 or 6.2 - above, all end user licenses that have been validly granted - by You or any distributor hereunder prior to termination - (excluding licenses granted to You by any distributor) - shall survive termination. - - 7. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE - INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF - COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE - LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR - CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT - LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK - STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL - INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT - APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO - NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR - CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT - APPLY TO YOU. - - 8. U.S. GOVERNMENT END USERS. - - The Covered Software is a "commercial item," as that term is - defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial - computer software" (as that term is defined at 48 C.F.R. - 252.227-7014(a)(1)) and "commercial computer software - documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. - 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 - through 227.7202-4 (June 1995), all U.S. Government End Users - acquire Covered Software with only those rights set forth herein. - This U.S. Government Rights clause is in lieu of, and supersedes, - any other FAR, DFAR, or other clause or provision that addresses - Government rights in computer software under this License. - - 9. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the - extent necessary to make it enforceable. This License shall be - governed by the law of the jurisdiction specified in a notice - contained within the Original Software (except to the extent - applicable law, if any, provides otherwise), excluding such - jurisdiction's conflict-of-law provisions. Any litigation - relating to this License shall be subject to the jurisdiction of - the courts located in the jurisdiction and venue specified in a - notice contained within the Original Software, with the losing - party responsible for costs, including, without limitation, court - costs and reasonable attorneys' fees and expenses. The - application of the United Nations Convention on Contracts for the - International Sale of Goods is expressly excluded. Any law or - regulation which provides that the language of a contract shall - be construed against the drafter shall not apply to this License. - You agree that You alone are responsible for compliance with the - United States export administration regulations (and the export - control laws and regulation of any other countries) when You use, - distribute or otherwise make available any Covered Software. - - 10. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or - indirectly, out of its utilization of rights under this License - and You agree to work with Initial Developer and Contributors to - distribute such responsibility on an equitable basis. Nothing - herein is intended or shall be deemed to constitute any admission - of liability. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/META-INF/NOTICE b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/META-INF/NOTICE deleted file mode 100644 index d48810c0ec..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/META-INF/NOTICE +++ /dev/null @@ -1,18 +0,0 @@ -========================================================================= -== NOTICE file corresponding to the section 4 d of == -== the Apache License, Version 2.0, == -== in this case for the Apache Tuscany distribution. == -========================================================================= - -This product includes software developed by the Apache Software Foundation -(http://www.apache.org/). - -This product also includes software developed by: -- the Eclipse Modeling Framework project (http://www.eclipse.org/emf/) -- the Celtix project (http://celtix.objectweb.org/) -- the Mozilla Rhino project (http://www.mozilla.org/rhino/) -- the GlassFish JAX-WS project (https://jax-ws.dev.java.net/) - -Please read the LICENSE.txt file present in the root directory of this -distribution. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/META-INF/README.txt b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/META-INF/README.txt deleted file mode 100644 index 9b26d1690a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/META-INF/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -Apache Tuscany M1 build (May, 2006) -=================================== - -http://incubator.apache.org/tuscany/ - -Tuscany is an effort undergoing incubation at the Apache Software Foundation -(ASF), sponsored by the Web Services PMC. - -Incubation is required of all newly accepted projects until a further review -indicates that the infrastructure, communications, and decision making process -have stabilized in a manner consistent with other successful ASF projects. - -While incubation status is not necessarily a reflection of the completeness or -stability of the code, it does indicate that the project has yet to be fully -endorsed by the ASF. - - -Support -------- - -Any problem with this release can be reported to the Tuscany mailing list -or in the JIRA issue tracker. - -Mailing list subscription: - tuscany-dev-subscribe@ws.apache.org - -Jira: - http://issues.apache.org/jira/browse/Tuscany - - -Thank you for using Tuscany! - - -The Tuscany Team. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/helloworldwsclient-om.composite b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/helloworldwsclient-om.composite deleted file mode 100644 index 7b9b8fd08c..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/helloworldwsclient-om.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/logging.properties b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/logging.properties deleted file mode 100644 index 6ff8d23044..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/logging.properties +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2006 The Apache Software Foundation or its licensors, as applicable. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# $Rev$ $Date$ -# - -# Custom logging configuration for Tuscany samples -# By default, only INFO level logging is enabled and ALL messages get sent to the console -# For more messages from the runtime, uncomment specific settings at the end of this file -handlers = java.util.logging.ConsoleHandler -java.util.logging.ConsoleHandler.level = ALL -java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter -.level=INFO - -# Uncomment the next setting to get all Tuscany messages (this will be a lot) -#org.apache.tuscany.level=FINEST diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/wsdl/helloworld-om.wsdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/wsdl/helloworld-om.wsdl deleted file mode 100644 index 2c23e45e31..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/main/resources/wsdl/helloworld-om.wsdl +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/test/java/helloworld/om/HelloWorldClientTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/test/java/helloworld/om/HelloWorldClientTestCase.java deleted file mode 100644 index 6f3ab19d9f..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/test/java/helloworld/om/HelloWorldClientTestCase.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 helloworld.om; - -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.api.SCARuntime; -import org.apache.tuscany.core.test.SCATestCaseRunner; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * Test case for helloworld web service client - */ -public class HelloWorldClientTestCase extends TestCase { - - private HelloWorldService helloWorldService; - - private SCATestCaseRunner server; - - @Override - protected void setUp() throws Exception { - server = new SCATestCaseRunner(HelloWorldServerTest.class); - server.setUp(); - - SCARuntime.start("helloworldwsclient-om.composite"); - - CompositeContext compositeContext = CurrentCompositeContext.getContext(); - helloWorldService = compositeContext.locateService(HelloWorldService.class, "HelloWorldServiceComponent"); - - } - - public void testWSClient() { - 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 = helloWorldService.getGreetings(requestOM); - OMElement child = (OMElement)responseOM.getFirstElement(); - Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText()); - } - - @Override - protected void tearDown() throws Exception { - server.tearDown(); - SCARuntime.stop(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/test/java/helloworld/om/HelloWorldServerTest.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/test/java/helloworld/om/HelloWorldServerTest.java deleted file mode 100644 index 0c78f9c9be..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-om-wsclient/src/test/java/helloworld/om/HelloWorldServerTest.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 helloworld.om; - -import java.io.IOException; -import java.net.Socket; - -import junit.framework.TestCase; - -import org.apache.tuscany.api.SCARuntime; - -public class HelloWorldServerTest extends TestCase { - - @Override - protected void setUp() throws Exception { - SCARuntime.start("helloworldws-om.composite"); - } - - public void testPing() throws IOException { - new Socket("127.0.0.1", 8080); - } - - @Override - protected void tearDown() throws Exception { - SCARuntime.stop(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/pom.xml deleted file mode 100644 index 599e2e44af..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/pom.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - - org.apache.tuscany.samples.sca - parent - 0.1-integration-incubating-SNAPSHOT - - 4.0.0 - tuscany-sample-helloworld-oneway-ws - war - Tuscany Greeter Web Service Sample - A sample Greeter OneWay Web Service. - - - axis2 - - - - - org.osoa - sca-api-r1.0 - 0.1-integration-incubating-SNAPSHOT - compile - - - org.apache.tuscany.sca.kernel - tuscany-api - ${pom.version} - compile - - - - commonj - sdo-api-r2.1 - 0.1-integration-incubating-SNAPSHOT - compile - - - org.apache.tuscany.sca.kernel - tuscany-core - ${pom.version} - runtime - - - javax.servlet - servlet-api - 2.5 - provided - - - org.apache.tuscany.sca.services.bindings - axis2 - ${pom.version} - runtime - - - org.apache.tuscany.sca.services.databinding - databinding-axiom - ${pom.version} - runtime - - - org.apache.tuscany.sca.services.databinding - databinding-sdo - ${pom.version} - runtime - - - org.apache.tuscany.sca.runtime.webapp - webapp-api - ${pom.version} - runtime - - - org.apache.tuscany.sca.runtime.webapp - webapp-host - ${pom.version} - runtime - - - org.apache.ws.commons.axiom - axiom-api - SNAPSHOT - compile - - - org.apache.ws.commons.axiom - axiom-impl - SNAPSHOT - runtime - - - junit - junit - 4.2 - test - - - - - - sample-greeterws-oneway-0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sca.runtime.webapp - tuscany-war-plugin - - - tuscany-war - - tuscany-war - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/java/greeter/GreeterImpl.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/java/greeter/GreeterImpl.java deleted file mode 100644 index a38187b552..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/java/greeter/GreeterImpl.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 greeter; - -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -@Service(GreeterService.class) -@Scope("COMPOSITE") -public class GreeterImpl implements GreeterService { - - public void greet(String name) { - System.out.println("Hello " + name); - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/java/greeter/GreeterService.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/java/greeter/GreeterService.java deleted file mode 100644 index fef29e17e5..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/java/greeter/GreeterService.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 greeter; - -import org.osoa.sca.annotations.OneWay; -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Service; - -@Remotable -@Service -public interface GreeterService { - - @OneWay - public void greet(String name); -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/resources/wsdl/greeter.wsdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/resources/wsdl/greeter.wsdl deleted file mode 100644 index 9dfe244d8e..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/resources/wsdl/greeter.wsdl +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/sca/default.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/sca/default.scdl deleted file mode 100644 index b1dbb078c6..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/sca/default.scdl +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - GreeterServiceComponent - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/binding.axis2.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/binding.axis2.scdl deleted file mode 100644 index 852f36e10d..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/binding.axis2.scdl +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/databinding.axiom.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/databinding.axiom.scdl deleted file mode 100644 index 6c902e24ad..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/databinding.axiom.scdl +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/databinding.sdo.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/databinding.sdo.scdl deleted file mode 100644 index 8c1c36d466..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/databinding.sdo.scdl +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/interface.wsdl.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/interface.wsdl.scdl deleted file mode 100644 index b30777b8c6..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/interface.wsdl.scdl +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/webapp.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/webapp.scdl deleted file mode 100644 index f7d51a1437..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/META-INF/tuscany/webapp.scdl +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 10 - - - - - - - - - - - - - - - - - - - - - - - . - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/WEB-INF/web.xml b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 8bfbd86496..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-ws/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - Tuscany Greeter Web Service Sample - - - tuscany.systemScdlPath - /META-INF/tuscany/webapp.scdl - - - - tuscany.applicationScdlPath - /META-INF/sca/default.scdl - - - - org.apache.tuscany.runtime.webapp.TuscanyContextListener - - - - TuscanyServlet - Tuscany Servlet - org.apache.tuscany.runtime.webapp.TuscanyServlet - - - - TuscanyServlet - /* - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/pom.xml deleted file mode 100644 index d234485b09..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/pom.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - org.apache.tuscany.samples.sca - parent - 0.1-integration-incubating-SNAPSHOT - - 4.0.0 - tuscany-sample-helloworld-oneway-wsclient - jar - Tuscany HelloWorld Web Service Async Client Sample - A sample client for a HelloWorld Web Service. - - axis2 - - - - - commonj - sdo-api-r2.1 - ${tuscanyVersion} - compile - - - - org.apache.tuscany.sca.kernel - tuscany-api - 0.1-integration-incubating-SNAPSHOT - compile - - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - - org.apache.tuscany.sca.services.bindings - axis2 - 0.1-integration-incubating-SNAPSHOT - runtime - - - - org.apache.tuscany.sca.services.databinding - databinding-sdo - 0.1-integration-incubating-SNAPSHOT - runtime - - - - junit - junit - 4.2 - test - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - greeter.GreeterClient - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/java/greeter/GreeterClient.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/java/greeter/GreeterClient.java deleted file mode 100644 index 1aa3dce320..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/java/greeter/GreeterClient.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 greeter; - -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -public class GreeterClient { - - public final static void main(String[] args) throws Exception { - CompositeContext compositeContext = CurrentCompositeContext.getContext(); - GreeterLocal greeterLocal = - compositeContext.locateService(GreeterLocal.class, "GreeterServiceComponent"); - greeterLocal.greet("John"); - System.out.println("Sleeping for 5 seconds ..."); - Thread.sleep(5000); - System.out.println("Done ..."); - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/java/greeter/GreeterImpl.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/java/greeter/GreeterImpl.java deleted file mode 100644 index fc17992dbf..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/java/greeter/GreeterImpl.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 greeter; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Scope; - -@Scope("COMPOSITE") -public class GreeterImpl implements GreeterLocal { - - private GreeterService greeterService; - - @Reference - public void setGreeterService(GreeterService greeterService) { - this.greeterService = greeterService; - } - - public void greet(String name) { - this.greeterService.greet(name); - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/java/greeter/GreeterLocal.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/java/greeter/GreeterLocal.java deleted file mode 100644 index 7cf650f73b..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/java/greeter/GreeterLocal.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 greeter; - -public interface GreeterLocal { - public void greet(String name); -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/java/greeter/GreeterService.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/java/greeter/GreeterService.java deleted file mode 100644 index 57279b8a7c..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/java/greeter/GreeterService.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 greeter; - -import org.osoa.sca.annotations.OneWay; -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Service; - -@Remotable -@Service -public interface GreeterService { - @OneWay - public void greet(String name); -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/resources/META-INF/sca/default.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/resources/META-INF/sca/default.scdl deleted file mode 100644 index c450e10408..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/resources/META-INF/sca/default.scdl +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - GreeterService - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/resources/wsdl/greeter.wsdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/resources/wsdl/greeter.wsdl deleted file mode 100644 index 9dfe244d8e..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/main/resources/wsdl/greeter.wsdl +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/test/java/greeter/GreeterWSOneWayClient.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/test/java/greeter/GreeterWSOneWayClient.java deleted file mode 100644 index 1f017744de..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/test/java/greeter/GreeterWSOneWayClient.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 greeter; - -import org.apache.tuscany.test.SCATestCase; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -public class GreeterWSOneWayClient extends SCATestCase { - - private GreeterLocal greeterLocal; - - @Override - protected void setUp() throws Exception { - try { - setApplicationSCDL(GreeterService.class, "META-INF/sca/default.scdl"); - ClassLoader classLoader = getClass().getClassLoader(); - addExtension("test.extensions", classLoader.getResource("META-INF/tuscany/test-extensions.scdl")); - - super.setUp(); - CompositeContext compositeContext = CurrentCompositeContext.getContext(); - greeterLocal = compositeContext.locateService(GreeterLocal.class, "GreeterServiceComponent"); - } catch (Exception e) { - e.printStackTrace(); - fail(e.getMessage()); - } - } - - public void testWSClient() { - try { - greeterLocal.greet("John"); - - System.out.println("Sleeping ..."); - Thread.sleep(5000); - - System.out.println("Done ..."); - } catch (Exception e) { - e.printStackTrace(); - fail(e.getMessage()); - } - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/test/resources/META-INF/tuscany/test-extensions.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/test/resources/META-INF/tuscany/test-extensions.scdl deleted file mode 100644 index ec3643cf00..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-oneway-wsclient/src/test/resources/META-INF/tuscany/test-extensions.scdl +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/pom.xml deleted file mode 100644 index cb389d168b..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2.samples - parent - 0.1-integration-incubating-SNAPSHOT - ../pom.xml - - - 4.0.0 - tuscany-sample-helloworld-ws - jar - Tuscany HelloWorld Web Service Sample - A sample HelloWorld Web Service. - - - - org.apache.tuscany.sca.kernel - tuscany-api - compile - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - org.apache.tuscany.sca.extensions.axis2 - tuscany-axis2 - runtime - 0.1-integration-incubating-SNAPSHOT - - - org.apache.tuscany.sca.services - tuscany-http-jetty - runtime - 0.1-integration-incubating-SNAPSHOT - - - junit - junit - 4.2 - test - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - helloworld.HelloWorldServer - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/java/helloworld/HelloWorldImpl.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/java/helloworld/HelloWorldImpl.java deleted file mode 100644 index 0de3c70303..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/java/helloworld/HelloWorldImpl.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 helloworld; - -import org.osoa.sca.annotations.Service; - -/** - * This class implements the HelloWorld service. - */ -@Service(HelloWorldService.class) -public class HelloWorldImpl implements HelloWorldService { - - public String getGreetings(String name) { - return "Hello " + name; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/java/helloworld/HelloWorldServer.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/java/helloworld/HelloWorldServer.java deleted file mode 100644 index 2f09cd77f0..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/java/helloworld/HelloWorldServer.java +++ /dev/null @@ -1,28 +0,0 @@ -package helloworld; - - -import java.io.IOException; - -import org.apache.tuscany.api.SCARuntime; - -public class HelloWorldServer { - - /** - * @param args - */ - public static void main(String[] args) { - - SCARuntime.start("helloworldws.composite"); - - try { - System.out.println("HelloWorld server started"); - System.in.read(); - } catch (IOException e) { - e.printStackTrace(); - } - - SCARuntime.stop(); - System.out.println("HelloWorld server stopped"); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/java/helloworld/HelloWorldService.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/java/helloworld/HelloWorldService.java deleted file mode 100644 index bd527ff8e2..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/java/helloworld/HelloWorldService.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 helloworld; - -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Service; - -/** - * This is the business interface of the HelloWorld greetings service. - */ -@Remotable -@Service -public interface HelloWorldService { - - public String getGreetings(String name); -} - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/META-INF/LICENSE.txt b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/META-INF/LICENSE.txt deleted file mode 100644 index 25d78feeac..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/META-INF/LICENSE.txt +++ /dev/null @@ -1,1277 +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. - - -APACHE TUSCANY SUBCOMPONENTS: - -The Apache Tuscany distribution includes a number of subcomponents with -separate copyright notices and license terms. Your use of the source -code for the these subcomponents is subject to the terms and -conditions of the following licenses. - -=============================================================================== - -For the Eclipse Modeling Framework component and the Celtix binding: - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE -PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF -THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and -documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and - -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and -are distributed by that particular Contributor. A Contribution -'originates' from a Contributor if it was added to the Program by such -Contributor itself or anyone acting on such Contributor's behalf. -Contributions do not include additions to the Program which: (i) are -separate modules of software distributed in conjunction with the -Program under their own license agreement, and (ii) are not derivative -works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents " mean patent claims licensable by a Contributor -which are necessarily infringed by the use or sale of its Contribution -alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this -Agreement. - -"Recipient" means anyone who receives the Program under this -Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free copyright -license to reproduce, prepare derivative works of, publicly display, -publicly perform, distribute and sublicense the Contribution of such -Contributor, if any, and such derivative works, in source code and -object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free patent -license under Licensed Patents to make, use, sell, offer to sell, -import and otherwise transfer the Contribution of such Contributor, if -any, in source code and object code form. This patent license shall -apply to the combination of the Contribution and the Program if, at -the time the Contribution is added by the Contributor, such addition -of the Contribution causes such combination to be covered by the -Licensed Patents. The patent license shall not apply to any other -combinations which include the Contribution. No hardware per se is -licensed hereunder. - -c) Recipient understands that although each Contributor grants the -licenses to its Contributions set forth herein, no assurances are -provided by any Contributor that the Program does not infringe the -patent or other intellectual property rights of any other entity. Each -Contributor disclaims any liability to Recipient for claims brought by -any other entity based on infringement of intellectual property rights -or otherwise. As a condition to exercising the rights and licenses -granted hereunder, each Recipient hereby assumes sole responsibility -to secure any other intellectual property rights needed, if any. For -example, if a third party patent license is required to allow -Recipient to distribute the Program, it is Recipient's responsibility -to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient -copyright rights in its Contribution, if any, to grant the copyright -license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form -under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties -and conditions, express and implied, including warranties or -conditions of title and non-infringement, and implied warranties or -conditions of merchantability and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability -for damages, including direct, indirect, special, incidental and -consequential damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are -offered by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such -Contributor, and informs licensees how to obtain it in a reasonable -manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the -Program. - -Contributors may not remove or alter any copyright notices contained -within the Program. - -Each Contributor must identify itself as the originator of its -Contribution, if any, in a manner that reasonably allows subsequent -Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain -responsibilities with respect to end users, business partners and the -like. While this license is intended to facilitate the commercial use -of the Program, the Contributor who includes the Program in a -commercial product offering should do so in a manner which does not -create potential liability for other Contributors. Therefore, if a -Contributor includes the Program in a commercial product offering, -such Contributor ("Commercial Contributor") hereby agrees to defend -and indemnify every other Contributor ("Indemnified Contributor") -against any losses, damages and costs (collectively "Losses") arising -from claims, lawsuits and other legal actions brought by a third party -against the Indemnified Contributor to the extent caused by the acts -or omissions of such Commercial Contributor in connection with its -distribution of the Program in a commercial product offering. The -obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. -In order to qualify, an Indemnified Contributor must: a) promptly -notify the Commercial Contributor in writing of such claim, and b) -allow the Commercial Contributor to control, and cooperate with the -Commercial Contributor in, the defense and any related settlement -negotiations. The Indemnified Contributor may participate in any such -claim at its own expense. - -For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those -performance claims and warranties, and if a court requires any other -Contributor to pay any damages as a result, the Commercial Contributor -must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS -PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY -WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY -OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely -responsible for determining the appropriateness of using and -distributing the Program and assumes all risks associated with its -exercise of rights under this Agreement , including but not limited to -the risks and costs of program errors, compliance with applicable -laws, damage to or loss of data, programs or equipment, and -unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR -ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING -WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR -DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED -HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further -action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that -the Program itself (excluding combinations of the Program with other -software or hardware) infringes such Recipient's patent(s), then such -Recipient's rights granted under Section 2(b) shall terminate as of -the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of -time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use -and distribution of the Program as soon as reasonably practicable. -However, Recipient's obligations under this Agreement and any licenses -granted by Recipient relating to the Program shall continue and -survive. - -Everyone is permitted to copy and distribute copies of this Agreement, -but in order to avoid inconsistency the Agreement is copyrighted and -may only be modified in the following manner. The Agreement Steward -reserves the right to publish new versions (including revisions) of -this Agreement from time to time. No one other than the Agreement -Steward has the right to modify this Agreement. The Eclipse Foundation -is the initial Agreement Steward. The Eclipse Foundation may assign -the responsibility to serve as the Agreement Steward to a suitable -separate entity. Each new version of the Agreement will be given a -distinguishing version number. The Program (including Contributions) -may always be distributed subject to the version of the Agreement -under which it was received. In addition, after a new version of the -Agreement is published, Contributor may elect to distribute the -Program (including its Contributions) under the new version. Except as -expressly stated in Sections 2(a) and 2(b) above, Recipient receives -no rights or licenses to the intellectual property of any Contributor -under this Agreement, whether expressly, by implication, estoppel or -otherwise. All rights in the Program not expressly granted under this -Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and -the intellectual property laws of the United States of America. No -party to this Agreement will bring a legal action under this Agreement -more than one year after the cause of action arose. Each party waives -its rights to a jury trial in any resulting litigation. - -=============================================================================== - -For the Rhino JavaScript container component: - -Mozilla Public License 1.1 (MPL 1.1) - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the -Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to -the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original Code, -prior Modifications used by a Contributor, and the Modifications made by that -particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the -combination of the Original Code and Modifications, in each case including -portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally -accepted in the software development community for the electronic transfer of -data. - - 1.5. "Executable" means Covered Code in any form other than Source -Code. - - 1.6. "Initial Developer" means the individual or entity identified as -the Initial Developer in the Source Code notice required by Exhibit A. - - 1.7. "Larger Work" means a work which combines Covered Code or -portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum -extent possible, whether at the time of the initial grant or subsequently -acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the -substance or structure of either the Original Code or any previous -Modifications. When Covered Code is released as a series of files, a -Modification is: - A. Any addition to or deletion from the contents of a file -containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or -previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code -which is described in the Source Code notice required by Exhibit A as Original -Code, and which, at the time of its release under this License is not already -Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or -hereafter acquired, including without limitation, method, process, and -apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for -making modifications to it, including all modules it contains, plus any -associated interface definition files, scripts used to control compilation and -installation of an Executable, or source code differential comparisons against -either the Original Code or another well known, available Covered Code of the -Contributor's choice. The Source Code can be in a compressed or archival form, -provided the appropriate decompression or de-archiving software is widely -available for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity -exercising rights under, and complying with all of the terms of, this License -or a future version of this License issued under Section 6.1. For legal -entities, "You" includes any entity which controls, is controlled by, or is -under common control with You. For purposes of this definition, "control" -means (a) the power, direct or indirect, to cause the direction or management -of such entity, whether by contract or otherwise, or (b) ownership of more -than fifty percent (50%) of the outstanding shares or beneficial ownership of -such entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - The Initial Developer hereby grants You a world-wide, royalty-free, -non-exclusive license, subject to third party intellectual property claims: - (a) under intellectual property rights (other than patent or -trademark) Licensable by Initial Developer to use, reproduce, modify, display, -perform, sublicense and distribute the Original Code (or portions thereof) -with or without Modifications, and/or as part of a Larger Work; and - - (b) under Patents Claims infringed by the making, using or selling -of Original Code, to make, have made, use, practice, sell, and offer for sale, -and/or otherwise dispose of the Original Code (or portions thereof). - (c) the licenses granted in this Section 2.1(a) and -(b) are effective on the date Initial Developer first distributes Original -Code under the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is -granted: 1) for code that You delete from the Original Code; 2) separate from -the Original Code; or 3) for infringements caused by: i) the modification of -the Original Code or ii) the combination of the Original Code with other -software or devices. - - 2.2. Contributor Grant. - Subject to third party intellectual property claims, each Contributor -hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or -trademark) Licensable by Contributor, to use, reproduce, modify, display, -perform, sublicense and distribute the Modifications created by such -Contributor (or portions thereof) either on an unmodified basis, with other -Modifications, as Covered Code and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, using, or selling -of Modifications made by that Contributor either alone and/or in combination -with its Contributor Version (or portions of such combination), to make, use, -sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications -made by that Contributor (or portions thereof); and 2) the combination of -Modifications made by that Contributor with its Contributor Version (or -portions of such combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are -effective on the date Contributor first makes Commercial Use of the Covered -Code. - - (d) Notwithstanding Section 2.2(b) above, no patent license is -granted: 1) for any code that Contributor has deleted from the Contributor -Version; 2) separate from the Contributor Version; 3) for infringements -caused by: i) third party modifications of Contributor Version or ii) the -combination of Modifications made by that Contributor with other software -(except as part of the Contributor Version) or other devices; or 4) under -Patent Claims infringed by Covered Code in the absence of Modifications made -by that Contributor. - - -3. Distribution Obligations. - - 3.1. Application of License. - The Modifications which You create or to which You contribute are -governed by the terms of this License, including without limitation Section -2.2. The Source Code version of Covered Code may be distributed only under the -terms of this License or a future version of this License released under -Section 6.1, and You must include a copy of this License with every copy of -the Source Code You distribute. You may not offer or impose any terms on any -Source Code version that alters or restricts the applicable version of this -License or the recipients' rights hereunder. However, You may include an -additional document offering the additional rights described in Section 3.5. - - 3.2. Availability of Source Code. - Any Modification which You create or to which You contribute must be -made available in Source Code form under the terms of this License either on -the same media as an Executable version or via an accepted Electronic -Distribution Mechanism to anyone to whom you made an Executable version -available; and if made available via Electronic Distribution Mechanism, must -remain available for at least twelve (12) months after the date it initially -became available, or at least six (6) months after a subsequent version of -that particular Modification has been made available to such recipients. You -are responsible for ensuring that the Source Code version remains available -even if the Electronic Distribution Mechanism is maintained by a third party. - - 3.3. Description of Modifications. - You must cause all Covered Code to which You contribute to contain a -file documenting the changes You made to create that Covered Code and the date -of any change. You must include a prominent statement that the Modification is -derived, directly or indirectly, from Original Code provided by the Initial -Developer and including the name of the Initial Developer in (a) the Source -Code, and (b) in any notice in an Executable version or related documentation -in which You describe the origin or ownership of the Covered Code. - - 3.4. Intellectual Property Matters - (a) Third Party Claims. - If Contributor has knowledge that a license under a third party's -intellectual property rights is required to exercise the rights granted by -such Contributor under Sections 2.1 or 2.2, Contributor must include a text -file with the Source Code distribution titled "LEGAL" which describes the -claim and the party making the claim in sufficient detail that a recipient -will know whom to contact. If Contributor obtains such knowledge after the -Modification is made available as described in Section 3.2, Contributor shall -promptly modify the LEGAL file in all copies Contributor makes available -thereafter and shall take other steps (such as notifying appropriate mailing -lists or newsgroups) reasonably calculated to inform those who received the -Covered Code that new knowledge has been obtained. - - (b) Contributor APIs. - If Contributor's Modifications include an application programming -interface and Contributor has knowledge of patent licenses which are -reasonably necessary to implement that API, Contributor must also include this -information in the LEGAL file. - - (c) Representations. - Contributor represents that, except as disclosed pursuant to -Section 3.4(a) above, Contributor believes that Contributor's Modifications -are Contributor's original creation(s) and/or Contributor has sufficient -rights to grant the rights conveyed by this License. - - - 3.5. Required Notices. - You must duplicate the notice in Exhibit A in each file of the Source -Code. If it is not possible to put such notice in a particular Source Code -file due to its structure, then You must include such notice in a location -(such as a relevant directory) where a user would be likely to look for such a -notice. If You created one or more Modification(s) You may add your name as a -Contributor to the notice described in Exhibit A. You must also duplicate -this License in any documentation for the Source Code where You describe -recipients' rights or ownership rights relating to Covered Code. You may -choose to offer, and to charge a fee for, warranty, support, indemnity or -liability obligations to one or more recipients of Covered Code. However, You -may do so only on Your own behalf, and not on behalf of the Initial Developer -or any Contributor. You must make it absolutely clear than any such warranty, -support, indemnity or liability obligation is offered by You alone, and You -hereby agree to indemnify the Initial Developer and every Contributor for any -liability incurred by the Initial Developer or such Contributor as a result of -warranty, support, indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - You may distribute Covered Code in Executable form only if the -requirements of Section 3.1-3.5 have been met for that Covered Code, and if -You include a notice stating that the Source Code version of the Covered Code -is available under the terms of this License, including a description of how -and where You have fulfilled the obligations of Section 3.2. The notice must -be conspicuously included in any notice in an Executable version, related -documentation or collateral in which You describe recipients' rights relating -to the Covered Code. You may distribute the Executable version of Covered Code -or ownership rights under a license of Your choice, which may contain terms -different from this License, provided that You are in compliance with the -terms of this License and that the license for the Executable version does not -attempt to limit or alter the recipient's rights in the Source Code version -from the rights set forth in this License. If You distribute the Executable -version under a different license You must make it absolutely clear that any -terms which differ from this License are offered by You alone, not by the -Initial Developer or any Contributor. You hereby agree to indemnify the -Initial Developer and every Contributor for any liability incurred by the -Initial Developer or such Contributor as a result of any such terms You offer. - - 3.7. Larger Works. - You may create a Larger Work by combining Covered Code with other code -not governed by the terms of this License and distribute the Larger Work as a -single product. In such a case, You must make sure the requirements of this -License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Code due to statute, -judicial order, or regulation then You must: (a) comply with the terms of this -License to the maximum extent possible; and (b) describe the limitations and -the code they affect. Such description must be included in the LEGAL file -described in Section 3.4 and must be included with all distributions of the -Source Code. Except to the extent prohibited by statute or regulation, such -description must be sufficiently detailed for a recipient of ordinary skill to -be able to understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has attached -the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - Netscape Communications Corporation ("Netscape") may publish revised -and/or new versions of the License from time to time. Each version will be -given a distinguishing version number. - - 6.2. Effect of New Versions. - Once Covered Code has been published under a particular version of the -License, You may always continue to use it under the terms of that version. -You may also choose to use such Covered Code under the terms of any subsequent -version of the License published by Netscape. No one other than Netscape has -the right to modify the terms applicable to Covered Code created under this -License. - - 6.3. Derivative Works. - If You create or use a modified version of this License (which you may -only do in order to apply it to code which is not already Covered Code -governed by this License), You must (a) rename Your license so that the -phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or -any confusingly similar phrase do not appear in your license (except to note -that your license differs from this License) and (b) otherwise make it clear -that Your version of the license contains terms which differ from the Mozilla -Public License and Netscape Public License. (Filling in the name of the -Initial Developer, Original Code or Contributor in the notice described in -Exhibit A shall not of themselves be deemed to be modifications of this -License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT -LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, -FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE -QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED -CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY -OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR -CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS -LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS -DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate -automatically if You fail to comply with terms herein and fail to cure such -breach within 30 days of becoming aware of the breach. All sublicenses to the -Covered Code which are properly granted shall survive any termination of this -License. Provisions which, by their nature, must remain in effect beyond the -termination of this License shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement -claim (excluding declatory judgment actions) against Initial Developer or a -Contributor (the Initial Developer or Contributor against whom You file such -action is referred to as "Participant") alleging that: - - (a) such Participant's Contributor Version directly or indirectly -infringes any patent, then any and all rights granted by such Participant to -You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice -from Participant terminate prospectively, unless if within 60 days after -receipt of notice You either: (i) agree in writing to pay Participant a -mutually agreeable reasonable royalty for Your past and future use of -Modifications made by such Participant, or (ii) withdraw Your litigation claim -with respect to the Contributor Version against such Participant. If within -60 days of notice, a reasonable royalty and payment arrangement are not -mutually agreed upon in writing by the parties or the litigation claim is not -withdrawn, the rights granted by Participant to You under Sections 2.1 and/or -2.2 automatically terminate at the expiration of the 60 day notice period -specified above. - - (b) any software, hardware, or device, other than such Participant's -Contributor Version, directly or indirectly infringes any patent, then any -rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are -revoked effective as of the date You first made, used, sold, distributed, or -had made, Modifications made by that Participant. - - 8.3. If You assert a patent infringement claim against Participant -alleging that such Participant's Contributor Version directly or indirectly -infringes any patent where such claim is resolved (such as by license or -settlement) prior to the initiation of patent infringement litigation, then -the reasonable value of the licenses granted by such Participant under -Sections 2.1 or 2.2 shall be taken into account in determining the amount or -value of any payment or license. - - 8.4. In the event of termination under Sections 8.1 or 8.2 above, all -end user license agreements (excluding distributors and resellers) which have -been validly granted by You or any distributor hereunder prior to termination -shall survive termination. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT -(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL -DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY -SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, -SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, -WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER -FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, -EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH -DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH -OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT -APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE -EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS -EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in 48 -C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and -"commercial computer software documentation," as such terms are used in 48 -C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. -227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users -acquire Covered Code with only those rights set forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject matter -hereof. If any provision of this License is held to be unenforceable, such -provision shall be reformed only to the extent necessary to make it -enforceable. This License shall be governed by California law provisions -(except to the extent applicable law, if any, provides otherwise), excluding -its conflict-of-law provisions. With respect to disputes in which at least one -party is a citizen of, or an entity chartered or registered to do business in -the United States of America, any litigation relating to this License shall be -subject to the jurisdiction of the Federal Courts of the Northern District of -California, with venue lying in Santa Clara County, California, with the -losing party responsible for costs, including without limitation, court costs -and reasonable attorneys' fees and expenses. The application of the United -Nations Convention on Contracts for the International Sale of Goods is -expressly excluded. Any law or regulation which provides that the language of -a contract shall be construed against the drafter shall not apply to this -License. - -12. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is -responsible for claims and damages arising, directly or indirectly, out of its -utilization of rights under this License and You agree to work with Initial -Developer and Contributors to distribute such responsibility on an equitable -basis. Nothing herein is intended or shall be deemed to constitute any -admission of liability. - -13. MULTIPLE-LICENSED CODE. - - Initial Developer may designate portions of the Covered Code as -Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits -you to utilize portions of the Covered Code under Your choice of the MPL or -the alternative licenses, if any, specified by the Initial Developer in the -file described in Exhibit A. - - -EXHIBIT A -Mozilla Public License. - - ``The contents of this file are subject to the Mozilla Public License -Version 1.1 (the "License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF - ANY KIND, either express or implied. See the License for the specific -language governing rights and - limitations under the License. - - The Original Code is ______________________________________. - - The Initial Developer of the Original Code is ________________________. -Portions created by - ______________________ are Copyright (C) ______ -_______________________. All Rights - Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the terms of -the _____ license (the [___] License), in which case the provisions of -[______] License are applicable instead of those above. If you wish to allow -use of your version of this file only under the terms of the [____] License -and not to allow others to use your version of this file under the MPL, -indicate your decision by deleting the provisions above and replace them -with the notice and other provisions required by the [___] License. If you do -not delete the provisions above, a recipient may use your version of this file -under either the MPL or the [___] License." - - [NOTE: The text of this Exhibit A may differ slightly from the text of -the notices in the Source Code files of the Original Code. You should use the -text of this Exhibit A rather than the text found in the Original Code Source -Code for Your Modifications.] - - -=============================================================================== - -For the JAX-WS Reference Implementation component: - -COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 - - - 1. Definitions. - - 1.1. "Contributor" means each individual or entity that - creates or contributes to the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the - Original Software, prior Modifications used by a - Contributor (if any), and the Modifications made by that - particular Contributor. - - 1.3. "Covered Software" means (a) the Original Software, or - (b) Modifications, or (c) the combination of files - containing Original Software with files containing - Modifications, in each case including portions thereof. - - 1.4. "Executable" means the Covered Software in any form - other than Source Code. - - 1.5. "Initial Developer" means the individual or entity - that first makes Original Software available under this - License. - - 1.6. "Larger Work" means a work which combines Covered - Software or portions thereof with code not governed by the - terms of this License. - - 1.7. "License" means this document. - - 1.8. "Licensable" means having the right to grant, to the - maximum extent possible, whether at the time of the initial - grant or subsequently acquired, any and all of the rights - conveyed herein. - - 1.9. "Modifications" means the Source Code and Executable - form of any of the following: - - A. Any file that results from an addition to, - deletion from or modification of the contents of a - file containing Original Software or previous - Modifications; - - B. Any new file that contains any part of the - Original Software or previous Modification; or - - C. Any new file that is contributed or otherwise made - available under the terms of this License. - - 1.10. "Original Software" means the Source Code and - Executable form of computer software code that is - originally released under this License. - - 1.11. "Patent Claims" means any patent claim(s), now owned - or hereafter acquired, including without limitation, - method, process, and apparatus claims, in any patent - Licensable by grantor. - - 1.12. "Source Code" means (a) the common form of computer - software code in which modifications are made and (b) - associated documentation included in or with such code. - - 1.13. "You" (or "Your") means an individual or a legal - entity exercising rights under, and complying with all of - the terms of, this License. For legal entities, "You" - includes any entity which controls, is controlled by, or is - under common control with You. For purposes of this - definition, "control" means (a) the power, direct or - indirect, to cause the direction or management of such - entity, whether by contract or otherwise, or (b) ownership - of more than fifty percent (50%) of the outstanding shares - or beneficial ownership of such entity. - - 2. License Grants. - - 2.1. The Initial Developer Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, the - Initial Developer hereby grants You a world-wide, - royalty-free, non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Initial Developer, - to use, reproduce, modify, display, perform, - sublicense and distribute the Original Software (or - portions thereof), with or without Modifications, - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, - using or selling of Original Software, to make, have - made, use, practice, sell, and offer for sale, and/or - otherwise dispose of the Original Software (or - portions thereof). - - (c) The licenses granted in Sections 2.1(a) and (b) - are effective on the date Initial Developer first - distributes or otherwise makes the Original Software - available to a third party under the terms of this - License. - - (d) Notwithstanding Section 2.1(b) above, no patent - license is granted: (1) for code that You delete from - the Original Software, or (2) for infringements - caused by: (i) the modification of the Original - Software, or (ii) the combination of the Original - Software with other software or devices. - - 2.2. Contributor Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, each - Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Contributor to - use, reproduce, modify, display, perform, sublicense - and distribute the Modifications created by such - Contributor (or portions thereof), either on an - unmodified basis, with other Modifications, as - Covered Software and/or as part of a Larger Work; and - - - (b) under Patent Claims infringed by the making, - using, or selling of Modifications made by that - Contributor either alone and/or in combination with - its Contributor Version (or portions of such - combination), to make, use, sell, offer for sale, - have made, and/or otherwise dispose of: (1) - Modifications made by that Contributor (or portions - thereof); and (2) the combination of Modifications - made by that Contributor with its Contributor Version - (or portions of such combination). - - (c) The licenses granted in Sections 2.2(a) and - 2.2(b) are effective on the date Contributor first - distributes or otherwise makes the Modifications - available to a third party. - - (d) Notwithstanding Section 2.2(b) above, no patent - license is granted: (1) for any code that Contributor - has deleted from the Contributor Version; (2) for - infringements caused by: (i) third party - modifications of Contributor Version, or (ii) the - combination of Modifications made by that Contributor - with other software (except as part of the - Contributor Version) or other devices; or (3) under - Patent Claims infringed by Covered Software in the - absence of Modifications made by that Contributor. - - 3. Distribution Obligations. - - 3.1. Availability of Source Code. - - Any Covered Software that You distribute or otherwise make - available in Executable form must also be made available in - Source Code form and that Source Code form must be - distributed only under the terms of this License. You must - include a copy of this License with every copy of the - Source Code form of the Covered Software You distribute or - otherwise make available. You must inform recipients of any - such Covered Software in Executable form as to how they can - obtain such Covered Software in Source Code form in a - reasonable manner on or through a medium customarily used - for software exchange. - - 3.2. Modifications. - - The Modifications that You create or to which You - contribute are governed by the terms of this License. You - represent that You believe Your Modifications are Your - original creation(s) and/or You have sufficient rights to - grant the rights conveyed by this License. - - 3.3. Required Notices. - - You must include a notice in each of Your Modifications - that identifies You as the Contributor of the Modification. - You may not remove or alter any copyright, patent or - trademark notices contained within the Covered Software, or - any notices of licensing or any descriptive text giving - attribution to any Contributor or the Initial Developer. - - 3.4. Application of Additional Terms. - - You may not offer or impose any terms on any Covered - Software in Source Code form that alters or restricts the - applicable version of this License or the recipients' - rights hereunder. You may choose to offer, and to charge a - fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Software. - However, you may do so only on Your own behalf, and not on - behalf of the Initial Developer or any Contributor. You - must make it absolutely clear that any such warranty, - support, indemnity or liability obligation is offered by - You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred - by the Initial Developer or such Contributor as a result of - warranty, support, indemnity or liability terms You offer. - - - 3.5. Distribution of Executable Versions. - - You may distribute the Executable form of the Covered - Software under the terms of this License or under the terms - of a license of Your choice, which may contain terms - different from this License, provided that You are in - compliance with the terms of this License and that the - license for the Executable form does not attempt to limit - or alter the recipient's rights in the Source Code form - from the rights set forth in this License. If You - distribute the Covered Software in Executable form under a - different license, You must make it absolutely clear that - any terms which differ from this License are offered by You - alone, not by the Initial Developer or Contributor. You - hereby agree to indemnify the Initial Developer and every - Contributor for any liability incurred by the Initial - Developer or such Contributor as a result of any such terms - You offer. - - 3.6. Larger Works. - - You may create a Larger Work by combining Covered Software - with other code not governed by the terms of this License - and distribute the Larger Work as a single product. In such - a case, You must make sure the requirements of this License - are fulfilled for the Covered Software. - - 4. Versions of the License. - - 4.1. New Versions. - - Sun Microsystems, Inc. is the initial license steward and - may publish revised and/or new versions of this License - from time to time. Each version will be given a - distinguishing version number. Except as provided in - Section 4.3, no one other than the license steward has the - right to modify this License. - - 4.2. Effect of New Versions. - - You may always continue to use, distribute or otherwise - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. If the Initial Developer includes a - notice in the Original Software prohibiting it from being - distributed or otherwise made available under any - subsequent version of the License, You must distribute and - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. Otherwise, You may also choose to - use, distribute or otherwise make the Covered Software - available under the terms of any subsequent version of the - License published by the license steward. - - 4.3. Modified Versions. - - When You are an Initial Developer and You want to create a - new license for Your Original Software, You may create and - use a modified version of this License if You: (a) rename - the license and remove any references to the name of the - license steward (except to note that the license differs - from this License); and (b) otherwise make it clear that - the license contains terms which differ from this License. - - - 5. DISCLAIMER OF WARRANTY. - - COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" - BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, - INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED - SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR - PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND - PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY - COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE - INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF - ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF - WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS - DISCLAIMER. - - 6. TERMINATION. - - 6.1. This License and the rights granted hereunder will - terminate automatically if You fail to comply with terms - herein and fail to cure such breach within 30 days of - becoming aware of the breach. Provisions which, by their - nature, must remain in effect beyond the termination of - this License shall survive. - - 6.2. If You assert a patent infringement claim (excluding - declaratory judgment actions) against Initial Developer or - a Contributor (the Initial Developer or Contributor against - whom You assert such claim is referred to as "Participant") - alleging that the Participant Software (meaning the - Contributor Version where the Participant is a Contributor - or the Original Software where the Participant is the - Initial Developer) directly or indirectly infringes any - patent, then any and all rights granted directly or - indirectly to You by such Participant, the Initial - Developer (if the Initial Developer is not the Participant) - and all Contributors under Sections 2.1 and/or 2.2 of this - License shall, upon 60 days notice from Participant - terminate prospectively and automatically at the expiration - of such 60 day notice period, unless if within such 60 day - period You withdraw Your claim with respect to the - Participant Software against such Participant either - unilaterally or pursuant to a written agreement with - Participant. - - 6.3. In the event of termination under Sections 6.1 or 6.2 - above, all end user licenses that have been validly granted - by You or any distributor hereunder prior to termination - (excluding licenses granted to You by any distributor) - shall survive termination. - - 7. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE - INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF - COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE - LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR - CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT - LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK - STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL - INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT - APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO - NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR - CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT - APPLY TO YOU. - - 8. U.S. GOVERNMENT END USERS. - - The Covered Software is a "commercial item," as that term is - defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial - computer software" (as that term is defined at 48 C.F.R. - 252.227-7014(a)(1)) and "commercial computer software - documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. - 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 - through 227.7202-4 (June 1995), all U.S. Government End Users - acquire Covered Software with only those rights set forth herein. - This U.S. Government Rights clause is in lieu of, and supersedes, - any other FAR, DFAR, or other clause or provision that addresses - Government rights in computer software under this License. - - 9. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the - extent necessary to make it enforceable. This License shall be - governed by the law of the jurisdiction specified in a notice - contained within the Original Software (except to the extent - applicable law, if any, provides otherwise), excluding such - jurisdiction's conflict-of-law provisions. Any litigation - relating to this License shall be subject to the jurisdiction of - the courts located in the jurisdiction and venue specified in a - notice contained within the Original Software, with the losing - party responsible for costs, including, without limitation, court - costs and reasonable attorneys' fees and expenses. The - application of the United Nations Convention on Contracts for the - International Sale of Goods is expressly excluded. Any law or - regulation which provides that the language of a contract shall - be construed against the drafter shall not apply to this License. - You agree that You alone are responsible for compliance with the - United States export administration regulations (and the export - control laws and regulation of any other countries) when You use, - distribute or otherwise make available any Covered Software. - - 10. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or - indirectly, out of its utilization of rights under this License - and You agree to work with Initial Developer and Contributors to - distribute such responsibility on an equitable basis. Nothing - herein is intended or shall be deemed to constitute any admission - of liability. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/META-INF/NOTICE b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/META-INF/NOTICE deleted file mode 100644 index d48810c0ec..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/META-INF/NOTICE +++ /dev/null @@ -1,18 +0,0 @@ -========================================================================= -== NOTICE file corresponding to the section 4 d of == -== the Apache License, Version 2.0, == -== in this case for the Apache Tuscany distribution. == -========================================================================= - -This product includes software developed by the Apache Software Foundation -(http://www.apache.org/). - -This product also includes software developed by: -- the Eclipse Modeling Framework project (http://www.eclipse.org/emf/) -- the Celtix project (http://celtix.objectweb.org/) -- the Mozilla Rhino project (http://www.mozilla.org/rhino/) -- the GlassFish JAX-WS project (https://jax-ws.dev.java.net/) - -Please read the LICENSE.txt file present in the root directory of this -distribution. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/META-INF/README.txt b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/META-INF/README.txt deleted file mode 100644 index 9b26d1690a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/META-INF/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -Apache Tuscany M1 build (May, 2006) -=================================== - -http://incubator.apache.org/tuscany/ - -Tuscany is an effort undergoing incubation at the Apache Software Foundation -(ASF), sponsored by the Web Services PMC. - -Incubation is required of all newly accepted projects until a further review -indicates that the infrastructure, communications, and decision making process -have stabilized in a manner consistent with other successful ASF projects. - -While incubation status is not necessarily a reflection of the completeness or -stability of the code, it does indicate that the project has yet to be fully -endorsed by the ASF. - - -Support -------- - -Any problem with this release can be reported to the Tuscany mailing list -or in the JIRA issue tracker. - -Mailing list subscription: - tuscany-dev-subscribe@ws.apache.org - -Jira: - http://issues.apache.org/jira/browse/Tuscany - - -Thank you for using Tuscany! - - -The Tuscany Team. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/helloworldws.composite b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/helloworldws.composite deleted file mode 100644 index ac1bb3f20d..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/helloworldws.composite +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - HelloWorldServiceComponent - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/system.composite b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/system.composite deleted file mode 100644 index c288471c14..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/system.composite +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - 8080 - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/wsdl/helloworld.wsdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/wsdl/helloworld.wsdl deleted file mode 100644 index 0b95fbd14f..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/main/resources/wsdl/helloworld.wsdl +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/test/java/helloworld/HelloWorldServerTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/test/java/helloworld/HelloWorldServerTestCase.java deleted file mode 100644 index c2d1a5067b..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-ws/src/test/java/helloworld/HelloWorldServerTestCase.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 java.io.IOException; -import java.net.Socket; - -import org.apache.tuscany.api.SCARuntime; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import junit.framework.TestCase; - -public class HelloWorldServerTestCase { - - @Before - public void startServer() throws Exception { - SCARuntime.start("helloworldws.composite"); - } - - @Test - public void testPing() throws IOException { - new Socket("127.0.0.1", 8080); - } - - @After - public void stopServer() throws Exception { - SCARuntime.stop(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/pom.xml deleted file mode 100644 index cef8bc7885..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/pom.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2.samples - parent - 0.1-integration-incubating-SNAPSHOT - ../pom.xml - - - 4.0.0 - tuscany-sample-helloworld-wsclient - jar - Tuscany HelloWorld Web Service Client Sample - A sample client for a HelloWorld Web Service. - - - - org.apache.tuscany.sca.kernel - tuscany-api - compile - 0.1-integration-incubating-SNAPSHOT - - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - - org.apache.tuscany.sca.extensions.axis2 - tuscany-axis2 - runtime - 0.1-integration-incubating-SNAPSHOT - - - - org.apache.tuscany.sca.extensions.axis2.samples - tuscany-sample-helloworld-ws - runtime - 0.1-integration-incubating-SNAPSHOT - - - - junit - junit - 4.2 - test - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - helloworld.HelloWorldClient - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/java/helloworld/HelloWorldClient.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/java/helloworld/HelloWorldClient.java deleted file mode 100644 index 764cdac3bd..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/java/helloworld/HelloWorldClient.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 helloworld; - -import org.apache.tuscany.api.SCARuntime; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * This client program shows how to create an SCA runtime, start it, - * locate the HelloWorld service and invoke it. - */ -public class HelloWorldClient { - - public final static void main(String[] args) throws Exception { - SCARuntime.start("helloworldwsclient.composite"); - - CompositeContext compositeContext = CurrentCompositeContext.getContext(); - HelloWorldService helloWorldService= compositeContext.locateService(HelloWorldService.class, "HelloWorldServiceComponent"); - String value = helloWorldService.getGreetings("World"); - System.out.println(value); - - SCARuntime.stop(); - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/java/helloworld/HelloWorldService.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/java/helloworld/HelloWorldService.java deleted file mode 100644 index 82ce2d6db8..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/java/helloworld/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 helloworld; - -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Service; - -@Remotable -@Service -public interface HelloWorldService { - public String getGreetings(String name); -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/java/helloworld/HelloWorldServiceComponent.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/java/helloworld/HelloWorldServiceComponent.java deleted file mode 100644 index d706517b76..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/java/helloworld/HelloWorldServiceComponent.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 helloworld; - -import org.osoa.sca.annotations.Scope; - -/** - * This client program shows how to create an SCA runtime, start it, - * locate the HelloWorld service and invoke it. - */ -@Scope("COMPOSITE") -public class HelloWorldServiceComponent implements HelloWorldService { - - HelloWorldService helloWorldService; - - public String getGreetings(String name) { - return helloWorldService.getGreetings(name); - } - - public HelloWorldService getHelloWorldService() { - return helloWorldService; - } - - public void setHelloWorldService(HelloWorldService helloWorldService) { - this.helloWorldService = helloWorldService; - } -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/META-INF/LICENSE.txt b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/META-INF/LICENSE.txt deleted file mode 100644 index 25d78feeac..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/META-INF/LICENSE.txt +++ /dev/null @@ -1,1277 +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. - - -APACHE TUSCANY SUBCOMPONENTS: - -The Apache Tuscany distribution includes a number of subcomponents with -separate copyright notices and license terms. Your use of the source -code for the these subcomponents is subject to the terms and -conditions of the following licenses. - -=============================================================================== - -For the Eclipse Modeling Framework component and the Celtix binding: - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE -PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF -THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and -documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and - -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and -are distributed by that particular Contributor. A Contribution -'originates' from a Contributor if it was added to the Program by such -Contributor itself or anyone acting on such Contributor's behalf. -Contributions do not include additions to the Program which: (i) are -separate modules of software distributed in conjunction with the -Program under their own license agreement, and (ii) are not derivative -works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents " mean patent claims licensable by a Contributor -which are necessarily infringed by the use or sale of its Contribution -alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this -Agreement. - -"Recipient" means anyone who receives the Program under this -Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free copyright -license to reproduce, prepare derivative works of, publicly display, -publicly perform, distribute and sublicense the Contribution of such -Contributor, if any, and such derivative works, in source code and -object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free patent -license under Licensed Patents to make, use, sell, offer to sell, -import and otherwise transfer the Contribution of such Contributor, if -any, in source code and object code form. This patent license shall -apply to the combination of the Contribution and the Program if, at -the time the Contribution is added by the Contributor, such addition -of the Contribution causes such combination to be covered by the -Licensed Patents. The patent license shall not apply to any other -combinations which include the Contribution. No hardware per se is -licensed hereunder. - -c) Recipient understands that although each Contributor grants the -licenses to its Contributions set forth herein, no assurances are -provided by any Contributor that the Program does not infringe the -patent or other intellectual property rights of any other entity. Each -Contributor disclaims any liability to Recipient for claims brought by -any other entity based on infringement of intellectual property rights -or otherwise. As a condition to exercising the rights and licenses -granted hereunder, each Recipient hereby assumes sole responsibility -to secure any other intellectual property rights needed, if any. For -example, if a third party patent license is required to allow -Recipient to distribute the Program, it is Recipient's responsibility -to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient -copyright rights in its Contribution, if any, to grant the copyright -license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form -under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties -and conditions, express and implied, including warranties or -conditions of title and non-infringement, and implied warranties or -conditions of merchantability and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability -for damages, including direct, indirect, special, incidental and -consequential damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are -offered by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such -Contributor, and informs licensees how to obtain it in a reasonable -manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the -Program. - -Contributors may not remove or alter any copyright notices contained -within the Program. - -Each Contributor must identify itself as the originator of its -Contribution, if any, in a manner that reasonably allows subsequent -Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain -responsibilities with respect to end users, business partners and the -like. While this license is intended to facilitate the commercial use -of the Program, the Contributor who includes the Program in a -commercial product offering should do so in a manner which does not -create potential liability for other Contributors. Therefore, if a -Contributor includes the Program in a commercial product offering, -such Contributor ("Commercial Contributor") hereby agrees to defend -and indemnify every other Contributor ("Indemnified Contributor") -against any losses, damages and costs (collectively "Losses") arising -from claims, lawsuits and other legal actions brought by a third party -against the Indemnified Contributor to the extent caused by the acts -or omissions of such Commercial Contributor in connection with its -distribution of the Program in a commercial product offering. The -obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. -In order to qualify, an Indemnified Contributor must: a) promptly -notify the Commercial Contributor in writing of such claim, and b) -allow the Commercial Contributor to control, and cooperate with the -Commercial Contributor in, the defense and any related settlement -negotiations. The Indemnified Contributor may participate in any such -claim at its own expense. - -For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those -performance claims and warranties, and if a court requires any other -Contributor to pay any damages as a result, the Commercial Contributor -must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS -PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY -WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY -OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely -responsible for determining the appropriateness of using and -distributing the Program and assumes all risks associated with its -exercise of rights under this Agreement , including but not limited to -the risks and costs of program errors, compliance with applicable -laws, damage to or loss of data, programs or equipment, and -unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR -ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING -WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR -DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED -HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further -action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that -the Program itself (excluding combinations of the Program with other -software or hardware) infringes such Recipient's patent(s), then such -Recipient's rights granted under Section 2(b) shall terminate as of -the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of -time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use -and distribution of the Program as soon as reasonably practicable. -However, Recipient's obligations under this Agreement and any licenses -granted by Recipient relating to the Program shall continue and -survive. - -Everyone is permitted to copy and distribute copies of this Agreement, -but in order to avoid inconsistency the Agreement is copyrighted and -may only be modified in the following manner. The Agreement Steward -reserves the right to publish new versions (including revisions) of -this Agreement from time to time. No one other than the Agreement -Steward has the right to modify this Agreement. The Eclipse Foundation -is the initial Agreement Steward. The Eclipse Foundation may assign -the responsibility to serve as the Agreement Steward to a suitable -separate entity. Each new version of the Agreement will be given a -distinguishing version number. The Program (including Contributions) -may always be distributed subject to the version of the Agreement -under which it was received. In addition, after a new version of the -Agreement is published, Contributor may elect to distribute the -Program (including its Contributions) under the new version. Except as -expressly stated in Sections 2(a) and 2(b) above, Recipient receives -no rights or licenses to the intellectual property of any Contributor -under this Agreement, whether expressly, by implication, estoppel or -otherwise. All rights in the Program not expressly granted under this -Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and -the intellectual property laws of the United States of America. No -party to this Agreement will bring a legal action under this Agreement -more than one year after the cause of action arose. Each party waives -its rights to a jury trial in any resulting litigation. - -=============================================================================== - -For the Rhino JavaScript container component: - -Mozilla Public License 1.1 (MPL 1.1) - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the -Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to -the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original Code, -prior Modifications used by a Contributor, and the Modifications made by that -particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the -combination of the Original Code and Modifications, in each case including -portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally -accepted in the software development community for the electronic transfer of -data. - - 1.5. "Executable" means Covered Code in any form other than Source -Code. - - 1.6. "Initial Developer" means the individual or entity identified as -the Initial Developer in the Source Code notice required by Exhibit A. - - 1.7. "Larger Work" means a work which combines Covered Code or -portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum -extent possible, whether at the time of the initial grant or subsequently -acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the -substance or structure of either the Original Code or any previous -Modifications. When Covered Code is released as a series of files, a -Modification is: - A. Any addition to or deletion from the contents of a file -containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or -previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code -which is described in the Source Code notice required by Exhibit A as Original -Code, and which, at the time of its release under this License is not already -Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or -hereafter acquired, including without limitation, method, process, and -apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for -making modifications to it, including all modules it contains, plus any -associated interface definition files, scripts used to control compilation and -installation of an Executable, or source code differential comparisons against -either the Original Code or another well known, available Covered Code of the -Contributor's choice. The Source Code can be in a compressed or archival form, -provided the appropriate decompression or de-archiving software is widely -available for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity -exercising rights under, and complying with all of the terms of, this License -or a future version of this License issued under Section 6.1. For legal -entities, "You" includes any entity which controls, is controlled by, or is -under common control with You. For purposes of this definition, "control" -means (a) the power, direct or indirect, to cause the direction or management -of such entity, whether by contract or otherwise, or (b) ownership of more -than fifty percent (50%) of the outstanding shares or beneficial ownership of -such entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - The Initial Developer hereby grants You a world-wide, royalty-free, -non-exclusive license, subject to third party intellectual property claims: - (a) under intellectual property rights (other than patent or -trademark) Licensable by Initial Developer to use, reproduce, modify, display, -perform, sublicense and distribute the Original Code (or portions thereof) -with or without Modifications, and/or as part of a Larger Work; and - - (b) under Patents Claims infringed by the making, using or selling -of Original Code, to make, have made, use, practice, sell, and offer for sale, -and/or otherwise dispose of the Original Code (or portions thereof). - (c) the licenses granted in this Section 2.1(a) and -(b) are effective on the date Initial Developer first distributes Original -Code under the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is -granted: 1) for code that You delete from the Original Code; 2) separate from -the Original Code; or 3) for infringements caused by: i) the modification of -the Original Code or ii) the combination of the Original Code with other -software or devices. - - 2.2. Contributor Grant. - Subject to third party intellectual property claims, each Contributor -hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or -trademark) Licensable by Contributor, to use, reproduce, modify, display, -perform, sublicense and distribute the Modifications created by such -Contributor (or portions thereof) either on an unmodified basis, with other -Modifications, as Covered Code and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, using, or selling -of Modifications made by that Contributor either alone and/or in combination -with its Contributor Version (or portions of such combination), to make, use, -sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications -made by that Contributor (or portions thereof); and 2) the combination of -Modifications made by that Contributor with its Contributor Version (or -portions of such combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are -effective on the date Contributor first makes Commercial Use of the Covered -Code. - - (d) Notwithstanding Section 2.2(b) above, no patent license is -granted: 1) for any code that Contributor has deleted from the Contributor -Version; 2) separate from the Contributor Version; 3) for infringements -caused by: i) third party modifications of Contributor Version or ii) the -combination of Modifications made by that Contributor with other software -(except as part of the Contributor Version) or other devices; or 4) under -Patent Claims infringed by Covered Code in the absence of Modifications made -by that Contributor. - - -3. Distribution Obligations. - - 3.1. Application of License. - The Modifications which You create or to which You contribute are -governed by the terms of this License, including without limitation Section -2.2. The Source Code version of Covered Code may be distributed only under the -terms of this License or a future version of this License released under -Section 6.1, and You must include a copy of this License with every copy of -the Source Code You distribute. You may not offer or impose any terms on any -Source Code version that alters or restricts the applicable version of this -License or the recipients' rights hereunder. However, You may include an -additional document offering the additional rights described in Section 3.5. - - 3.2. Availability of Source Code. - Any Modification which You create or to which You contribute must be -made available in Source Code form under the terms of this License either on -the same media as an Executable version or via an accepted Electronic -Distribution Mechanism to anyone to whom you made an Executable version -available; and if made available via Electronic Distribution Mechanism, must -remain available for at least twelve (12) months after the date it initially -became available, or at least six (6) months after a subsequent version of -that particular Modification has been made available to such recipients. You -are responsible for ensuring that the Source Code version remains available -even if the Electronic Distribution Mechanism is maintained by a third party. - - 3.3. Description of Modifications. - You must cause all Covered Code to which You contribute to contain a -file documenting the changes You made to create that Covered Code and the date -of any change. You must include a prominent statement that the Modification is -derived, directly or indirectly, from Original Code provided by the Initial -Developer and including the name of the Initial Developer in (a) the Source -Code, and (b) in any notice in an Executable version or related documentation -in which You describe the origin or ownership of the Covered Code. - - 3.4. Intellectual Property Matters - (a) Third Party Claims. - If Contributor has knowledge that a license under a third party's -intellectual property rights is required to exercise the rights granted by -such Contributor under Sections 2.1 or 2.2, Contributor must include a text -file with the Source Code distribution titled "LEGAL" which describes the -claim and the party making the claim in sufficient detail that a recipient -will know whom to contact. If Contributor obtains such knowledge after the -Modification is made available as described in Section 3.2, Contributor shall -promptly modify the LEGAL file in all copies Contributor makes available -thereafter and shall take other steps (such as notifying appropriate mailing -lists or newsgroups) reasonably calculated to inform those who received the -Covered Code that new knowledge has been obtained. - - (b) Contributor APIs. - If Contributor's Modifications include an application programming -interface and Contributor has knowledge of patent licenses which are -reasonably necessary to implement that API, Contributor must also include this -information in the LEGAL file. - - (c) Representations. - Contributor represents that, except as disclosed pursuant to -Section 3.4(a) above, Contributor believes that Contributor's Modifications -are Contributor's original creation(s) and/or Contributor has sufficient -rights to grant the rights conveyed by this License. - - - 3.5. Required Notices. - You must duplicate the notice in Exhibit A in each file of the Source -Code. If it is not possible to put such notice in a particular Source Code -file due to its structure, then You must include such notice in a location -(such as a relevant directory) where a user would be likely to look for such a -notice. If You created one or more Modification(s) You may add your name as a -Contributor to the notice described in Exhibit A. You must also duplicate -this License in any documentation for the Source Code where You describe -recipients' rights or ownership rights relating to Covered Code. You may -choose to offer, and to charge a fee for, warranty, support, indemnity or -liability obligations to one or more recipients of Covered Code. However, You -may do so only on Your own behalf, and not on behalf of the Initial Developer -or any Contributor. You must make it absolutely clear than any such warranty, -support, indemnity or liability obligation is offered by You alone, and You -hereby agree to indemnify the Initial Developer and every Contributor for any -liability incurred by the Initial Developer or such Contributor as a result of -warranty, support, indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - You may distribute Covered Code in Executable form only if the -requirements of Section 3.1-3.5 have been met for that Covered Code, and if -You include a notice stating that the Source Code version of the Covered Code -is available under the terms of this License, including a description of how -and where You have fulfilled the obligations of Section 3.2. The notice must -be conspicuously included in any notice in an Executable version, related -documentation or collateral in which You describe recipients' rights relating -to the Covered Code. You may distribute the Executable version of Covered Code -or ownership rights under a license of Your choice, which may contain terms -different from this License, provided that You are in compliance with the -terms of this License and that the license for the Executable version does not -attempt to limit or alter the recipient's rights in the Source Code version -from the rights set forth in this License. If You distribute the Executable -version under a different license You must make it absolutely clear that any -terms which differ from this License are offered by You alone, not by the -Initial Developer or any Contributor. You hereby agree to indemnify the -Initial Developer and every Contributor for any liability incurred by the -Initial Developer or such Contributor as a result of any such terms You offer. - - 3.7. Larger Works. - You may create a Larger Work by combining Covered Code with other code -not governed by the terms of this License and distribute the Larger Work as a -single product. In such a case, You must make sure the requirements of this -License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Code due to statute, -judicial order, or regulation then You must: (a) comply with the terms of this -License to the maximum extent possible; and (b) describe the limitations and -the code they affect. Such description must be included in the LEGAL file -described in Section 3.4 and must be included with all distributions of the -Source Code. Except to the extent prohibited by statute or regulation, such -description must be sufficiently detailed for a recipient of ordinary skill to -be able to understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has attached -the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - Netscape Communications Corporation ("Netscape") may publish revised -and/or new versions of the License from time to time. Each version will be -given a distinguishing version number. - - 6.2. Effect of New Versions. - Once Covered Code has been published under a particular version of the -License, You may always continue to use it under the terms of that version. -You may also choose to use such Covered Code under the terms of any subsequent -version of the License published by Netscape. No one other than Netscape has -the right to modify the terms applicable to Covered Code created under this -License. - - 6.3. Derivative Works. - If You create or use a modified version of this License (which you may -only do in order to apply it to code which is not already Covered Code -governed by this License), You must (a) rename Your license so that the -phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or -any confusingly similar phrase do not appear in your license (except to note -that your license differs from this License) and (b) otherwise make it clear -that Your version of the license contains terms which differ from the Mozilla -Public License and Netscape Public License. (Filling in the name of the -Initial Developer, Original Code or Contributor in the notice described in -Exhibit A shall not of themselves be deemed to be modifications of this -License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT -LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, -FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE -QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED -CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY -OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR -CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS -LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS -DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate -automatically if You fail to comply with terms herein and fail to cure such -breach within 30 days of becoming aware of the breach. All sublicenses to the -Covered Code which are properly granted shall survive any termination of this -License. Provisions which, by their nature, must remain in effect beyond the -termination of this License shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement -claim (excluding declatory judgment actions) against Initial Developer or a -Contributor (the Initial Developer or Contributor against whom You file such -action is referred to as "Participant") alleging that: - - (a) such Participant's Contributor Version directly or indirectly -infringes any patent, then any and all rights granted by such Participant to -You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice -from Participant terminate prospectively, unless if within 60 days after -receipt of notice You either: (i) agree in writing to pay Participant a -mutually agreeable reasonable royalty for Your past and future use of -Modifications made by such Participant, or (ii) withdraw Your litigation claim -with respect to the Contributor Version against such Participant. If within -60 days of notice, a reasonable royalty and payment arrangement are not -mutually agreed upon in writing by the parties or the litigation claim is not -withdrawn, the rights granted by Participant to You under Sections 2.1 and/or -2.2 automatically terminate at the expiration of the 60 day notice period -specified above. - - (b) any software, hardware, or device, other than such Participant's -Contributor Version, directly or indirectly infringes any patent, then any -rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are -revoked effective as of the date You first made, used, sold, distributed, or -had made, Modifications made by that Participant. - - 8.3. If You assert a patent infringement claim against Participant -alleging that such Participant's Contributor Version directly or indirectly -infringes any patent where such claim is resolved (such as by license or -settlement) prior to the initiation of patent infringement litigation, then -the reasonable value of the licenses granted by such Participant under -Sections 2.1 or 2.2 shall be taken into account in determining the amount or -value of any payment or license. - - 8.4. In the event of termination under Sections 8.1 or 8.2 above, all -end user license agreements (excluding distributors and resellers) which have -been validly granted by You or any distributor hereunder prior to termination -shall survive termination. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT -(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL -DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY -SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, -SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, -WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER -FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, -EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH -DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH -OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT -APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE -EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS -EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in 48 -C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and -"commercial computer software documentation," as such terms are used in 48 -C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. -227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users -acquire Covered Code with only those rights set forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject matter -hereof. If any provision of this License is held to be unenforceable, such -provision shall be reformed only to the extent necessary to make it -enforceable. This License shall be governed by California law provisions -(except to the extent applicable law, if any, provides otherwise), excluding -its conflict-of-law provisions. With respect to disputes in which at least one -party is a citizen of, or an entity chartered or registered to do business in -the United States of America, any litigation relating to this License shall be -subject to the jurisdiction of the Federal Courts of the Northern District of -California, with venue lying in Santa Clara County, California, with the -losing party responsible for costs, including without limitation, court costs -and reasonable attorneys' fees and expenses. The application of the United -Nations Convention on Contracts for the International Sale of Goods is -expressly excluded. Any law or regulation which provides that the language of -a contract shall be construed against the drafter shall not apply to this -License. - -12. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is -responsible for claims and damages arising, directly or indirectly, out of its -utilization of rights under this License and You agree to work with Initial -Developer and Contributors to distribute such responsibility on an equitable -basis. Nothing herein is intended or shall be deemed to constitute any -admission of liability. - -13. MULTIPLE-LICENSED CODE. - - Initial Developer may designate portions of the Covered Code as -Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits -you to utilize portions of the Covered Code under Your choice of the MPL or -the alternative licenses, if any, specified by the Initial Developer in the -file described in Exhibit A. - - -EXHIBIT A -Mozilla Public License. - - ``The contents of this file are subject to the Mozilla Public License -Version 1.1 (the "License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF - ANY KIND, either express or implied. See the License for the specific -language governing rights and - limitations under the License. - - The Original Code is ______________________________________. - - The Initial Developer of the Original Code is ________________________. -Portions created by - ______________________ are Copyright (C) ______ -_______________________. All Rights - Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the terms of -the _____ license (the [___] License), in which case the provisions of -[______] License are applicable instead of those above. If you wish to allow -use of your version of this file only under the terms of the [____] License -and not to allow others to use your version of this file under the MPL, -indicate your decision by deleting the provisions above and replace them -with the notice and other provisions required by the [___] License. If you do -not delete the provisions above, a recipient may use your version of this file -under either the MPL or the [___] License." - - [NOTE: The text of this Exhibit A may differ slightly from the text of -the notices in the Source Code files of the Original Code. You should use the -text of this Exhibit A rather than the text found in the Original Code Source -Code for Your Modifications.] - - -=============================================================================== - -For the JAX-WS Reference Implementation component: - -COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 - - - 1. Definitions. - - 1.1. "Contributor" means each individual or entity that - creates or contributes to the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the - Original Software, prior Modifications used by a - Contributor (if any), and the Modifications made by that - particular Contributor. - - 1.3. "Covered Software" means (a) the Original Software, or - (b) Modifications, or (c) the combination of files - containing Original Software with files containing - Modifications, in each case including portions thereof. - - 1.4. "Executable" means the Covered Software in any form - other than Source Code. - - 1.5. "Initial Developer" means the individual or entity - that first makes Original Software available under this - License. - - 1.6. "Larger Work" means a work which combines Covered - Software or portions thereof with code not governed by the - terms of this License. - - 1.7. "License" means this document. - - 1.8. "Licensable" means having the right to grant, to the - maximum extent possible, whether at the time of the initial - grant or subsequently acquired, any and all of the rights - conveyed herein. - - 1.9. "Modifications" means the Source Code and Executable - form of any of the following: - - A. Any file that results from an addition to, - deletion from or modification of the contents of a - file containing Original Software or previous - Modifications; - - B. Any new file that contains any part of the - Original Software or previous Modification; or - - C. Any new file that is contributed or otherwise made - available under the terms of this License. - - 1.10. "Original Software" means the Source Code and - Executable form of computer software code that is - originally released under this License. - - 1.11. "Patent Claims" means any patent claim(s), now owned - or hereafter acquired, including without limitation, - method, process, and apparatus claims, in any patent - Licensable by grantor. - - 1.12. "Source Code" means (a) the common form of computer - software code in which modifications are made and (b) - associated documentation included in or with such code. - - 1.13. "You" (or "Your") means an individual or a legal - entity exercising rights under, and complying with all of - the terms of, this License. For legal entities, "You" - includes any entity which controls, is controlled by, or is - under common control with You. For purposes of this - definition, "control" means (a) the power, direct or - indirect, to cause the direction or management of such - entity, whether by contract or otherwise, or (b) ownership - of more than fifty percent (50%) of the outstanding shares - or beneficial ownership of such entity. - - 2. License Grants. - - 2.1. The Initial Developer Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, the - Initial Developer hereby grants You a world-wide, - royalty-free, non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Initial Developer, - to use, reproduce, modify, display, perform, - sublicense and distribute the Original Software (or - portions thereof), with or without Modifications, - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, - using or selling of Original Software, to make, have - made, use, practice, sell, and offer for sale, and/or - otherwise dispose of the Original Software (or - portions thereof). - - (c) The licenses granted in Sections 2.1(a) and (b) - are effective on the date Initial Developer first - distributes or otherwise makes the Original Software - available to a third party under the terms of this - License. - - (d) Notwithstanding Section 2.1(b) above, no patent - license is granted: (1) for code that You delete from - the Original Software, or (2) for infringements - caused by: (i) the modification of the Original - Software, or (ii) the combination of the Original - Software with other software or devices. - - 2.2. Contributor Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, each - Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Contributor to - use, reproduce, modify, display, perform, sublicense - and distribute the Modifications created by such - Contributor (or portions thereof), either on an - unmodified basis, with other Modifications, as - Covered Software and/or as part of a Larger Work; and - - - (b) under Patent Claims infringed by the making, - using, or selling of Modifications made by that - Contributor either alone and/or in combination with - its Contributor Version (or portions of such - combination), to make, use, sell, offer for sale, - have made, and/or otherwise dispose of: (1) - Modifications made by that Contributor (or portions - thereof); and (2) the combination of Modifications - made by that Contributor with its Contributor Version - (or portions of such combination). - - (c) The licenses granted in Sections 2.2(a) and - 2.2(b) are effective on the date Contributor first - distributes or otherwise makes the Modifications - available to a third party. - - (d) Notwithstanding Section 2.2(b) above, no patent - license is granted: (1) for any code that Contributor - has deleted from the Contributor Version; (2) for - infringements caused by: (i) third party - modifications of Contributor Version, or (ii) the - combination of Modifications made by that Contributor - with other software (except as part of the - Contributor Version) or other devices; or (3) under - Patent Claims infringed by Covered Software in the - absence of Modifications made by that Contributor. - - 3. Distribution Obligations. - - 3.1. Availability of Source Code. - - Any Covered Software that You distribute or otherwise make - available in Executable form must also be made available in - Source Code form and that Source Code form must be - distributed only under the terms of this License. You must - include a copy of this License with every copy of the - Source Code form of the Covered Software You distribute or - otherwise make available. You must inform recipients of any - such Covered Software in Executable form as to how they can - obtain such Covered Software in Source Code form in a - reasonable manner on or through a medium customarily used - for software exchange. - - 3.2. Modifications. - - The Modifications that You create or to which You - contribute are governed by the terms of this License. You - represent that You believe Your Modifications are Your - original creation(s) and/or You have sufficient rights to - grant the rights conveyed by this License. - - 3.3. Required Notices. - - You must include a notice in each of Your Modifications - that identifies You as the Contributor of the Modification. - You may not remove or alter any copyright, patent or - trademark notices contained within the Covered Software, or - any notices of licensing or any descriptive text giving - attribution to any Contributor or the Initial Developer. - - 3.4. Application of Additional Terms. - - You may not offer or impose any terms on any Covered - Software in Source Code form that alters or restricts the - applicable version of this License or the recipients' - rights hereunder. You may choose to offer, and to charge a - fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Software. - However, you may do so only on Your own behalf, and not on - behalf of the Initial Developer or any Contributor. You - must make it absolutely clear that any such warranty, - support, indemnity or liability obligation is offered by - You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred - by the Initial Developer or such Contributor as a result of - warranty, support, indemnity or liability terms You offer. - - - 3.5. Distribution of Executable Versions. - - You may distribute the Executable form of the Covered - Software under the terms of this License or under the terms - of a license of Your choice, which may contain terms - different from this License, provided that You are in - compliance with the terms of this License and that the - license for the Executable form does not attempt to limit - or alter the recipient's rights in the Source Code form - from the rights set forth in this License. If You - distribute the Covered Software in Executable form under a - different license, You must make it absolutely clear that - any terms which differ from this License are offered by You - alone, not by the Initial Developer or Contributor. You - hereby agree to indemnify the Initial Developer and every - Contributor for any liability incurred by the Initial - Developer or such Contributor as a result of any such terms - You offer. - - 3.6. Larger Works. - - You may create a Larger Work by combining Covered Software - with other code not governed by the terms of this License - and distribute the Larger Work as a single product. In such - a case, You must make sure the requirements of this License - are fulfilled for the Covered Software. - - 4. Versions of the License. - - 4.1. New Versions. - - Sun Microsystems, Inc. is the initial license steward and - may publish revised and/or new versions of this License - from time to time. Each version will be given a - distinguishing version number. Except as provided in - Section 4.3, no one other than the license steward has the - right to modify this License. - - 4.2. Effect of New Versions. - - You may always continue to use, distribute or otherwise - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. If the Initial Developer includes a - notice in the Original Software prohibiting it from being - distributed or otherwise made available under any - subsequent version of the License, You must distribute and - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. Otherwise, You may also choose to - use, distribute or otherwise make the Covered Software - available under the terms of any subsequent version of the - License published by the license steward. - - 4.3. Modified Versions. - - When You are an Initial Developer and You want to create a - new license for Your Original Software, You may create and - use a modified version of this License if You: (a) rename - the license and remove any references to the name of the - license steward (except to note that the license differs - from this License); and (b) otherwise make it clear that - the license contains terms which differ from this License. - - - 5. DISCLAIMER OF WARRANTY. - - COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" - BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, - INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED - SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR - PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND - PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY - COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE - INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF - ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF - WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS - DISCLAIMER. - - 6. TERMINATION. - - 6.1. This License and the rights granted hereunder will - terminate automatically if You fail to comply with terms - herein and fail to cure such breach within 30 days of - becoming aware of the breach. Provisions which, by their - nature, must remain in effect beyond the termination of - this License shall survive. - - 6.2. If You assert a patent infringement claim (excluding - declaratory judgment actions) against Initial Developer or - a Contributor (the Initial Developer or Contributor against - whom You assert such claim is referred to as "Participant") - alleging that the Participant Software (meaning the - Contributor Version where the Participant is a Contributor - or the Original Software where the Participant is the - Initial Developer) directly or indirectly infringes any - patent, then any and all rights granted directly or - indirectly to You by such Participant, the Initial - Developer (if the Initial Developer is not the Participant) - and all Contributors under Sections 2.1 and/or 2.2 of this - License shall, upon 60 days notice from Participant - terminate prospectively and automatically at the expiration - of such 60 day notice period, unless if within such 60 day - period You withdraw Your claim with respect to the - Participant Software against such Participant either - unilaterally or pursuant to a written agreement with - Participant. - - 6.3. In the event of termination under Sections 6.1 or 6.2 - above, all end user licenses that have been validly granted - by You or any distributor hereunder prior to termination - (excluding licenses granted to You by any distributor) - shall survive termination. - - 7. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE - INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF - COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE - LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR - CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT - LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK - STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL - INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT - APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO - NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR - CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT - APPLY TO YOU. - - 8. U.S. GOVERNMENT END USERS. - - The Covered Software is a "commercial item," as that term is - defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial - computer software" (as that term is defined at 48 C.F.R. - 252.227-7014(a)(1)) and "commercial computer software - documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. - 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 - through 227.7202-4 (June 1995), all U.S. Government End Users - acquire Covered Software with only those rights set forth herein. - This U.S. Government Rights clause is in lieu of, and supersedes, - any other FAR, DFAR, or other clause or provision that addresses - Government rights in computer software under this License. - - 9. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the - extent necessary to make it enforceable. This License shall be - governed by the law of the jurisdiction specified in a notice - contained within the Original Software (except to the extent - applicable law, if any, provides otherwise), excluding such - jurisdiction's conflict-of-law provisions. Any litigation - relating to this License shall be subject to the jurisdiction of - the courts located in the jurisdiction and venue specified in a - notice contained within the Original Software, with the losing - party responsible for costs, including, without limitation, court - costs and reasonable attorneys' fees and expenses. The - application of the United Nations Convention on Contracts for the - International Sale of Goods is expressly excluded. Any law or - regulation which provides that the language of a contract shall - be construed against the drafter shall not apply to this License. - You agree that You alone are responsible for compliance with the - United States export administration regulations (and the export - control laws and regulation of any other countries) when You use, - distribute or otherwise make available any Covered Software. - - 10. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or - indirectly, out of its utilization of rights under this License - and You agree to work with Initial Developer and Contributors to - distribute such responsibility on an equitable basis. Nothing - herein is intended or shall be deemed to constitute any admission - of liability. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/META-INF/NOTICE b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/META-INF/NOTICE deleted file mode 100644 index d48810c0ec..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/META-INF/NOTICE +++ /dev/null @@ -1,18 +0,0 @@ -========================================================================= -== NOTICE file corresponding to the section 4 d of == -== the Apache License, Version 2.0, == -== in this case for the Apache Tuscany distribution. == -========================================================================= - -This product includes software developed by the Apache Software Foundation -(http://www.apache.org/). - -This product also includes software developed by: -- the Eclipse Modeling Framework project (http://www.eclipse.org/emf/) -- the Celtix project (http://celtix.objectweb.org/) -- the Mozilla Rhino project (http://www.mozilla.org/rhino/) -- the GlassFish JAX-WS project (https://jax-ws.dev.java.net/) - -Please read the LICENSE.txt file present in the root directory of this -distribution. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/META-INF/README.txt b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/META-INF/README.txt deleted file mode 100644 index 9b26d1690a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/META-INF/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -Apache Tuscany M1 build (May, 2006) -=================================== - -http://incubator.apache.org/tuscany/ - -Tuscany is an effort undergoing incubation at the Apache Software Foundation -(ASF), sponsored by the Web Services PMC. - -Incubation is required of all newly accepted projects until a further review -indicates that the infrastructure, communications, and decision making process -have stabilized in a manner consistent with other successful ASF projects. - -While incubation status is not necessarily a reflection of the completeness or -stability of the code, it does indicate that the project has yet to be fully -endorsed by the ASF. - - -Support -------- - -Any problem with this release can be reported to the Tuscany mailing list -or in the JIRA issue tracker. - -Mailing list subscription: - tuscany-dev-subscribe@ws.apache.org - -Jira: - http://issues.apache.org/jira/browse/Tuscany - - -Thank you for using Tuscany! - - -The Tuscany Team. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/helloworldwsclient.composite b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/helloworldwsclient.composite deleted file mode 100644 index 07f930ba37..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/helloworldwsclient.composite +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/logging.properties b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/logging.properties deleted file mode 100644 index 3dca310cdb..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/logging.properties +++ /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. -# -# $Rev$ $Date$ -# - -# Custom logging configuration for Tuscany samples -# By default, only INFO level logging is enabled and ALL messages get sent to the console -# For more messages from the runtime, uncomment specific settings at the end of this file -handlers = java.util.logging.ConsoleHandler -java.util.logging.ConsoleHandler.level = ALL -java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter -.level=INFO - -# Uncomment the next setting to get all Tuscany messages (this will be a lot) -#org.apache.tuscany.level=FINEST diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/wsdl/helloworld.wsdl b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/wsdl/helloworld.wsdl deleted file mode 100644 index 0b95fbd14f..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/main/resources/wsdl/helloworld.wsdl +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/test/java/helloworld/HelloWorldClientTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/test/java/helloworld/HelloWorldClientTestCase.java deleted file mode 100644 index ef45608d69..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/test/java/helloworld/HelloWorldClientTestCase.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 helloworld; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.api.SCARuntime; -import org.apache.tuscany.core.test.SCATestCaseRunner; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * Test case for helloworld web service client - */ -public class HelloWorldClientTestCase { - - private HelloWorldService helloWorldService; - - private SCATestCaseRunner server; - - @Before - public void startClient() throws Exception { - SCARuntime.start("helloworldwsclient.composite"); - - CompositeContext compositeContext = CurrentCompositeContext.getContext(); - helloWorldService = compositeContext.locateService(HelloWorldService.class, "HelloWorldServiceComponent"); - - server = new SCATestCaseRunner(HelloWorldServerTest.class); - server.before(); - } - - @Test - public void testWSClient() throws Exception { - String msg = helloWorldService.getGreetings("Smith"); - Assert.assertEquals("Hello Smith", msg); - } - - @After - public void stopClient() throws Exception { - server.after(); - SCARuntime.stop(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/test/java/helloworld/HelloWorldServerTest.java b/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/test/java/helloworld/HelloWorldServerTest.java deleted file mode 100644 index 647398281b..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/helloworld-wsclient/src/test/java/helloworld/HelloWorldServerTest.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 helloworld; - -import java.io.IOException; -import java.net.Socket; - -import org.apache.tuscany.api.SCARuntime; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -public class HelloWorldServerTest { - - @Before - public void startServer() throws Exception { - SCARuntime.start("helloworldws.composite"); - } - - @Test - public void testPing() throws IOException { - new Socket("127.0.0.1", 8080); - } - - @After - public void stopServer() throws Exception { - SCARuntime.stop(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/pom.xml deleted file mode 100644 index df0bfcb34b..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/pom.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - org.apache.tuscany.samples.sca - parent - 0.1-integration-incubating-SNAPSHOT - - 4.0.0 - tuscany-sample-loanapplication-ws - war - Tuscany Loan App Conversation Web Service Sample - A sample implementation of a loan application conversation web service. - - - - org.osoa - sca-api-r1.0 - - - org.apache.tuscany.sca.runtime.webapp - webapp-api - ${scaImplVersion} - runtime - - - - - ${artifactId} - - - org.apache.tuscany.sca.runtime.webapp - tuscany-war-plugin - ${scaImplVersion} - - - tuscany-war - - tuscany-war - - - - - - - false - - - - - org.apache.tuscany.sca.services.bindings - axis2 - ${scaImplVersion} - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/java/loanappconversation/LoanApplication.java b/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/java/loanappconversation/LoanApplication.java deleted file mode 100644 index 68564f1376..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/java/loanappconversation/LoanApplication.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 loanappconversation; - -public class LoanApplication { - - private String customerName; - private float loanAmount; - - public LoanApplication(String customerName, float loanAmount) { - this.customerName = customerName; - this.loanAmount = loanAmount; - } - - public String toString() { - return "[Customer: " + customerName + ", loan amount: " - + loanAmount + "]"; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/java/loanappconversation/LoanService.java b/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/java/loanappconversation/LoanService.java deleted file mode 100644 index 4156c2e72e..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/java/loanappconversation/LoanService.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 loanappconversation; - -import org.osoa.sca.annotations.AllowsPassByReference; -import org.osoa.sca.annotations.EndConversation; -import org.osoa.sca.annotations.OneWay; -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Scope; - -@Scope("CONVERSATION") -@Remotable -@AllowsPassByReference // bypasses the PassByValueIntercept error. -public interface LoanService { - //prim void apply(LoanApplication application); - void apply(String customerName, float loanAmount); - void lockCurrentRate(int termInYears); - @OneWay - void cancelApplication(); - String getLoanStatus(); - String display(); - @EndsConversation - void close(); -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/java/loanappconversation/LoanServiceImpl.java b/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/java/loanappconversation/LoanServiceImpl.java deleted file mode 100644 index c0c7d9a455..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/java/loanappconversation/LoanServiceImpl.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 loanappconversation; - -import org.osoa.sca.annotations.AllowsPassByReference; -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -@Scope("CONVERSATION") -@AllowsPassByReference // bypasses the PassByValueIntercept error. -@Remotable -@Service(LoanService.class) -public class LoanServiceImpl implements LoanService { - - private LoanApplication application; - private String status; - private int termLocked = 0; - - private void apply(LoanApplication application) { - this.application = application; - status = "open"; - } - //prim - public void apply(String customerName, float loanAmount) { - apply(new LoanApplication(customerName, loanAmount)); - - } - - public void lockCurrentRate(int termInYears) { - termLocked = termInYears; - status = "locked"; - } - - public void cancelApplication() { - status = "cancelled"; - } - - public String getLoanStatus() { - return status; - } - - public String display() { - return "Loan application: " + application + ", term: " - + termLocked + ", status: " + status; - } - - public void close() { - this.application = null; - this.status = "closed"; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/resources/wsdl/loanappconversation.wsdl b/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/resources/wsdl/loanappconversation.wsdl deleted file mode 100644 index 6822aa8c5d..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/resources/wsdl/loanappconversation.wsdl +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/webapp/WEB-INF/default.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/webapp/WEB-INF/default.scdl deleted file mode 100644 index a35af74047..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/webapp/WEB-INF/default.scdl +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - LoanServiceComponent - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/webapp/WEB-INF/web.xml b/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 6449f9d232..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-ws/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - A sample implementation of a loan application conversation web service. - - - - tuscany.online - true - - - - - org.apache.tuscany.runtime.webapp.TuscanyContextListener - - - - TuscanyServlet - Tuscany Servlet - org.apache.tuscany.runtime.webapp.TuscanyServlet - - - - TuscanyServlet - /* - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/pom.xml deleted file mode 100644 index 7ba7dbbf6e..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/pom.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - org.apache.tuscany.samples.sca - parent - 0.1-integration-incubating-SNAPSHOT - - 4.0.0 - tuscany-sample-loanapplication-wsclient - jar - Tuscany Loan App Conversation WS Client - A sample implementation conversation WS client. - - - - org.apache.tuscany.sca.kernel - tuscany-api - 0.1-integration-incubating-SNAPSHOT - compile - - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - - org.apache.tuscany.sca.services.bindings - axis2 - 0.1-integration-incubating-SNAPSHOT - runtime - - - - junit - junit - 4.2 - test - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - loanappconversation.LoanAppConversationClient - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.3 - - true - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanAppConversationClient.java b/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanAppConversationClient.java deleted file mode 100644 index 6272821083..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanAppConversationClient.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 loanappconversation; - -//import org.apache.tuscany.spi.component.TargetNotFoundException; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -public class LoanAppConversationClient { - - public static void main(String[] args) throws Exception { - // Locate the MyClient component and invoke it - CompositeContext context = CurrentCompositeContext.getContext(); - - LoanClient loanClient = context.locateService(LoanClient.class, "LoanClientComponent"); - assert loanClient != null : "loanClient was not resolved!"; - loanClient.applyForLoan("John Doe", 1000.0f); - assert loanClient.isOpen() : "Failed loan not in approved state"; - System.out.println("Loan opened: " + loanClient.displayLoan()); - - - loanClient.cancelLoan(); - System.out.println("Sleeping to let cancel complete ..."); - Thread.sleep(5000); - - assert loanClient.isCancelled() : "Failed to cancel loan"; - System.out.println("Cancelled: " + loanClient.displayLoan()); - - loanClient.closeLoan(); - - System.out.println("Closing for a second time!"); - try{ - loanClient.closeLoan(); - assert false : "close for second time incorrectly succeed"; - System.out.println("Failed: close for second time incorrectly succeed."); - }catch(Exception e){ - System.out.println("Second close successfully produced: '" + e.getClass().getName() +"'"); - } - - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanApplication.java b/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanApplication.java deleted file mode 100644 index 68564f1376..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanApplication.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 loanappconversation; - -public class LoanApplication { - - private String customerName; - private float loanAmount; - - public LoanApplication(String customerName, float loanAmount) { - this.customerName = customerName; - this.loanAmount = loanAmount; - } - - public String toString() { - return "[Customer: " + customerName + ", loan amount: " - + loanAmount + "]"; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanClient.java b/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanClient.java deleted file mode 100644 index 2de67508f6..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanClient.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 loanappconversation; - -public interface LoanClient { - - void applyForLoan(String customerName, float amount); - boolean isApproved(); - boolean isOpen(); - boolean isCancelled(); - String displayLoan(); - void cancelLoan(); - void closeLoan(); -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanClientImpl.java b/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanClientImpl.java deleted file mode 100644 index 0869e1591a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanClientImpl.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 loanappconversation; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Scope; - -@Scope("COMPOSITE") -public class LoanClientImpl implements LoanClient { - - private LoanService loanService; - - public boolean isApproved() { - return "approved".equals(loanService.getLoanStatus()); - } - - public boolean isOpen() { - return "open".equals(loanService.getLoanStatus()); - - } - - public boolean isCancelled() { - return "cancelled".equals(loanService.getLoanStatus()); - } - - @Reference - public void setLoanService(LoanService loanService) { - this.loanService = loanService; - } - - public void applyForLoan(String customerName, float amount) { - //prim loanService.apply(new LoanApplication(customerName, amount)); - loanService.apply(customerName, amount); - } - - public String displayLoan() { - return loanService.display(); - } - - public void cancelLoan() { - loanService.cancelApplication(); - } - - public void closeLoan() { - loanService.close(); - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanService.java b/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanService.java deleted file mode 100644 index f516825229..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/java/loanappconversation/LoanService.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 loanappconversation; - -import org.osoa.sca.annotations.AllowsPassByReference; -import org.osoa.sca.annotations.EndsConversation; -import org.osoa.sca.annotations.OneWay; -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Scope; - -@AllowsPassByReference // bypasses the PassByValueIntercept error. -@Scope("CONVERSATION") -@Remotable -public interface LoanService { - //prim void apply(LoanApplication application); - void apply(String customerName, float loanAmount); - void lockCurrentRate(int termInYears); - @OneWay - void cancelApplication(); - String getLoanStatus(); - String display(); - @EndsConversation - void close(); -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/resources/META-INF/sca/default.scdl b/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/resources/META-INF/sca/default.scdl deleted file mode 100644 index 7d1d13eb54..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/resources/META-INF/sca/default.scdl +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - LoanService - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/resources/wsdl/loanappconversation.wsdl b/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/resources/wsdl/loanappconversation.wsdl deleted file mode 100644 index 6822aa8c5d..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/main/resources/wsdl/loanappconversation.wsdl +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/test/java/loanappconversation/LoanAppConversationTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/test/java/loanappconversation/LoanAppConversationTestCase.java deleted file mode 100644 index 5ab428cf27..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/loanapplication-wsclient/src/test/java/loanappconversation/LoanAppConversationTestCase.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 loanappconversation; - -import org.apache.tuscany.spi.component.TargetNotFoundException; -import org.apache.tuscany.test.SCATestCase; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -public class LoanAppConversationTestCase extends SCATestCase { - - private LoanClient loanClient; - - protected void setUp() throws Exception { - try { - setApplicationSCDL(LoanClient.class, "META-INF/sca/default.scdl"); - super.setUp(); - - CompositeContext context = CurrentCompositeContext.getContext(); - loanClient = context.locateService(LoanClient.class, "LoanClientComponent"); - } catch(Throwable e) { - e.printStackTrace(); - } - } - - public void test() throws Exception { - try { - loanClient.applyForLoan("John Doe", 1000.0f); - System.out.println("Applied: " + loanClient.displayLoan()); - System.out.println("Loan approved: " + loanClient.isApproved()); - loanClient.cancelLoan(); - System.out.println("Sleeping to let cancel complete ..."); - Thread.sleep(500); - System.out.println("Cancelled: " + loanClient.displayLoan()); - loanClient.closeLoan(); - try { - System.out.println("Trying to use the closed loan in the ended conversation ..."); - System.out.println("Closed: " + loanClient.displayLoan()); - fail("Target should not be found"); - } catch(Exception e) { - System.out.println("Target not found as expected"); - } - } catch(Throwable e) { - e.printStackTrace(); - } - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/samples/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/samples/pom.xml deleted file mode 100644 index 4cf1a72f07..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/samples/pom.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - org.apache.tuscany.sca.extensions.axis2 - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - org.apache.tuscany.sca.extensions.axis2.samples - parent - pom - Tuscany Samples for the Axis2 extension - - - - - apache.snapshots - Apache Snapshot Repository - http://people.apache.org/repo/m2-snapshot-repository - - false - - - true - - - - apache.incubator - Apache Incubator Repository - http://people.apache.org/repo/m2-incubating-repository/ - - true - - - false - - - - - - - stable - - true - - - helloworld-ws - helloworld-wsclient - helloworld-om-ws - helloworld-om-wsclient - - - - - integration - - helloworld-ws - helloworld-wsclient - helloworld-om-ws - helloworld-om-wsclient - helloworld-async-ws - helloworld-async-wsclient - - - - - unstable - - helloworld-ws - helloworld-wsclient - helloworld-om-ws - helloworld-om-wsclient - helloworld-async-ws - helloworld-async-wsclient - - - - - - - - - org.codehaus.mojo - dependency-maven-plugin - - - - org.apache.tuscany.distribution.sca - standalone - ${scaImplVersion} - bin - zip - - - ${project.build.directory}/distribution - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/pom.xml deleted file mode 100644 index c6f29fcea8..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/pom.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2.tools - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - tuscany-java2wsdl - Apache Tuscany Axis2 Java2WSDL Tool - Apache Tuscany Axis2 Java2WSDL Tool - - - - org.apache.tuscany.sdo - tuscany-sdo-impl - - - - stax - stax-api - - - - wsdl4j - wsdl4j - - - - org.apache.neethi - neethi - - - - org.apache.ws.commons.schema - XmlSchema - - - - org.apache.ws.commons.axiom - axiom-api - - - - xerces - xercesImpl - - - - org.apache.ws.commons.axiom - axiom-impl - - - - org.apache.axis2 - axis2-kernel - - - - org.apache.axis2 - axis2-java2wsdl - - - - org.apache.axis2 - axis2-codegen - - - - org.eclipse.emf - codegen - - - - org.eclipse.emf - codegen-ecore - - - - annogen - annogen - - - - commons-logging - commons-logging - - - - org.codehaus.woodstox - wstx-asl - - - - junit - junit - - - - - - - - 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-incubator-SNAPSHOT - - - generate-sdo - generate-test-sources - - ${basedir}/src/test/resources/CreditScoreDocLit.wsdl - org.example.creditscore.doclit - true - true - true - - - generate - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/GenerationParameters.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/GenerationParameters.java deleted file mode 100644 index 3cb699681c..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/GenerationParameters.java +++ /dev/null @@ -1,435 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.java2wsdl.generate; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.Map; - -import org.apache.ws.java2wsdl.Java2WSDLUtils; -import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption; - -/** - * This class encapsulates the parameters that effect the generation of the - * WSDL. For example they contain all user settings such as source class, - * target location etc. - * - */ -public class GenerationParameters implements TuscanyJava2WSDLConstants -{ - public static final String WSDL_FILENAME_SUFFIX = ".wsdl"; - public static final String XSD_IMPORT_DELIMITER = "[,]"; - - private Map cmdLineOptions = null; - private FileOutputStream outputFileStream = null; - private String sourceClassName = null; - - private ArrayList extraClasses; - private String attrFormDefault = null; - private String elementFormDefault = null; - private String targetNamespace = null; - private String targetNamespacePrefix = null; - private String schemaTargetNamespace = null; - private String schemaTargetNamespacePrefix = null; - private ClassLoader classLoader = null; - private String serviceName = null; - private String style = DOCUMENT; - private String use = LITERAL; - private String locationUri = DEFAULT_LOCATION_URL; - private Map schemaLocationMap = null; - - public GenerationParameters(Map cmdLineOptions) throws Exception - { - this.cmdLineOptions = cmdLineOptions; - loadParameters(); - } - - protected void loadParameters() throws Exception - { - initializeSourceClassName(); - resolveFileOutputStream(); - resolveClassLoader4InputClasspath(); - loadSchemaLocationMap(); - initializeOtherParams(); - } - - private Java2WSDLCommandLineOption loadOption(String shortOption, String longOption) { - //short option gets precedence - Java2WSDLCommandLineOption option = null; - if (longOption != null) { - option = (Java2WSDLCommandLineOption) cmdLineOptions.get(longOption); - if (option != null) { - return option; - } - } - if (shortOption != null) { - option = (Java2WSDLCommandLineOption) cmdLineOptions.get(shortOption); - } - - return option; - } - - protected void initializeSourceClassName() throws Exception - { - Java2WSDLCommandLineOption option = - loadOption(CLASSNAME_OPTION, CLASSNAME_OPTION_LONG); - sourceClassName = option == null ? null : option.getOptionValue(); - - if (sourceClassName == null || sourceClassName.equals("")) { - throw new Exception("class name must be present!"); - } - } - - /** - * @throws Exception - */ - protected void resolveFileOutputStream() throws Exception - { - File outputFolder; - Java2WSDLCommandLineOption option = loadOption(OUTPUT_LOCATION_OPTION, - OUTPUT_LOCATION_OPTION_LONG); - String outputFolderName = option == null ? System.getProperty("user.dir") : option.getOptionValue(); - - outputFolder = new File(outputFolderName); - if (!outputFolder.exists()) { - outputFolder.mkdirs(); - } else if (!outputFolder.isDirectory()) { - throw new Exception("The specified location " + outputFolderName + "is not a folder"); - } - - option = loadOption(OUTPUT_FILENAME_OPTION, - OUTPUT_FILENAME_OPTION_LONG); - String outputFileName = option == null ? null : option.getOptionValue(); - //derive a file name from the class name if the filename is not specified - if (outputFileName == null) - { - outputFileName = Java2WSDLUtils.getSimpleClassName(sourceClassName) + WSDL_FILENAME_SUFFIX; - } - - //first create a file in the given location - File outputFile = new File(outputFolder, outputFileName); - try - { - if (!outputFile.exists()) - { - outputFile.createNewFile(); - } - outputFileStream = new FileOutputStream(outputFile); - } - catch (IOException e) - { - throw new Exception(e); - } - } - - protected void addToSchemaLocationMap(String optionValue) throws Exception - { - //option value will be of the form [namespace, schemalocation] - //hence we take the two substrings starting after '[' and upto ',' and - //starting after ',' and upto ']' - getSchemaLocationMap().put(optionValue.substring(1, optionValue.indexOf(COMMA)), - optionValue.substring(optionValue.indexOf(COMMA) + 1, optionValue.length() - 1)); - - - } - - protected void loadSchemaLocationMap() throws Exception - { - Java2WSDLCommandLineOption option = loadOption(IMPORT_XSD_OPTION, IMPORT_XSD_OPTION_LONG); - - if (option != null) - { - ArrayList optionValues = option.getOptionValues(); - - for ( int count = 0 ; count < optionValues.size() ; ++count ) - { - addToSchemaLocationMap(((String)optionValues.get(count)).trim()); - } - } - } - - protected void resolveClassLoader4InputClasspath() throws Exception - { - Java2WSDLCommandLineOption option = - loadOption(CLASSPATH_OPTION, CLASSPATH_OPTION_LONG); - - if (option != null) { - ArrayList optionValues = option.getOptionValues(); - URL[] urls = new URL[optionValues.size()]; - String[] classPathEntries = (String[]) optionValues.toArray(new String[optionValues.size()]); - - try { - for (int i = 0; i < classPathEntries.length; i++) { - String classPathEntry = classPathEntries[i]; - //this should be a file(or a URL) - if (Java2WSDLUtils.isURL(classPathEntry)) { - urls[i] = new URL(classPathEntry); - } else { - urls[i] = new File(classPathEntry).toURL(); - } - } - } catch (MalformedURLException e) { - throw new Exception(e); - } - - classLoader = new URLClassLoader(urls, Thread.currentThread().getContextClassLoader()); - - } else { - classLoader = Thread.currentThread().getContextClassLoader(); - } - } - - protected void initializeOtherParams() - { -// set the other parameters to the builder - Java2WSDLCommandLineOption option = loadOption(SCHEMA_TARGET_NAMESPACE_OPTION, - SCHEMA_TARGET_NAMESPACE_OPTION_LONG); - schemaTargetNamespace = (option == null) ? null : option.getOptionValue(); - - option = loadOption(SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION, - SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION_LONG); - schemaTargetNamespacePrefix = (option == null) ? null : option.getOptionValue(); - - option = loadOption(TARGET_NAMESPACE_OPTION, - TARGET_NAMESPACE_OPTION_LONG); - targetNamespace = (option == null) ? null : option.getOptionValue(); - - option = loadOption(TARGET_NAMESPACE_PREFIX_OPTION, - TARGET_NAMESPACE_PREFIX_OPTION_LONG); - targetNamespacePrefix = (option == null) ? null : option.getOptionValue(); - - option = loadOption(SERVICE_NAME_OPTION, - SERVICE_NAME_OPTION_LONG); - serviceName = (option == null) ? Java2WSDLUtils.getSimpleClassName(sourceClassName) : option.getOptionValue(); - - option = loadOption(STYLE_OPTION,STYLE_OPTION); - style = (option == null) ? null : option.getOptionValue(); - - - option = loadOption(LOCATION_OPTION, - LOCATION_OPTION); - locationUri = (option == null) ? null : option.getOptionValue(); - - option = loadOption(USE_OPTION,USE_OPTION); - use = (option == null) ? null : option.getOptionValue(); - - option = loadOption(ATTR_FORM_DEFAULT_OPTION, ATTR_FORM_DEFAULT_OPTION_LONG); - attrFormDefault = (option == null) ? null : option.getOptionValue(); - - option = loadOption(ELEMENT_FORM_DEFAULT_OPTION,ELEMENT_FORM_DEFAULT_OPTION_LONG); - elementFormDefault = option == null ? null : option.getOptionValue(); - - option = loadOption(TuscanyJava2WSDLConstants.EXTRA_CLASSES_DEFAULT_OPTION, - TuscanyJava2WSDLConstants.EXTRA_CLASSES_DEFAULT_OPTION_LONG); - extraClasses = option == null ? new ArrayList() : option.getOptionValues(); - } - - public ClassLoader getClassLoader() - { - return classLoader; - } - - public void setClassLoader(ClassLoader classLoader) - { - this.classLoader = classLoader; - } - - public String getLocationUri() - { - if ( locationUri == null ) - { - locationUri = DEFAULT_LOCATION_URL; - } - return locationUri; - } - - public void setLocationUri(String locationUri) - { - this.locationUri = locationUri; - } - - public FileOutputStream getOutputFileStream() - { - return outputFileStream; - } - - public void setOutputFileStream(FileOutputStream outputFileStream) - { - this.outputFileStream = outputFileStream; - } - - public String getSchemaTargetNamespace() throws Exception - { - if (schemaTargetNamespace == null - || schemaTargetNamespace.trim().equals("")) - { - this.schemaTargetNamespace = Java2WSDLUtils - .schemaNamespaceFromClassName(getSourceClassName(), getClassLoader()).toString(); - } - return schemaTargetNamespace; - } - - public void setSchemaTargetNamespace(String schemaTargetNamespace) - { - this.schemaTargetNamespace = schemaTargetNamespace; - } - - public String getSchemaTargetNamespacePrefix() - { - if (schemaTargetNamespacePrefix == null - || schemaTargetNamespacePrefix.trim().equals("")) - { - this.schemaTargetNamespacePrefix = SCHEMA_NAMESPACE_PRFIX; - } - - return schemaTargetNamespacePrefix; - } - - public void setSchemaTargetNamespacePrefix(String schemaTargetNamespacePrefix) - { - this.schemaTargetNamespacePrefix = schemaTargetNamespacePrefix; - } - - public String getServiceName() - { - if ( serviceName == null ) - { - serviceName = Java2WSDLUtils.getSimpleClassName(getSourceClassName()); - } - return serviceName; - } - - public void setServiceName(String serviceName) - { - this.serviceName = serviceName; - } - - public String getSourceClassName() - { - return sourceClassName; - } - - public void setSourceClassName(String sourceClassName) - { - this.sourceClassName = sourceClassName; - } - - public String getStyle() - { - if ( style == null ) - { - style = DOCUMENT; - } - return style; - } - - public void setStyle(String style) - { - this.style = style; - } - - public String getTargetNamespace() throws Exception - { - if ( targetNamespace == null ) { - targetNamespace = Java2WSDLUtils.namespaceFromClassName(this.sourceClassName, this.classLoader).toString(); - } - return targetNamespace; - } - - public void setTargetNamespace(String targetNamespace) - { - this.targetNamespace = targetNamespace; - } - - public String getTargetNamespacePrefix() - { - return targetNamespacePrefix; - } - - public void setTargetNamespacePrefix(String targetNamespacePrefix) - { - this.targetNamespacePrefix = targetNamespacePrefix; - } - - public String getUse() - { - if ( use == null ) - { - use = LITERAL; - } - return use; - } - - public void setUse(String use) - { - this.use = use; - } - - public Map getSchemaLocationMap() - { - if ( schemaLocationMap == null ) - { - schemaLocationMap = new Hashtable(); - } - return schemaLocationMap; - } - - public void setSchemaLocationMap(Map schemaLocationMap) { - this.schemaLocationMap = schemaLocationMap; - } - - public String getAttrFormDefault() { - if ( attrFormDefault == null ) - { - attrFormDefault = FORM_DEFAULT_QUALIFIED; - } - return attrFormDefault; - } - - public void setAttrFormDefault(String attrFormDefault) { - this.attrFormDefault = attrFormDefault; - } - - public String getElementFormDefault() { - if ( elementFormDefault == null ) - { - elementFormDefault = FORM_DEFAULT_QUALIFIED; - } - return elementFormDefault; - } - - public void setElementFormDefault(String elementFormDefault) { - this.elementFormDefault = elementFormDefault; - } - - public ArrayList getExtraClasses() { - return extraClasses; - } - - public void setExtraClasses(ArrayList extraClasses) { - this.extraClasses = extraClasses; - } -} - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java deleted file mode 100644 index 8855c3f6e9..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.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.tools.java2wsdl.generate; - -import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOptionParser; - -/** - * This class provides the tooling abstraction to Tuscany Java2WSDL and can be - * invoked from command line with the follwing options as with Axis2 Java2WSDL - * - */ -public class Java2WSDL { - /** - * @param args - */ - public static void main(String[] args) - { - //parse the cmd line args - Java2WSDLCommandLineOptionParser commandLineOptionParser = - new Java2WSDLCommandLineOptionParser(args); - // validate the arguments - validateCommandLineOptions(commandLineOptionParser); - - Java2WSDLGeneratorFactory.getInstance().createGenerator(). - generateWSDL(commandLineOptionParser.getAllOptions()); - - // Uncomment the following statement to directly run the Axis2 tool - // without - // runAxis2Tool(args); - } - - private static void runAxis2Tool(String[] args) { - org.apache.ws.java2wsdl.Java2WSDL.main(args); - } - - private static void validateCommandLineOptions(Java2WSDLCommandLineOptionParser parser) { - if (parser.getAllOptions().size() == 0) { - printUsage(); - } else if (parser.getInvalidOptions(new TuscanyJava2WSDLOptionsValidator()).size() > 0) { - printUsage(); - } - - } - - public static void printUsage() { - System.out.println("Usage java2wsdl -cn : class file name"); - System.out.println("-o : output file location"); - System.out.println("-cp : list of classpath entries - (urls)"); - System.out.println("-tn : target namespace"); - System.out.println("-tp : target namespace prefix"); - System.out.println("-stn : target namespace for schema"); - System.out.println("-stp : target namespace prefix for schema"); - System.out.println("-sn : service name"); - System.out.println("-of : output file name for the WSDL"); - System.out.println("-st : style for the WSDL"); - System.out.println("-u : use for the WSDL"); - System.out.println("-l : address of the port for the WSDL"); - System.out.println("-ixsd [, ] : schemas to be imported (and not generated)"); - System.out.println("-efd : Setting for elementFormDefault (defaults to qualified)"); - System.out.println("-afd : Setting for attributeFormDefault (defaults to qualified)"); - System.out.println("-xc : Extra class for which schematype must be generated. " + - "\t\tUse as : -xc class1 -xc class2 ..."); - System.exit(0); - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGenerator.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGenerator.java deleted file mode 100644 index 3323113af4..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGenerator.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.tools.java2wsdl.generate; - -import java.io.OutputStream; -import java.util.Map; - -/** - * This is the Java2WSDL Generator facade that will be used by Tuscany - * components for java to wsdl conversion. - * - */ -public interface Java2WSDLGenerator { - public void generateWSDL(String[] args); - - public void generateWSDL(Map commandLineOptions); - - public void addWSDLGenListener(WSDLGenListener l); - - public void removeWSDLGenListener(WSDLGenListener l); - - public Map getCommandLineOptions(); - - public void setCommandLineOptoins(Map cmdLineOpts); - - public OutputStream getOutputStream(); - - public void setOutputStream(OutputStream outStream); - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java deleted file mode 100644 index e8f3db95b0..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.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.tools.java2wsdl.generate; - -import java.util.Vector; - -/** - * Factory that creates Java2WSDL Generators. Presently the there is a Default - * Generator that wraps around the AXIS2 Java2WSDL implementation. The factory - * can be extended to create generators that wrap around other implementations - * if required. - */ - -public class Java2WSDLGeneratorFactory { - /* - * singleton instance of this factory class - */ - private static Java2WSDLGeneratorFactory factory = null; - - /** - * code for the default generator - */ - public static final int DEFAULT_GENERATOR = 0; - - /** - * Default Generator class name - */ - public static final String DEFAULT_GENERATOR_CLASSNAME = "org.apache.tuscany.tools.java2wsdl.generate.Java2WSDLGeneratorImpl"; - - /** - * list of generator classnames in a position that corresponds to their - * code. For example the default generator's code is 0 and hence this - * generator's classname is stored at index '0' of the list - */ - protected Vector generatorClassNames = new Vector(); - - /** - * @return the singleton instance of this generator factory - */ - public static Java2WSDLGeneratorFactory getInstance() { - if (factory == null) { - factory = new Java2WSDLGeneratorFactory(); - } - return factory; - } - - private Java2WSDLGeneratorFactory() { - generatorClassNames.addElement(DEFAULT_GENERATOR_CLASSNAME); - } - - public Java2WSDLGenerator createGenerator() { - return createGenerator(DEFAULT_GENERATOR); - } - - /** - * creates an instance of a Java2WSDL Generator based on the input type - * - * @param genType - * type of the generator to be created - * @return an instance of a Java2WSDL Generator - */ - public Java2WSDLGenerator createGenerator(int genType) { - try { - return (Java2WSDLGenerator) (Class.forName(generatorClassNames - .elementAt(genType)).newInstance()); - } catch (Exception e) { - System.out - .println(" Unable to create Java2WSDL generator due to ....."); - System.out.println(e); - return null; - } - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java deleted file mode 100644 index 9d1a9df438..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.java2wsdl.generate; - -import java.io.OutputStream; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Vector; - -import org.apache.ws.java2wsdl.Java2WSDL; -import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption; -import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOptionParser; -import org.apache.ws.java2wsdl.utils.Java2WSDLOptionsValidator; - -/** - * This is an implementation of the Java2WSDLGenerator facade. This - * implementation is a decorator around the Axis2 implementation of the - * Java2WSDL conversion. The WSDL generation is divided into phases that are - * stringed up as a template method. The phases are - User Input Validation - - * WSDL Java Model Generation - Serialization of WSDL Java Model The function of - * each phase is accomplished by delegation to the appropriate classes in Axis2. - * At the start and end of each phase an event is published to subcribers - * denoting the start and end of the phase. - * - * Such a spliting up of the Java2WSDL conversion into phases has been designed - * to enable interceptors to modify the model or apply transformations to the - * output. Typically the interceptors can subscribe to the start and end events - * of these phases and hence be able to intercept. - * - * Note: This class contains substantial AXIS2 Java2WSDL code refactored into - * it. These will be removed as and when the Axis2 code is fixed. - * - */ -public class Java2WSDLGeneratorImpl implements Java2WSDLGenerator, TuscanyJava2WSDLConstants -{ - private List genPhaseListeners = new Vector(); - private GenerationParameters genParams = null; - private Map commandLineOptions = null; - private TuscanyJava2WSDLBuilder java2WsdlBuilder; - private OutputStream outputStream = null; - - public Java2WSDLGeneratorImpl() - { - - } - - private void multicastGenPhaseCompletionEvent(int genPhase) { - WSDLGenEvent event = new WSDLGenEvent(this, genPhase); - Iterator iterator = genPhaseListeners.iterator(); - while (iterator.hasNext()) { - ((WSDLGenListener) iterator.next()).WSDLGenPhaseCompleted(event); - } - } - - private void initJava2WSDLBuilder() throws Exception - { -// Now we are done with loading the basic values - time to create the builder - java2WsdlBuilder = new TuscanyJava2WSDLBuilder(genParams); - } - - protected boolean validateInputArgs(String[] args) - { - boolean isValid = true; - Java2WSDLCommandLineOptionParser parser = new Java2WSDLCommandLineOptionParser(args); - if (parser.getAllOptions().size() == 0) { - Java2WSDL.printUsage(); - isValid = false; - } else if (parser.getInvalidOptions(new Java2WSDLOptionsValidator()) - .size() > 0) { - Java2WSDL.printUsage(); - isValid = false; - } - - if (isValid) - { - commandLineOptions = parser.getAllOptions(); - } - - return isValid; - } - - public boolean buildWSDLDocument() throws Exception - { - boolean isComplete = true; - initJava2WSDLBuilder(); - java2WsdlBuilder.buildWSDL(); - - return isComplete; - } - - public boolean serializeWSDLDocument() throws Exception { - boolean isComplete = true; - - if ( getOutputStream() == null ) - { - setOutputStream(genParams.getOutputFileStream()); - } - - java2WsdlBuilder.getWsdlDocument().serialize(getOutputStream()); - getOutputStream().flush(); - getOutputStream().close();; - - return isComplete; - } - - /* - * This is the template method that splits the Java2WSDL generation cycle - * into phase / steps. - * - * @see tuscany.tools.Java2WSDLGeneratorIfc#generateWSDL(java.lang.String[]) - */ - public void generateWSDL(Map commandLineOptions) - { - try - { - // load the user options into an easy to access abstraction - genParams = new GenerationParameters(commandLineOptions); - - // if the WSDL Model generation was successul - if ( buildWSDLDocument() ) - { - // multicast event for generation of wsdl model - multicastGenPhaseCompletionEvent(WSDLGenListener.WSDL_MODEL_CREATION); - // if the serialization of the generated (and fixed) model - // is successful - if (serializeWSDLDocument()) { - // multicast event for writing of the WSDL Model to - // supplied output stream - multicastGenPhaseCompletionEvent(WSDLGenListener.WSDL_MODEL_WRITING); - } - } - } - catch (Exception e) - { - e.printStackTrace(); - } - - // TODO Auto-generated method stub - - } - - public void generateWSDL(String[] args) - { - // if the argument input are found to be valid - if (validateInputArgs(args)) - { - //multicast event for input args validation complete - multicastGenPhaseCompletionEvent(WSDLGenListener.INPUT_ARGS_VALIDATION); - generateWSDL(commandLineOptions); - } - } - - /* - * (non-Javadoc) - * - * @see tuscany.tools.Java2WSDLGeneratorIfc#addWSDLGenListener(tuscany.tools.WSDLGenListener) - */ - public void addWSDLGenListener(WSDLGenListener l) { - genPhaseListeners.add(l); - - } - - /* - * (non-Javadoc) - * - * @see tuscany.tools.Java2WSDLGeneratorIfc#removeWSDLGenListener(tuscany.tools.WSDLGenListener) - */ - public void removeWSDLGenListener(WSDLGenListener l) { - genPhaseListeners.remove(l); - } - - /* - * (non-Javadoc) - * - * @see tuscany.tools.Java2WSDLGeneratorIfc#getCommandLineOptions() - */ - public Map getCommandLineOptions() { - return commandLineOptions; - } - - /* - * (non-Javadoc) - * - * @see tuscany.tools.Java2WSDLGeneratorIfc#setCommandLineOptoins(java.util.Map) - */ - public void setCommandLineOptoins(Map cmdLineOpts) { - commandLineOptions = cmdLineOpts; - } - - - /* - * (non-Javadoc) - * - * @see tuscany.tools.Java2WSDLGeneratorIfc#getOutputStream() - */ - public OutputStream getOutputStream() { - // TODO Auto-generated method stub - return outputStream; - } - - /* - * (non-Javadoc) - * - * @see tuscany.tools.Java2WSDLGeneratorIfc#setOutputStream(java.io.OutputStream) - */ - public void setOutputStream(OutputStream outStream) { - outputStream = outStream; - } - - - public TuscanyJava2WSDLBuilder getJava2WsdlBuilder() - { - return java2WsdlBuilder; - } - - public void setJava2WsdlBuilder(TuscanyJava2WSDLBuilder java2WsdlBuilder) - { - this.java2WsdlBuilder = java2WsdlBuilder; - } - - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java deleted file mode 100644 index 67609445ae..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java +++ /dev/null @@ -1,524 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.java2wsdl.generate; - -import java.io.StringReader; -import java.lang.reflect.Constructor; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Vector; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sdo.util.SDOUtil; -import org.apache.ws.commons.schema.XmlSchema; -import org.apache.ws.commons.schema.XmlSchemaCollection; -import org.apache.ws.commons.schema.XmlSchemaComplexType; -import org.apache.ws.commons.schema.XmlSchemaElement; -import org.apache.ws.commons.schema.XmlSchemaForm; -import org.apache.ws.commons.schema.XmlSchemaGroupBase; -import org.apache.ws.commons.schema.XmlSchemaImport; -import org.apache.ws.commons.schema.XmlSchemaInclude; -import org.apache.ws.commons.schema.XmlSchemaSequence; -import org.apache.ws.commons.schema.XmlSchemaType; -import org.apache.ws.commons.schema.utils.NamespaceMap; -import org.apache.ws.java2wsdl.Java2WSDLUtils; -import org.codehaus.jam.JClass; -import org.codehaus.jam.JProperty; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; -import commonj.sdo.helper.XSDHelper; - -public class SchemaBuilder implements TuscanyJava2WSDLConstants { - public static final String NAME_SPACE_PREFIX = "stn_"; - - private static int prefixCount = 1; - - public static final String MIXED = "mixed"; - - public static final String GROUP = "group"; - - protected String attrFormDefault = null; - - protected String elementFormDefault = null; - - protected XmlSchemaCollection xmlSchemaCollection = new XmlSchemaCollection(); - - private Hashtable schemaMap = new Hashtable(); - - protected Hashtable targetNamespacePrefixMap = new Hashtable(); - - protected TuscanyTypeTable typeTable = new TuscanyTypeTable(); - - protected Map schemaLocationMap = null; - - private ClassLoader classLoader; - - protected SchemaBuilder(XmlSchemaCollection schemaCollection, - Hashtable schemaMap, - Hashtable nsPrefixMap, - TuscanyTypeTable typeTable, - String attrFormDef, - String eleFormDef, - Map schemaLocMap, - ClassLoader classLoader) { - this.schemaMap = schemaMap; - this.xmlSchemaCollection = schemaCollection; - this.targetNamespacePrefixMap = nsPrefixMap; - this.typeTable = typeTable; - this.schemaLocationMap = schemaLocMap; - this.classLoader = classLoader; - this.attrFormDefault = attrFormDef; - this.elementFormDefault = eleFormDef; - } - - private boolean isSDO(JClass javaType) throws Exception { - Class sdoClass = Class.forName(javaType.getQualifiedName(), - true, - classLoader); - return DataObject.class.isAssignableFrom(sdoClass); - } - - private void buildComplexTypeContents_JavaType(JClass javaType, - XmlSchemaComplexType complexType, - XmlSchema xmlSchema) throws Exception { - JProperty[] properties = javaType.getDeclaredProperties(); - - for (int i = 0; i < properties.length; i++) { - JProperty property = properties[i]; - String propertyName = property.getType().getQualifiedName(); - boolean isArryType = property.getType().isArrayType(); - if (isArryType) { - propertyName = property.getType().getArrayComponentType().getQualifiedName(); - } - - if (typeTable.isSimpleType(propertyName)) { - XmlSchemaElement elt1 = new XmlSchemaElement(); - elt1.setName(getCorrectName(property.getSimpleName())); - elt1.setSchemaTypeName(typeTable.getSimpleSchemaTypeName(propertyName)); - ((XmlSchemaGroupBase) complexType.getParticle()).getItems().add(elt1); - if (isArryType) { - elt1.setMaxOccurs(Long.MAX_VALUE); - elt1.setMinOccurs(0); - } - } else { - QName schemaTypeName = null; - if (isArryType) { - schemaTypeName = generateSchema(property.getType().getArrayComponentType()); - } else { - schemaTypeName = generateSchema(property.getType()); - } - - XmlSchemaElement elt1 = new XmlSchemaElement(); - elt1.setName(getCorrectName(property.getSimpleName())); - elt1.setSchemaTypeName(schemaTypeName); - ((XmlSchemaGroupBase) complexType.getParticle()).getItems().add(elt1); - - if (isArryType) { - elt1.setMaxOccurs(Long.MAX_VALUE); - elt1.setMinOccurs(0); - } - - addImports(xmlSchema, - schemaTypeName); - } - } - } - - protected QName buildSchema_JavaType(JClass javaType) throws Exception { - QName schemaTypeName = typeTable.getComplexSchemaTypeName(javaType, this.classLoader); - if (schemaTypeName == null) { - String simpleName = javaType.getSimpleName(); - - String packageName = javaType.getContainingPackage().getQualifiedName(); - - String targetNameSpace = - Java2WSDLUtils.schemaNamespaceFromClassName(javaType.getQualifiedName(), this.classLoader) - .toString(); - - XmlSchema xmlSchema = getXmlSchema(targetNameSpace); - String targetNamespacePrefix = (String) targetNamespacePrefixMap.get(targetNameSpace); - - schemaTypeName = new QName(targetNameSpace, simpleName, targetNamespacePrefix); - XmlSchemaComplexType complexType = new XmlSchemaComplexType(xmlSchema); - complexType.setName(simpleName); - - XmlSchemaSequence sequence = new XmlSchemaSequence(); - complexType.setParticle(sequence); - - createGlobalElement(xmlSchema, - complexType, - schemaTypeName); - xmlSchema.getItems().add(complexType); - xmlSchema.getSchemaTypes().add(schemaTypeName, - complexType); - - // adding this type to the table - // typeTable.addComplexScheam(name, complexType.getQName()); - typeTable.addComplexSchemaType(targetNameSpace, - simpleName, - schemaTypeName); - buildComplexTypeContents_JavaType(javaType, - complexType, - xmlSchema); - } - return schemaTypeName; - } - - protected QName buildSchema_SDO(Type dataType) // throws Exception - { - QName schemaTypeName = typeTable.getComplexSchemaTypeName(dataType.getURI(), - dataType.getName()); - - if (schemaTypeName == null) { - // invoke XSDHelper to generate schema for this sdo type - XSDHelper xsdHelper = SDOUtil.createXSDHelper(SDOUtil.createTypeHelper()); - // it is better to check if XSDHelper can generate the schema - if (xsdHelper.isXSD(dataType)) { - // if schemalocations for xsd has been specified, include them - includeExtXSD(dataType); - } else { - List typeList = new Vector(); - typeList.add(dataType); - - // the xsdhelper returns a string that contains the schemas for this type - String schemaDefns = xsdHelper.generate(typeList, - schemaLocationMap); - - // extract the schema elements and store them in the schema map - extractSchemas(schemaDefns); - } - // since the XSDHelper will not return the type name, create it and store it in typetable - schemaTypeName = new QName(dataType.getURI(), dataType.getName(), generatePrefix()); - typeTable.addComplexSchemaType(dataType.getURI(), - dataType.getName(), - schemaTypeName); - - } - return schemaTypeName; - } - - public QName generateSchema(JClass javaType) throws Exception { - if (isSDO(javaType)) { - Type dataType = createDataObject(javaType).getType(); - return buildSchema_SDO(dataType); - } else { - return buildSchema_JavaType(javaType); - } - } - - private XmlSchema getXmlSchema(String targetNamespace) { - XmlSchema xmlSchema; - - if ((xmlSchema = (XmlSchema) schemaMap.get(targetNamespace)) == null) { - String targetNamespacePrefix = generatePrefix(); - - xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection); - xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting()); - xmlSchema.setElementFormDefault(getElementFormDefaultSetting()); - - targetNamespacePrefixMap.put(targetNamespace, - targetNamespacePrefix); - schemaMap.put(targetNamespace, - xmlSchema); - - NamespaceMap prefixmap = new NamespaceMap(); - prefixmap.put(TuscanyTypeTable.XS_URI_PREFIX, - TuscanyTypeTable.XML_SCHEMA_URI); - prefixmap.put(targetNamespacePrefix, - targetNamespace); - xmlSchema.setNamespaceContext(prefixmap); - } - return xmlSchema; - } - - /** - * JAM convert first name of an attribute into UpperCase as an example if there is a instance variable called foo in a bean , then Jam give that - * as Foo so this method is to correct that error - * - * @param wrongName - * @return the right name, using english as the locale for case conversion - */ - public static String getCorrectName(String wrongName) { - if (wrongName.length() > 1) { - return wrongName.substring(0, - 1).toLowerCase(Locale.ENGLISH) - + wrongName.substring(1, - wrongName.length()); - } else { - return wrongName.substring(0, - 1).toLowerCase(Locale.ENGLISH); - } - } - - private String addImports(XmlSchema xmlSchema, QName schemaTypeName) { - String prefix = null; - String[] prefixes = xmlSchema.getNamespaceContext().getDeclaredPrefixes(); - for (int count = 0; count < prefixes.length; ++count) { - if (schemaTypeName.getNamespaceURI(). - equals(xmlSchema.getNamespaceContext().getNamespaceURI(prefixes[count])) ) { - return prefixes[count]; - } - } - - // the following lines are executed only if a prefix was not found which implies that the - // schemaTypeName was not imported earlier and also it does not belong to the targetnamespace - String schemaLocation = null; - XmlSchemaImport importElement = new XmlSchemaImport(); - importElement.setNamespace(schemaTypeName.getNamespaceURI()); - xmlSchema.getItems().add(importElement); - prefix = generatePrefix(); - //it is safe to cast like this since it was this class that instantiated the - //NamespaceContext and assigned it to an instance of a NamespaceMap (see method getXmlSchema) - ((NamespaceMap)xmlSchema.getNamespaceContext()).put(prefix, - schemaTypeName.getNamespaceURI()); - - return prefix; - } - - private String formGlobalElementName(String typeName) { - String firstChar = typeName.substring(0, - 1); - return typeName.replaceFirst(firstChar, - firstChar.toLowerCase()); - } - - private void createGlobalElement(XmlSchema xmlSchema, - XmlSchemaComplexType complexType, - QName elementName) { - XmlSchemaElement globalElement = new XmlSchemaElement(); - globalElement.setSchemaTypeName(complexType.getQName()); - globalElement.setName(formGlobalElementName(complexType.getName())); - globalElement.setQName(elementName); - - xmlSchema.getItems().add(globalElement); - xmlSchema.getElements().add(elementName, - globalElement); - } - - private DataObject createDataObject(JClass sdoClass) throws Exception { - Class sdoType = Class.forName(sdoClass.getQualifiedName(), - true, - classLoader); - - Constructor constructor = sdoType.getDeclaredConstructor(new Class[0]); - constructor.setAccessible(true); - Object instance = constructor.newInstance(new Object[0]); - return (DataObject) instance; - } - - private String generatePrefix() { - return NAME_SPACE_PREFIX + prefixCount++; - } - - private void includeExtXSD(Type dataType) { - // now we know there is a type for which the xsd must come from outside - // create a schema for the namespace of this type and add an include in it for - // the xsd that is defined externally - XmlSchema xmlSchema = getXmlSchema(dataType.getURI()); - - // ideally there could be more than one external schema defintions for a namespace - // and hence schemalocations will be a list of locations - // List schemaLocations = (List)schemaLocationMap.get(dataType.getURI()); - - // since as per the specs the input to XSDHelper is a map of allowing - // only one schemalocation for a namespace. So for now this single location will be - // picked up and put into a list - List schemaLocations = new Vector(); - - if (schemaLocationMap.get(dataType.getURI()) != null) { - schemaLocations.add(schemaLocationMap.get(dataType.getURI())); - } - - if (schemaLocations.size() <= 0) { - schemaLocations.add(DEFAULT_SCHEMA_LOCATION); - } - - Iterator includesIterator = xmlSchema.getIncludes().getIterator(); - Iterator schemaLocIterator = schemaLocations.iterator(); - String aSchemaLocation = null; - boolean includeExists = false; - // include all external schema locations - while (schemaLocIterator.hasNext()) { - aSchemaLocation = (String) schemaLocIterator.next(); - while (includesIterator.hasNext()) { - if (!includeExists - && aSchemaLocation.equals(((XmlSchemaInclude) includesIterator.next()).getSchemaLocation())) { - includeExists = true; - } - } - - if (!includeExists) { - XmlSchemaInclude includeElement = new XmlSchemaInclude(); - includeElement.setSchemaLocation(aSchemaLocation); - xmlSchema.getIncludes().add(includeElement); - xmlSchema.getItems().add(includeElement); - } - } - - } - - private void extractSchemas(String schemaDefns) { - // load each schema element and add it to the schema map - - String token = getToken(schemaDefns); - int curIndex = schemaDefns.indexOf(token); - int nextIndex = schemaDefns.indexOf(token, - curIndex + token.length()); - - while (curIndex != -1) { - StringReader sr = null; - if (nextIndex != -1) - sr = new StringReader(schemaDefns.substring(curIndex, - nextIndex)); - else - sr = new StringReader(schemaDefns.substring(curIndex)); - - XmlSchemaCollection collection = new XmlSchemaCollection(); - XmlSchema aSchema = collection.read(sr, - null); - addSchemaToMap(aSchema); - - curIndex = nextIndex; - nextIndex = schemaDefns.indexOf(token, - curIndex + token.length()); - } - } - - private void addSchemaToMap(XmlSchema extractedSchema) { - // check if a Schema object already exists in schema map for targetNamespace of this schema element - // if it does then copy the contents of this schema element to the existing one, ensuring that - // duplicate elements are not created. i.e. before adding some child element like 'include' or 'import' - // check if it already exists, if it does don't add this - XmlSchema existingSchema = (XmlSchema) schemaMap.get(extractedSchema.getTargetNamespace()); - - if (existingSchema == null) { - extractedSchema.setAttributeFormDefault(getAttrFormDefaultSetting()); - extractedSchema.setElementFormDefault(getElementFormDefaultSetting()); - schemaMap.put(extractedSchema.getTargetNamespace(), - extractedSchema); - - } else { - copySchemaItems(existingSchema, - extractedSchema); - } - } - - private void copySchemaItems(XmlSchema existingSchema, XmlSchema aSchema) { - // items to copy are imports, includes, elements, types ... - // each item is checked if it is a duplicate entry and copied only if it isn't - Iterator itemsIterator = aSchema.getItems().getIterator(); - Object schemaObject = null; - XmlSchemaElement schemaElement = null; - XmlSchemaType schemaType = null; - XmlSchemaInclude schemaInclude = null; - QName qName = null; - List existingIncludes = getExistingIncludes(existingSchema); - - while (itemsIterator.hasNext()) { - schemaObject = itemsIterator.next(); - if (schemaObject instanceof XmlSchemaElement) { - schemaElement = (XmlSchemaElement) schemaObject; - qName = schemaElement.getQName(); - // if the element does not exist in the existing schema - if (existingSchema.getElementByName(qName) == null) { - // add it to the existing schema - existingSchema.getElements().add(qName, - schemaElement); - existingSchema.getItems().add(schemaElement); - } - } else if (schemaObject instanceof XmlSchemaType) { - schemaType = (XmlSchemaType) itemsIterator.next(); - qName = schemaType.getQName(); - // if the element does not exist in the existing schema - if (existingSchema.getElementByName(qName) == null) { - // add it to the existing schema - existingSchema.getSchemaTypes().add(qName, - schemaType); - existingSchema.getItems().add(schemaType); - // add imports - addImports(existingSchema, - qName); - } - } else if (schemaObject instanceof XmlSchemaInclude) { - schemaInclude = (XmlSchemaInclude) itemsIterator.next(); - if (!existingIncludes.contains(schemaInclude.getSchemaLocation())) { - existingSchema.getIncludes().add(schemaInclude); - existingSchema.getItems().add(schemaInclude); - } - } - } - } - - private List getExistingIncludes(XmlSchema xmlSchema) { - List includeSchemaLocations = new Vector(); - Iterator iterator = xmlSchema.getIncludes().getIterator(); - - while (iterator.hasNext()) { - includeSchemaLocations.add(((XmlSchemaInclude) iterator.next()).getSchemaLocation()); - } - return includeSchemaLocations; - } - - private XmlSchemaForm getAttrFormDefaultSetting() { - if (FORM_DEFAULT_UNQUALIFIED.equals(getAttrFormDefault())) { - return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED); - } else { - return new XmlSchemaForm(XmlSchemaForm.QUALIFIED); - } - } - - private XmlSchemaForm getElementFormDefaultSetting() { - if (FORM_DEFAULT_UNQUALIFIED.equals(getElementFormDefault())) { - return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED); - } else { - return new XmlSchemaForm(XmlSchemaForm.QUALIFIED); - } - } - - private String getToken(String s) { - // get the schema element name eg. "); - writeSchemas(writer); - writer.write(""); - - XMLStreamReader xmlReader = XMLInputFactory.newInstance() - .createXMLStreamReader(new ByteArrayInputStream(writer.toString() - .getBytes())); - - StAXOMBuilder staxOMBuilders = new StAXOMBuilder(fac, xmlReader); - OMElement documentElement = staxOMBuilders.getDocumentElement(); - - - Iterator iterator = documentElement.getChildElements(); - while (iterator.hasNext()) { - wsdlTypes.addChild((OMNode) iterator.next()); - } - defintions.addChild(wsdlTypes); - } - - private void writeSchemas(StringWriter writer) { - Iterator iterator = schemaCollection.iterator(); - XmlSchema xmlSchema = null; - - while (iterator.hasNext()) { - xmlSchema = (XmlSchema) iterator.next(); - // typeIterator = xmlSchema.getSchemaTypes().getValues(); - /* - * while (typeIterator.hasNext()) { xmlSchema.getItems().add((XmlSchemaObject) typeIterator.next()); } - */ - xmlSchema.write(writer); - } - } - - private void generateMessages(OMFactory fac, OMElement definitions) throws Exception { - Hashtable namespaceMap = new Hashtable(); - String namespacePrefix = null; - String namespaceURI = null; - QName messagePartType = null; - for (int i = 0; i < method.length; i++) { - JMethod jmethod = method[i]; - - if (jmethod.isPublic()) { - // Request Message - OMElement requestMessge = fac.createOMElement(MESSAGE_LOCAL_NAME, - wsdl); - requestMessge.addAttribute(ATTRIBUTE_NAME, - jmethod.getSimpleName() + MESSAGE_SUFFIX, - null); - definitions.addChild(requestMessge); - - // only if a type for the message part has already been defined - if ((messagePartType = typeTable.getComplexSchemaTypeName(generationParams.getSchemaTargetNamespace(), - jmethod.getSimpleName())) != null) { - namespaceURI = messagePartType.getNamespaceURI(); - // avoid duplicate namespaces - if ((namespacePrefix = (String) namespaceMap.get(namespaceURI)) == null) { - namespacePrefix = generatePrefix(); - namespaceMap.put(namespaceURI, - namespacePrefix); - } - - OMElement requestPart = fac.createOMElement(PART_ATTRIBUTE_NAME, - wsdl); - requestMessge.addChild(requestPart); - requestPart.addAttribute(ATTRIBUTE_NAME, - "part1", - null); - - requestPart.addAttribute(ELEMENT_ATTRIBUTE_NAME, - namespacePrefix + COLON_SEPARATOR - + jmethod.getSimpleName(), - null); - } - - // only if a type for the message part has already been defined - if ((messagePartType = typeTable.getComplexSchemaTypeName(generationParams.getSchemaTargetNamespace(), - jmethod.getSimpleName() - + RESPONSE)) != null) { - namespaceURI = messagePartType.getNamespaceURI(); - if ((namespacePrefix = (String) namespaceMap.get(namespaceURI)) == null) { - namespacePrefix = generatePrefix(); - namespaceMap.put(namespaceURI, - namespacePrefix); - } - // Response Message - OMElement responseMessge = fac.createOMElement(MESSAGE_LOCAL_NAME, - wsdl); - responseMessge.addAttribute(ATTRIBUTE_NAME, - jmethod.getSimpleName() + RESPONSE_MESSAGE, - null); - definitions.addChild(responseMessge); - OMElement responsePart = fac.createOMElement(PART_ATTRIBUTE_NAME, - wsdl); - responseMessge.addChild(responsePart); - responsePart.addAttribute(ATTRIBUTE_NAME, - "part1", - null); - - responsePart.addAttribute(ELEMENT_ATTRIBUTE_NAME, - namespacePrefix + COLON_SEPARATOR - + jmethod.getSimpleName() + RESPONSE, - null); - } - } - } - - // now add these unique namespaces to the the definitions element - Enumeration enumeration = namespaceMap.keys(); - while (enumeration.hasMoreElements()) { - namespaceURI = (String) enumeration.nextElement(); - definitions.declareNamespace(namespaceURI, - (String) namespaceMap.get(namespaceURI)); - } - } - - /** - * Generate the porttypes - */ - private void generatePortType(OMFactory fac, OMElement defintions) { - JMethod jmethod = null; - OMElement operation = null; - OMElement message = null; - OMElement portType = fac.createOMElement(PORT_TYPE_LOCAL_NAME, - wsdl); - defintions.addChild(portType); - portType.addAttribute(ATTRIBUTE_NAME, - generationParams.getServiceName() + PORT_TYPE_SUFFIX, - null); - // adding message refs - for (int i = 0; i < method.length; i++) { - jmethod = method[i]; - - if (jmethod.isPublic()) { - operation = fac.createOMElement(OPERATION_LOCAL_NAME, - wsdl); - portType.addChild(operation); - operation.addAttribute(ATTRIBUTE_NAME, - jmethod.getSimpleName(), - null); - - message = fac.createOMElement(IN_PUT_LOCAL_NAME, - wsdl); - message.addAttribute(MESSAGE_LOCAL_NAME, - tns.getPrefix() + COLON_SEPARATOR + jmethod.getSimpleName() - + MESSAGE_SUFFIX, - null); - operation.addChild(message); - - if (!jmethod.getReturnType().isVoidType()) { - message = fac.createOMElement(OUT_PUT_LOCAL_NAME, - wsdl); - message.addAttribute(MESSAGE_LOCAL_NAME, - tns.getPrefix() + COLON_SEPARATOR - + jmethod.getSimpleName() + RESPONSE_MESSAGE, - null); - operation.addChild(message); - } - } - } - - } - - /** - * Generate the service - */ - public void generateService(OMFactory fac, OMElement defintions) { - OMElement service = fac.createOMElement(SERVICE_LOCAL_NAME, - wsdl); - defintions.addChild(service); - service.addAttribute(ATTRIBUTE_NAME, - generationParams.getServiceName(), - null); - OMElement port = fac.createOMElement(PORT, - wsdl); - service.addChild(port); - port.addAttribute(ATTRIBUTE_NAME, - generationParams.getServiceName() + SOAP11PORT, - null); - port.addAttribute(BINDING_LOCAL_NAME, - tns.getPrefix() + COLON_SEPARATOR + generationParams.getServiceName() - + BINDING_NAME_SUFFIX, - null); - addExtensionElement(fac, - port, - soap, - SOAP_ADDRESS, - LOCATION, - generationParams.getLocationUri() + generationParams.getServiceName()); - - port = fac.createOMElement(PORT, - wsdl); - service.addChild(port); - port.addAttribute(ATTRIBUTE_NAME, - generationParams.getServiceName() + SOAP12PORT, - null); - port.addAttribute(BINDING_LOCAL_NAME, - tns.getPrefix() + COLON_SEPARATOR + generationParams.getServiceName() - + SOAP12BINDING_NAME_SUFFIX, - null); - addExtensionElement(fac, - port, - soap12, - SOAP_ADDRESS, - LOCATION, - generationParams.getLocationUri() + generationParams.getServiceName()); - } - - /** - * Generate the bindings - */ - private void generateBinding(OMFactory fac, OMElement defintions) throws Exception { - generateSoap11Binding(fac, - defintions); - generateSoap12Binding(fac, - defintions); - } - - private void generateSoap11Binding(OMFactory fac, OMElement defintions) throws Exception { - OMElement binding = fac.createOMElement(BINDING_LOCAL_NAME, - wsdl); - defintions.addChild(binding); - binding.addAttribute(ATTRIBUTE_NAME, - generationParams.getServiceName() + BINDING_NAME_SUFFIX, - null); - binding.addAttribute("type", - tns.getPrefix() + COLON_SEPARATOR + generationParams.getServiceName() - + PORT_TYPE_SUFFIX, - null); - - addExtensionElement(fac, - binding, - soap, - BINDING_LOCAL_NAME, - TRANSPORT, - TRANSPORT_URI, - STYLE, - generationParams.getStyle()); - - for (int i = 0; i < method.length; i++) { - JMethod jmethod = method[i]; - if (jmethod.isPublic()) { - OMElement operation = fac.createOMElement(OPERATION_LOCAL_NAME, - wsdl); - binding.addChild(operation); - - addExtensionElement(fac, - operation, - soap, - OPERATION_LOCAL_NAME, - SOAP_ACTION, - URN_PREFIX + COLON_SEPARATOR + jmethod.getSimpleName(), - STYLE, - generationParams.getStyle()); - operation.addAttribute(ATTRIBUTE_NAME, - jmethod.getSimpleName(), - null); - - OMElement input = fac.createOMElement(IN_PUT_LOCAL_NAME, - wsdl); - addExtensionElement(fac, - input, - soap, - SOAP_BODY, - SOAP_USE, - generationParams.getUse(), - "namespace", - generationParams.getTargetNamespace()); - operation.addChild(input); - - if (!jmethod.getReturnType().isVoidType()) { - OMElement output = fac.createOMElement(OUT_PUT_LOCAL_NAME, - wsdl); - addExtensionElement(fac, - output, - soap, - SOAP_BODY, - SOAP_USE, - generationParams.getUse(), - "namespace", - generationParams.getTargetNamespace()); - operation.addChild(output); - } - } - } - } - - private void generateSoap12Binding(OMFactory fac, OMElement defintions) throws Exception { - OMElement binding = fac.createOMElement(BINDING_LOCAL_NAME, - wsdl); - defintions.addChild(binding); - binding.addAttribute(ATTRIBUTE_NAME, - generationParams.getServiceName() + SOAP12BINDING_NAME_SUFFIX, - null); - binding.addAttribute("type", - tns.getPrefix() + COLON_SEPARATOR + generationParams.getServiceName() - + PORT_TYPE_SUFFIX, - null); - - addExtensionElement(fac, - binding, - soap12, - BINDING_LOCAL_NAME, - TRANSPORT, - TRANSPORT_URI, - STYLE, - generationParams.getStyle()); - - for (int i = 0; i < method.length; i++) { - JMethod jmethod = method[i]; - - if (jmethod.isPublic()) { - OMElement operation = fac.createOMElement(OPERATION_LOCAL_NAME, - wsdl); - binding.addChild(operation); - operation.declareNamespace(URI_WSDL12_SOAP, - SOAP12_PREFIX); - - addExtensionElement(fac, - operation, - soap12, - OPERATION_LOCAL_NAME, - SOAP_ACTION, - URN_PREFIX + COLON_SEPARATOR + jmethod.getSimpleName(), - STYLE, - generationParams.getStyle()); - operation.addAttribute(ATTRIBUTE_NAME, - jmethod.getSimpleName(), - null); - - OMElement input = fac.createOMElement(IN_PUT_LOCAL_NAME, - wsdl); - addExtensionElement(fac, - input, - soap12, - SOAP_BODY, - SOAP_USE, - generationParams.getUse(), - "namespace", - generationParams.getTargetNamespace()); - operation.addChild(input); - - if (!jmethod.getReturnType().isVoidType()) { - OMElement output = fac.createOMElement(OUT_PUT_LOCAL_NAME, - wsdl); - addExtensionElement(fac, - output, - soap12, - SOAP_BODY, - SOAP_USE, - generationParams.getUse(), - "namespace", - generationParams.getTargetNamespace()); - operation.addChild(output); - } - } - } - } - - private void addExtensionElement(OMFactory fac, - OMElement element, - OMNamespace namespace, - String name, - String att1Name, - String att1Value, - String att2Name, - String att2Value) { - OMElement soapbinding = fac.createOMElement(name, - namespace); - element.addChild(soapbinding); - soapbinding.addAttribute(att1Name, - att1Value, - null); - soapbinding.addAttribute(att2Name, - att2Value, - null); - } - - private void addExtensionElement(OMFactory fac, - OMElement element, - OMNamespace namespace, - String name, - String att1Name, - String att1Value) { - OMElement soapbinding = fac.createOMElement(name, - namespace); - element.addChild(soapbinding); - soapbinding.addAttribute(att1Name, - att1Value, - null); - } - - private String generatePrefix() { - return NAMESPACE_PREFIX + prefixCount++; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLBuilder.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLBuilder.java deleted file mode 100644 index b23726f6fa..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLBuilder.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.tools.java2wsdl.generate; - -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Collection; - -import org.apache.axiom.om.OMElement; -import org.apache.ws.java2wsdl.Java2WSDLConstants; - -public class TuscanyJava2WSDLBuilder implements Java2WSDLConstants { - - private OutputStream out; - private String className; - private ClassLoader classLoader; - private String wsdlPrefix = "wsdl"; - - // these apply for the WSDL - private GenerationParameters generationParams; - - private OMElement wsdlDocument = null; - - public String getWsdlPrefix() { - return wsdlPrefix; - } - - public void setWsdlPrefix(String wsdlPrefix) { - this.wsdlPrefix = wsdlPrefix; - } - - public TuscanyJava2WSDLBuilder(GenerationParameters genParams) { - this.generationParams = genParams; - } - - /** - * Externally visible generator method - * - * @throws Exception - */ - public void buildWSDL() throws Exception { - ArrayList excludeOpeartion = new ArrayList(); - excludeOpeartion.add("init"); - excludeOpeartion.add("setOperationContext"); - excludeOpeartion.add("destroy"); - - TuscanyWSDLTypesGenerator typesGenerator = new TuscanyWSDLTypesGenerator(generationParams); - typesGenerator.setExcludeMethods(excludeOpeartion); - Collection schemaCollection = typesGenerator.buildWSDLTypes(); - - TuscanyJava2OMBuilder java2OMBuilder = - new TuscanyJava2OMBuilder(typesGenerator.getMethods(), schemaCollection, typesGenerator - .getTypeTable(), generationParams); - - wsdlDocument = java2OMBuilder.generateOM(); - } - - public OMElement getWsdlDocument() { - return wsdlDocument; - } - - public void setWsdlDocument(OMElement wsdlDocument) { - this.wsdlDocument = wsdlDocument; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLConstants.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLConstants.java deleted file mode 100644 index cde870fff4..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLConstants.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.tools.java2wsdl.generate; - -import org.apache.ws.java2wsdl.Java2WSDLConstants; - -/** - * This is a extension from the Axis2 Java2WSDLConstants to handle additions specific to Tuscany. - * This class can be done away with once Axis2 is also enhanced to support these - * additional options. - * - */ -public interface TuscanyJava2WSDLConstants extends Java2WSDLConstants -{ - public static final char OPEN_BRACKET = '['; - public static final char COMMA = ','; - public static final char CLOSE_BRACKET = ']'; - public static final String DEFAULT_SCHEMA_LOCATION = "*.xsd"; - public static final String SCHEMA_ELEMENT_NAME = "schema"; - - String FORM_DEFAULT_QUALIFIED = "qualified"; - String FORM_DEFAULT_UNQUALIFIED = "unqualified"; - - //short options - String IMPORT_XSD_OPTION = "ixsd"; //option for importing XSDs - String ATTR_FORM_DEFAULT_OPTION = "afd"; - String ELEMENT_FORM_DEFAULT_OPTION = "efd"; - String EXTRA_CLASSES_DEFAULT_OPTION = "xc"; - - //long options - String IMPORT_XSD_OPTION_LONG = "import_xsd"; //option for importing XSDs - String ATTR_FORM_DEFAULT_OPTION_LONG = "attributeFormDefault"; - String ELEMENT_FORM_DEFAULT_OPTION_LONG = "elementFormDefault"; - String EXTRA_CLASSES_DEFAULT_OPTION_LONG = "extraClasses"; -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLOptionsValidator.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLOptionsValidator.java deleted file mode 100644 index 6411327abf..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLOptionsValidator.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.tools.java2wsdl.generate; - -import java.util.ArrayList; - -import org.apache.ws.java2wsdl.Java2WSDLConstants; -import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption; -import org.apache.ws.java2wsdl.utils.Java2WSDLOptionsValidator; - -/** - * This class is an extension from the Axis2 implementation in order to handle additional optoins - * specific to Tuscany. This class can be done away with once Axis2 is also enhanced to support these - * additional options. - * - */ -public class TuscanyJava2WSDLOptionsValidator extends Java2WSDLOptionsValidator implements - TuscanyJava2WSDLConstants { - public boolean isInvalid(Java2WSDLCommandLineOption option) { - boolean invalid; - String optionType = option.getOptionType(); - - invalid = !((IMPORT_XSD_OPTION).equalsIgnoreCase(optionType) - || (IMPORT_XSD_OPTION_LONG).equalsIgnoreCase(optionType) - || (TuscanyJava2WSDLConstants.EXTRA_CLASSES_DEFAULT_OPTION_LONG).equalsIgnoreCase(optionType) - || (TuscanyJava2WSDLConstants.EXTRA_CLASSES_DEFAULT_OPTION).equalsIgnoreCase(optionType) - || !super.isInvalid(option)); - - invalid = validateImportXSDOption(invalid, - option); - - return invalid; - } - - private boolean validateImportXSDOption(boolean invalid, Java2WSDLCommandLineOption option) { - String optionType = option.getOptionType(); - String schemaNSLocationPair = null; - - if (!invalid && (IMPORT_XSD_OPTION).equalsIgnoreCase(optionType) - || (IMPORT_XSD_OPTION_LONG).equalsIgnoreCase(optionType)) { - ArrayList optionValues = option.getOptionValues(); - - for (int count = 0; count < optionValues.size(); ++count) { - schemaNSLocationPair = ((String) optionValues.get(count)).trim(); - if ((schemaNSLocationPair.charAt(0) != OPEN_BRACKET) - || (schemaNSLocationPair.charAt(schemaNSLocationPair.length() - 1) != CLOSE_BRACKET) - || (schemaNSLocationPair.indexOf(COMMA) == -1)) - - { - System.out.println("Schema Namespace-Location pair option not specified properly!!"); - invalid = true; - } - } - } - - return invalid; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanySchemaGenerator.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanySchemaGenerator.java deleted file mode 100644 index 4f3371126d..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanySchemaGenerator.java +++ /dev/null @@ -1,410 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.java2wsdl.generate; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.apache.ws.commons.schema.XmlSchema; -import org.apache.ws.commons.schema.XmlSchemaCollection; -import org.apache.ws.commons.schema.XmlSchemaComplexType; -import org.apache.ws.commons.schema.XmlSchemaElement; -import org.apache.ws.commons.schema.XmlSchemaForm; -import org.apache.ws.commons.schema.XmlSchemaImport; -import org.apache.ws.commons.schema.XmlSchemaInclude; -import org.apache.ws.commons.schema.XmlSchemaSequence; -import org.apache.ws.commons.schema.utils.NamespaceMap; -import org.apache.ws.java2wsdl.Java2WSDLConstants; -import org.apache.ws.java2wsdl.SchemaGenerator; -import org.apache.ws.java2wsdl.bytecode.MethodTable; -import org.codehaus.jam.JClass; -import org.codehaus.jam.JMethod; -import org.codehaus.jam.JParameter; -import org.codehaus.jam.JamClassIterator; -import org.codehaus.jam.JamService; -import org.codehaus.jam.JamServiceFactory; -import org.codehaus.jam.JamServiceParams; - - -public class TuscanySchemaGenerator implements TuscanyJava2WSDLConstants -{ - public static final String NAME_SPACE_PREFIX = "stn_"; - public static final String PERIOD_SEPARATOR = "."; - private static int prefixCount = 1; - - protected String attrFormDefault = null; - protected String elementFormDefault = null; - protected Hashtable targetNamespacePrefixMap = new Hashtable(); - protected Hashtable schemaMap = new Hashtable(); - protected Hashtable sdoAnnoMap = new Hashtable(); - protected XmlSchemaCollection xmlSchemaCollection = new XmlSchemaCollection(); - private TuscanyTypeTable typeTable = new TuscanyTypeTable(); - protected SchemaBuilder schemaBuilder = null; - protected Map schemaLocationMap = null; - - private static final Log log = LogFactory.getLog(SchemaGenerator.class); - private ClassLoader classLoader; - private String className; - - // to keep loadded method using JAM - private JMethod methods []; - - //to store byte code method using Axis 1.x codes - private MethodTable methodTable; - private String schemaTargetNameSpace; - private String schema_namespace_prefix; - private Class clazz; - private ArrayList excludeMethods = new ArrayList(); - - public TuscanySchemaGenerator(ClassLoader loader, - String className, - String schematargetNamespace, - String schematargetNamespacePrefix, - Map schemaLocMap) - throws Exception - { - DataObjectUtil.initRuntime(); - this.classLoader = loader; - this.className = className; - clazz = Class.forName(className, true, loader); - methodTable = new MethodTable(clazz); - this.schemaTargetNameSpace = schematargetNamespace; - this.schema_namespace_prefix = schematargetNamespacePrefix; - this.schemaLocationMap = schemaLocMap; - - initializeSchemaMap(this.schemaTargetNameSpace, this.schema_namespace_prefix); - schemaBuilder = new SchemaBuilder(xmlSchemaCollection, - schemaMap, - targetNamespacePrefixMap, - typeTable, - getAttrFormDefault(), - getElementFormDefault(), - schemaLocMap, - this.classLoader ); - } - - /** - * Generates schema for all the parameters in method. First generates schema - * for all different parameter type and later refers to them. - * - * @return Returns XmlSchema. - * @throws Exception - */ - public Collection buildWSDLTypes() throws Exception - { - JamServiceFactory factory = JamServiceFactory.getInstance(); - JamServiceParams jam_service_parms = factory.createServiceParams(); - //setting the classLoder -// jam_service_parms.setParentClassLoader(factory.createJamClassLoader(classLoader)); - //it can posible to add the classLoader as well - jam_service_parms.addClassLoader(classLoader); - jam_service_parms.includeClass(className); - JamService service = factory.createService(jam_service_parms); - - JamClassIterator jClassIter = service.getClasses(); - //all most all the time the ittr will have only one class in it - while (jClassIter.hasNext()) - { - JClass jclass = (JClass) jClassIter.next(); - // serviceName = jclass.getSimpleName(); - //todo in the future , when we support annotation we can use this - //JAnnotation[] annotations = jclass.getAnnotations(); - - /** - * Schema genertaion done in two stage 1. Load all the methods and - * create type for methods parameters (if the parameters are Bean - * then it will create Complex types for those , and if the - * parameters are simple type which decribe in SimpleTypeTable - * nothing will happen) 2. In the next stage for all the methods - * messages and port types will be creteated - */ - methods = jclass.getDeclaredMethods(); - - // since we do not support overload - HashMap uniqueMethods = new HashMap(); - XmlSchemaComplexType methodSchemaType = null; - XmlSchemaSequence sequence = null; - QName methodPartSchemaTypeName = null; - for (int i = 0; i < methods.length; i++) - { - String methodName = methods[i].getSimpleName(); - JMethod jMethod = methods[i]; - // no need to think abt this method , since that is system - // config method - if (excludeMethods.contains(jMethod.getSimpleName())) { - continue; - } - //if (jMethod.getSimpleName().equals("init") - // || "setOperationContext".equals(jMethod.getSimpleName()) - // || "destroy".equals(jMethod.getSimpleName())) - // continue; - if (uniqueMethods.get(jMethod.getSimpleName()) != null) { - throw new Exception( - " Sorry we don't support methods overloading !!!! "); - } - - if (!jMethod.isPublic()) { - // no need to generate Schema for non public methods - continue; - } - - uniqueMethods.put(jMethod.getSimpleName(), jMethod); - JParameter [] paras = jMethod.getParameters(); - String parameterNames [] = null; - if (paras.length > 0) - { - parameterNames = methodTable.getParameterNames(methodName); - sequence = new XmlSchemaSequence(); - - //create the schema type for the method wrapper - methodSchemaType = createSchemaTypeForMethodPart(jMethod.getSimpleName()); - methodSchemaType.setParticle(sequence); - } - - for (int j = 0; j < paras.length; j++) - { - JParameter methodParameter = paras[j]; - JClass paraType = methodParameter.getType(); - generateSchemaForType(sequence, paraType, - ( parameterNames != null && parameterNames[j] != null )? parameterNames[j] : methodParameter.getSimpleName()); - } - // for its return type - JClass returnType = jMethod.getReturnType(); - QName methodReturnSchemaTypeName = null; - - if (!returnType.isVoidType()) - { - methodSchemaType = createSchemaTypeForMethodPart(jMethod.getSimpleName() + RESPONSE); - sequence = new XmlSchemaSequence(); - methodSchemaType.setParticle(sequence); - generateSchemaForType(sequence, returnType, "return"); - } - } - //generateWrapperElements(methods); - } - return schemaMap.values(); - } - - private QName generateSchemaForType(XmlSchemaSequence sequence, JClass type, String partName) throws Exception - { - boolean isArrayType = type.isArrayType(); - if ( isArrayType ) - { - type = type.getArrayComponentType(); - } - - String classTypeName = type.getQualifiedName(); - - QName schemaTypeName = typeTable.getSimpleSchemaTypeName(classTypeName); - if ( schemaTypeName == null ) - { - schemaTypeName = - schemaBuilder.generateSchema(type); - addContentToMethodSchemaType(sequence, - schemaTypeName, - partName, - type.isArrayType()); - addImportORInclude((XmlSchema)schemaMap.get(schemaTargetNameSpace), schemaTypeName); - - } - else - { - addContentToMethodSchemaType(sequence, - schemaTypeName, - partName, - type.isArrayType()); - } - - return schemaTypeName; - } - - private void addContentToMethodSchemaType(XmlSchemaSequence sequence, - QName schemaTypeName, - String paraName, - boolean isArray ) - { - XmlSchemaElement elt1 = new XmlSchemaElement(); - elt1.setName(paraName); - elt1.setSchemaTypeName(schemaTypeName); - sequence.getItems().add(elt1); - - if ( isArray ) - { - elt1.setMaxOccurs(Long.MAX_VALUE); - elt1.setMinOccurs(0); - } - } - - private XmlSchemaComplexType createSchemaTypeForMethodPart(String localPartName) - { - XmlSchema xmlSchema = (XmlSchema)schemaMap.get(schemaTargetNameSpace); - QName elementName = new QName(this.schemaTargetNameSpace, localPartName, this.schema_namespace_prefix); - XmlSchemaComplexType complexType = new XmlSchemaComplexType(xmlSchema); - - XmlSchemaElement globalElement = new XmlSchemaElement(); - globalElement.setSchemaType(complexType); - globalElement.setName(formGlobalElementName(localPartName)); - globalElement.setQName(elementName); - - xmlSchema.getItems().add(globalElement); - xmlSchema.getElements().add(elementName, globalElement); - - typeTable.addComplexSchemaType(this.schemaTargetNameSpace, globalElement.getName(), elementName); - - return complexType; - } - - - private String formGlobalElementName(String typeName) - { - String firstChar = typeName.substring(0,1); - return typeName.replaceFirst(firstChar, firstChar.toLowerCase()); - } - - public TuscanyTypeTable getTypeTable() { - return typeTable; - } - - public JMethod[] getMethods() { - return methods; - } - - private String generatePrefix() { - return NAME_SPACE_PREFIX + prefixCount++; - } - - public void setExcludeMethods(ArrayList excludeMethods) { - this.excludeMethods = excludeMethods; - } - - private void initializeSchemaMap(String targetNamespace, String targetNamespacePrefix) - { - XmlSchema xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection); - xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting()); - xmlSchema.setElementFormDefault(getElementFormDefaultSetting()); - - targetNamespacePrefixMap.put(targetNamespace, targetNamespacePrefix); - schemaMap.put(targetNamespace, xmlSchema); - - - NamespaceMap prefixmap = new NamespaceMap(); - prefixmap.put(TuscanyTypeTable.XS_URI_PREFIX, TuscanyTypeTable.XML_SCHEMA_URI); - prefixmap.put(targetNamespacePrefix, targetNamespace); - xmlSchema.setNamespaceContext(prefixmap); - } - - private void setFormDefaults() - { - - } - - public Hashtable getSdoAnnoMap() { - return sdoAnnoMap; - } - - public void setSdoAnnoMap(Hashtable sdoAnnoMap) { - this.sdoAnnoMap = sdoAnnoMap; - } - - private void addImportORInclude(XmlSchema xmlSchema, QName schemaTypeName) - { - //decide whether there must be an import or an include - if ( xmlSchema.getTargetNamespace().equals(schemaTypeName.getNamespaceURI()) ) - { - XmlSchema containingSchema = (XmlSchema)schemaMap.get(schemaTypeName.getNamespaceURI()); - //if the type is not defined in the Schema then include - if ( containingSchema.getTypeByName(schemaTypeName) == null ) - { - String schemaLocation = null; - if ( (schemaLocation = (String)schemaLocationMap.get(schemaTypeName.getNamespaceURI())) != null ) - { - schemaLocation = DEFAULT_SCHEMA_LOCATION; - } - - XmlSchemaInclude includeElement = new XmlSchemaInclude(); - includeElement.setSchemaLocation(schemaLocation); - - if ( !xmlSchema.getIncludes().contains(includeElement) ) - { - xmlSchema.getIncludes().add(includeElement); - } - } - } - else - { - if (!((NamespaceMap)xmlSchema.getNamespaceContext()).values(). - contains(schemaTypeName.getNamespaceURI())) - { - XmlSchemaImport importElement = new XmlSchemaImport(); - importElement.setNamespace(schemaTypeName.getNamespaceURI()); - xmlSchema.getItems().add(importElement); - ((NamespaceMap)xmlSchema.getNamespaceContext()). - put(generatePrefix(), schemaTypeName.getNamespaceURI()); - } - } - } - - private XmlSchemaForm getAttrFormDefaultSetting() - { - if ( FORM_DEFAULT_UNQUALIFIED.equals(getAttrFormDefault()) ) - { - return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED); - } - else - { - return new XmlSchemaForm(XmlSchemaForm.QUALIFIED); - } - } - - private XmlSchemaForm getElementFormDefaultSetting() - { - if ( FORM_DEFAULT_UNQUALIFIED.equals(getElementFormDefault()) ) - { - return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED); - } - else - { - return new XmlSchemaForm(XmlSchemaForm.QUALIFIED); - } - } - - public String getAttrFormDefault() { - return attrFormDefault; - } - - public void setAttrFormDefault(String attrFormDefault) { - this.attrFormDefault = attrFormDefault; - } - - public String getElementFormDefault() { - return elementFormDefault; - } - - public void setElementFormDefault(String elementFormDefault) { - this.elementFormDefault = elementFormDefault; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyTypeTable.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyTypeTable.java deleted file mode 100644 index 4abd7a7ce7..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyTypeTable.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.java2wsdl.generate; - -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Vector; - -import javax.xml.namespace.QName; - -import org.apache.axiom.om.OMElement; -import org.apache.ws.java2wsdl.Java2WSDLUtils; -import org.codehaus.jam.JClass; - -public class TuscanyTypeTable -{ - public static final String XML_SCHEMA_URI = "http://www.w3.org/2001/XMLSchema"; - public static final String XS_URI_PREFIX = "xs"; - public static final QName XS_QNAME = new QName(XML_SCHEMA_URI, "schema", XS_URI_PREFIX); - public static final String DELIMITER = "#"; - - private Hashtable simpleXSDTypes; - private Hashtable complexXSDTypes; - - public static String asQualifiedName(String uri, String typeName) - { - return (uri + DELIMITER + typeName); - } - - - public TuscanyTypeTable() - { - simpleXSDTypes = new Hashtable(); - complexXSDTypes = new Hashtable(); - populateSimpleXSDTypes(); - populateStdSDOTypes(); - } - - private void populateStdSDOTypes() - { - simpleXSDTypes.put("Boolean", - new QName(XML_SCHEMA_URI, "boolean", XS_URI_PREFIX)); - simpleXSDTypes.put("Byte", - new QName(XML_SCHEMA_URI, "byte", XS_URI_PREFIX)); - simpleXSDTypes.put("Bytes", - new QName(XML_SCHEMA_URI, "hexBinary", XS_URI_PREFIX)); - simpleXSDTypes.put("Character", - new QName(XML_SCHEMA_URI, "string", XS_URI_PREFIX)); - simpleXSDTypes.put("DataObject", - new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX)); - simpleXSDTypes.put("Date", - new QName(XML_SCHEMA_URI, "dateTime", XS_URI_PREFIX)); - simpleXSDTypes.put("Day", - new QName(XML_SCHEMA_URI, "gDay", XS_URI_PREFIX)); - simpleXSDTypes.put("Decimal", - new QName(XML_SCHEMA_URI, "decimal", XS_URI_PREFIX)); - simpleXSDTypes.put("Double", - new QName(XML_SCHEMA_URI, "double", XS_URI_PREFIX)); - simpleXSDTypes.put("Duration", - new QName(XML_SCHEMA_URI, "duration", XS_URI_PREFIX)); - simpleXSDTypes.put("Float", - new QName(XML_SCHEMA_URI, "float", XS_URI_PREFIX)); - simpleXSDTypes.put("Int", - new QName(XML_SCHEMA_URI, "int", XS_URI_PREFIX)); - simpleXSDTypes.put("Integer", - new QName(XML_SCHEMA_URI, "integer", XS_URI_PREFIX)); - simpleXSDTypes.put("Long", - new QName(XML_SCHEMA_URI, "long", XS_URI_PREFIX)); - simpleXSDTypes.put("Month", - new QName(XML_SCHEMA_URI, "gMonth", XS_URI_PREFIX)); - simpleXSDTypes.put("monthDay", - new QName(XML_SCHEMA_URI, "gMonthDay", XS_URI_PREFIX)); - simpleXSDTypes.put("Object", - new QName(XML_SCHEMA_URI, "anySimpleType", XS_URI_PREFIX)); - simpleXSDTypes.put("Short", - new QName(XML_SCHEMA_URI, "short", XS_URI_PREFIX)); - simpleXSDTypes.put("String", - new QName(XML_SCHEMA_URI, "string", XS_URI_PREFIX)); - simpleXSDTypes.put("Strings", - new QName(XML_SCHEMA_URI, "string", XS_URI_PREFIX)); - simpleXSDTypes.put("Time", - new QName(XML_SCHEMA_URI, "time", XS_URI_PREFIX)); - simpleXSDTypes.put("Year", - new QName(XML_SCHEMA_URI, "gYear", XS_URI_PREFIX)); - simpleXSDTypes.put("YearMonth", - new QName(XML_SCHEMA_URI, "gYearMonth", XS_URI_PREFIX)); - simpleXSDTypes.put("YearMonthDay", - new QName(XML_SCHEMA_URI, "date", XS_URI_PREFIX)); - simpleXSDTypes.put("URI", - new QName(XML_SCHEMA_URI, "anyURI", XS_URI_PREFIX)); - } - - private void populateSimpleXSDTypes() { - //todo pls use the types from org.apache.ws.commons.schema.constants.Constants - simpleXSDTypes.put("int", - new QName(XML_SCHEMA_URI, "int", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.String", - new QName(XML_SCHEMA_URI, "string", XS_URI_PREFIX)); - simpleXSDTypes.put("boolean", - new QName(XML_SCHEMA_URI, "boolean", XS_URI_PREFIX)); - simpleXSDTypes.put("float", - new QName(XML_SCHEMA_URI, "float", XS_URI_PREFIX)); - simpleXSDTypes.put("double", - new QName(XML_SCHEMA_URI, "double", XS_URI_PREFIX)); - simpleXSDTypes.put("short", - new QName(XML_SCHEMA_URI, "short", XS_URI_PREFIX)); - simpleXSDTypes.put("long", - new QName(XML_SCHEMA_URI, "long", XS_URI_PREFIX)); - simpleXSDTypes.put("byte", - new QName(XML_SCHEMA_URI, "byte", XS_URI_PREFIX)); - simpleXSDTypes.put("char", - new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Integer", - new QName(XML_SCHEMA_URI, "int", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Double", - new QName(XML_SCHEMA_URI, "double", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Float", - new QName(XML_SCHEMA_URI, "float", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Long", - new QName(XML_SCHEMA_URI, "long", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Character", - new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Boolean", - new QName(XML_SCHEMA_URI, "boolean", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Byte", - new QName(XML_SCHEMA_URI, "byte", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Short", - new QName(XML_SCHEMA_URI, "short", XS_URI_PREFIX)); - simpleXSDTypes.put("java.util.Date", - new QName(XML_SCHEMA_URI, "dateTime", XS_URI_PREFIX)); - simpleXSDTypes.put("java.util.Calendar", - new QName(XML_SCHEMA_URI, "dateTime", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Object", - new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX)); - simpleXSDTypes.put("java.math.BigDecimal", - new QName(XML_SCHEMA_URI, "decimal", XS_URI_PREFIX)); - - // Any types - simpleXSDTypes.put(OMElement.class.getName(), - new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX)); - simpleXSDTypes.put(ArrayList.class.getName(), - new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX)); - simpleXSDTypes.put(Vector.class.getName(), - new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX)); - simpleXSDTypes.put(List.class.getName(), - new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX)); - } - - public QName getStdSdoType(String typename) - { - return (QName) simpleXSDTypes.get(typename); - } - - public QName getComplexSchemaTypeName(String sdoURI, String sdoTypeName) - { - return (QName) complexXSDTypes.get(asQualifiedName(sdoURI, sdoTypeName)); - } - - public QName getComplexSchemaTypeName(JClass javaClass, ClassLoader cl) throws Exception - { - String namespace = Java2WSDLUtils.schemaNamespaceFromClassName( - javaClass.getQualifiedName(), cl).toString(); - return (QName) complexXSDTypes.get(asQualifiedName(namespace, javaClass.getSimpleName())); - } - - public boolean isSimpleType(String typeName) - { - Iterator keys = simpleXSDTypes.keySet().iterator(); - while (keys.hasNext()) { - String s = (String) keys.next(); - if (s.equals(typeName)) { - return true; - } - } - return false; - } - - public QName getSimpleSchemaTypeName(String typename) - { - return (QName) simpleXSDTypes.get(typename); - } - - public void addSimpleSchemaType(String typeName, QName schemaType) - { - simpleXSDTypes.put(typeName, schemaType); - } - - - public void addComplexSchemaType(String namespaceURI, String name, QName schemaType) - { - complexXSDTypes.put(asQualifiedName(namespaceURI, name), schemaType); - } - - - public QName getQNamefortheType(String namespaceURI, String typeName) - { - if ( XML_SCHEMA_URI.equals(namespaceURI)) - { - return getSimpleSchemaTypeName(typeName); - } - else - { - return getComplexSchemaTypeName(namespaceURI, typeName); - } - } -} - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyWSDLTypesGenerator.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyWSDLTypesGenerator.java deleted file mode 100644 index a742e8913d..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyWSDLTypesGenerator.java +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.java2wsdl.generate; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.apache.ws.commons.schema.XmlSchema; -import org.apache.ws.commons.schema.XmlSchemaCollection; -import org.apache.ws.commons.schema.XmlSchemaComplexType; -import org.apache.ws.commons.schema.XmlSchemaElement; -import org.apache.ws.commons.schema.XmlSchemaForm; -import org.apache.ws.commons.schema.XmlSchemaImport; -import org.apache.ws.commons.schema.XmlSchemaInclude; -import org.apache.ws.commons.schema.XmlSchemaSequence; -import org.apache.ws.commons.schema.utils.NamespaceMap; -import org.apache.ws.java2wsdl.Java2WSDLConstants; -import org.apache.ws.java2wsdl.SchemaGenerator; -import org.apache.ws.java2wsdl.bytecode.MethodTable; -import org.codehaus.jam.JClass; -import org.codehaus.jam.JMethod; -import org.codehaus.jam.JParameter; -import org.codehaus.jam.JamClassIterator; -import org.codehaus.jam.JamService; -import org.codehaus.jam.JamServiceFactory; -import org.codehaus.jam.JamServiceParams; - -public class TuscanyWSDLTypesGenerator implements TuscanyJava2WSDLConstants { - public static final String NAME_SPACE_PREFIX = "stn_"; - - public static final String PERIOD_SEPARATOR = "."; - - private static int prefixCount = 1; - - protected GenerationParameters generationParams; - - protected Hashtable targetNamespacePrefixMap = new Hashtable(); - - protected Hashtable schemaMap = new Hashtable(); - - protected XmlSchemaCollection xmlSchemaCollection = new XmlSchemaCollection(); - - private TuscanyTypeTable typeTable = new TuscanyTypeTable(); - - protected SchemaBuilder schemaBuilder = null; - - protected Map schemaLocationMap = null; - - private static final Log log = LogFactory.getLog(SchemaGenerator.class); - - // to keep loadded method using JAM - private JMethod methods[]; - - //to store byte code method using Axis 1.x codes - private MethodTable methodTable; - - private Class clazz; - - private ArrayList excludeMethods = new ArrayList(); - - public TuscanyWSDLTypesGenerator(GenerationParameters genParams) throws Exception { - DataObjectUtil.initRuntime(); - this.generationParams = genParams; - - clazz = Class.forName(generationParams.getSourceClassName(), - true, - generationParams.getClassLoader()); - methodTable = new MethodTable(clazz); - - initializeSchemaMap(generationParams.getSchemaTargetNamespace(), - generationParams.getSchemaTargetNamespacePrefix()); - schemaBuilder = new SchemaBuilder(xmlSchemaCollection, - schemaMap, - targetNamespacePrefixMap, - typeTable, - generationParams.getAttrFormDefault(), - generationParams.getElementFormDefault(), - generationParams.getSchemaLocationMap(), - generationParams.getClassLoader()); - } - - /** - * Generates schema for all the parameters in method. First generates schema - * for all different parameter type and later refers to them. - * - * @return Returns XmlSchema. - * @throws Exception - */ - public Collection buildWSDLTypes() throws Exception { - JamServiceFactory factory = JamServiceFactory.getInstance(); - JamServiceParams jam_service_parms = factory.createServiceParams(); - //setting the classLoder -// jam_service_parms.setParentClassLoader(factory.createJamClassLoader(classLoader)); - //it can posible to add the classLoader as well - jam_service_parms.addClassLoader(generationParams.getClassLoader()); - jam_service_parms.includeClass(generationParams.getSourceClassName()); - - for ( int count = 0 ; count < generationParams.getExtraClasses().size() ; ++count ) - { - jam_service_parms.includeClass((String)generationParams.getExtraClasses().get(count)); - } - - JamService service = factory.createService(jam_service_parms); - QName extraSchemaTypeName = null; - JamClassIterator jClassIter = service.getClasses(); - //all most all the time the ittr will have only one class in it - while (jClassIter.hasNext()) { - JClass jclass = (JClass) jClassIter.next(); - // serviceName = jclass.getSimpleName(); - //todo in the future , when we support annotation we can use this - //JAnnotation[] annotations = jclass.getAnnotations(); - - if ( jclass.getQualifiedName().equals(generationParams.getSourceClassName()) ) - { - /** - * Schema genertaion done in two stage 1. Load all the methods and - * create type for methods parameters (if the parameters are Bean - * then it will create Complex types for those , and if the - * parameters are simple type which decribe in SimpleTypeTable - * nothing will happen) 2. In the next stage for all the methods - * messages and port types will be creteated - */ - methods = jclass.getDeclaredMethods(); - //short the elements in the array - Arrays.sort(methods); - - // since we do not support overload - HashMap uniqueMethods = new HashMap(); - XmlSchemaComplexType methodSchemaType; - XmlSchemaSequence sequence = null; - - for (int i = 0; i < methods.length; i++) { - JMethod jMethod = methods[i]; - - String methodName = methods[i].getSimpleName(); - // no need to think abt this method , since that is system - // config method - if (excludeMethods.contains(jMethod.getSimpleName())) { - continue; - } - - if (uniqueMethods.get(jMethod.getSimpleName()) != null) { - throw new Exception( - " Sorry we don't support methods overloading !!!! "); - } - - if (!jMethod.isPublic()) { - // no need to generate Schema for non public methods - continue; - } - uniqueMethods.put(jMethod.getSimpleName(), jMethod); - //create the schema type for the method wrapper - - uniqueMethods.put(jMethod.getSimpleName(), jMethod); - JParameter [] paras = jMethod.getParameters(); - String parameterNames [] = null; - if (paras.length > 0) { - parameterNames = methodTable.getParameterNames(methodName); - sequence = new XmlSchemaSequence(); - - methodSchemaType = createSchemaTypeForMethodPart(jMethod.getSimpleName()); - methodSchemaType.setParticle(sequence); - } - - for (int j = 0; j < paras.length; j++) { - JParameter methodParameter = paras[j]; - JClass paraType = methodParameter.getType(); - generateSchemaForType(sequence, paraType, - (parameterNames != null && parameterNames[j] != null) ? parameterNames[j] : methodParameter.getSimpleName()); - } - // for its return type - JClass returnType = jMethod.getReturnType(); - - if (!returnType.isVoidType()) { - methodSchemaType = createSchemaTypeForMethodPart(jMethod.getSimpleName() + RESPONSE); - sequence = new XmlSchemaSequence(); - methodSchemaType.setParticle(sequence); - generateSchemaForType(sequence, returnType, "return"); - } - } - } - else - { - //generate the schema type for extra classes - extraSchemaTypeName = typeTable.getSimpleSchemaTypeName(jclass.getQualifiedName()); - if (extraSchemaTypeName == null) - { - extraSchemaTypeName = schemaBuilder.generateSchema(jclass); - } - } - } - return schemaMap.values(); - } - - private QName generateSchemaForType(XmlSchemaSequence sequence, JClass type, String partName) throws Exception { - boolean isArrayType = type.isArrayType(); - if (isArrayType) { - type = type.getArrayComponentType(); - } - - String classTypeName = type.getQualifiedName(); - - QName schemaTypeName = typeTable.getSimpleSchemaTypeName(classTypeName); - if (schemaTypeName == null) { - schemaTypeName = schemaBuilder.generateSchema(type); - addContentToMethodSchemaType(sequence, - schemaTypeName, - partName, - type.isArrayType()); - addImportORInclude((XmlSchema) schemaMap.get(generationParams.getSchemaTargetNamespace()), - schemaTypeName); - - } else { - addContentToMethodSchemaType(sequence, - schemaTypeName, - partName, - type.isArrayType()); - } - - return schemaTypeName; - } - - private void addContentToMethodSchemaType(XmlSchemaSequence sequence, - QName schemaTypeName, - String paraName, - boolean isArray) { - XmlSchemaElement elt1 = new XmlSchemaElement(); - elt1.setName(paraName); - elt1.setSchemaTypeName(schemaTypeName); - sequence.getItems().add(elt1); - - if (isArray) { - elt1.setMaxOccurs(Long.MAX_VALUE); - elt1.setMinOccurs(0); - } - } - - private XmlSchemaComplexType createSchemaTypeForMethodPart(String localPartName) throws Exception { - XmlSchema xmlSchema = (XmlSchema) schemaMap.get(generationParams.getSchemaTargetNamespace()); - QName elementName = new QName(generationParams.getSchemaTargetNamespace(), - localPartName, - generationParams.getSchemaTargetNamespacePrefix()); - XmlSchemaComplexType complexType = new XmlSchemaComplexType(xmlSchema); - - XmlSchemaElement globalElement = new XmlSchemaElement(); - globalElement.setSchemaType(complexType); - globalElement.setName(formGlobalElementName(localPartName)); - globalElement.setQName(elementName); - - xmlSchema.getItems().add(globalElement); - xmlSchema.getElements().add(elementName, - globalElement); - - typeTable.addComplexSchemaType(generationParams.getSchemaTargetNamespace(), - globalElement.getName(), - elementName); - - return complexType; - } - - private String formGlobalElementName(String typeName) { - String firstChar = typeName.substring(0, - 1); - return typeName.replaceFirst(firstChar, - firstChar.toLowerCase()); - } - - public TuscanyTypeTable getTypeTable() { - return typeTable; - } - - public JMethod[] getMethods() { - return methods; - } - - private String generatePrefix() { - return NAME_SPACE_PREFIX + prefixCount++; - } - - public void setExcludeMethods(ArrayList excludeMethods) { - this.excludeMethods = excludeMethods; - } - - private void initializeSchemaMap(String targetNamespace, String targetNamespacePrefix) { - XmlSchema xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection); - xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting()); - xmlSchema.setElementFormDefault(getElementFormDefaultSetting()); - - targetNamespacePrefixMap.put(targetNamespace, - targetNamespacePrefix); - schemaMap.put(targetNamespace, - xmlSchema); - - NamespaceMap prefixmap = new NamespaceMap(); - prefixmap.put(TuscanyTypeTable.XS_URI_PREFIX, - TuscanyTypeTable.XML_SCHEMA_URI); - prefixmap.put(targetNamespacePrefix, - targetNamespace); - xmlSchema.setNamespaceContext(prefixmap); - } - - - private void addImportORInclude(XmlSchema xmlSchema, QName schemaTypeName) { - //decide whether there must be an import or an include - if (xmlSchema.getTargetNamespace().equals(schemaTypeName.getNamespaceURI())) { - XmlSchema containingSchema = (XmlSchema) schemaMap.get(schemaTypeName.getNamespaceURI()); - //if the type is not defined in the Schema then include - if (containingSchema.getTypeByName(schemaTypeName) == null) { - String schemaLocation = null; - if ((schemaLocation = (String) schemaLocationMap.get(schemaTypeName.getNamespaceURI())) != null) { - schemaLocation = DEFAULT_SCHEMA_LOCATION; - } - - XmlSchemaInclude includeElement = new XmlSchemaInclude(); - includeElement.setSchemaLocation(schemaLocation); - - if (!xmlSchema.getIncludes().contains(includeElement)) { - xmlSchema.getIncludes().add(includeElement); - } - } - } else { - if (!((NamespaceMap) xmlSchema.getNamespaceContext()).values() - .contains(schemaTypeName.getNamespaceURI())) { - XmlSchemaImport importElement = new XmlSchemaImport(); - importElement.setNamespace(schemaTypeName.getNamespaceURI()); - xmlSchema.getItems().add(importElement); - ((NamespaceMap) xmlSchema.getNamespaceContext()).put(generatePrefix(), - schemaTypeName.getNamespaceURI()); - } - } - } - - private XmlSchemaForm getAttrFormDefaultSetting() { - if (FORM_DEFAULT_UNQUALIFIED.equals(generationParams.getAttrFormDefault())) { - return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED); - } else { - return new XmlSchemaForm(XmlSchemaForm.QUALIFIED); - } - } - - private XmlSchemaForm getElementFormDefaultSetting() { - if (FORM_DEFAULT_UNQUALIFIED.equals(generationParams.getElementFormDefault())) { - return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED); - } else { - return new XmlSchemaForm(XmlSchemaForm.QUALIFIED); - } - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenEvent.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenEvent.java deleted file mode 100644 index 26b3d092de..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenEvent.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.tools.java2wsdl.generate; - -import java.util.EventObject; - -public class WSDLGenEvent extends EventObject { - private int generationPhase = WSDLGenListener.UNKNOWN; - - public WSDLGenEvent(Object source, int genPhase) { - super(source); - this.generationPhase = genPhase; - } - - public int getGenerationPhase() { - return generationPhase; - } - - public void setGenerationPhase(int generationPhase) { - this.generationPhase = generationPhase; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenListener.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenListener.java deleted file mode 100644 index 788d162f34..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenListener.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.tools.java2wsdl.generate; - -public interface WSDLGenListener { - public static int UNKNOWN = 0; - - public static int INPUT_ARGS_PARSING = 1; - - public static int INPUT_ARGS_VALIDATION = 2; - - public static int WSDL_MODEL_CREATION = 3; - - public static int WSDL_MODEL_WRITING = 4; - - public static String[] phaseAsString = { "Unknown", - "Input Arguments Parsing", "Input Arguments Validation", - "WSDL Model Creation", "WSDL Model Writing" }; - - public void WSDLGenPhaseStarted(WSDLGenEvent event); - - public void WSDLGenPhaseCompleted(WSDLGenEvent event); -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/util/XMLNameUtil.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/util/XMLNameUtil.java deleted file mode 100644 index b30b8cd62b..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/java2wsdl/util/XMLNameUtil.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.java2wsdl.util; - -import java.util.ArrayList; -import java.util.List; - -public class XMLNameUtil { - - /** - * Returns a valid Java name from an XML Name. - * - * @param name - * @param isUpperCase - * @return a valid Java name from an XML Name - */ - public static String getJavaNameFromXMLName(String name, boolean isUpperCase) { - List parsedName = parseName(name, '_'); - StringBuilder result = new StringBuilder(64 * parsedName.size()); - for (String nameComponent: parsedName) { - if (nameComponent.length() > 0) { - if (result.length() > 0 || isUpperCase) { - result.append(Character.toUpperCase(nameComponent.charAt(0))); - result.append(nameComponent.substring(1)); - } else { - result.append(nameComponent); - } - } - } - - if (result.length() == 0) { - return "_"; - } - if (Character.isJavaIdentifierStart(result.charAt(0))) { - return isUpperCase ? result.toString() : decapitalizeName(result.toString()); - } - return "_" + result; - } - - /** - * Decapitalize a name. - * @param name - * @return a decapitalized name - */ - public static String decapitalizeName(String name) { - if (name.length() == 0) { - return name; - } else { - String lowerName = name.toLowerCase(); - int i; - for (i = 0; i < name.length(); i++) { - if (name.charAt(i) == lowerName.charAt(i)) { - break; - } - } - if (i > 1 && i < name.length()) { - --i; - } - return name.substring(0, i).toLowerCase() + name.substring(i); - } - } - - /** - * Parse the given name. - * - * @param sourceName - * @param separator - * @return some stuff parsed from the name - */ - private static List parseName(String sourceName, char separator) { - List result = new ArrayList(); - if (sourceName != null) { - StringBuilder currentWord = new StringBuilder(64); - boolean lastIsLower = false; - int index; - int length; - for (index = 0, length = sourceName.length(); index < length; ++index) { - char curChar = sourceName.charAt(index); - if (!Character.isJavaIdentifierPart(curChar)) { - curChar = separator; - } - if (Character.isUpperCase(curChar) - || (!lastIsLower && Character.isDigit(curChar)) - || curChar == separator) { - - if (lastIsLower && currentWord.length() > 1 - || curChar == separator && currentWord.length() > 0) { - result.add(currentWord.toString()); - currentWord = new StringBuilder(64); - } - lastIsLower = false; - } else { - if (!lastIsLower) { - int currentWordLength = currentWord.length(); - if (currentWordLength > 1) { - char lastChar = currentWord.charAt(--currentWordLength); - currentWord.setLength(currentWordLength); - result.add(currentWord.toString()); - currentWord = new StringBuilder(64); - currentWord.append(lastChar); - } - } - lastIsLower = true; - } - - if (curChar != separator) { - currentWord.append(curChar); - } - } - - result.add(currentWord.toString()); - } - return result; - } - - /** - * Return an EPackage name for the given namespace. - * - * @param namespace - * @return an EPackage name for the given namespace - */ - public static String getPackageNameFromNamespace(String namespace) { - return org.apache.tuscany.sdo.helper.SDOXSDEcoreBuilder.getDefaultPackageName(namespace); - } - - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java deleted file mode 100644 index 22383e99db..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.wsdl2java.generate; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.axis2.description.AxisMessage; -import org.apache.axis2.description.AxisOperation; -import org.apache.axis2.util.FileWriter; -import org.apache.axis2.wsdl.WSDLConstants; -import org.apache.axis2.wsdl.codegen.CodeGenConfiguration; -import org.apache.axis2.wsdl.codegen.emitter.JavaEmitter; -import org.apache.axis2.wsdl.codegen.writer.InterfaceWriter; -import org.apache.axis2.wsdl.databinding.TypeMapper; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import static org.apache.tuscany.tools.java2wsdl.util.XMLNameUtil.getJavaNameFromXMLName; - -/** - * Overrides the Axis2 JavaEmitter to generate unwrapped methods. - */ -public class JavaInterfaceEmitter extends JavaEmitter { - - private CodeGenConfiguration codegenConfiguration; - private TypeMapper typeMapper; - - public void setCodeGenConfiguration(CodeGenConfiguration configuration) { - super.setCodeGenConfiguration(configuration); - codegenConfiguration=configuration; - } - - public void setMapper(TypeMapper typeMapper) { - super.setMapper(typeMapper); - this.typeMapper = typeMapper; - } - - private List getParameterElementList(Document doc, AxisMessage message, boolean wrapped) { - List parameterElementList = new ArrayList(); - - if (message != null && message.getElementQName()!=null) { - - SDODataBindingTypeMappingEntry typeMappingEntry = - (SDODataBindingTypeMappingEntry)this.typeMapper.getTypeMappingObject(message.getElementQName()); - List typeMappings; - if (wrapped) { - typeMappings = (List)typeMappingEntry.getPropertyClassNames(); - } else { - typeMappings = new ArrayList(); - typeMappings.add(typeMappingEntry.getClassName()); - } - - for (int i=0; i> Generating Java class " + packageName + "." + className); - File outputFile = FileWriter.createClassFile(this.codegenConfiguration.getOutputLocation(), - packageName, className, ".java"); - if (outputFile.exists()) { - outputFile.delete(); - } - - writeClass(interfaceModel, interfaceWriter); - } - - protected String makeJavaClassName(String word) { - //return XMLNameUtil.getJavaNameFromXMLName(word, true); - return getJavaNameFromXMLName(word, true); - } - - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java deleted file mode 100644 index b68277566a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.wsdl2java.generate; - -import static org.apache.tuscany.tools.java2wsdl.util.XMLNameUtil.getPackageNameFromNamespace; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import javax.wsdl.Binding; -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.PortType; -import javax.wsdl.Service; -import javax.wsdl.WSDLException; -import javax.wsdl.factory.WSDLFactory; -import javax.wsdl.xml.WSDLReader; -import javax.xml.namespace.QName; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.axis2.AxisFault; -import org.apache.axis2.description.AxisService; -import org.apache.axis2.description.WSDL11ToAxisServiceBuilder; -import org.apache.axis2.util.XMLUtils; -import org.apache.axis2.wsdl.codegen.CodeGenConfiguration; -import org.apache.axis2.wsdl.codegen.CodeGenerationException; -import org.apache.axis2.wsdl.codegen.extension.CodeGenExtension; -import org.apache.axis2.wsdl.codegen.extension.DefaultDatabindingExtension; -import org.apache.axis2.wsdl.codegen.extension.PackageFinder; -import org.apache.axis2.wsdl.codegen.extension.WSDLValidatorExtension; -import org.apache.axis2.wsdl.databinding.JavaTypeMapper; -import org.w3c.dom.Document; -import org.xml.sax.SAXException; - -public class JavaInterfaceGenerator { - - private List codegenExtensions = new ArrayList(); - private List codegenConfigurations= new LinkedList(); - - - - - public JavaInterfaceGenerator(String uri, String ports[], String outputLocation, String packageName, - Map typeMapping) throws CodeGenerationException { - - Definition definition; - try { - definition = readWSDL(uri); - } catch (WSDLException e) { - throw new CodeGenerationException(e); - } - - HashSet interestedPorts= ports == null ? null : new HashSet(Arrays.asList(ports)); - - // Service service=(Service)definition.getServices().values().().next(); - - HashSet donePortTypes= new HashSet(); - - for (Iterator sIter = definition.getServices().values().iterator(); sIter.hasNext(); ) { - Service service = (Service) sIter.next(); - - QName serviceQname = service.getQName(); - for (Iterator pIter= service.getPorts().values().iterator(); pIter.hasNext(); ) { - Port port= (Port) pIter.next(); - if(interestedPorts != null && ! interestedPorts.contains(port.getName())) continue;//not iterested. - PortType portType= getPortType(port); - if(null == portType) continue; // not connected. - QName pQName= portType.getQName(); - if(donePortTypes.contains(pQName)) continue; //allready did it. - donePortTypes.add(pQName); - - if (packageName == null) { - - packageName = getPackageNameFromNamespace(definition.getTargetNamespace()); - } - JavaTypeMapper typeMapper = new JavaTypeMapper(); - for (Map.Entry e : typeMapping.entrySet()) { - typeMapper.addTypeMappingObject(e.getKey(), e.getValue()); - } - AxisService axisService; - try { - axisService = new WSDL11ToAxisServiceBuilder(definition, serviceQname, port.getName()).populateService(); - } catch (AxisFault e) { - throw new CodeGenerationException(e); - } - axisService.setName(port.getBinding().getPortType().getQName().getLocalPart()); - CodeGenConfiguration codegenConfiguration = new CodeGenConfiguration(Collections.EMPTY_MAP); - codegenConfigurations.add(codegenConfiguration); - codegenConfiguration.setAxisService(axisService); - codegenConfiguration.setAdvancedCodeGenEnabled(false); - codegenConfiguration.setAsyncOn(false); - codegenConfiguration.setDatabindingType("sdo"); - codegenConfiguration.setGenerateAll(true); - codegenConfiguration.setGenerateDeployementDescriptor(false); - codegenConfiguration.setOutputLanguage("java"); - codegenConfiguration.setOutputLocation(new File(outputLocation)); - codegenConfiguration.setPackageName(packageName); - codegenConfiguration.setPackClasses(false); - codegenConfiguration.setPolicyMap(Collections.EMPTY_MAP); - codegenConfiguration.setPortName(port.getName()); - codegenConfiguration.setServerSide(false); - codegenConfiguration.setServiceName(service.getQName().getLocalPart()); - codegenConfiguration.setSyncOn(true); - codegenConfiguration.setTypeMapper(typeMapper); - codegenConfiguration.setWriteMessageReceiver(false); - codegenConfiguration.setWriteTestCase(false); - addExtension(new WSDLValidatorExtension(), codegenConfiguration); - addExtension(new PackageFinder(), codegenConfiguration); - addExtension(new SDODataBindingCodegenExtension(typeMapper), codegenConfiguration); - addExtension(new DefaultDatabindingExtension(), codegenConfiguration); - } - } - } - - - private PortType getPortType(Port port) { - Binding binding = port.getBinding(); - if(null != binding){ - return binding.getPortType(); - } - return null; - - } - - - @SuppressWarnings("unchecked") - private void addExtension(CodeGenExtension ext, CodeGenConfiguration codegenConfiguration) { - //ext.init(codegenConfiguration); - codegenExtensions.add(new Object[]{ext, codegenConfiguration}); - } - - public void generate() throws CodeGenerationException { - try { - for (int i = 0; i < codegenExtensions.size(); i++) { - //CodeGenExtension - Object[] pair = (Object[])codegenExtensions.get(i); - - CodeGenExtension cge= (CodeGenExtension) pair[0]; - CodeGenConfiguration cgf= (CodeGenConfiguration)pair[1]; - - cge.engage(cgf); - - } - - for(CodeGenConfiguration codegenConfiguration : codegenConfigurations){ - JavaInterfaceEmitter emitter = new JavaInterfaceEmitter(); - emitter.setCodeGenConfiguration(codegenConfiguration); - emitter.setMapper(codegenConfiguration.getTypeMapper()); - - emitter.writeInterface(false); - } - - } catch (Exception e) { - throw new CodeGenerationException(e); - } - } - - /** - * Read the WSDL file - * @param uri - * @return - * @throws WSDLException - */ - private Definition readWSDL(String uri) throws WSDLException { - - WSDLReader reader = - WSDLFactory.newInstance().newWSDLReader(); - reader.setFeature("javax.wsdl.importDocuments", true); - - File file = new File(uri); - String baseURI; - - if (uri.startsWith("http://")){ - baseURI = uri; - } else{ - if(file.getParentFile() == null){ - try { - baseURI = new File(".").getCanonicalFile().toURI().toString(); - } catch (IOException e) { - throw new RuntimeException(e); - } - } else { - baseURI = file.getParentFile().toURI().toString(); - } - } - - Document doc; - try { - doc = XMLUtils.newDocument(uri); - } catch (ParserConfigurationException e) { - throw new WSDLException(WSDLException.PARSER_ERROR, - "Parser Configuration Error", - e); - } catch (SAXException e) { - throw new WSDLException(WSDLException.PARSER_ERROR, - "Parser SAX Error", - e); - - } catch (IOException e) { - throw new WSDLException(WSDLException.INVALID_WSDL, "IO Error", e); - } - - return reader.readWSDL(baseURI, doc); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java deleted file mode 100644 index cb413bca50..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.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.tools.wsdl2java.generate; - -import java.io.File; - -import org.apache.axis2.wsdl.codegen.CodeGenerationException; -import org.apache.axis2.wsdl.codegen.writer.InterfaceWriter; - -/** - * @author lresende - */ -public class RemotableInterfaceWritter extends InterfaceWriter { - private static final String REMOTABLE_INTERFACE_TEMPLATE="/RemotableInterfaceTemplate.xsl"; - - public RemotableInterfaceWritter(String outputFileLocation) { - super(outputFileLocation); - } - - public RemotableInterfaceWritter(File outputFileLocation, String language) { - super(outputFileLocation, language); - } - - /** - * Loads the template. - */ - @Override - public void loadTemplate() throws CodeGenerationException { - // the default behavior for the class writers is to use the property map from the languge specific types - // The properties are arranged in the following order - // .* .template=, - - //overrida original behaviour to always load the template we specified - this.xsltStream = this.getClass().getResourceAsStream(REMOTABLE_INTERFACE_TEMPLATE); - - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.java deleted file mode 100644 index 075959f985..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.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.tools.wsdl2java.generate; - -import org.apache.axis2.wsdl.codegen.CodeGenConfiguration; -import org.apache.axis2.wsdl.codegen.CodeGenerationException; -import org.apache.axis2.wsdl.codegen.extension.AbstractDBProcessingExtension; -import org.apache.axis2.wsdl.databinding.TypeMapper; - -/** - * SDO data binding codegen extension. - */ -public class SDODataBindingCodegenExtension extends AbstractDBProcessingExtension { - - private TypeMapper typeMapper; - - public SDODataBindingCodegenExtension(TypeMapper typeMapper) { - this.typeMapper=typeMapper; - } - - protected boolean testFallThrough(String dbFrameworkName) { - return !dbFrameworkName.equals("sdo"); - } - -// public void engage() { -// if (testFallThrough(configuration.getDatabindingType())) { -// return; -// } -// -// // Set the type mapper into the config -// configuration.setTypeMapper(typeMapper); -// -// } - - public void engage(CodeGenConfiguration configuration) throws CodeGenerationException { - // TODO Auto-generated method stub - if (testFallThrough(configuration.getDatabindingType())) { - return; - } - - // Set the type mapper into the config - configuration.setTypeMapper(typeMapper); - - - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingTypeMappingEntry.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingTypeMappingEntry.java deleted file mode 100644 index 2d81ef12bf..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingTypeMappingEntry.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.tools.wsdl2java.generate; - -import java.util.List; - -/** - * This represents a type mapping entry, used by the JavaInterfaceEmitter to generate - * method signatures. - */ -public class SDODataBindingTypeMappingEntry { - - private final boolean anonymous; - private final List propertyClassNames; - private final String className; - - public SDODataBindingTypeMappingEntry(String className, boolean anonymous, List propertyClassNames) { - this.className = className; - this.anonymous = anonymous; - this.propertyClassNames = propertyClassNames; - } - - public boolean isAnonymous() { - return anonymous; - } - - public String getClassName() { - return className; - } - - public List getPropertyClassNames() { - return propertyClassNames; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.java deleted file mode 100644 index 8f3f7447b2..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.java +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.wsdl2java.generate; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.StringTokenizer; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sdo.helper.XSDHelperImpl; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.eclipse.emf.codegen.ecore.genmodel.GenClass; -import org.eclipse.emf.codegen.ecore.genmodel.GenModel; -import org.eclipse.emf.codegen.ecore.genmodel.GenModelFactory; -import org.eclipse.emf.codegen.ecore.genmodel.GenPackage; -import org.eclipse.emf.codegen.util.CodeGenUtil; -import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.BasicExtendedMetaData; -import org.eclipse.emf.ecore.util.ExtendedMetaData; - -import commonj.sdo.helper.XSDHelper; - -public class WSDL2JavaGenerator { - - /** - * Generate Java interfaces from WSDL Usage arguments: [ -targetDirectory - * ] [ -javaPackage ] - * For example: generate somedir/somefile.wsdl Basic options: - * -targetDirectory Generates the Java source code in the specified - * directory. By default, the code is generated in the same directory as the - * input wsdl file. -javaPackage Overrides the Java package for the - * generated classes. By default the package name is derived from the - * targetNamespace of the WSDL definition being generated. For example, if - * the targetNamespace is "http://www.example.com/simple", the default - * package will be "com.example.simple". - */ - public static void main(String args[]) { - if (args.length == 0) { - printUsage(); - return; - } - - String portName = null; - String targetDirectory = null; - String wsdlJavaPackage = null; - String xsdJavaPackage = null; - - int index = 0; - for (; index < args.length && args[index].startsWith("-"); ++index) { - if (args[index].equalsIgnoreCase("-port")) { - portName = args[++index]; - } else if (args[index].equalsIgnoreCase("-targetDirectory")) { - targetDirectory = args[++index]; - } else if (args[index].equalsIgnoreCase("-javaPackage")) { - wsdlJavaPackage = args[++index]; - } - // else if (...) - else { - printUsage(); - return; - } - } - - String wsdlFileName = args[index]; - if (wsdlFileName == null || targetDirectory == null) { - printUsage(); - return; - } - - generateFromWSDL(wsdlFileName, portName!=null? new String[]{portName}:null, targetDirectory, wsdlJavaPackage, xsdJavaPackage, 0); - - } - - @SuppressWarnings("unchecked") - public static void generateFromWSDL(String wsdlFileName, String targetDirectory, - String wsdlJavaPackage, - String xsdJavaPackage, int genOptions){ - generateFromWSDL( wsdlFileName, null, targetDirectory, - wsdlJavaPackage, - xsdJavaPackage, genOptions); - - } - - - @SuppressWarnings("unchecked") - public static void generateFromWSDL(String wsdlFileName, String[] ports, - String targetDirectory, String wsdlJavaPackage, - String xsdJavaPackage, int genOptions) - { - - // Initialize the SDO runtime - DataObjectUtil.initRuntime(); - EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE); - ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry); - XSDHelper xsdHelper = new XSDHelperImpl(extendedMetaData, null); - - try { - - // Load the WSDL file - File inputFile = new File(wsdlFileName).getAbsoluteFile(); - InputStream inputStream = new FileInputStream(inputFile); - - // Define SDO metadata - xsdHelper.define(inputStream, inputFile.toURI().toString()); - - if (targetDirectory == null) { - targetDirectory = new File(wsdlFileName).getCanonicalFile().getParent(); - } else { - targetDirectory = new File(targetDirectory).getCanonicalPath(); - } - - // Populate the typeMapping table that will be given to the Axis2 WSDL2Java - Map typeMapping = - new HashMap(); - if (!packageRegistry.values().isEmpty()) { - ResourceSet resourceSet = DataObjectUtil.createResourceSet(); - - // Populate list of GenPackages and a map of GenClasses keyed by EClass - List genPackages = new ArrayList(); - Map genClasses = new HashMap(); - for (Iterator iter = packageRegistry.values().iterator(); iter.hasNext();) { - EPackage currentEPackage = (EPackage)iter.next(); - String currentBasePackage = extractBasePackageName(currentEPackage, xsdJavaPackage); - String currentPrefix = CodeGenUtil.capName(currentEPackage.getName()); - - GenPackage currentGenPackage = createGenPackage(currentEPackage, currentBasePackage, - currentPrefix, genOptions, resourceSet); - genPackages.add(currentGenPackage); - for (GenClass genClass : (List)currentGenPackage.getGenClasses()) { - genClasses.put(genClass.getEcoreClass(), genClass); - } - - } - - // Process all the SDO packages - // Populate the qname -> interfaceName typeMapping table - for (GenPackage currentGenPackage : genPackages) { - EPackage currentEPackage = currentGenPackage.getEcorePackage(); - - // Populate the type mappings for all the complex types - for (GenClass genClass : (List)currentGenPackage.getGenClasses()) { - QName qname = new QName(extendedMetaData.getNamespace(currentEPackage), - extendedMetaData.getName(genClass.getEcoreClass())); - String interfaceName = currentGenPackage.getInterfacePackageName() + '.' - + genClass.getInterfaceName(); - SDODataBindingTypeMappingEntry typeMappingEntry = - new SDODataBindingTypeMappingEntry(interfaceName, false, null); - typeMapping.put(qname, typeMappingEntry); - } - - // Process all the global XSD elements - EClass documentRoot = extendedMetaData.getDocumentRoot(currentEPackage); - if (documentRoot != null) { - for (EStructuralFeature element : (List)extendedMetaData - .getElements(documentRoot)) { - EClassifier elementType = element.getEType(); - - // Handle a complex type - if (elementType instanceof EClass) { - EClass eClass = (EClass)elementType; - - GenClass genClass = genClasses.get(elementType); - QName qname = new QName(extendedMetaData.getNamespace(currentEPackage), - extendedMetaData.getName(element)); - String interfaceName = genClass.getGenPackage().getInterfacePackageName() - + '.' + genClass.getInterfaceName(); - boolean anonymous = extendedMetaData.isAnonymous(eClass); - - // Build list of property class names - List propertyClassNames=new ArrayList(); - for (EStructuralFeature feature : (List)eClass.getEStructuralFeatures()) { - EClassifier propertyType = feature.getEType(); - if (propertyType instanceof EClass) { - GenClass propertyGenClass = genClasses.get(propertyType); - String propertyClassName = propertyGenClass.getGenPackage().getInterfacePackageName() - + '.' + propertyGenClass.getInterfaceName(); - propertyClassNames.add(propertyClassName); - } else if (propertyType instanceof EClassifier) { - String propertyClassName = propertyType.getInstanceClass().getName(); - propertyClassNames.add(propertyClassName); - } - } - - SDODataBindingTypeMappingEntry typeMappingEntry = - new SDODataBindingTypeMappingEntry(interfaceName, anonymous, propertyClassNames); - typeMapping.put(qname, typeMappingEntry); - - } else { - - // Handle a simple type - QName qname = new QName(extendedMetaData.getNamespace(currentEPackage), - extendedMetaData.getName(element)); - String className = elementType.getInstanceClass().getName(); - SDODataBindingTypeMappingEntry typeMappingEntry = - new SDODataBindingTypeMappingEntry(className, false, null); - typeMapping.put(qname, typeMappingEntry); - } - } - } - } - } - - try { - JavaInterfaceGenerator codeGenerator = new JavaInterfaceGenerator(wsdlFileName, - ports, - targetDirectory, - wsdlJavaPackage, - typeMapping); - codeGenerator.generate(); - } catch (Exception e) { - throw new IllegalArgumentException(e); - } - - } catch (IOException e) { - throw new IllegalArgumentException(e); - } - } - - @SuppressWarnings("unchecked") - public static GenPackage createGenPackage(EPackage ePackage, String basePackage, String prefix, - int genOptions, ResourceSet resourceSet) { - GenModel genModel = ecore2GenModel(ePackage, basePackage, prefix, genOptions); - - URI ecoreURI = URI.createURI("file:///" + ePackage.getName() + ".ecore"); - URI genModelURI = ecoreURI.trimFileExtension().appendFileExtension("genmodel"); - - Resource ecoreResource = resourceSet.createResource(ecoreURI); - ecoreResource.getContents().add(ePackage); - - Resource genModelResource = resourceSet.createResource(genModelURI); - genModelResource.getContents().add(genModel); - - return (GenPackage)genModel.getGenPackages().get(0); - } - - public static GenModel ecore2GenModel(EPackage ePackage, String basePackage, - String prefix, int genOptions) { - GenModel genModel = GenModelFactory.eINSTANCE.createGenModel(); - genModel.initialize(Collections.singleton(ePackage)); - - genModel.setRootExtendsInterface(""); - genModel.setRootImplementsInterface("commonj.sdo.DataObject"); - genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.DataObjectImpl"); - genModel.setFeatureMapWrapperInterface("commonj.sdo.Sequence"); - genModel.setFeatureMapWrapperInternalInterface("org.apache.tuscany.sdo.util.BasicSequence"); - genModel.setFeatureMapWrapperClass("org.apache.tuscany.sdo.util.BasicSequence"); - genModel.setSuppressEMFTypes(true); - genModel.setSuppressEMFMetaData(true); - genModel.setSuppressEMFModelTags(true); - genModel.setCanGenerate(true); - // FIXME workaround java.lang.NoClassDefFoundError: - // org/eclipse/jdt/core/jdom/IDOMNode with 02162006 build - genModel.setFacadeHelperClass("Hack"); - genModel.setForceOverwrite(true); - - GenPackage genPackage = (GenPackage)genModel.getGenPackages().get(0); - - if (basePackage != null) { - genPackage.setBasePackage(basePackage); - } - if (prefix != null) { - genPackage.setPrefix(prefix); - } - - return genModel; - } - - public static String extractBasePackageName(EPackage ePackage, String javaPackage) { - String qualifiedName = javaPackage != null ? javaPackage : ePackage.getName(); - String name = /* CodeGenUtil. */shortName(qualifiedName); - String baseName = qualifiedName.substring(0, qualifiedName.length() - name.length()); - if (javaPackage != null || !name.equals(qualifiedName)) { - ePackage.setName(name); - } - return baseName != null ? /* CodeGenUtil. */safeQualifiedName(baseName) : null; - } - - public static String shortName(String qualifiedName) { - int index = qualifiedName.lastIndexOf("."); - return index != -1 ? qualifiedName.substring(index + 1) : qualifiedName; - } - - public static String safeQualifiedName(String qualifiedName) { - StringBuffer safeQualifiedName = new StringBuffer(); - for (StringTokenizer stringTokenizer = new StringTokenizer(qualifiedName, "."); - stringTokenizer.hasMoreTokens();) { - String name = stringTokenizer.nextToken(); - safeQualifiedName.append(CodeGenUtil.safeName(name)); - if (stringTokenizer.hasMoreTokens()) { - safeQualifiedName.append('.'); - } - } - return safeQualifiedName.toString(); - } - - protected static void printDiagnostic(Diagnostic diagnostic, String indent) { - System.out.print(indent); - System.out.println(diagnostic.getMessage()); - for (Iterator i = diagnostic.getChildren().iterator(); i.hasNext();) { - printDiagnostic((Diagnostic)i.next(), indent + " "); - } - } - - protected static void printUsage() { - System.out.println("Usage arguments:"); - System.out.println(" [ -targetDirectory ]"); - System.out.println(" [ -javaPackage ]"); - System.out.println(" "); - System.out.println(""); - System.out.println("For example:"); - System.out.println(""); - System.out.println(" generate somedir/somefile.wsdl"); - } - - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/resources/META-INF/LICENSE.txt b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/resources/META-INF/LICENSE.txt deleted file mode 100644 index 25d78feeac..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/resources/META-INF/LICENSE.txt +++ /dev/null @@ -1,1277 +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. - - -APACHE TUSCANY SUBCOMPONENTS: - -The Apache Tuscany distribution includes a number of subcomponents with -separate copyright notices and license terms. Your use of the source -code for the these subcomponents is subject to the terms and -conditions of the following licenses. - -=============================================================================== - -For the Eclipse Modeling Framework component and the Celtix binding: - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE -PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF -THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and -documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and - -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and -are distributed by that particular Contributor. A Contribution -'originates' from a Contributor if it was added to the Program by such -Contributor itself or anyone acting on such Contributor's behalf. -Contributions do not include additions to the Program which: (i) are -separate modules of software distributed in conjunction with the -Program under their own license agreement, and (ii) are not derivative -works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents " mean patent claims licensable by a Contributor -which are necessarily infringed by the use or sale of its Contribution -alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this -Agreement. - -"Recipient" means anyone who receives the Program under this -Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free copyright -license to reproduce, prepare derivative works of, publicly display, -publicly perform, distribute and sublicense the Contribution of such -Contributor, if any, and such derivative works, in source code and -object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free patent -license under Licensed Patents to make, use, sell, offer to sell, -import and otherwise transfer the Contribution of such Contributor, if -any, in source code and object code form. This patent license shall -apply to the combination of the Contribution and the Program if, at -the time the Contribution is added by the Contributor, such addition -of the Contribution causes such combination to be covered by the -Licensed Patents. The patent license shall not apply to any other -combinations which include the Contribution. No hardware per se is -licensed hereunder. - -c) Recipient understands that although each Contributor grants the -licenses to its Contributions set forth herein, no assurances are -provided by any Contributor that the Program does not infringe the -patent or other intellectual property rights of any other entity. Each -Contributor disclaims any liability to Recipient for claims brought by -any other entity based on infringement of intellectual property rights -or otherwise. As a condition to exercising the rights and licenses -granted hereunder, each Recipient hereby assumes sole responsibility -to secure any other intellectual property rights needed, if any. For -example, if a third party patent license is required to allow -Recipient to distribute the Program, it is Recipient's responsibility -to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient -copyright rights in its Contribution, if any, to grant the copyright -license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form -under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties -and conditions, express and implied, including warranties or -conditions of title and non-infringement, and implied warranties or -conditions of merchantability and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability -for damages, including direct, indirect, special, incidental and -consequential damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are -offered by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such -Contributor, and informs licensees how to obtain it in a reasonable -manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the -Program. - -Contributors may not remove or alter any copyright notices contained -within the Program. - -Each Contributor must identify itself as the originator of its -Contribution, if any, in a manner that reasonably allows subsequent -Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain -responsibilities with respect to end users, business partners and the -like. While this license is intended to facilitate the commercial use -of the Program, the Contributor who includes the Program in a -commercial product offering should do so in a manner which does not -create potential liability for other Contributors. Therefore, if a -Contributor includes the Program in a commercial product offering, -such Contributor ("Commercial Contributor") hereby agrees to defend -and indemnify every other Contributor ("Indemnified Contributor") -against any losses, damages and costs (collectively "Losses") arising -from claims, lawsuits and other legal actions brought by a third party -against the Indemnified Contributor to the extent caused by the acts -or omissions of such Commercial Contributor in connection with its -distribution of the Program in a commercial product offering. The -obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. -In order to qualify, an Indemnified Contributor must: a) promptly -notify the Commercial Contributor in writing of such claim, and b) -allow the Commercial Contributor to control, and cooperate with the -Commercial Contributor in, the defense and any related settlement -negotiations. The Indemnified Contributor may participate in any such -claim at its own expense. - -For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those -performance claims and warranties, and if a court requires any other -Contributor to pay any damages as a result, the Commercial Contributor -must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS -PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY -WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY -OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely -responsible for determining the appropriateness of using and -distributing the Program and assumes all risks associated with its -exercise of rights under this Agreement , including but not limited to -the risks and costs of program errors, compliance with applicable -laws, damage to or loss of data, programs or equipment, and -unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR -ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING -WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR -DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED -HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further -action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that -the Program itself (excluding combinations of the Program with other -software or hardware) infringes such Recipient's patent(s), then such -Recipient's rights granted under Section 2(b) shall terminate as of -the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of -time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use -and distribution of the Program as soon as reasonably practicable. -However, Recipient's obligations under this Agreement and any licenses -granted by Recipient relating to the Program shall continue and -survive. - -Everyone is permitted to copy and distribute copies of this Agreement, -but in order to avoid inconsistency the Agreement is copyrighted and -may only be modified in the following manner. The Agreement Steward -reserves the right to publish new versions (including revisions) of -this Agreement from time to time. No one other than the Agreement -Steward has the right to modify this Agreement. The Eclipse Foundation -is the initial Agreement Steward. The Eclipse Foundation may assign -the responsibility to serve as the Agreement Steward to a suitable -separate entity. Each new version of the Agreement will be given a -distinguishing version number. The Program (including Contributions) -may always be distributed subject to the version of the Agreement -under which it was received. In addition, after a new version of the -Agreement is published, Contributor may elect to distribute the -Program (including its Contributions) under the new version. Except as -expressly stated in Sections 2(a) and 2(b) above, Recipient receives -no rights or licenses to the intellectual property of any Contributor -under this Agreement, whether expressly, by implication, estoppel or -otherwise. All rights in the Program not expressly granted under this -Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and -the intellectual property laws of the United States of America. No -party to this Agreement will bring a legal action under this Agreement -more than one year after the cause of action arose. Each party waives -its rights to a jury trial in any resulting litigation. - -=============================================================================== - -For the Rhino JavaScript container component: - -Mozilla Public License 1.1 (MPL 1.1) - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the -Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to -the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original Code, -prior Modifications used by a Contributor, and the Modifications made by that -particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the -combination of the Original Code and Modifications, in each case including -portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally -accepted in the software development community for the electronic transfer of -data. - - 1.5. "Executable" means Covered Code in any form other than Source -Code. - - 1.6. "Initial Developer" means the individual or entity identified as -the Initial Developer in the Source Code notice required by Exhibit A. - - 1.7. "Larger Work" means a work which combines Covered Code or -portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum -extent possible, whether at the time of the initial grant or subsequently -acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the -substance or structure of either the Original Code or any previous -Modifications. When Covered Code is released as a series of files, a -Modification is: - A. Any addition to or deletion from the contents of a file -containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or -previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code -which is described in the Source Code notice required by Exhibit A as Original -Code, and which, at the time of its release under this License is not already -Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or -hereafter acquired, including without limitation, method, process, and -apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for -making modifications to it, including all modules it contains, plus any -associated interface definition files, scripts used to control compilation and -installation of an Executable, or source code differential comparisons against -either the Original Code or another well known, available Covered Code of the -Contributor's choice. The Source Code can be in a compressed or archival form, -provided the appropriate decompression or de-archiving software is widely -available for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity -exercising rights under, and complying with all of the terms of, this License -or a future version of this License issued under Section 6.1. For legal -entities, "You" includes any entity which controls, is controlled by, or is -under common control with You. For purposes of this definition, "control" -means (a) the power, direct or indirect, to cause the direction or management -of such entity, whether by contract or otherwise, or (b) ownership of more -than fifty percent (50%) of the outstanding shares or beneficial ownership of -such entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - The Initial Developer hereby grants You a world-wide, royalty-free, -non-exclusive license, subject to third party intellectual property claims: - (a) under intellectual property rights (other than patent or -trademark) Licensable by Initial Developer to use, reproduce, modify, display, -perform, sublicense and distribute the Original Code (or portions thereof) -with or without Modifications, and/or as part of a Larger Work; and - - (b) under Patents Claims infringed by the making, using or selling -of Original Code, to make, have made, use, practice, sell, and offer for sale, -and/or otherwise dispose of the Original Code (or portions thereof). - (c) the licenses granted in this Section 2.1(a) and -(b) are effective on the date Initial Developer first distributes Original -Code under the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is -granted: 1) for code that You delete from the Original Code; 2) separate from -the Original Code; or 3) for infringements caused by: i) the modification of -the Original Code or ii) the combination of the Original Code with other -software or devices. - - 2.2. Contributor Grant. - Subject to third party intellectual property claims, each Contributor -hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or -trademark) Licensable by Contributor, to use, reproduce, modify, display, -perform, sublicense and distribute the Modifications created by such -Contributor (or portions thereof) either on an unmodified basis, with other -Modifications, as Covered Code and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, using, or selling -of Modifications made by that Contributor either alone and/or in combination -with its Contributor Version (or portions of such combination), to make, use, -sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications -made by that Contributor (or portions thereof); and 2) the combination of -Modifications made by that Contributor with its Contributor Version (or -portions of such combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are -effective on the date Contributor first makes Commercial Use of the Covered -Code. - - (d) Notwithstanding Section 2.2(b) above, no patent license is -granted: 1) for any code that Contributor has deleted from the Contributor -Version; 2) separate from the Contributor Version; 3) for infringements -caused by: i) third party modifications of Contributor Version or ii) the -combination of Modifications made by that Contributor with other software -(except as part of the Contributor Version) or other devices; or 4) under -Patent Claims infringed by Covered Code in the absence of Modifications made -by that Contributor. - - -3. Distribution Obligations. - - 3.1. Application of License. - The Modifications which You create or to which You contribute are -governed by the terms of this License, including without limitation Section -2.2. The Source Code version of Covered Code may be distributed only under the -terms of this License or a future version of this License released under -Section 6.1, and You must include a copy of this License with every copy of -the Source Code You distribute. You may not offer or impose any terms on any -Source Code version that alters or restricts the applicable version of this -License or the recipients' rights hereunder. However, You may include an -additional document offering the additional rights described in Section 3.5. - - 3.2. Availability of Source Code. - Any Modification which You create or to which You contribute must be -made available in Source Code form under the terms of this License either on -the same media as an Executable version or via an accepted Electronic -Distribution Mechanism to anyone to whom you made an Executable version -available; and if made available via Electronic Distribution Mechanism, must -remain available for at least twelve (12) months after the date it initially -became available, or at least six (6) months after a subsequent version of -that particular Modification has been made available to such recipients. You -are responsible for ensuring that the Source Code version remains available -even if the Electronic Distribution Mechanism is maintained by a third party. - - 3.3. Description of Modifications. - You must cause all Covered Code to which You contribute to contain a -file documenting the changes You made to create that Covered Code and the date -of any change. You must include a prominent statement that the Modification is -derived, directly or indirectly, from Original Code provided by the Initial -Developer and including the name of the Initial Developer in (a) the Source -Code, and (b) in any notice in an Executable version or related documentation -in which You describe the origin or ownership of the Covered Code. - - 3.4. Intellectual Property Matters - (a) Third Party Claims. - If Contributor has knowledge that a license under a third party's -intellectual property rights is required to exercise the rights granted by -such Contributor under Sections 2.1 or 2.2, Contributor must include a text -file with the Source Code distribution titled "LEGAL" which describes the -claim and the party making the claim in sufficient detail that a recipient -will know whom to contact. If Contributor obtains such knowledge after the -Modification is made available as described in Section 3.2, Contributor shall -promptly modify the LEGAL file in all copies Contributor makes available -thereafter and shall take other steps (such as notifying appropriate mailing -lists or newsgroups) reasonably calculated to inform those who received the -Covered Code that new knowledge has been obtained. - - (b) Contributor APIs. - If Contributor's Modifications include an application programming -interface and Contributor has knowledge of patent licenses which are -reasonably necessary to implement that API, Contributor must also include this -information in the LEGAL file. - - (c) Representations. - Contributor represents that, except as disclosed pursuant to -Section 3.4(a) above, Contributor believes that Contributor's Modifications -are Contributor's original creation(s) and/or Contributor has sufficient -rights to grant the rights conveyed by this License. - - - 3.5. Required Notices. - You must duplicate the notice in Exhibit A in each file of the Source -Code. If it is not possible to put such notice in a particular Source Code -file due to its structure, then You must include such notice in a location -(such as a relevant directory) where a user would be likely to look for such a -notice. If You created one or more Modification(s) You may add your name as a -Contributor to the notice described in Exhibit A. You must also duplicate -this License in any documentation for the Source Code where You describe -recipients' rights or ownership rights relating to Covered Code. You may -choose to offer, and to charge a fee for, warranty, support, indemnity or -liability obligations to one or more recipients of Covered Code. However, You -may do so only on Your own behalf, and not on behalf of the Initial Developer -or any Contributor. You must make it absolutely clear than any such warranty, -support, indemnity or liability obligation is offered by You alone, and You -hereby agree to indemnify the Initial Developer and every Contributor for any -liability incurred by the Initial Developer or such Contributor as a result of -warranty, support, indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - You may distribute Covered Code in Executable form only if the -requirements of Section 3.1-3.5 have been met for that Covered Code, and if -You include a notice stating that the Source Code version of the Covered Code -is available under the terms of this License, including a description of how -and where You have fulfilled the obligations of Section 3.2. The notice must -be conspicuously included in any notice in an Executable version, related -documentation or collateral in which You describe recipients' rights relating -to the Covered Code. You may distribute the Executable version of Covered Code -or ownership rights under a license of Your choice, which may contain terms -different from this License, provided that You are in compliance with the -terms of this License and that the license for the Executable version does not -attempt to limit or alter the recipient's rights in the Source Code version -from the rights set forth in this License. If You distribute the Executable -version under a different license You must make it absolutely clear that any -terms which differ from this License are offered by You alone, not by the -Initial Developer or any Contributor. You hereby agree to indemnify the -Initial Developer and every Contributor for any liability incurred by the -Initial Developer or such Contributor as a result of any such terms You offer. - - 3.7. Larger Works. - You may create a Larger Work by combining Covered Code with other code -not governed by the terms of this License and distribute the Larger Work as a -single product. In such a case, You must make sure the requirements of this -License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Code due to statute, -judicial order, or regulation then You must: (a) comply with the terms of this -License to the maximum extent possible; and (b) describe the limitations and -the code they affect. Such description must be included in the LEGAL file -described in Section 3.4 and must be included with all distributions of the -Source Code. Except to the extent prohibited by statute or regulation, such -description must be sufficiently detailed for a recipient of ordinary skill to -be able to understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has attached -the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - Netscape Communications Corporation ("Netscape") may publish revised -and/or new versions of the License from time to time. Each version will be -given a distinguishing version number. - - 6.2. Effect of New Versions. - Once Covered Code has been published under a particular version of the -License, You may always continue to use it under the terms of that version. -You may also choose to use such Covered Code under the terms of any subsequent -version of the License published by Netscape. No one other than Netscape has -the right to modify the terms applicable to Covered Code created under this -License. - - 6.3. Derivative Works. - If You create or use a modified version of this License (which you may -only do in order to apply it to code which is not already Covered Code -governed by this License), You must (a) rename Your license so that the -phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or -any confusingly similar phrase do not appear in your license (except to note -that your license differs from this License) and (b) otherwise make it clear -that Your version of the license contains terms which differ from the Mozilla -Public License and Netscape Public License. (Filling in the name of the -Initial Developer, Original Code or Contributor in the notice described in -Exhibit A shall not of themselves be deemed to be modifications of this -License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT -LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, -FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE -QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED -CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY -OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR -CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS -LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS -DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate -automatically if You fail to comply with terms herein and fail to cure such -breach within 30 days of becoming aware of the breach. All sublicenses to the -Covered Code which are properly granted shall survive any termination of this -License. Provisions which, by their nature, must remain in effect beyond the -termination of this License shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement -claim (excluding declatory judgment actions) against Initial Developer or a -Contributor (the Initial Developer or Contributor against whom You file such -action is referred to as "Participant") alleging that: - - (a) such Participant's Contributor Version directly or indirectly -infringes any patent, then any and all rights granted by such Participant to -You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice -from Participant terminate prospectively, unless if within 60 days after -receipt of notice You either: (i) agree in writing to pay Participant a -mutually agreeable reasonable royalty for Your past and future use of -Modifications made by such Participant, or (ii) withdraw Your litigation claim -with respect to the Contributor Version against such Participant. If within -60 days of notice, a reasonable royalty and payment arrangement are not -mutually agreed upon in writing by the parties or the litigation claim is not -withdrawn, the rights granted by Participant to You under Sections 2.1 and/or -2.2 automatically terminate at the expiration of the 60 day notice period -specified above. - - (b) any software, hardware, or device, other than such Participant's -Contributor Version, directly or indirectly infringes any patent, then any -rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are -revoked effective as of the date You first made, used, sold, distributed, or -had made, Modifications made by that Participant. - - 8.3. If You assert a patent infringement claim against Participant -alleging that such Participant's Contributor Version directly or indirectly -infringes any patent where such claim is resolved (such as by license or -settlement) prior to the initiation of patent infringement litigation, then -the reasonable value of the licenses granted by such Participant under -Sections 2.1 or 2.2 shall be taken into account in determining the amount or -value of any payment or license. - - 8.4. In the event of termination under Sections 8.1 or 8.2 above, all -end user license agreements (excluding distributors and resellers) which have -been validly granted by You or any distributor hereunder prior to termination -shall survive termination. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT -(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL -DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY -SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, -SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, -WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER -FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, -EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH -DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH -OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT -APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE -EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS -EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in 48 -C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and -"commercial computer software documentation," as such terms are used in 48 -C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. -227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users -acquire Covered Code with only those rights set forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject matter -hereof. If any provision of this License is held to be unenforceable, such -provision shall be reformed only to the extent necessary to make it -enforceable. This License shall be governed by California law provisions -(except to the extent applicable law, if any, provides otherwise), excluding -its conflict-of-law provisions. With respect to disputes in which at least one -party is a citizen of, or an entity chartered or registered to do business in -the United States of America, any litigation relating to this License shall be -subject to the jurisdiction of the Federal Courts of the Northern District of -California, with venue lying in Santa Clara County, California, with the -losing party responsible for costs, including without limitation, court costs -and reasonable attorneys' fees and expenses. The application of the United -Nations Convention on Contracts for the International Sale of Goods is -expressly excluded. Any law or regulation which provides that the language of -a contract shall be construed against the drafter shall not apply to this -License. - -12. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is -responsible for claims and damages arising, directly or indirectly, out of its -utilization of rights under this License and You agree to work with Initial -Developer and Contributors to distribute such responsibility on an equitable -basis. Nothing herein is intended or shall be deemed to constitute any -admission of liability. - -13. MULTIPLE-LICENSED CODE. - - Initial Developer may designate portions of the Covered Code as -Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits -you to utilize portions of the Covered Code under Your choice of the MPL or -the alternative licenses, if any, specified by the Initial Developer in the -file described in Exhibit A. - - -EXHIBIT A -Mozilla Public License. - - ``The contents of this file are subject to the Mozilla Public License -Version 1.1 (the "License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF - ANY KIND, either express or implied. See the License for the specific -language governing rights and - limitations under the License. - - The Original Code is ______________________________________. - - The Initial Developer of the Original Code is ________________________. -Portions created by - ______________________ are Copyright (C) ______ -_______________________. All Rights - Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the terms of -the _____ license (the [___] License), in which case the provisions of -[______] License are applicable instead of those above. If you wish to allow -use of your version of this file only under the terms of the [____] License -and not to allow others to use your version of this file under the MPL, -indicate your decision by deleting the provisions above and replace them -with the notice and other provisions required by the [___] License. If you do -not delete the provisions above, a recipient may use your version of this file -under either the MPL or the [___] License." - - [NOTE: The text of this Exhibit A may differ slightly from the text of -the notices in the Source Code files of the Original Code. You should use the -text of this Exhibit A rather than the text found in the Original Code Source -Code for Your Modifications.] - - -=============================================================================== - -For the JAX-WS Reference Implementation component: - -COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 - - - 1. Definitions. - - 1.1. "Contributor" means each individual or entity that - creates or contributes to the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the - Original Software, prior Modifications used by a - Contributor (if any), and the Modifications made by that - particular Contributor. - - 1.3. "Covered Software" means (a) the Original Software, or - (b) Modifications, or (c) the combination of files - containing Original Software with files containing - Modifications, in each case including portions thereof. - - 1.4. "Executable" means the Covered Software in any form - other than Source Code. - - 1.5. "Initial Developer" means the individual or entity - that first makes Original Software available under this - License. - - 1.6. "Larger Work" means a work which combines Covered - Software or portions thereof with code not governed by the - terms of this License. - - 1.7. "License" means this document. - - 1.8. "Licensable" means having the right to grant, to the - maximum extent possible, whether at the time of the initial - grant or subsequently acquired, any and all of the rights - conveyed herein. - - 1.9. "Modifications" means the Source Code and Executable - form of any of the following: - - A. Any file that results from an addition to, - deletion from or modification of the contents of a - file containing Original Software or previous - Modifications; - - B. Any new file that contains any part of the - Original Software or previous Modification; or - - C. Any new file that is contributed or otherwise made - available under the terms of this License. - - 1.10. "Original Software" means the Source Code and - Executable form of computer software code that is - originally released under this License. - - 1.11. "Patent Claims" means any patent claim(s), now owned - or hereafter acquired, including without limitation, - method, process, and apparatus claims, in any patent - Licensable by grantor. - - 1.12. "Source Code" means (a) the common form of computer - software code in which modifications are made and (b) - associated documentation included in or with such code. - - 1.13. "You" (or "Your") means an individual or a legal - entity exercising rights under, and complying with all of - the terms of, this License. For legal entities, "You" - includes any entity which controls, is controlled by, or is - under common control with You. For purposes of this - definition, "control" means (a) the power, direct or - indirect, to cause the direction or management of such - entity, whether by contract or otherwise, or (b) ownership - of more than fifty percent (50%) of the outstanding shares - or beneficial ownership of such entity. - - 2. License Grants. - - 2.1. The Initial Developer Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, the - Initial Developer hereby grants You a world-wide, - royalty-free, non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Initial Developer, - to use, reproduce, modify, display, perform, - sublicense and distribute the Original Software (or - portions thereof), with or without Modifications, - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, - using or selling of Original Software, to make, have - made, use, practice, sell, and offer for sale, and/or - otherwise dispose of the Original Software (or - portions thereof). - - (c) The licenses granted in Sections 2.1(a) and (b) - are effective on the date Initial Developer first - distributes or otherwise makes the Original Software - available to a third party under the terms of this - License. - - (d) Notwithstanding Section 2.1(b) above, no patent - license is granted: (1) for code that You delete from - the Original Software, or (2) for infringements - caused by: (i) the modification of the Original - Software, or (ii) the combination of the Original - Software with other software or devices. - - 2.2. Contributor Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, each - Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Contributor to - use, reproduce, modify, display, perform, sublicense - and distribute the Modifications created by such - Contributor (or portions thereof), either on an - unmodified basis, with other Modifications, as - Covered Software and/or as part of a Larger Work; and - - - (b) under Patent Claims infringed by the making, - using, or selling of Modifications made by that - Contributor either alone and/or in combination with - its Contributor Version (or portions of such - combination), to make, use, sell, offer for sale, - have made, and/or otherwise dispose of: (1) - Modifications made by that Contributor (or portions - thereof); and (2) the combination of Modifications - made by that Contributor with its Contributor Version - (or portions of such combination). - - (c) The licenses granted in Sections 2.2(a) and - 2.2(b) are effective on the date Contributor first - distributes or otherwise makes the Modifications - available to a third party. - - (d) Notwithstanding Section 2.2(b) above, no patent - license is granted: (1) for any code that Contributor - has deleted from the Contributor Version; (2) for - infringements caused by: (i) third party - modifications of Contributor Version, or (ii) the - combination of Modifications made by that Contributor - with other software (except as part of the - Contributor Version) or other devices; or (3) under - Patent Claims infringed by Covered Software in the - absence of Modifications made by that Contributor. - - 3. Distribution Obligations. - - 3.1. Availability of Source Code. - - Any Covered Software that You distribute or otherwise make - available in Executable form must also be made available in - Source Code form and that Source Code form must be - distributed only under the terms of this License. You must - include a copy of this License with every copy of the - Source Code form of the Covered Software You distribute or - otherwise make available. You must inform recipients of any - such Covered Software in Executable form as to how they can - obtain such Covered Software in Source Code form in a - reasonable manner on or through a medium customarily used - for software exchange. - - 3.2. Modifications. - - The Modifications that You create or to which You - contribute are governed by the terms of this License. You - represent that You believe Your Modifications are Your - original creation(s) and/or You have sufficient rights to - grant the rights conveyed by this License. - - 3.3. Required Notices. - - You must include a notice in each of Your Modifications - that identifies You as the Contributor of the Modification. - You may not remove or alter any copyright, patent or - trademark notices contained within the Covered Software, or - any notices of licensing or any descriptive text giving - attribution to any Contributor or the Initial Developer. - - 3.4. Application of Additional Terms. - - You may not offer or impose any terms on any Covered - Software in Source Code form that alters or restricts the - applicable version of this License or the recipients' - rights hereunder. You may choose to offer, and to charge a - fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Software. - However, you may do so only on Your own behalf, and not on - behalf of the Initial Developer or any Contributor. You - must make it absolutely clear that any such warranty, - support, indemnity or liability obligation is offered by - You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred - by the Initial Developer or such Contributor as a result of - warranty, support, indemnity or liability terms You offer. - - - 3.5. Distribution of Executable Versions. - - You may distribute the Executable form of the Covered - Software under the terms of this License or under the terms - of a license of Your choice, which may contain terms - different from this License, provided that You are in - compliance with the terms of this License and that the - license for the Executable form does not attempt to limit - or alter the recipient's rights in the Source Code form - from the rights set forth in this License. If You - distribute the Covered Software in Executable form under a - different license, You must make it absolutely clear that - any terms which differ from this License are offered by You - alone, not by the Initial Developer or Contributor. You - hereby agree to indemnify the Initial Developer and every - Contributor for any liability incurred by the Initial - Developer or such Contributor as a result of any such terms - You offer. - - 3.6. Larger Works. - - You may create a Larger Work by combining Covered Software - with other code not governed by the terms of this License - and distribute the Larger Work as a single product. In such - a case, You must make sure the requirements of this License - are fulfilled for the Covered Software. - - 4. Versions of the License. - - 4.1. New Versions. - - Sun Microsystems, Inc. is the initial license steward and - may publish revised and/or new versions of this License - from time to time. Each version will be given a - distinguishing version number. Except as provided in - Section 4.3, no one other than the license steward has the - right to modify this License. - - 4.2. Effect of New Versions. - - You may always continue to use, distribute or otherwise - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. If the Initial Developer includes a - notice in the Original Software prohibiting it from being - distributed or otherwise made available under any - subsequent version of the License, You must distribute and - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. Otherwise, You may also choose to - use, distribute or otherwise make the Covered Software - available under the terms of any subsequent version of the - License published by the license steward. - - 4.3. Modified Versions. - - When You are an Initial Developer and You want to create a - new license for Your Original Software, You may create and - use a modified version of this License if You: (a) rename - the license and remove any references to the name of the - license steward (except to note that the license differs - from this License); and (b) otherwise make it clear that - the license contains terms which differ from this License. - - - 5. DISCLAIMER OF WARRANTY. - - COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" - BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, - INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED - SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR - PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND - PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY - COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE - INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF - ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF - WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS - DISCLAIMER. - - 6. TERMINATION. - - 6.1. This License and the rights granted hereunder will - terminate automatically if You fail to comply with terms - herein and fail to cure such breach within 30 days of - becoming aware of the breach. Provisions which, by their - nature, must remain in effect beyond the termination of - this License shall survive. - - 6.2. If You assert a patent infringement claim (excluding - declaratory judgment actions) against Initial Developer or - a Contributor (the Initial Developer or Contributor against - whom You assert such claim is referred to as "Participant") - alleging that the Participant Software (meaning the - Contributor Version where the Participant is a Contributor - or the Original Software where the Participant is the - Initial Developer) directly or indirectly infringes any - patent, then any and all rights granted directly or - indirectly to You by such Participant, the Initial - Developer (if the Initial Developer is not the Participant) - and all Contributors under Sections 2.1 and/or 2.2 of this - License shall, upon 60 days notice from Participant - terminate prospectively and automatically at the expiration - of such 60 day notice period, unless if within such 60 day - period You withdraw Your claim with respect to the - Participant Software against such Participant either - unilaterally or pursuant to a written agreement with - Participant. - - 6.3. In the event of termination under Sections 6.1 or 6.2 - above, all end user licenses that have been validly granted - by You or any distributor hereunder prior to termination - (excluding licenses granted to You by any distributor) - shall survive termination. - - 7. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE - INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF - COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE - LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR - CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT - LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK - STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL - INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT - APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO - NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR - CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT - APPLY TO YOU. - - 8. U.S. GOVERNMENT END USERS. - - The Covered Software is a "commercial item," as that term is - defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial - computer software" (as that term is defined at 48 C.F.R. - 252.227-7014(a)(1)) and "commercial computer software - documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. - 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 - through 227.7202-4 (June 1995), all U.S. Government End Users - acquire Covered Software with only those rights set forth herein. - This U.S. Government Rights clause is in lieu of, and supersedes, - any other FAR, DFAR, or other clause or provision that addresses - Government rights in computer software under this License. - - 9. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the - extent necessary to make it enforceable. This License shall be - governed by the law of the jurisdiction specified in a notice - contained within the Original Software (except to the extent - applicable law, if any, provides otherwise), excluding such - jurisdiction's conflict-of-law provisions. Any litigation - relating to this License shall be subject to the jurisdiction of - the courts located in the jurisdiction and venue specified in a - notice contained within the Original Software, with the losing - party responsible for costs, including, without limitation, court - costs and reasonable attorneys' fees and expenses. The - application of the United Nations Convention on Contracts for the - International Sale of Goods is expressly excluded. Any law or - regulation which provides that the language of a contract shall - be construed against the drafter shall not apply to this License. - You agree that You alone are responsible for compliance with the - United States export administration regulations (and the export - control laws and regulation of any other countries) when You use, - distribute or otherwise make available any Covered Software. - - 10. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or - indirectly, out of its utilization of rights under this License - and You agree to work with Initial Developer and Contributors to - distribute such responsibility on an equitable basis. Nothing - herein is intended or shall be deemed to constitute any admission - of liability. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/resources/META-INF/NOTICE b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/resources/META-INF/NOTICE deleted file mode 100644 index d48810c0ec..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/resources/META-INF/NOTICE +++ /dev/null @@ -1,18 +0,0 @@ -========================================================================= -== NOTICE file corresponding to the section 4 d of == -== the Apache License, Version 2.0, == -== in this case for the Apache Tuscany distribution. == -========================================================================= - -This product includes software developed by the Apache Software Foundation -(http://www.apache.org/). - -This product also includes software developed by: -- the Eclipse Modeling Framework project (http://www.eclipse.org/emf/) -- the Celtix project (http://celtix.objectweb.org/) -- the Mozilla Rhino project (http://www.mozilla.org/rhino/) -- the GlassFish JAX-WS project (https://jax-ws.dev.java.net/) - -Please read the LICENSE.txt file present in the root directory of this -distribution. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/resources/META-INF/README.txt b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/resources/META-INF/README.txt deleted file mode 100644 index 9b26d1690a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/resources/META-INF/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -Apache Tuscany M1 build (May, 2006) -=================================== - -http://incubator.apache.org/tuscany/ - -Tuscany is an effort undergoing incubation at the Apache Software Foundation -(ASF), sponsored by the Web Services PMC. - -Incubation is required of all newly accepted projects until a further review -indicates that the infrastructure, communications, and decision making process -have stabilized in a manner consistent with other successful ASF projects. - -While incubation status is not necessarily a reflection of the completeness or -stability of the code, it does indicate that the project has yet to be fully -endorsed by the ASF. - - -Support -------- - -Any problem with this release can be reported to the Tuscany mailing list -or in the JIRA issue tracker. - -Mailing list subscription: - tuscany-dev-subscribe@ws.apache.org - -Jira: - http://issues.apache.org/jira/browse/Tuscany - - -Thank you for using Tuscany! - - -The Tuscany Team. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/resources/RemotableInterfaceTemplate.xsl b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/resources/RemotableInterfaceTemplate.xsl deleted file mode 100644 index e3da5da20f..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/main/resources/RemotableInterfaceTemplate.xsl +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - - - - - /** - * .java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: #axisVersion# #today# - */ - package ; - - import org.osoa.sca.annotations.Remotable; - import org.apache.tuscany.api.annotation.DataType; - - /* - * java interface - */ - - @Remotable - @DataType(name="commonj.sdo.DataObject") - public interface { - - - - - - - - /** - * Auto generated method signatures - * @param - */ - public void - ( - - , - ) throws java.rmi.RemoteException; - - - - - - /** - * Auto generated method signature - * @param - */ - - public void start( - - - , - ,final . callback) throws java.rmi.RemoteException; - - - - - - - - - /** - * Auto generated method signature - - *@param - - */ - public void - ( - - , - - ) throws java.rmi.RemoteException; - - - - - - // - } - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java deleted file mode 100644 index e679496509..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.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.tools.java2wsdl.generate; - -import org.apache.tuscany.tools.java2wsdl.generate.customer.Customer; - -public class CustomerValue { - - public int getValue(String custId, String stockSymbol) { - return 0; - } - - public Customer getCustomerDetails(String custId) { - return new Customer(); - } - - public String noArgsServiceMethod() - { - return new String(); - } - - private void privateServiceMethod() - { - - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java deleted file mode 100644 index 4b5a795f2c..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.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.tools.java2wsdl.generate; - -import org.apache.tuscany.tools.java2wsdl.generate.account.Account; -import org.apache.tuscany.tools.java2wsdl.generate.customer.Customer; - -public class CustomerWithAccount { - - private Customer customer = new Customer(); - - private Account[] accounts; - - public int getValue(String custId, String stockSymbol) { - return 123; - } - - public Customer getCustomerDetails(String custId) { - return customer; - } - - public Account getCustomerAccount(String custId, String accountId) { - return accounts[0]; - } - - public Account[] getAccounts() { - return accounts; - } - - public void setAccounts(Account[] accounts) { - this.accounts = accounts; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java deleted file mode 100644 index a72321c9b1..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.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.tools.java2wsdl.generate; - -import java.io.File; - -import junit.framework.TestCase; - -/** - * A JUnit test case to test the Tuscany Java 2 WSDL Generation - */ -public class TuscanyJava2WSDLTestCase extends TestCase { - - /** - * setup the pre-requisites for the test case to run - * - * @exception Exception - */ - protected void setUp() throws Exception { - // System.out.println("inside setup"); - super.setUp(); - } - - /** - * @exception Exception - */ - protected void tearDown() throws Exception { - // System.out.println("inside tearDown"); - super.tearDown(); - } - - - /** - * Simple WSDL generation test. - */ - public void testSimpleWSDLGeneration() { - String[] arguments = new String[] { "-cn","org.apache.tuscany.tools.java2wsdl.generate.CustomerValue", - "-o", "target/java2wsdl-source", - "-xc", "org.apache.tuscany.tools.java2wsdl.generate.extra.GoldCustomer"}; - - - Java2WSDL.main(arguments); - - File file = new File("target/java2wsdl-source/CustomerValue.wsdl"); - assertTrue(file.exists() && file.isFile()); - } - - /** - * Test WSDL generation where a parameter Object[] is involved. - */ - public void testWsdlGeneration2() { - - String[] arguments = new String[] - { - "-cn", - "org.apache.tuscany.tools.java2wsdl.generate.CustomerWithAccount", - "-o", "target/java2wsdl-source", }; - Java2WSDL.main(arguments); - - File file = new File("target/java2wsdl-source/CustomerWithAccount.wsdl"); - assertTrue(file.exists() && file.isFile()); - } - - public void testWsdlGeneration_SDO_Static() - { - //tests for SDOs where XSD exist. Hence no XSDs must be generated - String[] arguments = new String[] { - "-cn", - "org.soapinterop.CreditScoreDocLit", - "-o", "target/java2wsdl-source", - "-ixsd", "[http://www.example.org/creditscore/doclit/," + - "http://www.example.org/creditscore/doclit/xsd]"}; - Java2WSDL.main(arguments); - - File file = new File("target/java2wsdl-source/CreditScoreDocLit.wsdl"); - assertTrue(file.exists() && file.isFile()); - } - - - - /** - * Test WSDL generation from a java interface and then generate the java - * interface using the generated WSDL. - */ - public void _testRoundTrip() { - // TODO implement round trip - // this should re-generate java interfaces from the generated wsdl - // and compile (?) the generated java code. - // fail(); - - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java deleted file mode 100644 index 84d59164ee..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.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.tools.java2wsdl.generate.account; - -import java.math.BigDecimal; - -public class Account { - int accountType; - - String accountNo; - - BigDecimal balance; - - public String getAccountNo() { - return accountNo; - } - - public void setAccountNo(String accountNo) { - this.accountNo = accountNo; - } - - public int getAccountType() { - return accountType; - } - - public void setAccountType(int accountType) { - this.accountType = accountType; - } - - public BigDecimal getBalance() { - return balance; - } - - public void setBalance(BigDecimal balance) { - this.balance = balance; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java deleted file mode 100644 index a28399e7fe..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.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.tools.java2wsdl.generate.customer; - -public class Customer { - private String name = ""; - - public int custType = 0; - - public String getName() { - return name; - } -} - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java deleted file mode 100644 index afc68a3217..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.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.tools.java2wsdl.generate.extra; - -import org.apache.tuscany.tools.java2wsdl.generate.customer.Customer; - - - - -public class GoldCustomer extends Customer { - public String goldCustNumber = ""; - - public String getGoldCustNumber() { - return goldCustNumber; - } - - public void setGoldCustNumber(String goldCustNumber) { - this.goldCustNumber = goldCustNumber; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGeneratorTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGeneratorTestCase.java deleted file mode 100644 index c3467cbabc..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGeneratorTestCase.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.tools.wsdl2java.generate; - -import junit.framework.TestCase; - -/** - * Test case for WSDL2Java - */ -public class WSDL2JavaGeneratorTestCase extends TestCase { - - public void testAccountService() { - - String basedir = System.getProperty("basedir"); - if (basedir == null) - basedir ="."; - - - String[] args=new String[] { "-targetDirectory", basedir + "/target/wsdl2java-source", - "-javaPackage", "org.apache.tuscany.tools.wsdl2java.generate.account", - basedir + "/src/test/resources/AccountService.wsdl"}; - - WSDL2JavaGenerator.main(args); - - } - - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/soapinterop/CreditScoreDocLit.java b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/soapinterop/CreditScoreDocLit.java deleted file mode 100644 index e9e8aa882a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/java/org/soapinterop/CreditScoreDocLit.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 org.soapinterop; - -public interface CreditScoreDocLit { - public org.example.creditscore.doclit.CreditReport getCreditScore( - org.example.creditscore.doclit.Customer param0) throws java.rmi.RemoteException; - } - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/AccountService.wsdl b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/AccountService.wsdl deleted file mode 100644 index e7be3ce5ba..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/AccountService.wsdl +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/CreditScoreDocLit.wsdl b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/CreditScoreDocLit.wsdl deleted file mode 100644 index 09d1a58589..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/CreditScoreDocLit.wsdl +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/helloworld.wsdl b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/helloworld.wsdl deleted file mode 100644 index 051f604bb2..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/helloworld.wsdl +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/interopdoc.wsdl b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/interopdoc.wsdl deleted file mode 100644 index 820c26ca34..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/interopdoc.wsdl +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/sequences.xsd b/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/sequences.xsd deleted file mode 100644 index a565f3fa65..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/java2wsdl/src/test/resources/sequences.xsd +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/tools/pom.xml deleted file mode 100644 index a5b5a65105..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/pom.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2 - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - org.apache.tuscany.sca.extensions.axis2.tools - parent - pom - Apache Tuscany Axis2 Tools - Tools for the Axis2 extension - - - - - osuosl.org - http://ftp.osuosl.org/pub/eclipse/tools/emf/maven2 - - true - - - - - - java2wsdl - wsdl2java - - - - - - - org.apache.tuscany.sdo - tuscany-sdo-impl - 1.0-incubator-SNAPSHOT - compile - - - - org.apache.neethi - neethi - 2.0 - compile - - - - org.apache.ws.commons.axiom - axiom-api - 1.2.2 - - - xerces - xercesImpl - - - - - - xerces - xercesImpl - 2.8.1 - - - - org.apache.axis2 - axis2-java2wsdl - 1.1.1 - compile - - - - org.apache.axis2 - axis2-codegen - 1.1.1 - compile - - - - org.eclipse.emf - codegen - 2.2.1 - compile - - - - org.eclipse.emf - codegen-ecore - 2.2.1 - compile - - - - annogen - annogen - 0.1.0 - compile - - - - commons-logging - commons-logging - 1.1 - compile - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/pom.xml b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/pom.xml deleted file mode 100644 index 6f48974b41..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/pom.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.axis2.tools - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - tuscany-wsdl2java - Apache Tuscany Axis2 WSDL2Java Tool - Apache Tuscany Axis2 WSDL2Java Tool - - - - org.apache.tuscany.sdo - tuscany-sdo-impl - - - - stax - stax-api - - - - wsdl4j - wsdl4j - - - - org.apache.neethi - neethi - - - - org.apache.ws.commons.schema - XmlSchema - - - - org.apache.ws.commons.axiom - axiom-api - - - - xerces - xercesImpl - - - - org.apache.ws.commons.axiom - axiom-impl - - - - org.apache.axis2 - axis2-kernel - - - - org.apache.axis2 - axis2-java2wsdl - - - - org.apache.axis2 - axis2-codegen - - - - org.eclipse.emf - codegen - - - - org.eclipse.emf - codegen-ecore - - - - annogen - annogen - - - - commons-logging - commons-logging - - - - org.codehaus.woodstox - wstx-asl - - - - junit - junit - - - - - - - - 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-incubator-SNAPSHOT - - - generate-sdo - generate-test-sources - - ${basedir}/src/test/resources/CreditScoreDocLit.wsdl - org.example.creditscore.doclit - true - true - true - - - generate - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/GenerationParameters.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/GenerationParameters.java deleted file mode 100644 index 3cb699681c..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/GenerationParameters.java +++ /dev/null @@ -1,435 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.java2wsdl.generate; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.Map; - -import org.apache.ws.java2wsdl.Java2WSDLUtils; -import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption; - -/** - * This class encapsulates the parameters that effect the generation of the - * WSDL. For example they contain all user settings such as source class, - * target location etc. - * - */ -public class GenerationParameters implements TuscanyJava2WSDLConstants -{ - public static final String WSDL_FILENAME_SUFFIX = ".wsdl"; - public static final String XSD_IMPORT_DELIMITER = "[,]"; - - private Map cmdLineOptions = null; - private FileOutputStream outputFileStream = null; - private String sourceClassName = null; - - private ArrayList extraClasses; - private String attrFormDefault = null; - private String elementFormDefault = null; - private String targetNamespace = null; - private String targetNamespacePrefix = null; - private String schemaTargetNamespace = null; - private String schemaTargetNamespacePrefix = null; - private ClassLoader classLoader = null; - private String serviceName = null; - private String style = DOCUMENT; - private String use = LITERAL; - private String locationUri = DEFAULT_LOCATION_URL; - private Map schemaLocationMap = null; - - public GenerationParameters(Map cmdLineOptions) throws Exception - { - this.cmdLineOptions = cmdLineOptions; - loadParameters(); - } - - protected void loadParameters() throws Exception - { - initializeSourceClassName(); - resolveFileOutputStream(); - resolveClassLoader4InputClasspath(); - loadSchemaLocationMap(); - initializeOtherParams(); - } - - private Java2WSDLCommandLineOption loadOption(String shortOption, String longOption) { - //short option gets precedence - Java2WSDLCommandLineOption option = null; - if (longOption != null) { - option = (Java2WSDLCommandLineOption) cmdLineOptions.get(longOption); - if (option != null) { - return option; - } - } - if (shortOption != null) { - option = (Java2WSDLCommandLineOption) cmdLineOptions.get(shortOption); - } - - return option; - } - - protected void initializeSourceClassName() throws Exception - { - Java2WSDLCommandLineOption option = - loadOption(CLASSNAME_OPTION, CLASSNAME_OPTION_LONG); - sourceClassName = option == null ? null : option.getOptionValue(); - - if (sourceClassName == null || sourceClassName.equals("")) { - throw new Exception("class name must be present!"); - } - } - - /** - * @throws Exception - */ - protected void resolveFileOutputStream() throws Exception - { - File outputFolder; - Java2WSDLCommandLineOption option = loadOption(OUTPUT_LOCATION_OPTION, - OUTPUT_LOCATION_OPTION_LONG); - String outputFolderName = option == null ? System.getProperty("user.dir") : option.getOptionValue(); - - outputFolder = new File(outputFolderName); - if (!outputFolder.exists()) { - outputFolder.mkdirs(); - } else if (!outputFolder.isDirectory()) { - throw new Exception("The specified location " + outputFolderName + "is not a folder"); - } - - option = loadOption(OUTPUT_FILENAME_OPTION, - OUTPUT_FILENAME_OPTION_LONG); - String outputFileName = option == null ? null : option.getOptionValue(); - //derive a file name from the class name if the filename is not specified - if (outputFileName == null) - { - outputFileName = Java2WSDLUtils.getSimpleClassName(sourceClassName) + WSDL_FILENAME_SUFFIX; - } - - //first create a file in the given location - File outputFile = new File(outputFolder, outputFileName); - try - { - if (!outputFile.exists()) - { - outputFile.createNewFile(); - } - outputFileStream = new FileOutputStream(outputFile); - } - catch (IOException e) - { - throw new Exception(e); - } - } - - protected void addToSchemaLocationMap(String optionValue) throws Exception - { - //option value will be of the form [namespace, schemalocation] - //hence we take the two substrings starting after '[' and upto ',' and - //starting after ',' and upto ']' - getSchemaLocationMap().put(optionValue.substring(1, optionValue.indexOf(COMMA)), - optionValue.substring(optionValue.indexOf(COMMA) + 1, optionValue.length() - 1)); - - - } - - protected void loadSchemaLocationMap() throws Exception - { - Java2WSDLCommandLineOption option = loadOption(IMPORT_XSD_OPTION, IMPORT_XSD_OPTION_LONG); - - if (option != null) - { - ArrayList optionValues = option.getOptionValues(); - - for ( int count = 0 ; count < optionValues.size() ; ++count ) - { - addToSchemaLocationMap(((String)optionValues.get(count)).trim()); - } - } - } - - protected void resolveClassLoader4InputClasspath() throws Exception - { - Java2WSDLCommandLineOption option = - loadOption(CLASSPATH_OPTION, CLASSPATH_OPTION_LONG); - - if (option != null) { - ArrayList optionValues = option.getOptionValues(); - URL[] urls = new URL[optionValues.size()]; - String[] classPathEntries = (String[]) optionValues.toArray(new String[optionValues.size()]); - - try { - for (int i = 0; i < classPathEntries.length; i++) { - String classPathEntry = classPathEntries[i]; - //this should be a file(or a URL) - if (Java2WSDLUtils.isURL(classPathEntry)) { - urls[i] = new URL(classPathEntry); - } else { - urls[i] = new File(classPathEntry).toURL(); - } - } - } catch (MalformedURLException e) { - throw new Exception(e); - } - - classLoader = new URLClassLoader(urls, Thread.currentThread().getContextClassLoader()); - - } else { - classLoader = Thread.currentThread().getContextClassLoader(); - } - } - - protected void initializeOtherParams() - { -// set the other parameters to the builder - Java2WSDLCommandLineOption option = loadOption(SCHEMA_TARGET_NAMESPACE_OPTION, - SCHEMA_TARGET_NAMESPACE_OPTION_LONG); - schemaTargetNamespace = (option == null) ? null : option.getOptionValue(); - - option = loadOption(SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION, - SCHEMA_TARGET_NAMESPACE_PREFIX_OPTION_LONG); - schemaTargetNamespacePrefix = (option == null) ? null : option.getOptionValue(); - - option = loadOption(TARGET_NAMESPACE_OPTION, - TARGET_NAMESPACE_OPTION_LONG); - targetNamespace = (option == null) ? null : option.getOptionValue(); - - option = loadOption(TARGET_NAMESPACE_PREFIX_OPTION, - TARGET_NAMESPACE_PREFIX_OPTION_LONG); - targetNamespacePrefix = (option == null) ? null : option.getOptionValue(); - - option = loadOption(SERVICE_NAME_OPTION, - SERVICE_NAME_OPTION_LONG); - serviceName = (option == null) ? Java2WSDLUtils.getSimpleClassName(sourceClassName) : option.getOptionValue(); - - option = loadOption(STYLE_OPTION,STYLE_OPTION); - style = (option == null) ? null : option.getOptionValue(); - - - option = loadOption(LOCATION_OPTION, - LOCATION_OPTION); - locationUri = (option == null) ? null : option.getOptionValue(); - - option = loadOption(USE_OPTION,USE_OPTION); - use = (option == null) ? null : option.getOptionValue(); - - option = loadOption(ATTR_FORM_DEFAULT_OPTION, ATTR_FORM_DEFAULT_OPTION_LONG); - attrFormDefault = (option == null) ? null : option.getOptionValue(); - - option = loadOption(ELEMENT_FORM_DEFAULT_OPTION,ELEMENT_FORM_DEFAULT_OPTION_LONG); - elementFormDefault = option == null ? null : option.getOptionValue(); - - option = loadOption(TuscanyJava2WSDLConstants.EXTRA_CLASSES_DEFAULT_OPTION, - TuscanyJava2WSDLConstants.EXTRA_CLASSES_DEFAULT_OPTION_LONG); - extraClasses = option == null ? new ArrayList() : option.getOptionValues(); - } - - public ClassLoader getClassLoader() - { - return classLoader; - } - - public void setClassLoader(ClassLoader classLoader) - { - this.classLoader = classLoader; - } - - public String getLocationUri() - { - if ( locationUri == null ) - { - locationUri = DEFAULT_LOCATION_URL; - } - return locationUri; - } - - public void setLocationUri(String locationUri) - { - this.locationUri = locationUri; - } - - public FileOutputStream getOutputFileStream() - { - return outputFileStream; - } - - public void setOutputFileStream(FileOutputStream outputFileStream) - { - this.outputFileStream = outputFileStream; - } - - public String getSchemaTargetNamespace() throws Exception - { - if (schemaTargetNamespace == null - || schemaTargetNamespace.trim().equals("")) - { - this.schemaTargetNamespace = Java2WSDLUtils - .schemaNamespaceFromClassName(getSourceClassName(), getClassLoader()).toString(); - } - return schemaTargetNamespace; - } - - public void setSchemaTargetNamespace(String schemaTargetNamespace) - { - this.schemaTargetNamespace = schemaTargetNamespace; - } - - public String getSchemaTargetNamespacePrefix() - { - if (schemaTargetNamespacePrefix == null - || schemaTargetNamespacePrefix.trim().equals("")) - { - this.schemaTargetNamespacePrefix = SCHEMA_NAMESPACE_PRFIX; - } - - return schemaTargetNamespacePrefix; - } - - public void setSchemaTargetNamespacePrefix(String schemaTargetNamespacePrefix) - { - this.schemaTargetNamespacePrefix = schemaTargetNamespacePrefix; - } - - public String getServiceName() - { - if ( serviceName == null ) - { - serviceName = Java2WSDLUtils.getSimpleClassName(getSourceClassName()); - } - return serviceName; - } - - public void setServiceName(String serviceName) - { - this.serviceName = serviceName; - } - - public String getSourceClassName() - { - return sourceClassName; - } - - public void setSourceClassName(String sourceClassName) - { - this.sourceClassName = sourceClassName; - } - - public String getStyle() - { - if ( style == null ) - { - style = DOCUMENT; - } - return style; - } - - public void setStyle(String style) - { - this.style = style; - } - - public String getTargetNamespace() throws Exception - { - if ( targetNamespace == null ) { - targetNamespace = Java2WSDLUtils.namespaceFromClassName(this.sourceClassName, this.classLoader).toString(); - } - return targetNamespace; - } - - public void setTargetNamespace(String targetNamespace) - { - this.targetNamespace = targetNamespace; - } - - public String getTargetNamespacePrefix() - { - return targetNamespacePrefix; - } - - public void setTargetNamespacePrefix(String targetNamespacePrefix) - { - this.targetNamespacePrefix = targetNamespacePrefix; - } - - public String getUse() - { - if ( use == null ) - { - use = LITERAL; - } - return use; - } - - public void setUse(String use) - { - this.use = use; - } - - public Map getSchemaLocationMap() - { - if ( schemaLocationMap == null ) - { - schemaLocationMap = new Hashtable(); - } - return schemaLocationMap; - } - - public void setSchemaLocationMap(Map schemaLocationMap) { - this.schemaLocationMap = schemaLocationMap; - } - - public String getAttrFormDefault() { - if ( attrFormDefault == null ) - { - attrFormDefault = FORM_DEFAULT_QUALIFIED; - } - return attrFormDefault; - } - - public void setAttrFormDefault(String attrFormDefault) { - this.attrFormDefault = attrFormDefault; - } - - public String getElementFormDefault() { - if ( elementFormDefault == null ) - { - elementFormDefault = FORM_DEFAULT_QUALIFIED; - } - return elementFormDefault; - } - - public void setElementFormDefault(String elementFormDefault) { - this.elementFormDefault = elementFormDefault; - } - - public ArrayList getExtraClasses() { - return extraClasses; - } - - public void setExtraClasses(ArrayList extraClasses) { - this.extraClasses = extraClasses; - } -} - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.java deleted file mode 100644 index 8855c3f6e9..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDL.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.tools.java2wsdl.generate; - -import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOptionParser; - -/** - * This class provides the tooling abstraction to Tuscany Java2WSDL and can be - * invoked from command line with the follwing options as with Axis2 Java2WSDL - * - */ -public class Java2WSDL { - /** - * @param args - */ - public static void main(String[] args) - { - //parse the cmd line args - Java2WSDLCommandLineOptionParser commandLineOptionParser = - new Java2WSDLCommandLineOptionParser(args); - // validate the arguments - validateCommandLineOptions(commandLineOptionParser); - - Java2WSDLGeneratorFactory.getInstance().createGenerator(). - generateWSDL(commandLineOptionParser.getAllOptions()); - - // Uncomment the following statement to directly run the Axis2 tool - // without - // runAxis2Tool(args); - } - - private static void runAxis2Tool(String[] args) { - org.apache.ws.java2wsdl.Java2WSDL.main(args); - } - - private static void validateCommandLineOptions(Java2WSDLCommandLineOptionParser parser) { - if (parser.getAllOptions().size() == 0) { - printUsage(); - } else if (parser.getInvalidOptions(new TuscanyJava2WSDLOptionsValidator()).size() > 0) { - printUsage(); - } - - } - - public static void printUsage() { - System.out.println("Usage java2wsdl -cn : class file name"); - System.out.println("-o : output file location"); - System.out.println("-cp : list of classpath entries - (urls)"); - System.out.println("-tn : target namespace"); - System.out.println("-tp : target namespace prefix"); - System.out.println("-stn : target namespace for schema"); - System.out.println("-stp : target namespace prefix for schema"); - System.out.println("-sn : service name"); - System.out.println("-of : output file name for the WSDL"); - System.out.println("-st : style for the WSDL"); - System.out.println("-u : use for the WSDL"); - System.out.println("-l : address of the port for the WSDL"); - System.out.println("-ixsd [, ] : schemas to be imported (and not generated)"); - System.out.println("-efd : Setting for elementFormDefault (defaults to qualified)"); - System.out.println("-afd : Setting for attributeFormDefault (defaults to qualified)"); - System.out.println("-xc : Extra class for which schematype must be generated. " + - "\t\tUse as : -xc class1 -xc class2 ..."); - System.exit(0); - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGenerator.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGenerator.java deleted file mode 100644 index 3323113af4..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGenerator.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.tools.java2wsdl.generate; - -import java.io.OutputStream; -import java.util.Map; - -/** - * This is the Java2WSDL Generator facade that will be used by Tuscany - * components for java to wsdl conversion. - * - */ -public interface Java2WSDLGenerator { - public void generateWSDL(String[] args); - - public void generateWSDL(Map commandLineOptions); - - public void addWSDLGenListener(WSDLGenListener l); - - public void removeWSDLGenListener(WSDLGenListener l); - - public Map getCommandLineOptions(); - - public void setCommandLineOptoins(Map cmdLineOpts); - - public OutputStream getOutputStream(); - - public void setOutputStream(OutputStream outStream); - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.java deleted file mode 100644 index e8f3db95b0..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorFactory.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.tools.java2wsdl.generate; - -import java.util.Vector; - -/** - * Factory that creates Java2WSDL Generators. Presently the there is a Default - * Generator that wraps around the AXIS2 Java2WSDL implementation. The factory - * can be extended to create generators that wrap around other implementations - * if required. - */ - -public class Java2WSDLGeneratorFactory { - /* - * singleton instance of this factory class - */ - private static Java2WSDLGeneratorFactory factory = null; - - /** - * code for the default generator - */ - public static final int DEFAULT_GENERATOR = 0; - - /** - * Default Generator class name - */ - public static final String DEFAULT_GENERATOR_CLASSNAME = "org.apache.tuscany.tools.java2wsdl.generate.Java2WSDLGeneratorImpl"; - - /** - * list of generator classnames in a position that corresponds to their - * code. For example the default generator's code is 0 and hence this - * generator's classname is stored at index '0' of the list - */ - protected Vector generatorClassNames = new Vector(); - - /** - * @return the singleton instance of this generator factory - */ - public static Java2WSDLGeneratorFactory getInstance() { - if (factory == null) { - factory = new Java2WSDLGeneratorFactory(); - } - return factory; - } - - private Java2WSDLGeneratorFactory() { - generatorClassNames.addElement(DEFAULT_GENERATOR_CLASSNAME); - } - - public Java2WSDLGenerator createGenerator() { - return createGenerator(DEFAULT_GENERATOR); - } - - /** - * creates an instance of a Java2WSDL Generator based on the input type - * - * @param genType - * type of the generator to be created - * @return an instance of a Java2WSDL Generator - */ - public Java2WSDLGenerator createGenerator(int genType) { - try { - return (Java2WSDLGenerator) (Class.forName(generatorClassNames - .elementAt(genType)).newInstance()); - } catch (Exception e) { - System.out - .println(" Unable to create Java2WSDL generator due to ....."); - System.out.println(e); - return null; - } - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java deleted file mode 100644 index 9d1a9df438..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/Java2WSDLGeneratorImpl.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.java2wsdl.generate; - -import java.io.OutputStream; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Vector; - -import org.apache.ws.java2wsdl.Java2WSDL; -import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption; -import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOptionParser; -import org.apache.ws.java2wsdl.utils.Java2WSDLOptionsValidator; - -/** - * This is an implementation of the Java2WSDLGenerator facade. This - * implementation is a decorator around the Axis2 implementation of the - * Java2WSDL conversion. The WSDL generation is divided into phases that are - * stringed up as a template method. The phases are - User Input Validation - - * WSDL Java Model Generation - Serialization of WSDL Java Model The function of - * each phase is accomplished by delegation to the appropriate classes in Axis2. - * At the start and end of each phase an event is published to subcribers - * denoting the start and end of the phase. - * - * Such a spliting up of the Java2WSDL conversion into phases has been designed - * to enable interceptors to modify the model or apply transformations to the - * output. Typically the interceptors can subscribe to the start and end events - * of these phases and hence be able to intercept. - * - * Note: This class contains substantial AXIS2 Java2WSDL code refactored into - * it. These will be removed as and when the Axis2 code is fixed. - * - */ -public class Java2WSDLGeneratorImpl implements Java2WSDLGenerator, TuscanyJava2WSDLConstants -{ - private List genPhaseListeners = new Vector(); - private GenerationParameters genParams = null; - private Map commandLineOptions = null; - private TuscanyJava2WSDLBuilder java2WsdlBuilder; - private OutputStream outputStream = null; - - public Java2WSDLGeneratorImpl() - { - - } - - private void multicastGenPhaseCompletionEvent(int genPhase) { - WSDLGenEvent event = new WSDLGenEvent(this, genPhase); - Iterator iterator = genPhaseListeners.iterator(); - while (iterator.hasNext()) { - ((WSDLGenListener) iterator.next()).WSDLGenPhaseCompleted(event); - } - } - - private void initJava2WSDLBuilder() throws Exception - { -// Now we are done with loading the basic values - time to create the builder - java2WsdlBuilder = new TuscanyJava2WSDLBuilder(genParams); - } - - protected boolean validateInputArgs(String[] args) - { - boolean isValid = true; - Java2WSDLCommandLineOptionParser parser = new Java2WSDLCommandLineOptionParser(args); - if (parser.getAllOptions().size() == 0) { - Java2WSDL.printUsage(); - isValid = false; - } else if (parser.getInvalidOptions(new Java2WSDLOptionsValidator()) - .size() > 0) { - Java2WSDL.printUsage(); - isValid = false; - } - - if (isValid) - { - commandLineOptions = parser.getAllOptions(); - } - - return isValid; - } - - public boolean buildWSDLDocument() throws Exception - { - boolean isComplete = true; - initJava2WSDLBuilder(); - java2WsdlBuilder.buildWSDL(); - - return isComplete; - } - - public boolean serializeWSDLDocument() throws Exception { - boolean isComplete = true; - - if ( getOutputStream() == null ) - { - setOutputStream(genParams.getOutputFileStream()); - } - - java2WsdlBuilder.getWsdlDocument().serialize(getOutputStream()); - getOutputStream().flush(); - getOutputStream().close();; - - return isComplete; - } - - /* - * This is the template method that splits the Java2WSDL generation cycle - * into phase / steps. - * - * @see tuscany.tools.Java2WSDLGeneratorIfc#generateWSDL(java.lang.String[]) - */ - public void generateWSDL(Map commandLineOptions) - { - try - { - // load the user options into an easy to access abstraction - genParams = new GenerationParameters(commandLineOptions); - - // if the WSDL Model generation was successul - if ( buildWSDLDocument() ) - { - // multicast event for generation of wsdl model - multicastGenPhaseCompletionEvent(WSDLGenListener.WSDL_MODEL_CREATION); - // if the serialization of the generated (and fixed) model - // is successful - if (serializeWSDLDocument()) { - // multicast event for writing of the WSDL Model to - // supplied output stream - multicastGenPhaseCompletionEvent(WSDLGenListener.WSDL_MODEL_WRITING); - } - } - } - catch (Exception e) - { - e.printStackTrace(); - } - - // TODO Auto-generated method stub - - } - - public void generateWSDL(String[] args) - { - // if the argument input are found to be valid - if (validateInputArgs(args)) - { - //multicast event for input args validation complete - multicastGenPhaseCompletionEvent(WSDLGenListener.INPUT_ARGS_VALIDATION); - generateWSDL(commandLineOptions); - } - } - - /* - * (non-Javadoc) - * - * @see tuscany.tools.Java2WSDLGeneratorIfc#addWSDLGenListener(tuscany.tools.WSDLGenListener) - */ - public void addWSDLGenListener(WSDLGenListener l) { - genPhaseListeners.add(l); - - } - - /* - * (non-Javadoc) - * - * @see tuscany.tools.Java2WSDLGeneratorIfc#removeWSDLGenListener(tuscany.tools.WSDLGenListener) - */ - public void removeWSDLGenListener(WSDLGenListener l) { - genPhaseListeners.remove(l); - } - - /* - * (non-Javadoc) - * - * @see tuscany.tools.Java2WSDLGeneratorIfc#getCommandLineOptions() - */ - public Map getCommandLineOptions() { - return commandLineOptions; - } - - /* - * (non-Javadoc) - * - * @see tuscany.tools.Java2WSDLGeneratorIfc#setCommandLineOptoins(java.util.Map) - */ - public void setCommandLineOptoins(Map cmdLineOpts) { - commandLineOptions = cmdLineOpts; - } - - - /* - * (non-Javadoc) - * - * @see tuscany.tools.Java2WSDLGeneratorIfc#getOutputStream() - */ - public OutputStream getOutputStream() { - // TODO Auto-generated method stub - return outputStream; - } - - /* - * (non-Javadoc) - * - * @see tuscany.tools.Java2WSDLGeneratorIfc#setOutputStream(java.io.OutputStream) - */ - public void setOutputStream(OutputStream outStream) { - outputStream = outStream; - } - - - public TuscanyJava2WSDLBuilder getJava2WsdlBuilder() - { - return java2WsdlBuilder; - } - - public void setJava2WsdlBuilder(TuscanyJava2WSDLBuilder java2WsdlBuilder) - { - this.java2WsdlBuilder = java2WsdlBuilder; - } - - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java deleted file mode 100644 index 67609445ae..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/SchemaBuilder.java +++ /dev/null @@ -1,524 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.java2wsdl.generate; - -import java.io.StringReader; -import java.lang.reflect.Constructor; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Vector; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sdo.util.SDOUtil; -import org.apache.ws.commons.schema.XmlSchema; -import org.apache.ws.commons.schema.XmlSchemaCollection; -import org.apache.ws.commons.schema.XmlSchemaComplexType; -import org.apache.ws.commons.schema.XmlSchemaElement; -import org.apache.ws.commons.schema.XmlSchemaForm; -import org.apache.ws.commons.schema.XmlSchemaGroupBase; -import org.apache.ws.commons.schema.XmlSchemaImport; -import org.apache.ws.commons.schema.XmlSchemaInclude; -import org.apache.ws.commons.schema.XmlSchemaSequence; -import org.apache.ws.commons.schema.XmlSchemaType; -import org.apache.ws.commons.schema.utils.NamespaceMap; -import org.apache.ws.java2wsdl.Java2WSDLUtils; -import org.codehaus.jam.JClass; -import org.codehaus.jam.JProperty; - -import commonj.sdo.DataObject; -import commonj.sdo.Type; -import commonj.sdo.helper.XSDHelper; - -public class SchemaBuilder implements TuscanyJava2WSDLConstants { - public static final String NAME_SPACE_PREFIX = "stn_"; - - private static int prefixCount = 1; - - public static final String MIXED = "mixed"; - - public static final String GROUP = "group"; - - protected String attrFormDefault = null; - - protected String elementFormDefault = null; - - protected XmlSchemaCollection xmlSchemaCollection = new XmlSchemaCollection(); - - private Hashtable schemaMap = new Hashtable(); - - protected Hashtable targetNamespacePrefixMap = new Hashtable(); - - protected TuscanyTypeTable typeTable = new TuscanyTypeTable(); - - protected Map schemaLocationMap = null; - - private ClassLoader classLoader; - - protected SchemaBuilder(XmlSchemaCollection schemaCollection, - Hashtable schemaMap, - Hashtable nsPrefixMap, - TuscanyTypeTable typeTable, - String attrFormDef, - String eleFormDef, - Map schemaLocMap, - ClassLoader classLoader) { - this.schemaMap = schemaMap; - this.xmlSchemaCollection = schemaCollection; - this.targetNamespacePrefixMap = nsPrefixMap; - this.typeTable = typeTable; - this.schemaLocationMap = schemaLocMap; - this.classLoader = classLoader; - this.attrFormDefault = attrFormDef; - this.elementFormDefault = eleFormDef; - } - - private boolean isSDO(JClass javaType) throws Exception { - Class sdoClass = Class.forName(javaType.getQualifiedName(), - true, - classLoader); - return DataObject.class.isAssignableFrom(sdoClass); - } - - private void buildComplexTypeContents_JavaType(JClass javaType, - XmlSchemaComplexType complexType, - XmlSchema xmlSchema) throws Exception { - JProperty[] properties = javaType.getDeclaredProperties(); - - for (int i = 0; i < properties.length; i++) { - JProperty property = properties[i]; - String propertyName = property.getType().getQualifiedName(); - boolean isArryType = property.getType().isArrayType(); - if (isArryType) { - propertyName = property.getType().getArrayComponentType().getQualifiedName(); - } - - if (typeTable.isSimpleType(propertyName)) { - XmlSchemaElement elt1 = new XmlSchemaElement(); - elt1.setName(getCorrectName(property.getSimpleName())); - elt1.setSchemaTypeName(typeTable.getSimpleSchemaTypeName(propertyName)); - ((XmlSchemaGroupBase) complexType.getParticle()).getItems().add(elt1); - if (isArryType) { - elt1.setMaxOccurs(Long.MAX_VALUE); - elt1.setMinOccurs(0); - } - } else { - QName schemaTypeName = null; - if (isArryType) { - schemaTypeName = generateSchema(property.getType().getArrayComponentType()); - } else { - schemaTypeName = generateSchema(property.getType()); - } - - XmlSchemaElement elt1 = new XmlSchemaElement(); - elt1.setName(getCorrectName(property.getSimpleName())); - elt1.setSchemaTypeName(schemaTypeName); - ((XmlSchemaGroupBase) complexType.getParticle()).getItems().add(elt1); - - if (isArryType) { - elt1.setMaxOccurs(Long.MAX_VALUE); - elt1.setMinOccurs(0); - } - - addImports(xmlSchema, - schemaTypeName); - } - } - } - - protected QName buildSchema_JavaType(JClass javaType) throws Exception { - QName schemaTypeName = typeTable.getComplexSchemaTypeName(javaType, this.classLoader); - if (schemaTypeName == null) { - String simpleName = javaType.getSimpleName(); - - String packageName = javaType.getContainingPackage().getQualifiedName(); - - String targetNameSpace = - Java2WSDLUtils.schemaNamespaceFromClassName(javaType.getQualifiedName(), this.classLoader) - .toString(); - - XmlSchema xmlSchema = getXmlSchema(targetNameSpace); - String targetNamespacePrefix = (String) targetNamespacePrefixMap.get(targetNameSpace); - - schemaTypeName = new QName(targetNameSpace, simpleName, targetNamespacePrefix); - XmlSchemaComplexType complexType = new XmlSchemaComplexType(xmlSchema); - complexType.setName(simpleName); - - XmlSchemaSequence sequence = new XmlSchemaSequence(); - complexType.setParticle(sequence); - - createGlobalElement(xmlSchema, - complexType, - schemaTypeName); - xmlSchema.getItems().add(complexType); - xmlSchema.getSchemaTypes().add(schemaTypeName, - complexType); - - // adding this type to the table - // typeTable.addComplexScheam(name, complexType.getQName()); - typeTable.addComplexSchemaType(targetNameSpace, - simpleName, - schemaTypeName); - buildComplexTypeContents_JavaType(javaType, - complexType, - xmlSchema); - } - return schemaTypeName; - } - - protected QName buildSchema_SDO(Type dataType) // throws Exception - { - QName schemaTypeName = typeTable.getComplexSchemaTypeName(dataType.getURI(), - dataType.getName()); - - if (schemaTypeName == null) { - // invoke XSDHelper to generate schema for this sdo type - XSDHelper xsdHelper = SDOUtil.createXSDHelper(SDOUtil.createTypeHelper()); - // it is better to check if XSDHelper can generate the schema - if (xsdHelper.isXSD(dataType)) { - // if schemalocations for xsd has been specified, include them - includeExtXSD(dataType); - } else { - List typeList = new Vector(); - typeList.add(dataType); - - // the xsdhelper returns a string that contains the schemas for this type - String schemaDefns = xsdHelper.generate(typeList, - schemaLocationMap); - - // extract the schema elements and store them in the schema map - extractSchemas(schemaDefns); - } - // since the XSDHelper will not return the type name, create it and store it in typetable - schemaTypeName = new QName(dataType.getURI(), dataType.getName(), generatePrefix()); - typeTable.addComplexSchemaType(dataType.getURI(), - dataType.getName(), - schemaTypeName); - - } - return schemaTypeName; - } - - public QName generateSchema(JClass javaType) throws Exception { - if (isSDO(javaType)) { - Type dataType = createDataObject(javaType).getType(); - return buildSchema_SDO(dataType); - } else { - return buildSchema_JavaType(javaType); - } - } - - private XmlSchema getXmlSchema(String targetNamespace) { - XmlSchema xmlSchema; - - if ((xmlSchema = (XmlSchema) schemaMap.get(targetNamespace)) == null) { - String targetNamespacePrefix = generatePrefix(); - - xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection); - xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting()); - xmlSchema.setElementFormDefault(getElementFormDefaultSetting()); - - targetNamespacePrefixMap.put(targetNamespace, - targetNamespacePrefix); - schemaMap.put(targetNamespace, - xmlSchema); - - NamespaceMap prefixmap = new NamespaceMap(); - prefixmap.put(TuscanyTypeTable.XS_URI_PREFIX, - TuscanyTypeTable.XML_SCHEMA_URI); - prefixmap.put(targetNamespacePrefix, - targetNamespace); - xmlSchema.setNamespaceContext(prefixmap); - } - return xmlSchema; - } - - /** - * JAM convert first name of an attribute into UpperCase as an example if there is a instance variable called foo in a bean , then Jam give that - * as Foo so this method is to correct that error - * - * @param wrongName - * @return the right name, using english as the locale for case conversion - */ - public static String getCorrectName(String wrongName) { - if (wrongName.length() > 1) { - return wrongName.substring(0, - 1).toLowerCase(Locale.ENGLISH) - + wrongName.substring(1, - wrongName.length()); - } else { - return wrongName.substring(0, - 1).toLowerCase(Locale.ENGLISH); - } - } - - private String addImports(XmlSchema xmlSchema, QName schemaTypeName) { - String prefix = null; - String[] prefixes = xmlSchema.getNamespaceContext().getDeclaredPrefixes(); - for (int count = 0; count < prefixes.length; ++count) { - if (schemaTypeName.getNamespaceURI(). - equals(xmlSchema.getNamespaceContext().getNamespaceURI(prefixes[count])) ) { - return prefixes[count]; - } - } - - // the following lines are executed only if a prefix was not found which implies that the - // schemaTypeName was not imported earlier and also it does not belong to the targetnamespace - String schemaLocation = null; - XmlSchemaImport importElement = new XmlSchemaImport(); - importElement.setNamespace(schemaTypeName.getNamespaceURI()); - xmlSchema.getItems().add(importElement); - prefix = generatePrefix(); - //it is safe to cast like this since it was this class that instantiated the - //NamespaceContext and assigned it to an instance of a NamespaceMap (see method getXmlSchema) - ((NamespaceMap)xmlSchema.getNamespaceContext()).put(prefix, - schemaTypeName.getNamespaceURI()); - - return prefix; - } - - private String formGlobalElementName(String typeName) { - String firstChar = typeName.substring(0, - 1); - return typeName.replaceFirst(firstChar, - firstChar.toLowerCase()); - } - - private void createGlobalElement(XmlSchema xmlSchema, - XmlSchemaComplexType complexType, - QName elementName) { - XmlSchemaElement globalElement = new XmlSchemaElement(); - globalElement.setSchemaTypeName(complexType.getQName()); - globalElement.setName(formGlobalElementName(complexType.getName())); - globalElement.setQName(elementName); - - xmlSchema.getItems().add(globalElement); - xmlSchema.getElements().add(elementName, - globalElement); - } - - private DataObject createDataObject(JClass sdoClass) throws Exception { - Class sdoType = Class.forName(sdoClass.getQualifiedName(), - true, - classLoader); - - Constructor constructor = sdoType.getDeclaredConstructor(new Class[0]); - constructor.setAccessible(true); - Object instance = constructor.newInstance(new Object[0]); - return (DataObject) instance; - } - - private String generatePrefix() { - return NAME_SPACE_PREFIX + prefixCount++; - } - - private void includeExtXSD(Type dataType) { - // now we know there is a type for which the xsd must come from outside - // create a schema for the namespace of this type and add an include in it for - // the xsd that is defined externally - XmlSchema xmlSchema = getXmlSchema(dataType.getURI()); - - // ideally there could be more than one external schema defintions for a namespace - // and hence schemalocations will be a list of locations - // List schemaLocations = (List)schemaLocationMap.get(dataType.getURI()); - - // since as per the specs the input to XSDHelper is a map of allowing - // only one schemalocation for a namespace. So for now this single location will be - // picked up and put into a list - List schemaLocations = new Vector(); - - if (schemaLocationMap.get(dataType.getURI()) != null) { - schemaLocations.add(schemaLocationMap.get(dataType.getURI())); - } - - if (schemaLocations.size() <= 0) { - schemaLocations.add(DEFAULT_SCHEMA_LOCATION); - } - - Iterator includesIterator = xmlSchema.getIncludes().getIterator(); - Iterator schemaLocIterator = schemaLocations.iterator(); - String aSchemaLocation = null; - boolean includeExists = false; - // include all external schema locations - while (schemaLocIterator.hasNext()) { - aSchemaLocation = (String) schemaLocIterator.next(); - while (includesIterator.hasNext()) { - if (!includeExists - && aSchemaLocation.equals(((XmlSchemaInclude) includesIterator.next()).getSchemaLocation())) { - includeExists = true; - } - } - - if (!includeExists) { - XmlSchemaInclude includeElement = new XmlSchemaInclude(); - includeElement.setSchemaLocation(aSchemaLocation); - xmlSchema.getIncludes().add(includeElement); - xmlSchema.getItems().add(includeElement); - } - } - - } - - private void extractSchemas(String schemaDefns) { - // load each schema element and add it to the schema map - - String token = getToken(schemaDefns); - int curIndex = schemaDefns.indexOf(token); - int nextIndex = schemaDefns.indexOf(token, - curIndex + token.length()); - - while (curIndex != -1) { - StringReader sr = null; - if (nextIndex != -1) - sr = new StringReader(schemaDefns.substring(curIndex, - nextIndex)); - else - sr = new StringReader(schemaDefns.substring(curIndex)); - - XmlSchemaCollection collection = new XmlSchemaCollection(); - XmlSchema aSchema = collection.read(sr, - null); - addSchemaToMap(aSchema); - - curIndex = nextIndex; - nextIndex = schemaDefns.indexOf(token, - curIndex + token.length()); - } - } - - private void addSchemaToMap(XmlSchema extractedSchema) { - // check if a Schema object already exists in schema map for targetNamespace of this schema element - // if it does then copy the contents of this schema element to the existing one, ensuring that - // duplicate elements are not created. i.e. before adding some child element like 'include' or 'import' - // check if it already exists, if it does don't add this - XmlSchema existingSchema = (XmlSchema) schemaMap.get(extractedSchema.getTargetNamespace()); - - if (existingSchema == null) { - extractedSchema.setAttributeFormDefault(getAttrFormDefaultSetting()); - extractedSchema.setElementFormDefault(getElementFormDefaultSetting()); - schemaMap.put(extractedSchema.getTargetNamespace(), - extractedSchema); - - } else { - copySchemaItems(existingSchema, - extractedSchema); - } - } - - private void copySchemaItems(XmlSchema existingSchema, XmlSchema aSchema) { - // items to copy are imports, includes, elements, types ... - // each item is checked if it is a duplicate entry and copied only if it isn't - Iterator itemsIterator = aSchema.getItems().getIterator(); - Object schemaObject = null; - XmlSchemaElement schemaElement = null; - XmlSchemaType schemaType = null; - XmlSchemaInclude schemaInclude = null; - QName qName = null; - List existingIncludes = getExistingIncludes(existingSchema); - - while (itemsIterator.hasNext()) { - schemaObject = itemsIterator.next(); - if (schemaObject instanceof XmlSchemaElement) { - schemaElement = (XmlSchemaElement) schemaObject; - qName = schemaElement.getQName(); - // if the element does not exist in the existing schema - if (existingSchema.getElementByName(qName) == null) { - // add it to the existing schema - existingSchema.getElements().add(qName, - schemaElement); - existingSchema.getItems().add(schemaElement); - } - } else if (schemaObject instanceof XmlSchemaType) { - schemaType = (XmlSchemaType) itemsIterator.next(); - qName = schemaType.getQName(); - // if the element does not exist in the existing schema - if (existingSchema.getElementByName(qName) == null) { - // add it to the existing schema - existingSchema.getSchemaTypes().add(qName, - schemaType); - existingSchema.getItems().add(schemaType); - // add imports - addImports(existingSchema, - qName); - } - } else if (schemaObject instanceof XmlSchemaInclude) { - schemaInclude = (XmlSchemaInclude) itemsIterator.next(); - if (!existingIncludes.contains(schemaInclude.getSchemaLocation())) { - existingSchema.getIncludes().add(schemaInclude); - existingSchema.getItems().add(schemaInclude); - } - } - } - } - - private List getExistingIncludes(XmlSchema xmlSchema) { - List includeSchemaLocations = new Vector(); - Iterator iterator = xmlSchema.getIncludes().getIterator(); - - while (iterator.hasNext()) { - includeSchemaLocations.add(((XmlSchemaInclude) iterator.next()).getSchemaLocation()); - } - return includeSchemaLocations; - } - - private XmlSchemaForm getAttrFormDefaultSetting() { - if (FORM_DEFAULT_UNQUALIFIED.equals(getAttrFormDefault())) { - return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED); - } else { - return new XmlSchemaForm(XmlSchemaForm.QUALIFIED); - } - } - - private XmlSchemaForm getElementFormDefaultSetting() { - if (FORM_DEFAULT_UNQUALIFIED.equals(getElementFormDefault())) { - return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED); - } else { - return new XmlSchemaForm(XmlSchemaForm.QUALIFIED); - } - } - - private String getToken(String s) { - // get the schema element name eg. "); - writeSchemas(writer); - writer.write(""); - - XMLStreamReader xmlReader = XMLInputFactory.newInstance() - .createXMLStreamReader(new ByteArrayInputStream(writer.toString() - .getBytes())); - - StAXOMBuilder staxOMBuilders = new StAXOMBuilder(fac, xmlReader); - OMElement documentElement = staxOMBuilders.getDocumentElement(); - - - Iterator iterator = documentElement.getChildElements(); - while (iterator.hasNext()) { - wsdlTypes.addChild((OMNode) iterator.next()); - } - defintions.addChild(wsdlTypes); - } - - private void writeSchemas(StringWriter writer) { - Iterator iterator = schemaCollection.iterator(); - XmlSchema xmlSchema = null; - - while (iterator.hasNext()) { - xmlSchema = (XmlSchema) iterator.next(); - // typeIterator = xmlSchema.getSchemaTypes().getValues(); - /* - * while (typeIterator.hasNext()) { xmlSchema.getItems().add((XmlSchemaObject) typeIterator.next()); } - */ - xmlSchema.write(writer); - } - } - - private void generateMessages(OMFactory fac, OMElement definitions) throws Exception { - Hashtable namespaceMap = new Hashtable(); - String namespacePrefix = null; - String namespaceURI = null; - QName messagePartType = null; - for (int i = 0; i < method.length; i++) { - JMethod jmethod = method[i]; - - if (jmethod.isPublic()) { - // Request Message - OMElement requestMessge = fac.createOMElement(MESSAGE_LOCAL_NAME, - wsdl); - requestMessge.addAttribute(ATTRIBUTE_NAME, - jmethod.getSimpleName() + MESSAGE_SUFFIX, - null); - definitions.addChild(requestMessge); - - // only if a type for the message part has already been defined - if ((messagePartType = typeTable.getComplexSchemaTypeName(generationParams.getSchemaTargetNamespace(), - jmethod.getSimpleName())) != null) { - namespaceURI = messagePartType.getNamespaceURI(); - // avoid duplicate namespaces - if ((namespacePrefix = (String) namespaceMap.get(namespaceURI)) == null) { - namespacePrefix = generatePrefix(); - namespaceMap.put(namespaceURI, - namespacePrefix); - } - - OMElement requestPart = fac.createOMElement(PART_ATTRIBUTE_NAME, - wsdl); - requestMessge.addChild(requestPart); - requestPart.addAttribute(ATTRIBUTE_NAME, - "part1", - null); - - requestPart.addAttribute(ELEMENT_ATTRIBUTE_NAME, - namespacePrefix + COLON_SEPARATOR - + jmethod.getSimpleName(), - null); - } - - // only if a type for the message part has already been defined - if ((messagePartType = typeTable.getComplexSchemaTypeName(generationParams.getSchemaTargetNamespace(), - jmethod.getSimpleName() - + RESPONSE)) != null) { - namespaceURI = messagePartType.getNamespaceURI(); - if ((namespacePrefix = (String) namespaceMap.get(namespaceURI)) == null) { - namespacePrefix = generatePrefix(); - namespaceMap.put(namespaceURI, - namespacePrefix); - } - // Response Message - OMElement responseMessge = fac.createOMElement(MESSAGE_LOCAL_NAME, - wsdl); - responseMessge.addAttribute(ATTRIBUTE_NAME, - jmethod.getSimpleName() + RESPONSE_MESSAGE, - null); - definitions.addChild(responseMessge); - OMElement responsePart = fac.createOMElement(PART_ATTRIBUTE_NAME, - wsdl); - responseMessge.addChild(responsePart); - responsePart.addAttribute(ATTRIBUTE_NAME, - "part1", - null); - - responsePart.addAttribute(ELEMENT_ATTRIBUTE_NAME, - namespacePrefix + COLON_SEPARATOR - + jmethod.getSimpleName() + RESPONSE, - null); - } - } - } - - // now add these unique namespaces to the the definitions element - Enumeration enumeration = namespaceMap.keys(); - while (enumeration.hasMoreElements()) { - namespaceURI = (String) enumeration.nextElement(); - definitions.declareNamespace(namespaceURI, - (String) namespaceMap.get(namespaceURI)); - } - } - - /** - * Generate the porttypes - */ - private void generatePortType(OMFactory fac, OMElement defintions) { - JMethod jmethod = null; - OMElement operation = null; - OMElement message = null; - OMElement portType = fac.createOMElement(PORT_TYPE_LOCAL_NAME, - wsdl); - defintions.addChild(portType); - portType.addAttribute(ATTRIBUTE_NAME, - generationParams.getServiceName() + PORT_TYPE_SUFFIX, - null); - // adding message refs - for (int i = 0; i < method.length; i++) { - jmethod = method[i]; - - if (jmethod.isPublic()) { - operation = fac.createOMElement(OPERATION_LOCAL_NAME, - wsdl); - portType.addChild(operation); - operation.addAttribute(ATTRIBUTE_NAME, - jmethod.getSimpleName(), - null); - - message = fac.createOMElement(IN_PUT_LOCAL_NAME, - wsdl); - message.addAttribute(MESSAGE_LOCAL_NAME, - tns.getPrefix() + COLON_SEPARATOR + jmethod.getSimpleName() - + MESSAGE_SUFFIX, - null); - operation.addChild(message); - - if (!jmethod.getReturnType().isVoidType()) { - message = fac.createOMElement(OUT_PUT_LOCAL_NAME, - wsdl); - message.addAttribute(MESSAGE_LOCAL_NAME, - tns.getPrefix() + COLON_SEPARATOR - + jmethod.getSimpleName() + RESPONSE_MESSAGE, - null); - operation.addChild(message); - } - } - } - - } - - /** - * Generate the service - */ - public void generateService(OMFactory fac, OMElement defintions) { - OMElement service = fac.createOMElement(SERVICE_LOCAL_NAME, - wsdl); - defintions.addChild(service); - service.addAttribute(ATTRIBUTE_NAME, - generationParams.getServiceName(), - null); - OMElement port = fac.createOMElement(PORT, - wsdl); - service.addChild(port); - port.addAttribute(ATTRIBUTE_NAME, - generationParams.getServiceName() + SOAP11PORT, - null); - port.addAttribute(BINDING_LOCAL_NAME, - tns.getPrefix() + COLON_SEPARATOR + generationParams.getServiceName() - + BINDING_NAME_SUFFIX, - null); - addExtensionElement(fac, - port, - soap, - SOAP_ADDRESS, - LOCATION, - generationParams.getLocationUri() + generationParams.getServiceName()); - - port = fac.createOMElement(PORT, - wsdl); - service.addChild(port); - port.addAttribute(ATTRIBUTE_NAME, - generationParams.getServiceName() + SOAP12PORT, - null); - port.addAttribute(BINDING_LOCAL_NAME, - tns.getPrefix() + COLON_SEPARATOR + generationParams.getServiceName() - + SOAP12BINDING_NAME_SUFFIX, - null); - addExtensionElement(fac, - port, - soap12, - SOAP_ADDRESS, - LOCATION, - generationParams.getLocationUri() + generationParams.getServiceName()); - } - - /** - * Generate the bindings - */ - private void generateBinding(OMFactory fac, OMElement defintions) throws Exception { - generateSoap11Binding(fac, - defintions); - generateSoap12Binding(fac, - defintions); - } - - private void generateSoap11Binding(OMFactory fac, OMElement defintions) throws Exception { - OMElement binding = fac.createOMElement(BINDING_LOCAL_NAME, - wsdl); - defintions.addChild(binding); - binding.addAttribute(ATTRIBUTE_NAME, - generationParams.getServiceName() + BINDING_NAME_SUFFIX, - null); - binding.addAttribute("type", - tns.getPrefix() + COLON_SEPARATOR + generationParams.getServiceName() - + PORT_TYPE_SUFFIX, - null); - - addExtensionElement(fac, - binding, - soap, - BINDING_LOCAL_NAME, - TRANSPORT, - TRANSPORT_URI, - STYLE, - generationParams.getStyle()); - - for (int i = 0; i < method.length; i++) { - JMethod jmethod = method[i]; - if (jmethod.isPublic()) { - OMElement operation = fac.createOMElement(OPERATION_LOCAL_NAME, - wsdl); - binding.addChild(operation); - - addExtensionElement(fac, - operation, - soap, - OPERATION_LOCAL_NAME, - SOAP_ACTION, - URN_PREFIX + COLON_SEPARATOR + jmethod.getSimpleName(), - STYLE, - generationParams.getStyle()); - operation.addAttribute(ATTRIBUTE_NAME, - jmethod.getSimpleName(), - null); - - OMElement input = fac.createOMElement(IN_PUT_LOCAL_NAME, - wsdl); - addExtensionElement(fac, - input, - soap, - SOAP_BODY, - SOAP_USE, - generationParams.getUse(), - "namespace", - generationParams.getTargetNamespace()); - operation.addChild(input); - - if (!jmethod.getReturnType().isVoidType()) { - OMElement output = fac.createOMElement(OUT_PUT_LOCAL_NAME, - wsdl); - addExtensionElement(fac, - output, - soap, - SOAP_BODY, - SOAP_USE, - generationParams.getUse(), - "namespace", - generationParams.getTargetNamespace()); - operation.addChild(output); - } - } - } - } - - private void generateSoap12Binding(OMFactory fac, OMElement defintions) throws Exception { - OMElement binding = fac.createOMElement(BINDING_LOCAL_NAME, - wsdl); - defintions.addChild(binding); - binding.addAttribute(ATTRIBUTE_NAME, - generationParams.getServiceName() + SOAP12BINDING_NAME_SUFFIX, - null); - binding.addAttribute("type", - tns.getPrefix() + COLON_SEPARATOR + generationParams.getServiceName() - + PORT_TYPE_SUFFIX, - null); - - addExtensionElement(fac, - binding, - soap12, - BINDING_LOCAL_NAME, - TRANSPORT, - TRANSPORT_URI, - STYLE, - generationParams.getStyle()); - - for (int i = 0; i < method.length; i++) { - JMethod jmethod = method[i]; - - if (jmethod.isPublic()) { - OMElement operation = fac.createOMElement(OPERATION_LOCAL_NAME, - wsdl); - binding.addChild(operation); - operation.declareNamespace(URI_WSDL12_SOAP, - SOAP12_PREFIX); - - addExtensionElement(fac, - operation, - soap12, - OPERATION_LOCAL_NAME, - SOAP_ACTION, - URN_PREFIX + COLON_SEPARATOR + jmethod.getSimpleName(), - STYLE, - generationParams.getStyle()); - operation.addAttribute(ATTRIBUTE_NAME, - jmethod.getSimpleName(), - null); - - OMElement input = fac.createOMElement(IN_PUT_LOCAL_NAME, - wsdl); - addExtensionElement(fac, - input, - soap12, - SOAP_BODY, - SOAP_USE, - generationParams.getUse(), - "namespace", - generationParams.getTargetNamespace()); - operation.addChild(input); - - if (!jmethod.getReturnType().isVoidType()) { - OMElement output = fac.createOMElement(OUT_PUT_LOCAL_NAME, - wsdl); - addExtensionElement(fac, - output, - soap12, - SOAP_BODY, - SOAP_USE, - generationParams.getUse(), - "namespace", - generationParams.getTargetNamespace()); - operation.addChild(output); - } - } - } - } - - private void addExtensionElement(OMFactory fac, - OMElement element, - OMNamespace namespace, - String name, - String att1Name, - String att1Value, - String att2Name, - String att2Value) { - OMElement soapbinding = fac.createOMElement(name, - namespace); - element.addChild(soapbinding); - soapbinding.addAttribute(att1Name, - att1Value, - null); - soapbinding.addAttribute(att2Name, - att2Value, - null); - } - - private void addExtensionElement(OMFactory fac, - OMElement element, - OMNamespace namespace, - String name, - String att1Name, - String att1Value) { - OMElement soapbinding = fac.createOMElement(name, - namespace); - element.addChild(soapbinding); - soapbinding.addAttribute(att1Name, - att1Value, - null); - } - - private String generatePrefix() { - return NAMESPACE_PREFIX + prefixCount++; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLBuilder.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLBuilder.java deleted file mode 100644 index b23726f6fa..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLBuilder.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.tools.java2wsdl.generate; - -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Collection; - -import org.apache.axiom.om.OMElement; -import org.apache.ws.java2wsdl.Java2WSDLConstants; - -public class TuscanyJava2WSDLBuilder implements Java2WSDLConstants { - - private OutputStream out; - private String className; - private ClassLoader classLoader; - private String wsdlPrefix = "wsdl"; - - // these apply for the WSDL - private GenerationParameters generationParams; - - private OMElement wsdlDocument = null; - - public String getWsdlPrefix() { - return wsdlPrefix; - } - - public void setWsdlPrefix(String wsdlPrefix) { - this.wsdlPrefix = wsdlPrefix; - } - - public TuscanyJava2WSDLBuilder(GenerationParameters genParams) { - this.generationParams = genParams; - } - - /** - * Externally visible generator method - * - * @throws Exception - */ - public void buildWSDL() throws Exception { - ArrayList excludeOpeartion = new ArrayList(); - excludeOpeartion.add("init"); - excludeOpeartion.add("setOperationContext"); - excludeOpeartion.add("destroy"); - - TuscanyWSDLTypesGenerator typesGenerator = new TuscanyWSDLTypesGenerator(generationParams); - typesGenerator.setExcludeMethods(excludeOpeartion); - Collection schemaCollection = typesGenerator.buildWSDLTypes(); - - TuscanyJava2OMBuilder java2OMBuilder = - new TuscanyJava2OMBuilder(typesGenerator.getMethods(), schemaCollection, typesGenerator - .getTypeTable(), generationParams); - - wsdlDocument = java2OMBuilder.generateOM(); - } - - public OMElement getWsdlDocument() { - return wsdlDocument; - } - - public void setWsdlDocument(OMElement wsdlDocument) { - this.wsdlDocument = wsdlDocument; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLConstants.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLConstants.java deleted file mode 100644 index cde870fff4..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLConstants.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.tools.java2wsdl.generate; - -import org.apache.ws.java2wsdl.Java2WSDLConstants; - -/** - * This is a extension from the Axis2 Java2WSDLConstants to handle additions specific to Tuscany. - * This class can be done away with once Axis2 is also enhanced to support these - * additional options. - * - */ -public interface TuscanyJava2WSDLConstants extends Java2WSDLConstants -{ - public static final char OPEN_BRACKET = '['; - public static final char COMMA = ','; - public static final char CLOSE_BRACKET = ']'; - public static final String DEFAULT_SCHEMA_LOCATION = "*.xsd"; - public static final String SCHEMA_ELEMENT_NAME = "schema"; - - String FORM_DEFAULT_QUALIFIED = "qualified"; - String FORM_DEFAULT_UNQUALIFIED = "unqualified"; - - //short options - String IMPORT_XSD_OPTION = "ixsd"; //option for importing XSDs - String ATTR_FORM_DEFAULT_OPTION = "afd"; - String ELEMENT_FORM_DEFAULT_OPTION = "efd"; - String EXTRA_CLASSES_DEFAULT_OPTION = "xc"; - - //long options - String IMPORT_XSD_OPTION_LONG = "import_xsd"; //option for importing XSDs - String ATTR_FORM_DEFAULT_OPTION_LONG = "attributeFormDefault"; - String ELEMENT_FORM_DEFAULT_OPTION_LONG = "elementFormDefault"; - String EXTRA_CLASSES_DEFAULT_OPTION_LONG = "extraClasses"; -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLOptionsValidator.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLOptionsValidator.java deleted file mode 100644 index 6411327abf..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLOptionsValidator.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.tools.java2wsdl.generate; - -import java.util.ArrayList; - -import org.apache.ws.java2wsdl.Java2WSDLConstants; -import org.apache.ws.java2wsdl.utils.Java2WSDLCommandLineOption; -import org.apache.ws.java2wsdl.utils.Java2WSDLOptionsValidator; - -/** - * This class is an extension from the Axis2 implementation in order to handle additional optoins - * specific to Tuscany. This class can be done away with once Axis2 is also enhanced to support these - * additional options. - * - */ -public class TuscanyJava2WSDLOptionsValidator extends Java2WSDLOptionsValidator implements - TuscanyJava2WSDLConstants { - public boolean isInvalid(Java2WSDLCommandLineOption option) { - boolean invalid; - String optionType = option.getOptionType(); - - invalid = !((IMPORT_XSD_OPTION).equalsIgnoreCase(optionType) - || (IMPORT_XSD_OPTION_LONG).equalsIgnoreCase(optionType) - || (TuscanyJava2WSDLConstants.EXTRA_CLASSES_DEFAULT_OPTION_LONG).equalsIgnoreCase(optionType) - || (TuscanyJava2WSDLConstants.EXTRA_CLASSES_DEFAULT_OPTION).equalsIgnoreCase(optionType) - || !super.isInvalid(option)); - - invalid = validateImportXSDOption(invalid, - option); - - return invalid; - } - - private boolean validateImportXSDOption(boolean invalid, Java2WSDLCommandLineOption option) { - String optionType = option.getOptionType(); - String schemaNSLocationPair = null; - - if (!invalid && (IMPORT_XSD_OPTION).equalsIgnoreCase(optionType) - || (IMPORT_XSD_OPTION_LONG).equalsIgnoreCase(optionType)) { - ArrayList optionValues = option.getOptionValues(); - - for (int count = 0; count < optionValues.size(); ++count) { - schemaNSLocationPair = ((String) optionValues.get(count)).trim(); - if ((schemaNSLocationPair.charAt(0) != OPEN_BRACKET) - || (schemaNSLocationPair.charAt(schemaNSLocationPair.length() - 1) != CLOSE_BRACKET) - || (schemaNSLocationPair.indexOf(COMMA) == -1)) - - { - System.out.println("Schema Namespace-Location pair option not specified properly!!"); - invalid = true; - } - } - } - - return invalid; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanySchemaGenerator.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanySchemaGenerator.java deleted file mode 100644 index 4f3371126d..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanySchemaGenerator.java +++ /dev/null @@ -1,410 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.java2wsdl.generate; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.apache.ws.commons.schema.XmlSchema; -import org.apache.ws.commons.schema.XmlSchemaCollection; -import org.apache.ws.commons.schema.XmlSchemaComplexType; -import org.apache.ws.commons.schema.XmlSchemaElement; -import org.apache.ws.commons.schema.XmlSchemaForm; -import org.apache.ws.commons.schema.XmlSchemaImport; -import org.apache.ws.commons.schema.XmlSchemaInclude; -import org.apache.ws.commons.schema.XmlSchemaSequence; -import org.apache.ws.commons.schema.utils.NamespaceMap; -import org.apache.ws.java2wsdl.Java2WSDLConstants; -import org.apache.ws.java2wsdl.SchemaGenerator; -import org.apache.ws.java2wsdl.bytecode.MethodTable; -import org.codehaus.jam.JClass; -import org.codehaus.jam.JMethod; -import org.codehaus.jam.JParameter; -import org.codehaus.jam.JamClassIterator; -import org.codehaus.jam.JamService; -import org.codehaus.jam.JamServiceFactory; -import org.codehaus.jam.JamServiceParams; - - -public class TuscanySchemaGenerator implements TuscanyJava2WSDLConstants -{ - public static final String NAME_SPACE_PREFIX = "stn_"; - public static final String PERIOD_SEPARATOR = "."; - private static int prefixCount = 1; - - protected String attrFormDefault = null; - protected String elementFormDefault = null; - protected Hashtable targetNamespacePrefixMap = new Hashtable(); - protected Hashtable schemaMap = new Hashtable(); - protected Hashtable sdoAnnoMap = new Hashtable(); - protected XmlSchemaCollection xmlSchemaCollection = new XmlSchemaCollection(); - private TuscanyTypeTable typeTable = new TuscanyTypeTable(); - protected SchemaBuilder schemaBuilder = null; - protected Map schemaLocationMap = null; - - private static final Log log = LogFactory.getLog(SchemaGenerator.class); - private ClassLoader classLoader; - private String className; - - // to keep loadded method using JAM - private JMethod methods []; - - //to store byte code method using Axis 1.x codes - private MethodTable methodTable; - private String schemaTargetNameSpace; - private String schema_namespace_prefix; - private Class clazz; - private ArrayList excludeMethods = new ArrayList(); - - public TuscanySchemaGenerator(ClassLoader loader, - String className, - String schematargetNamespace, - String schematargetNamespacePrefix, - Map schemaLocMap) - throws Exception - { - DataObjectUtil.initRuntime(); - this.classLoader = loader; - this.className = className; - clazz = Class.forName(className, true, loader); - methodTable = new MethodTable(clazz); - this.schemaTargetNameSpace = schematargetNamespace; - this.schema_namespace_prefix = schematargetNamespacePrefix; - this.schemaLocationMap = schemaLocMap; - - initializeSchemaMap(this.schemaTargetNameSpace, this.schema_namespace_prefix); - schemaBuilder = new SchemaBuilder(xmlSchemaCollection, - schemaMap, - targetNamespacePrefixMap, - typeTable, - getAttrFormDefault(), - getElementFormDefault(), - schemaLocMap, - this.classLoader ); - } - - /** - * Generates schema for all the parameters in method. First generates schema - * for all different parameter type and later refers to them. - * - * @return Returns XmlSchema. - * @throws Exception - */ - public Collection buildWSDLTypes() throws Exception - { - JamServiceFactory factory = JamServiceFactory.getInstance(); - JamServiceParams jam_service_parms = factory.createServiceParams(); - //setting the classLoder -// jam_service_parms.setParentClassLoader(factory.createJamClassLoader(classLoader)); - //it can posible to add the classLoader as well - jam_service_parms.addClassLoader(classLoader); - jam_service_parms.includeClass(className); - JamService service = factory.createService(jam_service_parms); - - JamClassIterator jClassIter = service.getClasses(); - //all most all the time the ittr will have only one class in it - while (jClassIter.hasNext()) - { - JClass jclass = (JClass) jClassIter.next(); - // serviceName = jclass.getSimpleName(); - //todo in the future , when we support annotation we can use this - //JAnnotation[] annotations = jclass.getAnnotations(); - - /** - * Schema genertaion done in two stage 1. Load all the methods and - * create type for methods parameters (if the parameters are Bean - * then it will create Complex types for those , and if the - * parameters are simple type which decribe in SimpleTypeTable - * nothing will happen) 2. In the next stage for all the methods - * messages and port types will be creteated - */ - methods = jclass.getDeclaredMethods(); - - // since we do not support overload - HashMap uniqueMethods = new HashMap(); - XmlSchemaComplexType methodSchemaType = null; - XmlSchemaSequence sequence = null; - QName methodPartSchemaTypeName = null; - for (int i = 0; i < methods.length; i++) - { - String methodName = methods[i].getSimpleName(); - JMethod jMethod = methods[i]; - // no need to think abt this method , since that is system - // config method - if (excludeMethods.contains(jMethod.getSimpleName())) { - continue; - } - //if (jMethod.getSimpleName().equals("init") - // || "setOperationContext".equals(jMethod.getSimpleName()) - // || "destroy".equals(jMethod.getSimpleName())) - // continue; - if (uniqueMethods.get(jMethod.getSimpleName()) != null) { - throw new Exception( - " Sorry we don't support methods overloading !!!! "); - } - - if (!jMethod.isPublic()) { - // no need to generate Schema for non public methods - continue; - } - - uniqueMethods.put(jMethod.getSimpleName(), jMethod); - JParameter [] paras = jMethod.getParameters(); - String parameterNames [] = null; - if (paras.length > 0) - { - parameterNames = methodTable.getParameterNames(methodName); - sequence = new XmlSchemaSequence(); - - //create the schema type for the method wrapper - methodSchemaType = createSchemaTypeForMethodPart(jMethod.getSimpleName()); - methodSchemaType.setParticle(sequence); - } - - for (int j = 0; j < paras.length; j++) - { - JParameter methodParameter = paras[j]; - JClass paraType = methodParameter.getType(); - generateSchemaForType(sequence, paraType, - ( parameterNames != null && parameterNames[j] != null )? parameterNames[j] : methodParameter.getSimpleName()); - } - // for its return type - JClass returnType = jMethod.getReturnType(); - QName methodReturnSchemaTypeName = null; - - if (!returnType.isVoidType()) - { - methodSchemaType = createSchemaTypeForMethodPart(jMethod.getSimpleName() + RESPONSE); - sequence = new XmlSchemaSequence(); - methodSchemaType.setParticle(sequence); - generateSchemaForType(sequence, returnType, "return"); - } - } - //generateWrapperElements(methods); - } - return schemaMap.values(); - } - - private QName generateSchemaForType(XmlSchemaSequence sequence, JClass type, String partName) throws Exception - { - boolean isArrayType = type.isArrayType(); - if ( isArrayType ) - { - type = type.getArrayComponentType(); - } - - String classTypeName = type.getQualifiedName(); - - QName schemaTypeName = typeTable.getSimpleSchemaTypeName(classTypeName); - if ( schemaTypeName == null ) - { - schemaTypeName = - schemaBuilder.generateSchema(type); - addContentToMethodSchemaType(sequence, - schemaTypeName, - partName, - type.isArrayType()); - addImportORInclude((XmlSchema)schemaMap.get(schemaTargetNameSpace), schemaTypeName); - - } - else - { - addContentToMethodSchemaType(sequence, - schemaTypeName, - partName, - type.isArrayType()); - } - - return schemaTypeName; - } - - private void addContentToMethodSchemaType(XmlSchemaSequence sequence, - QName schemaTypeName, - String paraName, - boolean isArray ) - { - XmlSchemaElement elt1 = new XmlSchemaElement(); - elt1.setName(paraName); - elt1.setSchemaTypeName(schemaTypeName); - sequence.getItems().add(elt1); - - if ( isArray ) - { - elt1.setMaxOccurs(Long.MAX_VALUE); - elt1.setMinOccurs(0); - } - } - - private XmlSchemaComplexType createSchemaTypeForMethodPart(String localPartName) - { - XmlSchema xmlSchema = (XmlSchema)schemaMap.get(schemaTargetNameSpace); - QName elementName = new QName(this.schemaTargetNameSpace, localPartName, this.schema_namespace_prefix); - XmlSchemaComplexType complexType = new XmlSchemaComplexType(xmlSchema); - - XmlSchemaElement globalElement = new XmlSchemaElement(); - globalElement.setSchemaType(complexType); - globalElement.setName(formGlobalElementName(localPartName)); - globalElement.setQName(elementName); - - xmlSchema.getItems().add(globalElement); - xmlSchema.getElements().add(elementName, globalElement); - - typeTable.addComplexSchemaType(this.schemaTargetNameSpace, globalElement.getName(), elementName); - - return complexType; - } - - - private String formGlobalElementName(String typeName) - { - String firstChar = typeName.substring(0,1); - return typeName.replaceFirst(firstChar, firstChar.toLowerCase()); - } - - public TuscanyTypeTable getTypeTable() { - return typeTable; - } - - public JMethod[] getMethods() { - return methods; - } - - private String generatePrefix() { - return NAME_SPACE_PREFIX + prefixCount++; - } - - public void setExcludeMethods(ArrayList excludeMethods) { - this.excludeMethods = excludeMethods; - } - - private void initializeSchemaMap(String targetNamespace, String targetNamespacePrefix) - { - XmlSchema xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection); - xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting()); - xmlSchema.setElementFormDefault(getElementFormDefaultSetting()); - - targetNamespacePrefixMap.put(targetNamespace, targetNamespacePrefix); - schemaMap.put(targetNamespace, xmlSchema); - - - NamespaceMap prefixmap = new NamespaceMap(); - prefixmap.put(TuscanyTypeTable.XS_URI_PREFIX, TuscanyTypeTable.XML_SCHEMA_URI); - prefixmap.put(targetNamespacePrefix, targetNamespace); - xmlSchema.setNamespaceContext(prefixmap); - } - - private void setFormDefaults() - { - - } - - public Hashtable getSdoAnnoMap() { - return sdoAnnoMap; - } - - public void setSdoAnnoMap(Hashtable sdoAnnoMap) { - this.sdoAnnoMap = sdoAnnoMap; - } - - private void addImportORInclude(XmlSchema xmlSchema, QName schemaTypeName) - { - //decide whether there must be an import or an include - if ( xmlSchema.getTargetNamespace().equals(schemaTypeName.getNamespaceURI()) ) - { - XmlSchema containingSchema = (XmlSchema)schemaMap.get(schemaTypeName.getNamespaceURI()); - //if the type is not defined in the Schema then include - if ( containingSchema.getTypeByName(schemaTypeName) == null ) - { - String schemaLocation = null; - if ( (schemaLocation = (String)schemaLocationMap.get(schemaTypeName.getNamespaceURI())) != null ) - { - schemaLocation = DEFAULT_SCHEMA_LOCATION; - } - - XmlSchemaInclude includeElement = new XmlSchemaInclude(); - includeElement.setSchemaLocation(schemaLocation); - - if ( !xmlSchema.getIncludes().contains(includeElement) ) - { - xmlSchema.getIncludes().add(includeElement); - } - } - } - else - { - if (!((NamespaceMap)xmlSchema.getNamespaceContext()).values(). - contains(schemaTypeName.getNamespaceURI())) - { - XmlSchemaImport importElement = new XmlSchemaImport(); - importElement.setNamespace(schemaTypeName.getNamespaceURI()); - xmlSchema.getItems().add(importElement); - ((NamespaceMap)xmlSchema.getNamespaceContext()). - put(generatePrefix(), schemaTypeName.getNamespaceURI()); - } - } - } - - private XmlSchemaForm getAttrFormDefaultSetting() - { - if ( FORM_DEFAULT_UNQUALIFIED.equals(getAttrFormDefault()) ) - { - return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED); - } - else - { - return new XmlSchemaForm(XmlSchemaForm.QUALIFIED); - } - } - - private XmlSchemaForm getElementFormDefaultSetting() - { - if ( FORM_DEFAULT_UNQUALIFIED.equals(getElementFormDefault()) ) - { - return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED); - } - else - { - return new XmlSchemaForm(XmlSchemaForm.QUALIFIED); - } - } - - public String getAttrFormDefault() { - return attrFormDefault; - } - - public void setAttrFormDefault(String attrFormDefault) { - this.attrFormDefault = attrFormDefault; - } - - public String getElementFormDefault() { - return elementFormDefault; - } - - public void setElementFormDefault(String elementFormDefault) { - this.elementFormDefault = elementFormDefault; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyTypeTable.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyTypeTable.java deleted file mode 100644 index 4abd7a7ce7..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyTypeTable.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.java2wsdl.generate; - -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Vector; - -import javax.xml.namespace.QName; - -import org.apache.axiom.om.OMElement; -import org.apache.ws.java2wsdl.Java2WSDLUtils; -import org.codehaus.jam.JClass; - -public class TuscanyTypeTable -{ - public static final String XML_SCHEMA_URI = "http://www.w3.org/2001/XMLSchema"; - public static final String XS_URI_PREFIX = "xs"; - public static final QName XS_QNAME = new QName(XML_SCHEMA_URI, "schema", XS_URI_PREFIX); - public static final String DELIMITER = "#"; - - private Hashtable simpleXSDTypes; - private Hashtable complexXSDTypes; - - public static String asQualifiedName(String uri, String typeName) - { - return (uri + DELIMITER + typeName); - } - - - public TuscanyTypeTable() - { - simpleXSDTypes = new Hashtable(); - complexXSDTypes = new Hashtable(); - populateSimpleXSDTypes(); - populateStdSDOTypes(); - } - - private void populateStdSDOTypes() - { - simpleXSDTypes.put("Boolean", - new QName(XML_SCHEMA_URI, "boolean", XS_URI_PREFIX)); - simpleXSDTypes.put("Byte", - new QName(XML_SCHEMA_URI, "byte", XS_URI_PREFIX)); - simpleXSDTypes.put("Bytes", - new QName(XML_SCHEMA_URI, "hexBinary", XS_URI_PREFIX)); - simpleXSDTypes.put("Character", - new QName(XML_SCHEMA_URI, "string", XS_URI_PREFIX)); - simpleXSDTypes.put("DataObject", - new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX)); - simpleXSDTypes.put("Date", - new QName(XML_SCHEMA_URI, "dateTime", XS_URI_PREFIX)); - simpleXSDTypes.put("Day", - new QName(XML_SCHEMA_URI, "gDay", XS_URI_PREFIX)); - simpleXSDTypes.put("Decimal", - new QName(XML_SCHEMA_URI, "decimal", XS_URI_PREFIX)); - simpleXSDTypes.put("Double", - new QName(XML_SCHEMA_URI, "double", XS_URI_PREFIX)); - simpleXSDTypes.put("Duration", - new QName(XML_SCHEMA_URI, "duration", XS_URI_PREFIX)); - simpleXSDTypes.put("Float", - new QName(XML_SCHEMA_URI, "float", XS_URI_PREFIX)); - simpleXSDTypes.put("Int", - new QName(XML_SCHEMA_URI, "int", XS_URI_PREFIX)); - simpleXSDTypes.put("Integer", - new QName(XML_SCHEMA_URI, "integer", XS_URI_PREFIX)); - simpleXSDTypes.put("Long", - new QName(XML_SCHEMA_URI, "long", XS_URI_PREFIX)); - simpleXSDTypes.put("Month", - new QName(XML_SCHEMA_URI, "gMonth", XS_URI_PREFIX)); - simpleXSDTypes.put("monthDay", - new QName(XML_SCHEMA_URI, "gMonthDay", XS_URI_PREFIX)); - simpleXSDTypes.put("Object", - new QName(XML_SCHEMA_URI, "anySimpleType", XS_URI_PREFIX)); - simpleXSDTypes.put("Short", - new QName(XML_SCHEMA_URI, "short", XS_URI_PREFIX)); - simpleXSDTypes.put("String", - new QName(XML_SCHEMA_URI, "string", XS_URI_PREFIX)); - simpleXSDTypes.put("Strings", - new QName(XML_SCHEMA_URI, "string", XS_URI_PREFIX)); - simpleXSDTypes.put("Time", - new QName(XML_SCHEMA_URI, "time", XS_URI_PREFIX)); - simpleXSDTypes.put("Year", - new QName(XML_SCHEMA_URI, "gYear", XS_URI_PREFIX)); - simpleXSDTypes.put("YearMonth", - new QName(XML_SCHEMA_URI, "gYearMonth", XS_URI_PREFIX)); - simpleXSDTypes.put("YearMonthDay", - new QName(XML_SCHEMA_URI, "date", XS_URI_PREFIX)); - simpleXSDTypes.put("URI", - new QName(XML_SCHEMA_URI, "anyURI", XS_URI_PREFIX)); - } - - private void populateSimpleXSDTypes() { - //todo pls use the types from org.apache.ws.commons.schema.constants.Constants - simpleXSDTypes.put("int", - new QName(XML_SCHEMA_URI, "int", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.String", - new QName(XML_SCHEMA_URI, "string", XS_URI_PREFIX)); - simpleXSDTypes.put("boolean", - new QName(XML_SCHEMA_URI, "boolean", XS_URI_PREFIX)); - simpleXSDTypes.put("float", - new QName(XML_SCHEMA_URI, "float", XS_URI_PREFIX)); - simpleXSDTypes.put("double", - new QName(XML_SCHEMA_URI, "double", XS_URI_PREFIX)); - simpleXSDTypes.put("short", - new QName(XML_SCHEMA_URI, "short", XS_URI_PREFIX)); - simpleXSDTypes.put("long", - new QName(XML_SCHEMA_URI, "long", XS_URI_PREFIX)); - simpleXSDTypes.put("byte", - new QName(XML_SCHEMA_URI, "byte", XS_URI_PREFIX)); - simpleXSDTypes.put("char", - new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Integer", - new QName(XML_SCHEMA_URI, "int", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Double", - new QName(XML_SCHEMA_URI, "double", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Float", - new QName(XML_SCHEMA_URI, "float", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Long", - new QName(XML_SCHEMA_URI, "long", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Character", - new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Boolean", - new QName(XML_SCHEMA_URI, "boolean", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Byte", - new QName(XML_SCHEMA_URI, "byte", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Short", - new QName(XML_SCHEMA_URI, "short", XS_URI_PREFIX)); - simpleXSDTypes.put("java.util.Date", - new QName(XML_SCHEMA_URI, "dateTime", XS_URI_PREFIX)); - simpleXSDTypes.put("java.util.Calendar", - new QName(XML_SCHEMA_URI, "dateTime", XS_URI_PREFIX)); - simpleXSDTypes.put("java.lang.Object", - new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX)); - simpleXSDTypes.put("java.math.BigDecimal", - new QName(XML_SCHEMA_URI, "decimal", XS_URI_PREFIX)); - - // Any types - simpleXSDTypes.put(OMElement.class.getName(), - new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX)); - simpleXSDTypes.put(ArrayList.class.getName(), - new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX)); - simpleXSDTypes.put(Vector.class.getName(), - new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX)); - simpleXSDTypes.put(List.class.getName(), - new QName(XML_SCHEMA_URI, "anyType", XS_URI_PREFIX)); - } - - public QName getStdSdoType(String typename) - { - return (QName) simpleXSDTypes.get(typename); - } - - public QName getComplexSchemaTypeName(String sdoURI, String sdoTypeName) - { - return (QName) complexXSDTypes.get(asQualifiedName(sdoURI, sdoTypeName)); - } - - public QName getComplexSchemaTypeName(JClass javaClass, ClassLoader cl) throws Exception - { - String namespace = Java2WSDLUtils.schemaNamespaceFromClassName( - javaClass.getQualifiedName(), cl).toString(); - return (QName) complexXSDTypes.get(asQualifiedName(namespace, javaClass.getSimpleName())); - } - - public boolean isSimpleType(String typeName) - { - Iterator keys = simpleXSDTypes.keySet().iterator(); - while (keys.hasNext()) { - String s = (String) keys.next(); - if (s.equals(typeName)) { - return true; - } - } - return false; - } - - public QName getSimpleSchemaTypeName(String typename) - { - return (QName) simpleXSDTypes.get(typename); - } - - public void addSimpleSchemaType(String typeName, QName schemaType) - { - simpleXSDTypes.put(typeName, schemaType); - } - - - public void addComplexSchemaType(String namespaceURI, String name, QName schemaType) - { - complexXSDTypes.put(asQualifiedName(namespaceURI, name), schemaType); - } - - - public QName getQNamefortheType(String namespaceURI, String typeName) - { - if ( XML_SCHEMA_URI.equals(namespaceURI)) - { - return getSimpleSchemaTypeName(typeName); - } - else - { - return getComplexSchemaTypeName(namespaceURI, typeName); - } - } -} - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyWSDLTypesGenerator.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyWSDLTypesGenerator.java deleted file mode 100644 index a742e8913d..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyWSDLTypesGenerator.java +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.java2wsdl.generate; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.apache.ws.commons.schema.XmlSchema; -import org.apache.ws.commons.schema.XmlSchemaCollection; -import org.apache.ws.commons.schema.XmlSchemaComplexType; -import org.apache.ws.commons.schema.XmlSchemaElement; -import org.apache.ws.commons.schema.XmlSchemaForm; -import org.apache.ws.commons.schema.XmlSchemaImport; -import org.apache.ws.commons.schema.XmlSchemaInclude; -import org.apache.ws.commons.schema.XmlSchemaSequence; -import org.apache.ws.commons.schema.utils.NamespaceMap; -import org.apache.ws.java2wsdl.Java2WSDLConstants; -import org.apache.ws.java2wsdl.SchemaGenerator; -import org.apache.ws.java2wsdl.bytecode.MethodTable; -import org.codehaus.jam.JClass; -import org.codehaus.jam.JMethod; -import org.codehaus.jam.JParameter; -import org.codehaus.jam.JamClassIterator; -import org.codehaus.jam.JamService; -import org.codehaus.jam.JamServiceFactory; -import org.codehaus.jam.JamServiceParams; - -public class TuscanyWSDLTypesGenerator implements TuscanyJava2WSDLConstants { - public static final String NAME_SPACE_PREFIX = "stn_"; - - public static final String PERIOD_SEPARATOR = "."; - - private static int prefixCount = 1; - - protected GenerationParameters generationParams; - - protected Hashtable targetNamespacePrefixMap = new Hashtable(); - - protected Hashtable schemaMap = new Hashtable(); - - protected XmlSchemaCollection xmlSchemaCollection = new XmlSchemaCollection(); - - private TuscanyTypeTable typeTable = new TuscanyTypeTable(); - - protected SchemaBuilder schemaBuilder = null; - - protected Map schemaLocationMap = null; - - private static final Log log = LogFactory.getLog(SchemaGenerator.class); - - // to keep loadded method using JAM - private JMethod methods[]; - - //to store byte code method using Axis 1.x codes - private MethodTable methodTable; - - private Class clazz; - - private ArrayList excludeMethods = new ArrayList(); - - public TuscanyWSDLTypesGenerator(GenerationParameters genParams) throws Exception { - DataObjectUtil.initRuntime(); - this.generationParams = genParams; - - clazz = Class.forName(generationParams.getSourceClassName(), - true, - generationParams.getClassLoader()); - methodTable = new MethodTable(clazz); - - initializeSchemaMap(generationParams.getSchemaTargetNamespace(), - generationParams.getSchemaTargetNamespacePrefix()); - schemaBuilder = new SchemaBuilder(xmlSchemaCollection, - schemaMap, - targetNamespacePrefixMap, - typeTable, - generationParams.getAttrFormDefault(), - generationParams.getElementFormDefault(), - generationParams.getSchemaLocationMap(), - generationParams.getClassLoader()); - } - - /** - * Generates schema for all the parameters in method. First generates schema - * for all different parameter type and later refers to them. - * - * @return Returns XmlSchema. - * @throws Exception - */ - public Collection buildWSDLTypes() throws Exception { - JamServiceFactory factory = JamServiceFactory.getInstance(); - JamServiceParams jam_service_parms = factory.createServiceParams(); - //setting the classLoder -// jam_service_parms.setParentClassLoader(factory.createJamClassLoader(classLoader)); - //it can posible to add the classLoader as well - jam_service_parms.addClassLoader(generationParams.getClassLoader()); - jam_service_parms.includeClass(generationParams.getSourceClassName()); - - for ( int count = 0 ; count < generationParams.getExtraClasses().size() ; ++count ) - { - jam_service_parms.includeClass((String)generationParams.getExtraClasses().get(count)); - } - - JamService service = factory.createService(jam_service_parms); - QName extraSchemaTypeName = null; - JamClassIterator jClassIter = service.getClasses(); - //all most all the time the ittr will have only one class in it - while (jClassIter.hasNext()) { - JClass jclass = (JClass) jClassIter.next(); - // serviceName = jclass.getSimpleName(); - //todo in the future , when we support annotation we can use this - //JAnnotation[] annotations = jclass.getAnnotations(); - - if ( jclass.getQualifiedName().equals(generationParams.getSourceClassName()) ) - { - /** - * Schema genertaion done in two stage 1. Load all the methods and - * create type for methods parameters (if the parameters are Bean - * then it will create Complex types for those , and if the - * parameters are simple type which decribe in SimpleTypeTable - * nothing will happen) 2. In the next stage for all the methods - * messages and port types will be creteated - */ - methods = jclass.getDeclaredMethods(); - //short the elements in the array - Arrays.sort(methods); - - // since we do not support overload - HashMap uniqueMethods = new HashMap(); - XmlSchemaComplexType methodSchemaType; - XmlSchemaSequence sequence = null; - - for (int i = 0; i < methods.length; i++) { - JMethod jMethod = methods[i]; - - String methodName = methods[i].getSimpleName(); - // no need to think abt this method , since that is system - // config method - if (excludeMethods.contains(jMethod.getSimpleName())) { - continue; - } - - if (uniqueMethods.get(jMethod.getSimpleName()) != null) { - throw new Exception( - " Sorry we don't support methods overloading !!!! "); - } - - if (!jMethod.isPublic()) { - // no need to generate Schema for non public methods - continue; - } - uniqueMethods.put(jMethod.getSimpleName(), jMethod); - //create the schema type for the method wrapper - - uniqueMethods.put(jMethod.getSimpleName(), jMethod); - JParameter [] paras = jMethod.getParameters(); - String parameterNames [] = null; - if (paras.length > 0) { - parameterNames = methodTable.getParameterNames(methodName); - sequence = new XmlSchemaSequence(); - - methodSchemaType = createSchemaTypeForMethodPart(jMethod.getSimpleName()); - methodSchemaType.setParticle(sequence); - } - - for (int j = 0; j < paras.length; j++) { - JParameter methodParameter = paras[j]; - JClass paraType = methodParameter.getType(); - generateSchemaForType(sequence, paraType, - (parameterNames != null && parameterNames[j] != null) ? parameterNames[j] : methodParameter.getSimpleName()); - } - // for its return type - JClass returnType = jMethod.getReturnType(); - - if (!returnType.isVoidType()) { - methodSchemaType = createSchemaTypeForMethodPart(jMethod.getSimpleName() + RESPONSE); - sequence = new XmlSchemaSequence(); - methodSchemaType.setParticle(sequence); - generateSchemaForType(sequence, returnType, "return"); - } - } - } - else - { - //generate the schema type for extra classes - extraSchemaTypeName = typeTable.getSimpleSchemaTypeName(jclass.getQualifiedName()); - if (extraSchemaTypeName == null) - { - extraSchemaTypeName = schemaBuilder.generateSchema(jclass); - } - } - } - return schemaMap.values(); - } - - private QName generateSchemaForType(XmlSchemaSequence sequence, JClass type, String partName) throws Exception { - boolean isArrayType = type.isArrayType(); - if (isArrayType) { - type = type.getArrayComponentType(); - } - - String classTypeName = type.getQualifiedName(); - - QName schemaTypeName = typeTable.getSimpleSchemaTypeName(classTypeName); - if (schemaTypeName == null) { - schemaTypeName = schemaBuilder.generateSchema(type); - addContentToMethodSchemaType(sequence, - schemaTypeName, - partName, - type.isArrayType()); - addImportORInclude((XmlSchema) schemaMap.get(generationParams.getSchemaTargetNamespace()), - schemaTypeName); - - } else { - addContentToMethodSchemaType(sequence, - schemaTypeName, - partName, - type.isArrayType()); - } - - return schemaTypeName; - } - - private void addContentToMethodSchemaType(XmlSchemaSequence sequence, - QName schemaTypeName, - String paraName, - boolean isArray) { - XmlSchemaElement elt1 = new XmlSchemaElement(); - elt1.setName(paraName); - elt1.setSchemaTypeName(schemaTypeName); - sequence.getItems().add(elt1); - - if (isArray) { - elt1.setMaxOccurs(Long.MAX_VALUE); - elt1.setMinOccurs(0); - } - } - - private XmlSchemaComplexType createSchemaTypeForMethodPart(String localPartName) throws Exception { - XmlSchema xmlSchema = (XmlSchema) schemaMap.get(generationParams.getSchemaTargetNamespace()); - QName elementName = new QName(generationParams.getSchemaTargetNamespace(), - localPartName, - generationParams.getSchemaTargetNamespacePrefix()); - XmlSchemaComplexType complexType = new XmlSchemaComplexType(xmlSchema); - - XmlSchemaElement globalElement = new XmlSchemaElement(); - globalElement.setSchemaType(complexType); - globalElement.setName(formGlobalElementName(localPartName)); - globalElement.setQName(elementName); - - xmlSchema.getItems().add(globalElement); - xmlSchema.getElements().add(elementName, - globalElement); - - typeTable.addComplexSchemaType(generationParams.getSchemaTargetNamespace(), - globalElement.getName(), - elementName); - - return complexType; - } - - private String formGlobalElementName(String typeName) { - String firstChar = typeName.substring(0, - 1); - return typeName.replaceFirst(firstChar, - firstChar.toLowerCase()); - } - - public TuscanyTypeTable getTypeTable() { - return typeTable; - } - - public JMethod[] getMethods() { - return methods; - } - - private String generatePrefix() { - return NAME_SPACE_PREFIX + prefixCount++; - } - - public void setExcludeMethods(ArrayList excludeMethods) { - this.excludeMethods = excludeMethods; - } - - private void initializeSchemaMap(String targetNamespace, String targetNamespacePrefix) { - XmlSchema xmlSchema = new XmlSchema(targetNamespace, xmlSchemaCollection); - xmlSchema.setAttributeFormDefault(getAttrFormDefaultSetting()); - xmlSchema.setElementFormDefault(getElementFormDefaultSetting()); - - targetNamespacePrefixMap.put(targetNamespace, - targetNamespacePrefix); - schemaMap.put(targetNamespace, - xmlSchema); - - NamespaceMap prefixmap = new NamespaceMap(); - prefixmap.put(TuscanyTypeTable.XS_URI_PREFIX, - TuscanyTypeTable.XML_SCHEMA_URI); - prefixmap.put(targetNamespacePrefix, - targetNamespace); - xmlSchema.setNamespaceContext(prefixmap); - } - - - private void addImportORInclude(XmlSchema xmlSchema, QName schemaTypeName) { - //decide whether there must be an import or an include - if (xmlSchema.getTargetNamespace().equals(schemaTypeName.getNamespaceURI())) { - XmlSchema containingSchema = (XmlSchema) schemaMap.get(schemaTypeName.getNamespaceURI()); - //if the type is not defined in the Schema then include - if (containingSchema.getTypeByName(schemaTypeName) == null) { - String schemaLocation = null; - if ((schemaLocation = (String) schemaLocationMap.get(schemaTypeName.getNamespaceURI())) != null) { - schemaLocation = DEFAULT_SCHEMA_LOCATION; - } - - XmlSchemaInclude includeElement = new XmlSchemaInclude(); - includeElement.setSchemaLocation(schemaLocation); - - if (!xmlSchema.getIncludes().contains(includeElement)) { - xmlSchema.getIncludes().add(includeElement); - } - } - } else { - if (!((NamespaceMap) xmlSchema.getNamespaceContext()).values() - .contains(schemaTypeName.getNamespaceURI())) { - XmlSchemaImport importElement = new XmlSchemaImport(); - importElement.setNamespace(schemaTypeName.getNamespaceURI()); - xmlSchema.getItems().add(importElement); - ((NamespaceMap) xmlSchema.getNamespaceContext()).put(generatePrefix(), - schemaTypeName.getNamespaceURI()); - } - } - } - - private XmlSchemaForm getAttrFormDefaultSetting() { - if (FORM_DEFAULT_UNQUALIFIED.equals(generationParams.getAttrFormDefault())) { - return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED); - } else { - return new XmlSchemaForm(XmlSchemaForm.QUALIFIED); - } - } - - private XmlSchemaForm getElementFormDefaultSetting() { - if (FORM_DEFAULT_UNQUALIFIED.equals(generationParams.getElementFormDefault())) { - return new XmlSchemaForm(XmlSchemaForm.UNQUALIFIED); - } else { - return new XmlSchemaForm(XmlSchemaForm.QUALIFIED); - } - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenEvent.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenEvent.java deleted file mode 100644 index 26b3d092de..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenEvent.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.tools.java2wsdl.generate; - -import java.util.EventObject; - -public class WSDLGenEvent extends EventObject { - private int generationPhase = WSDLGenListener.UNKNOWN; - - public WSDLGenEvent(Object source, int genPhase) { - super(source); - this.generationPhase = genPhase; - } - - public int getGenerationPhase() { - return generationPhase; - } - - public void setGenerationPhase(int generationPhase) { - this.generationPhase = generationPhase; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenListener.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenListener.java deleted file mode 100644 index 788d162f34..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/generate/WSDLGenListener.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.tools.java2wsdl.generate; - -public interface WSDLGenListener { - public static int UNKNOWN = 0; - - public static int INPUT_ARGS_PARSING = 1; - - public static int INPUT_ARGS_VALIDATION = 2; - - public static int WSDL_MODEL_CREATION = 3; - - public static int WSDL_MODEL_WRITING = 4; - - public static String[] phaseAsString = { "Unknown", - "Input Arguments Parsing", "Input Arguments Validation", - "WSDL Model Creation", "WSDL Model Writing" }; - - public void WSDLGenPhaseStarted(WSDLGenEvent event); - - public void WSDLGenPhaseCompleted(WSDLGenEvent event); -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/util/XMLNameUtil.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/util/XMLNameUtil.java deleted file mode 100644 index b30b8cd62b..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/java2wsdl/util/XMLNameUtil.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.java2wsdl.util; - -import java.util.ArrayList; -import java.util.List; - -public class XMLNameUtil { - - /** - * Returns a valid Java name from an XML Name. - * - * @param name - * @param isUpperCase - * @return a valid Java name from an XML Name - */ - public static String getJavaNameFromXMLName(String name, boolean isUpperCase) { - List parsedName = parseName(name, '_'); - StringBuilder result = new StringBuilder(64 * parsedName.size()); - for (String nameComponent: parsedName) { - if (nameComponent.length() > 0) { - if (result.length() > 0 || isUpperCase) { - result.append(Character.toUpperCase(nameComponent.charAt(0))); - result.append(nameComponent.substring(1)); - } else { - result.append(nameComponent); - } - } - } - - if (result.length() == 0) { - return "_"; - } - if (Character.isJavaIdentifierStart(result.charAt(0))) { - return isUpperCase ? result.toString() : decapitalizeName(result.toString()); - } - return "_" + result; - } - - /** - * Decapitalize a name. - * @param name - * @return a decapitalized name - */ - public static String decapitalizeName(String name) { - if (name.length() == 0) { - return name; - } else { - String lowerName = name.toLowerCase(); - int i; - for (i = 0; i < name.length(); i++) { - if (name.charAt(i) == lowerName.charAt(i)) { - break; - } - } - if (i > 1 && i < name.length()) { - --i; - } - return name.substring(0, i).toLowerCase() + name.substring(i); - } - } - - /** - * Parse the given name. - * - * @param sourceName - * @param separator - * @return some stuff parsed from the name - */ - private static List parseName(String sourceName, char separator) { - List result = new ArrayList(); - if (sourceName != null) { - StringBuilder currentWord = new StringBuilder(64); - boolean lastIsLower = false; - int index; - int length; - for (index = 0, length = sourceName.length(); index < length; ++index) { - char curChar = sourceName.charAt(index); - if (!Character.isJavaIdentifierPart(curChar)) { - curChar = separator; - } - if (Character.isUpperCase(curChar) - || (!lastIsLower && Character.isDigit(curChar)) - || curChar == separator) { - - if (lastIsLower && currentWord.length() > 1 - || curChar == separator && currentWord.length() > 0) { - result.add(currentWord.toString()); - currentWord = new StringBuilder(64); - } - lastIsLower = false; - } else { - if (!lastIsLower) { - int currentWordLength = currentWord.length(); - if (currentWordLength > 1) { - char lastChar = currentWord.charAt(--currentWordLength); - currentWord.setLength(currentWordLength); - result.add(currentWord.toString()); - currentWord = new StringBuilder(64); - currentWord.append(lastChar); - } - } - lastIsLower = true; - } - - if (curChar != separator) { - currentWord.append(curChar); - } - } - - result.add(currentWord.toString()); - } - return result; - } - - /** - * Return an EPackage name for the given namespace. - * - * @param namespace - * @return an EPackage name for the given namespace - */ - public static String getPackageNameFromNamespace(String namespace) { - return org.apache.tuscany.sdo.helper.SDOXSDEcoreBuilder.getDefaultPackageName(namespace); - } - - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java deleted file mode 100644 index 22383e99db..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceEmitter.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.wsdl2java.generate; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.axis2.description.AxisMessage; -import org.apache.axis2.description.AxisOperation; -import org.apache.axis2.util.FileWriter; -import org.apache.axis2.wsdl.WSDLConstants; -import org.apache.axis2.wsdl.codegen.CodeGenConfiguration; -import org.apache.axis2.wsdl.codegen.emitter.JavaEmitter; -import org.apache.axis2.wsdl.codegen.writer.InterfaceWriter; -import org.apache.axis2.wsdl.databinding.TypeMapper; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import static org.apache.tuscany.tools.java2wsdl.util.XMLNameUtil.getJavaNameFromXMLName; - -/** - * Overrides the Axis2 JavaEmitter to generate unwrapped methods. - */ -public class JavaInterfaceEmitter extends JavaEmitter { - - private CodeGenConfiguration codegenConfiguration; - private TypeMapper typeMapper; - - public void setCodeGenConfiguration(CodeGenConfiguration configuration) { - super.setCodeGenConfiguration(configuration); - codegenConfiguration=configuration; - } - - public void setMapper(TypeMapper typeMapper) { - super.setMapper(typeMapper); - this.typeMapper = typeMapper; - } - - private List getParameterElementList(Document doc, AxisMessage message, boolean wrapped) { - List parameterElementList = new ArrayList(); - - if (message != null && message.getElementQName()!=null) { - - SDODataBindingTypeMappingEntry typeMappingEntry = - (SDODataBindingTypeMappingEntry)this.typeMapper.getTypeMappingObject(message.getElementQName()); - List typeMappings; - if (wrapped) { - typeMappings = (List)typeMappingEntry.getPropertyClassNames(); - } else { - typeMappings = new ArrayList(); - typeMappings.add(typeMappingEntry.getClassName()); - } - - for (int i=0; i> Generating Java class " + packageName + "." + className); - File outputFile = FileWriter.createClassFile(this.codegenConfiguration.getOutputLocation(), - packageName, className, ".java"); - if (outputFile.exists()) { - outputFile.delete(); - } - - writeClass(interfaceModel, interfaceWriter); - } - - protected String makeJavaClassName(String word) { - //return XMLNameUtil.getJavaNameFromXMLName(word, true); - return getJavaNameFromXMLName(word, true); - } - - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java deleted file mode 100644 index b68277566a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/JavaInterfaceGenerator.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.tools.wsdl2java.generate; - -import static org.apache.tuscany.tools.java2wsdl.util.XMLNameUtil.getPackageNameFromNamespace; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import javax.wsdl.Binding; -import javax.wsdl.Definition; -import javax.wsdl.Port; -import javax.wsdl.PortType; -import javax.wsdl.Service; -import javax.wsdl.WSDLException; -import javax.wsdl.factory.WSDLFactory; -import javax.wsdl.xml.WSDLReader; -import javax.xml.namespace.QName; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.axis2.AxisFault; -import org.apache.axis2.description.AxisService; -import org.apache.axis2.description.WSDL11ToAxisServiceBuilder; -import org.apache.axis2.util.XMLUtils; -import org.apache.axis2.wsdl.codegen.CodeGenConfiguration; -import org.apache.axis2.wsdl.codegen.CodeGenerationException; -import org.apache.axis2.wsdl.codegen.extension.CodeGenExtension; -import org.apache.axis2.wsdl.codegen.extension.DefaultDatabindingExtension; -import org.apache.axis2.wsdl.codegen.extension.PackageFinder; -import org.apache.axis2.wsdl.codegen.extension.WSDLValidatorExtension; -import org.apache.axis2.wsdl.databinding.JavaTypeMapper; -import org.w3c.dom.Document; -import org.xml.sax.SAXException; - -public class JavaInterfaceGenerator { - - private List codegenExtensions = new ArrayList(); - private List codegenConfigurations= new LinkedList(); - - - - - public JavaInterfaceGenerator(String uri, String ports[], String outputLocation, String packageName, - Map typeMapping) throws CodeGenerationException { - - Definition definition; - try { - definition = readWSDL(uri); - } catch (WSDLException e) { - throw new CodeGenerationException(e); - } - - HashSet interestedPorts= ports == null ? null : new HashSet(Arrays.asList(ports)); - - // Service service=(Service)definition.getServices().values().().next(); - - HashSet donePortTypes= new HashSet(); - - for (Iterator sIter = definition.getServices().values().iterator(); sIter.hasNext(); ) { - Service service = (Service) sIter.next(); - - QName serviceQname = service.getQName(); - for (Iterator pIter= service.getPorts().values().iterator(); pIter.hasNext(); ) { - Port port= (Port) pIter.next(); - if(interestedPorts != null && ! interestedPorts.contains(port.getName())) continue;//not iterested. - PortType portType= getPortType(port); - if(null == portType) continue; // not connected. - QName pQName= portType.getQName(); - if(donePortTypes.contains(pQName)) continue; //allready did it. - donePortTypes.add(pQName); - - if (packageName == null) { - - packageName = getPackageNameFromNamespace(definition.getTargetNamespace()); - } - JavaTypeMapper typeMapper = new JavaTypeMapper(); - for (Map.Entry e : typeMapping.entrySet()) { - typeMapper.addTypeMappingObject(e.getKey(), e.getValue()); - } - AxisService axisService; - try { - axisService = new WSDL11ToAxisServiceBuilder(definition, serviceQname, port.getName()).populateService(); - } catch (AxisFault e) { - throw new CodeGenerationException(e); - } - axisService.setName(port.getBinding().getPortType().getQName().getLocalPart()); - CodeGenConfiguration codegenConfiguration = new CodeGenConfiguration(Collections.EMPTY_MAP); - codegenConfigurations.add(codegenConfiguration); - codegenConfiguration.setAxisService(axisService); - codegenConfiguration.setAdvancedCodeGenEnabled(false); - codegenConfiguration.setAsyncOn(false); - codegenConfiguration.setDatabindingType("sdo"); - codegenConfiguration.setGenerateAll(true); - codegenConfiguration.setGenerateDeployementDescriptor(false); - codegenConfiguration.setOutputLanguage("java"); - codegenConfiguration.setOutputLocation(new File(outputLocation)); - codegenConfiguration.setPackageName(packageName); - codegenConfiguration.setPackClasses(false); - codegenConfiguration.setPolicyMap(Collections.EMPTY_MAP); - codegenConfiguration.setPortName(port.getName()); - codegenConfiguration.setServerSide(false); - codegenConfiguration.setServiceName(service.getQName().getLocalPart()); - codegenConfiguration.setSyncOn(true); - codegenConfiguration.setTypeMapper(typeMapper); - codegenConfiguration.setWriteMessageReceiver(false); - codegenConfiguration.setWriteTestCase(false); - addExtension(new WSDLValidatorExtension(), codegenConfiguration); - addExtension(new PackageFinder(), codegenConfiguration); - addExtension(new SDODataBindingCodegenExtension(typeMapper), codegenConfiguration); - addExtension(new DefaultDatabindingExtension(), codegenConfiguration); - } - } - } - - - private PortType getPortType(Port port) { - Binding binding = port.getBinding(); - if(null != binding){ - return binding.getPortType(); - } - return null; - - } - - - @SuppressWarnings("unchecked") - private void addExtension(CodeGenExtension ext, CodeGenConfiguration codegenConfiguration) { - //ext.init(codegenConfiguration); - codegenExtensions.add(new Object[]{ext, codegenConfiguration}); - } - - public void generate() throws CodeGenerationException { - try { - for (int i = 0; i < codegenExtensions.size(); i++) { - //CodeGenExtension - Object[] pair = (Object[])codegenExtensions.get(i); - - CodeGenExtension cge= (CodeGenExtension) pair[0]; - CodeGenConfiguration cgf= (CodeGenConfiguration)pair[1]; - - cge.engage(cgf); - - } - - for(CodeGenConfiguration codegenConfiguration : codegenConfigurations){ - JavaInterfaceEmitter emitter = new JavaInterfaceEmitter(); - emitter.setCodeGenConfiguration(codegenConfiguration); - emitter.setMapper(codegenConfiguration.getTypeMapper()); - - emitter.writeInterface(false); - } - - } catch (Exception e) { - throw new CodeGenerationException(e); - } - } - - /** - * Read the WSDL file - * @param uri - * @return - * @throws WSDLException - */ - private Definition readWSDL(String uri) throws WSDLException { - - WSDLReader reader = - WSDLFactory.newInstance().newWSDLReader(); - reader.setFeature("javax.wsdl.importDocuments", true); - - File file = new File(uri); - String baseURI; - - if (uri.startsWith("http://")){ - baseURI = uri; - } else{ - if(file.getParentFile() == null){ - try { - baseURI = new File(".").getCanonicalFile().toURI().toString(); - } catch (IOException e) { - throw new RuntimeException(e); - } - } else { - baseURI = file.getParentFile().toURI().toString(); - } - } - - Document doc; - try { - doc = XMLUtils.newDocument(uri); - } catch (ParserConfigurationException e) { - throw new WSDLException(WSDLException.PARSER_ERROR, - "Parser Configuration Error", - e); - } catch (SAXException e) { - throw new WSDLException(WSDLException.PARSER_ERROR, - "Parser SAX Error", - e); - - } catch (IOException e) { - throw new WSDLException(WSDLException.INVALID_WSDL, "IO Error", e); - } - - return reader.readWSDL(baseURI, doc); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.java deleted file mode 100644 index cb413bca50..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/RemotableInterfaceWritter.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.tools.wsdl2java.generate; - -import java.io.File; - -import org.apache.axis2.wsdl.codegen.CodeGenerationException; -import org.apache.axis2.wsdl.codegen.writer.InterfaceWriter; - -/** - * @author lresende - */ -public class RemotableInterfaceWritter extends InterfaceWriter { - private static final String REMOTABLE_INTERFACE_TEMPLATE="/RemotableInterfaceTemplate.xsl"; - - public RemotableInterfaceWritter(String outputFileLocation) { - super(outputFileLocation); - } - - public RemotableInterfaceWritter(File outputFileLocation, String language) { - super(outputFileLocation, language); - } - - /** - * Loads the template. - */ - @Override - public void loadTemplate() throws CodeGenerationException { - // the default behavior for the class writers is to use the property map from the languge specific types - // The properties are arranged in the following order - // .* .template=, - - //overrida original behaviour to always load the template we specified - this.xsltStream = this.getClass().getResourceAsStream(REMOTABLE_INTERFACE_TEMPLATE); - - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.java deleted file mode 100644 index 075959f985..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingCodegenExtension.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.tools.wsdl2java.generate; - -import org.apache.axis2.wsdl.codegen.CodeGenConfiguration; -import org.apache.axis2.wsdl.codegen.CodeGenerationException; -import org.apache.axis2.wsdl.codegen.extension.AbstractDBProcessingExtension; -import org.apache.axis2.wsdl.databinding.TypeMapper; - -/** - * SDO data binding codegen extension. - */ -public class SDODataBindingCodegenExtension extends AbstractDBProcessingExtension { - - private TypeMapper typeMapper; - - public SDODataBindingCodegenExtension(TypeMapper typeMapper) { - this.typeMapper=typeMapper; - } - - protected boolean testFallThrough(String dbFrameworkName) { - return !dbFrameworkName.equals("sdo"); - } - -// public void engage() { -// if (testFallThrough(configuration.getDatabindingType())) { -// return; -// } -// -// // Set the type mapper into the config -// configuration.setTypeMapper(typeMapper); -// -// } - - public void engage(CodeGenConfiguration configuration) throws CodeGenerationException { - // TODO Auto-generated method stub - if (testFallThrough(configuration.getDatabindingType())) { - return; - } - - // Set the type mapper into the config - configuration.setTypeMapper(typeMapper); - - - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingTypeMappingEntry.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingTypeMappingEntry.java deleted file mode 100644 index 2d81ef12bf..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/SDODataBindingTypeMappingEntry.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.tools.wsdl2java.generate; - -import java.util.List; - -/** - * This represents a type mapping entry, used by the JavaInterfaceEmitter to generate - * method signatures. - */ -public class SDODataBindingTypeMappingEntry { - - private final boolean anonymous; - private final List propertyClassNames; - private final String className; - - public SDODataBindingTypeMappingEntry(String className, boolean anonymous, List propertyClassNames) { - this.className = className; - this.anonymous = anonymous; - this.propertyClassNames = propertyClassNames; - } - - public boolean isAnonymous() { - return anonymous; - } - - public String getClassName() { - return className; - } - - public List getPropertyClassNames() { - return propertyClassNames; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.java deleted file mode 100644 index 94f8d88646..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGenerator.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.tools.wsdl2java.generate; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.StringTokenizer; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sdo.helper.XSDHelperImpl; -import org.apache.tuscany.sdo.util.DataObjectUtil; -import org.eclipse.emf.codegen.ecore.genmodel.GenClass; -import org.eclipse.emf.codegen.ecore.genmodel.GenModel; -import org.eclipse.emf.codegen.ecore.genmodel.GenModelFactory; -import org.eclipse.emf.codegen.ecore.genmodel.GenPackage; -import org.eclipse.emf.codegen.util.CodeGenUtil; -import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.BasicExtendedMetaData; -import org.eclipse.emf.ecore.util.ExtendedMetaData; - -import commonj.sdo.helper.XSDHelper; - -public class WSDL2JavaGenerator { - static protected final int DYNAMIC_SDO = 1; - - /** - * Generate Java interfaces from WSDL Usage arguments: [ -targetDirectory - * ] [ -javaPackage ] - * For example: generate somedir/somefile.wsdl Basic options: - * -targetDirectory Generates the Java source code in the specified - * directory. By default, the code is generated in the same directory as the - * input wsdl file. -javaPackage Overrides the Java package for the - * generated classes. By default the package name is derived from the - * targetNamespace of the WSDL definition being generated. For example, if - * the targetNamespace is "http://www.example.com/simple", the default - * package will be "com.example.simple". - */ - public static void main(String args[]) { - if (args.length == 0) { - printUsage(); - return; - } - - String portName = null; - String targetDirectory = null; - String wsdlJavaPackage = null; - String xsdJavaPackage = null; - int dynamicSDO = 0; - - int index = 0; - for (; index < args.length && args[index].startsWith("-"); ++index) { - if (args[index].equalsIgnoreCase("-port")) { - portName = args[++index]; - } else if (args[index].equalsIgnoreCase("-targetDirectory")) { - targetDirectory = args[++index]; - } else if (args[index].equalsIgnoreCase("-javaPackage")) { - wsdlJavaPackage = args[++index]; - } else if (args[index].equalsIgnoreCase("-dynamicSDO")) { - dynamicSDO = DYNAMIC_SDO; - } - // else if (...) - else { - printUsage(); - return; - } - } - - String wsdlFileName = args[index]; - if (wsdlFileName == null || targetDirectory == null) { - printUsage(); - return; - } - - generateFromWSDL(wsdlFileName, portName!=null? new String[]{portName}:null, targetDirectory, wsdlJavaPackage, xsdJavaPackage, dynamicSDO); - - } - - @SuppressWarnings("unchecked") - public static void generateFromWSDL(String wsdlFileName, String targetDirectory, - String wsdlJavaPackage, - String xsdJavaPackage, int genOptions){ - generateFromWSDL( wsdlFileName, null, targetDirectory, - wsdlJavaPackage, - xsdJavaPackage, genOptions); - - } - - - @SuppressWarnings("unchecked") - public static void generateFromWSDL(String wsdlFileName, String[] ports, - String targetDirectory, String wsdlJavaPackage, - String xsdJavaPackage, int genOptions) - { - - // Initialize the SDO runtime - DataObjectUtil.initRuntime(); - EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE); - ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry); - XSDHelper xsdHelper = new XSDHelperImpl(extendedMetaData, null); - - try { - - // Load the WSDL file - File inputFile = new File(wsdlFileName).getAbsoluteFile(); - InputStream inputStream = new FileInputStream(inputFile); - - // Define SDO metadata - xsdHelper.define(inputStream, inputFile.toURI().toString()); - - if (targetDirectory == null) { - targetDirectory = new File(wsdlFileName).getCanonicalFile().getParent(); - } else { - targetDirectory = new File(targetDirectory).getCanonicalPath(); - } - - // Populate the typeMapping table that will be given to the Axis2 WSDL2Java - Map typeMapping = - new HashMap(); - if (!packageRegistry.values().isEmpty()) { - ResourceSet resourceSet = DataObjectUtil.createResourceSet(); - - // Populate list of GenPackages and a map of GenClasses keyed by EClass - List genPackages = new ArrayList(); - Map genClasses = new HashMap(); - for (Iterator iter = packageRegistry.values().iterator(); iter.hasNext();) { - EPackage currentEPackage = (EPackage)iter.next(); - String currentBasePackage = extractBasePackageName(currentEPackage, xsdJavaPackage); - String currentPrefix = CodeGenUtil.capName(currentEPackage.getName()); - - GenPackage currentGenPackage = createGenPackage(currentEPackage, currentBasePackage, - currentPrefix, genOptions, resourceSet); - genPackages.add(currentGenPackage); - for (GenClass genClass : (List)currentGenPackage.getGenClasses()) { - genClasses.put(genClass.getEcoreClass(), genClass); - } - - } - - // Process all the SDO packages - // Populate the qname -> interfaceName typeMapping table - for (GenPackage currentGenPackage : genPackages) { - EPackage currentEPackage = currentGenPackage.getEcorePackage(); - - // Populate the type mappings for all the complex types - for (GenClass genClass : (List)currentGenPackage.getGenClasses()) { - QName qname = new QName(extendedMetaData.getNamespace(currentEPackage), - extendedMetaData.getName(genClass.getEcoreClass())); - String interfaceName = (DYNAMIC_SDO & genOptions) == DYNAMIC_SDO ? "commonj.sdo.DataObject" : currentGenPackage - .getInterfacePackageName() - + '.' + genClass.getInterfaceName(); - SDODataBindingTypeMappingEntry typeMappingEntry = - new SDODataBindingTypeMappingEntry(interfaceName, false, null); - typeMapping.put(qname, typeMappingEntry); - } - - // Process all the global XSD elements - EClass documentRoot = extendedMetaData.getDocumentRoot(currentEPackage); - if (documentRoot != null) { - for (EStructuralFeature element : (List)extendedMetaData - .getElements(documentRoot)) { - EClassifier elementType = element.getEType(); - - // Handle a complex type - if (elementType instanceof EClass) { - EClass eClass = (EClass)elementType; - - GenClass genClass = genClasses.get(elementType); - QName qname = new QName(extendedMetaData.getNamespace(currentEPackage), - extendedMetaData.getName(element)); - String interfaceName = (DYNAMIC_SDO & genOptions) == DYNAMIC_SDO ? "commonj.sdo.DataObject" : genClass - .getGenPackage().getInterfacePackageName() - + '.' + genClass.getInterfaceName(); - boolean anonymous = extendedMetaData.isAnonymous(eClass); - - // Build list of property class names - List propertyClassNames=new ArrayList(); - for (EStructuralFeature feature : (List)eClass.getEStructuralFeatures()) { - EClassifier propertyType = feature.getEType(); - if (propertyType instanceof EClass) { - GenClass propertyGenClass = genClasses.get(propertyType); - String propertyClassName = (DYNAMIC_SDO & genOptions) == DYNAMIC_SDO ? "commonj.sdo.DataObject" - : propertyGenClass.getGenPackage().getInterfacePackageName() + '.' - + propertyGenClass.getInterfaceName(); - propertyClassNames.add(propertyClassName); - } else if (propertyType instanceof EClassifier) { - String propertyClassName = propertyType.getInstanceClass().getName(); - propertyClassNames.add(propertyClassName); - } - } - - SDODataBindingTypeMappingEntry typeMappingEntry = - new SDODataBindingTypeMappingEntry(interfaceName, anonymous, propertyClassNames); - typeMapping.put(qname, typeMappingEntry); - - } else { - - // Handle a simple type - QName qname = new QName(extendedMetaData.getNamespace(currentEPackage), - extendedMetaData.getName(element)); - String className = elementType.getInstanceClass().getName(); - SDODataBindingTypeMappingEntry typeMappingEntry = - new SDODataBindingTypeMappingEntry(className, false, null); - typeMapping.put(qname, typeMappingEntry); - } - } - } - } - } - - try { - JavaInterfaceGenerator codeGenerator = new JavaInterfaceGenerator(wsdlFileName, - ports, - targetDirectory, - wsdlJavaPackage, - typeMapping); - codeGenerator.generate(); - } catch (Exception e) { - throw new IllegalArgumentException(e); - } - - } catch (IOException e) { - throw new IllegalArgumentException(e); - } - } - - @SuppressWarnings("unchecked") - public static GenPackage createGenPackage(EPackage ePackage, String basePackage, String prefix, - int genOptions, ResourceSet resourceSet) { - GenModel genModel = ecore2GenModel(ePackage, basePackage, prefix, genOptions); - - URI ecoreURI = URI.createURI("file:///" + ePackage.getName() + ".ecore"); - URI genModelURI = ecoreURI.trimFileExtension().appendFileExtension("genmodel"); - - Resource ecoreResource = resourceSet.createResource(ecoreURI); - ecoreResource.getContents().add(ePackage); - - Resource genModelResource = resourceSet.createResource(genModelURI); - genModelResource.getContents().add(genModel); - - return (GenPackage)genModel.getGenPackages().get(0); - } - - public static GenModel ecore2GenModel(EPackage ePackage, String basePackage, - String prefix, int genOptions) { - GenModel genModel = GenModelFactory.eINSTANCE.createGenModel(); - genModel.initialize(Collections.singleton(ePackage)); - - genModel.setRootExtendsInterface(""); - genModel.setRootImplementsInterface("commonj.sdo.DataObject"); - genModel.setRootExtendsClass("org.apache.tuscany.sdo.impl.DataObjectImpl"); - genModel.setFeatureMapWrapperInterface("commonj.sdo.Sequence"); - genModel.setFeatureMapWrapperInternalInterface("org.apache.tuscany.sdo.util.BasicSequence"); - genModel.setFeatureMapWrapperClass("org.apache.tuscany.sdo.util.BasicSequence"); - genModel.setSuppressEMFTypes(true); - genModel.setSuppressEMFMetaData(true); - genModel.setSuppressEMFModelTags(true); - genModel.setCanGenerate(true); - // FIXME workaround java.lang.NoClassDefFoundError: - // org/eclipse/jdt/core/jdom/IDOMNode with 02162006 build - genModel.setFacadeHelperClass("Hack"); - genModel.setForceOverwrite(true); - - GenPackage genPackage = (GenPackage)genModel.getGenPackages().get(0); - - if (basePackage != null) { - genPackage.setBasePackage(basePackage); - } - if (prefix != null) { - genPackage.setPrefix(prefix); - } - - return genModel; - } - - public static String extractBasePackageName(EPackage ePackage, String javaPackage) { - String qualifiedName = javaPackage != null ? javaPackage : ePackage.getName(); - String name = /* CodeGenUtil. */shortName(qualifiedName); - String baseName = qualifiedName.substring(0, qualifiedName.length() - name.length()); - if (javaPackage != null || !name.equals(qualifiedName)) { - ePackage.setName(name); - } - return baseName != null ? /* CodeGenUtil. */safeQualifiedName(baseName) : null; - } - - public static String shortName(String qualifiedName) { - int index = qualifiedName.lastIndexOf("."); - return index != -1 ? qualifiedName.substring(index + 1) : qualifiedName; - } - - public static String safeQualifiedName(String qualifiedName) { - StringBuffer safeQualifiedName = new StringBuffer(); - for (StringTokenizer stringTokenizer = new StringTokenizer(qualifiedName, "."); - stringTokenizer.hasMoreTokens();) { - String name = stringTokenizer.nextToken(); - safeQualifiedName.append(CodeGenUtil.safeName(name)); - if (stringTokenizer.hasMoreTokens()) { - safeQualifiedName.append('.'); - } - } - return safeQualifiedName.toString(); - } - - protected static void printDiagnostic(Diagnostic diagnostic, String indent) { - System.out.print(indent); - System.out.println(diagnostic.getMessage()); - for (Iterator i = diagnostic.getChildren().iterator(); i.hasNext();) { - printDiagnostic((Diagnostic)i.next(), indent + " "); - } - } - - protected static void printUsage() { - System.out.println("Usage arguments:"); - System.out.println(" [ -targetDirectory ]"); - System.out.println(" [ -javaPackage ]"); - System.out.println(" [ -dynamicSDO ]"); - System.out.println(" "); - System.out.println(""); - System.out.println("For example:"); - System.out.println(""); - System.out.println(" generate somedir/somefile.wsdl"); - } - - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/resources/META-INF/LICENSE.txt b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/resources/META-INF/LICENSE.txt deleted file mode 100644 index 25d78feeac..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/resources/META-INF/LICENSE.txt +++ /dev/null @@ -1,1277 +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. - - -APACHE TUSCANY SUBCOMPONENTS: - -The Apache Tuscany distribution includes a number of subcomponents with -separate copyright notices and license terms. Your use of the source -code for the these subcomponents is subject to the terms and -conditions of the following licenses. - -=============================================================================== - -For the Eclipse Modeling Framework component and the Celtix binding: - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE -PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF -THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and -documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and - -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and -are distributed by that particular Contributor. A Contribution -'originates' from a Contributor if it was added to the Program by such -Contributor itself or anyone acting on such Contributor's behalf. -Contributions do not include additions to the Program which: (i) are -separate modules of software distributed in conjunction with the -Program under their own license agreement, and (ii) are not derivative -works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents " mean patent claims licensable by a Contributor -which are necessarily infringed by the use or sale of its Contribution -alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this -Agreement. - -"Recipient" means anyone who receives the Program under this -Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free copyright -license to reproduce, prepare derivative works of, publicly display, -publicly perform, distribute and sublicense the Contribution of such -Contributor, if any, and such derivative works, in source code and -object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free patent -license under Licensed Patents to make, use, sell, offer to sell, -import and otherwise transfer the Contribution of such Contributor, if -any, in source code and object code form. This patent license shall -apply to the combination of the Contribution and the Program if, at -the time the Contribution is added by the Contributor, such addition -of the Contribution causes such combination to be covered by the -Licensed Patents. The patent license shall not apply to any other -combinations which include the Contribution. No hardware per se is -licensed hereunder. - -c) Recipient understands that although each Contributor grants the -licenses to its Contributions set forth herein, no assurances are -provided by any Contributor that the Program does not infringe the -patent or other intellectual property rights of any other entity. Each -Contributor disclaims any liability to Recipient for claims brought by -any other entity based on infringement of intellectual property rights -or otherwise. As a condition to exercising the rights and licenses -granted hereunder, each Recipient hereby assumes sole responsibility -to secure any other intellectual property rights needed, if any. For -example, if a third party patent license is required to allow -Recipient to distribute the Program, it is Recipient's responsibility -to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient -copyright rights in its Contribution, if any, to grant the copyright -license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form -under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties -and conditions, express and implied, including warranties or -conditions of title and non-infringement, and implied warranties or -conditions of merchantability and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability -for damages, including direct, indirect, special, incidental and -consequential damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are -offered by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such -Contributor, and informs licensees how to obtain it in a reasonable -manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the -Program. - -Contributors may not remove or alter any copyright notices contained -within the Program. - -Each Contributor must identify itself as the originator of its -Contribution, if any, in a manner that reasonably allows subsequent -Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain -responsibilities with respect to end users, business partners and the -like. While this license is intended to facilitate the commercial use -of the Program, the Contributor who includes the Program in a -commercial product offering should do so in a manner which does not -create potential liability for other Contributors. Therefore, if a -Contributor includes the Program in a commercial product offering, -such Contributor ("Commercial Contributor") hereby agrees to defend -and indemnify every other Contributor ("Indemnified Contributor") -against any losses, damages and costs (collectively "Losses") arising -from claims, lawsuits and other legal actions brought by a third party -against the Indemnified Contributor to the extent caused by the acts -or omissions of such Commercial Contributor in connection with its -distribution of the Program in a commercial product offering. The -obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. -In order to qualify, an Indemnified Contributor must: a) promptly -notify the Commercial Contributor in writing of such claim, and b) -allow the Commercial Contributor to control, and cooperate with the -Commercial Contributor in, the defense and any related settlement -negotiations. The Indemnified Contributor may participate in any such -claim at its own expense. - -For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those -performance claims and warranties, and if a court requires any other -Contributor to pay any damages as a result, the Commercial Contributor -must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS -PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY -WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY -OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely -responsible for determining the appropriateness of using and -distributing the Program and assumes all risks associated with its -exercise of rights under this Agreement , including but not limited to -the risks and costs of program errors, compliance with applicable -laws, damage to or loss of data, programs or equipment, and -unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR -ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING -WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR -DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED -HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further -action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that -the Program itself (excluding combinations of the Program with other -software or hardware) infringes such Recipient's patent(s), then such -Recipient's rights granted under Section 2(b) shall terminate as of -the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of -time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use -and distribution of the Program as soon as reasonably practicable. -However, Recipient's obligations under this Agreement and any licenses -granted by Recipient relating to the Program shall continue and -survive. - -Everyone is permitted to copy and distribute copies of this Agreement, -but in order to avoid inconsistency the Agreement is copyrighted and -may only be modified in the following manner. The Agreement Steward -reserves the right to publish new versions (including revisions) of -this Agreement from time to time. No one other than the Agreement -Steward has the right to modify this Agreement. The Eclipse Foundation -is the initial Agreement Steward. The Eclipse Foundation may assign -the responsibility to serve as the Agreement Steward to a suitable -separate entity. Each new version of the Agreement will be given a -distinguishing version number. The Program (including Contributions) -may always be distributed subject to the version of the Agreement -under which it was received. In addition, after a new version of the -Agreement is published, Contributor may elect to distribute the -Program (including its Contributions) under the new version. Except as -expressly stated in Sections 2(a) and 2(b) above, Recipient receives -no rights or licenses to the intellectual property of any Contributor -under this Agreement, whether expressly, by implication, estoppel or -otherwise. All rights in the Program not expressly granted under this -Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and -the intellectual property laws of the United States of America. No -party to this Agreement will bring a legal action under this Agreement -more than one year after the cause of action arose. Each party waives -its rights to a jury trial in any resulting litigation. - -=============================================================================== - -For the Rhino JavaScript container component: - -Mozilla Public License 1.1 (MPL 1.1) - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the -Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to -the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original Code, -prior Modifications used by a Contributor, and the Modifications made by that -particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the -combination of the Original Code and Modifications, in each case including -portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally -accepted in the software development community for the electronic transfer of -data. - - 1.5. "Executable" means Covered Code in any form other than Source -Code. - - 1.6. "Initial Developer" means the individual or entity identified as -the Initial Developer in the Source Code notice required by Exhibit A. - - 1.7. "Larger Work" means a work which combines Covered Code or -portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum -extent possible, whether at the time of the initial grant or subsequently -acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the -substance or structure of either the Original Code or any previous -Modifications. When Covered Code is released as a series of files, a -Modification is: - A. Any addition to or deletion from the contents of a file -containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or -previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code -which is described in the Source Code notice required by Exhibit A as Original -Code, and which, at the time of its release under this License is not already -Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or -hereafter acquired, including without limitation, method, process, and -apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for -making modifications to it, including all modules it contains, plus any -associated interface definition files, scripts used to control compilation and -installation of an Executable, or source code differential comparisons against -either the Original Code or another well known, available Covered Code of the -Contributor's choice. The Source Code can be in a compressed or archival form, -provided the appropriate decompression or de-archiving software is widely -available for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity -exercising rights under, and complying with all of the terms of, this License -or a future version of this License issued under Section 6.1. For legal -entities, "You" includes any entity which controls, is controlled by, or is -under common control with You. For purposes of this definition, "control" -means (a) the power, direct or indirect, to cause the direction or management -of such entity, whether by contract or otherwise, or (b) ownership of more -than fifty percent (50%) of the outstanding shares or beneficial ownership of -such entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - The Initial Developer hereby grants You a world-wide, royalty-free, -non-exclusive license, subject to third party intellectual property claims: - (a) under intellectual property rights (other than patent or -trademark) Licensable by Initial Developer to use, reproduce, modify, display, -perform, sublicense and distribute the Original Code (or portions thereof) -with or without Modifications, and/or as part of a Larger Work; and - - (b) under Patents Claims infringed by the making, using or selling -of Original Code, to make, have made, use, practice, sell, and offer for sale, -and/or otherwise dispose of the Original Code (or portions thereof). - (c) the licenses granted in this Section 2.1(a) and -(b) are effective on the date Initial Developer first distributes Original -Code under the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is -granted: 1) for code that You delete from the Original Code; 2) separate from -the Original Code; or 3) for infringements caused by: i) the modification of -the Original Code or ii) the combination of the Original Code with other -software or devices. - - 2.2. Contributor Grant. - Subject to third party intellectual property claims, each Contributor -hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or -trademark) Licensable by Contributor, to use, reproduce, modify, display, -perform, sublicense and distribute the Modifications created by such -Contributor (or portions thereof) either on an unmodified basis, with other -Modifications, as Covered Code and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, using, or selling -of Modifications made by that Contributor either alone and/or in combination -with its Contributor Version (or portions of such combination), to make, use, -sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications -made by that Contributor (or portions thereof); and 2) the combination of -Modifications made by that Contributor with its Contributor Version (or -portions of such combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are -effective on the date Contributor first makes Commercial Use of the Covered -Code. - - (d) Notwithstanding Section 2.2(b) above, no patent license is -granted: 1) for any code that Contributor has deleted from the Contributor -Version; 2) separate from the Contributor Version; 3) for infringements -caused by: i) third party modifications of Contributor Version or ii) the -combination of Modifications made by that Contributor with other software -(except as part of the Contributor Version) or other devices; or 4) under -Patent Claims infringed by Covered Code in the absence of Modifications made -by that Contributor. - - -3. Distribution Obligations. - - 3.1. Application of License. - The Modifications which You create or to which You contribute are -governed by the terms of this License, including without limitation Section -2.2. The Source Code version of Covered Code may be distributed only under the -terms of this License or a future version of this License released under -Section 6.1, and You must include a copy of this License with every copy of -the Source Code You distribute. You may not offer or impose any terms on any -Source Code version that alters or restricts the applicable version of this -License or the recipients' rights hereunder. However, You may include an -additional document offering the additional rights described in Section 3.5. - - 3.2. Availability of Source Code. - Any Modification which You create or to which You contribute must be -made available in Source Code form under the terms of this License either on -the same media as an Executable version or via an accepted Electronic -Distribution Mechanism to anyone to whom you made an Executable version -available; and if made available via Electronic Distribution Mechanism, must -remain available for at least twelve (12) months after the date it initially -became available, or at least six (6) months after a subsequent version of -that particular Modification has been made available to such recipients. You -are responsible for ensuring that the Source Code version remains available -even if the Electronic Distribution Mechanism is maintained by a third party. - - 3.3. Description of Modifications. - You must cause all Covered Code to which You contribute to contain a -file documenting the changes You made to create that Covered Code and the date -of any change. You must include a prominent statement that the Modification is -derived, directly or indirectly, from Original Code provided by the Initial -Developer and including the name of the Initial Developer in (a) the Source -Code, and (b) in any notice in an Executable version or related documentation -in which You describe the origin or ownership of the Covered Code. - - 3.4. Intellectual Property Matters - (a) Third Party Claims. - If Contributor has knowledge that a license under a third party's -intellectual property rights is required to exercise the rights granted by -such Contributor under Sections 2.1 or 2.2, Contributor must include a text -file with the Source Code distribution titled "LEGAL" which describes the -claim and the party making the claim in sufficient detail that a recipient -will know whom to contact. If Contributor obtains such knowledge after the -Modification is made available as described in Section 3.2, Contributor shall -promptly modify the LEGAL file in all copies Contributor makes available -thereafter and shall take other steps (such as notifying appropriate mailing -lists or newsgroups) reasonably calculated to inform those who received the -Covered Code that new knowledge has been obtained. - - (b) Contributor APIs. - If Contributor's Modifications include an application programming -interface and Contributor has knowledge of patent licenses which are -reasonably necessary to implement that API, Contributor must also include this -information in the LEGAL file. - - (c) Representations. - Contributor represents that, except as disclosed pursuant to -Section 3.4(a) above, Contributor believes that Contributor's Modifications -are Contributor's original creation(s) and/or Contributor has sufficient -rights to grant the rights conveyed by this License. - - - 3.5. Required Notices. - You must duplicate the notice in Exhibit A in each file of the Source -Code. If it is not possible to put such notice in a particular Source Code -file due to its structure, then You must include such notice in a location -(such as a relevant directory) where a user would be likely to look for such a -notice. If You created one or more Modification(s) You may add your name as a -Contributor to the notice described in Exhibit A. You must also duplicate -this License in any documentation for the Source Code where You describe -recipients' rights or ownership rights relating to Covered Code. You may -choose to offer, and to charge a fee for, warranty, support, indemnity or -liability obligations to one or more recipients of Covered Code. However, You -may do so only on Your own behalf, and not on behalf of the Initial Developer -or any Contributor. You must make it absolutely clear than any such warranty, -support, indemnity or liability obligation is offered by You alone, and You -hereby agree to indemnify the Initial Developer and every Contributor for any -liability incurred by the Initial Developer or such Contributor as a result of -warranty, support, indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - You may distribute Covered Code in Executable form only if the -requirements of Section 3.1-3.5 have been met for that Covered Code, and if -You include a notice stating that the Source Code version of the Covered Code -is available under the terms of this License, including a description of how -and where You have fulfilled the obligations of Section 3.2. The notice must -be conspicuously included in any notice in an Executable version, related -documentation or collateral in which You describe recipients' rights relating -to the Covered Code. You may distribute the Executable version of Covered Code -or ownership rights under a license of Your choice, which may contain terms -different from this License, provided that You are in compliance with the -terms of this License and that the license for the Executable version does not -attempt to limit or alter the recipient's rights in the Source Code version -from the rights set forth in this License. If You distribute the Executable -version under a different license You must make it absolutely clear that any -terms which differ from this License are offered by You alone, not by the -Initial Developer or any Contributor. You hereby agree to indemnify the -Initial Developer and every Contributor for any liability incurred by the -Initial Developer or such Contributor as a result of any such terms You offer. - - 3.7. Larger Works. - You may create a Larger Work by combining Covered Code with other code -not governed by the terms of this License and distribute the Larger Work as a -single product. In such a case, You must make sure the requirements of this -License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Code due to statute, -judicial order, or regulation then You must: (a) comply with the terms of this -License to the maximum extent possible; and (b) describe the limitations and -the code they affect. Such description must be included in the LEGAL file -described in Section 3.4 and must be included with all distributions of the -Source Code. Except to the extent prohibited by statute or regulation, such -description must be sufficiently detailed for a recipient of ordinary skill to -be able to understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has attached -the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - Netscape Communications Corporation ("Netscape") may publish revised -and/or new versions of the License from time to time. Each version will be -given a distinguishing version number. - - 6.2. Effect of New Versions. - Once Covered Code has been published under a particular version of the -License, You may always continue to use it under the terms of that version. -You may also choose to use such Covered Code under the terms of any subsequent -version of the License published by Netscape. No one other than Netscape has -the right to modify the terms applicable to Covered Code created under this -License. - - 6.3. Derivative Works. - If You create or use a modified version of this License (which you may -only do in order to apply it to code which is not already Covered Code -governed by this License), You must (a) rename Your license so that the -phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or -any confusingly similar phrase do not appear in your license (except to note -that your license differs from this License) and (b) otherwise make it clear -that Your version of the license contains terms which differ from the Mozilla -Public License and Netscape Public License. (Filling in the name of the -Initial Developer, Original Code or Contributor in the notice described in -Exhibit A shall not of themselves be deemed to be modifications of this -License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT -LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, -FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE -QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED -CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY -OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR -CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS -LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS -DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate -automatically if You fail to comply with terms herein and fail to cure such -breach within 30 days of becoming aware of the breach. All sublicenses to the -Covered Code which are properly granted shall survive any termination of this -License. Provisions which, by their nature, must remain in effect beyond the -termination of this License shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement -claim (excluding declatory judgment actions) against Initial Developer or a -Contributor (the Initial Developer or Contributor against whom You file such -action is referred to as "Participant") alleging that: - - (a) such Participant's Contributor Version directly or indirectly -infringes any patent, then any and all rights granted by such Participant to -You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice -from Participant terminate prospectively, unless if within 60 days after -receipt of notice You either: (i) agree in writing to pay Participant a -mutually agreeable reasonable royalty for Your past and future use of -Modifications made by such Participant, or (ii) withdraw Your litigation claim -with respect to the Contributor Version against such Participant. If within -60 days of notice, a reasonable royalty and payment arrangement are not -mutually agreed upon in writing by the parties or the litigation claim is not -withdrawn, the rights granted by Participant to You under Sections 2.1 and/or -2.2 automatically terminate at the expiration of the 60 day notice period -specified above. - - (b) any software, hardware, or device, other than such Participant's -Contributor Version, directly or indirectly infringes any patent, then any -rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are -revoked effective as of the date You first made, used, sold, distributed, or -had made, Modifications made by that Participant. - - 8.3. If You assert a patent infringement claim against Participant -alleging that such Participant's Contributor Version directly or indirectly -infringes any patent where such claim is resolved (such as by license or -settlement) prior to the initiation of patent infringement litigation, then -the reasonable value of the licenses granted by such Participant under -Sections 2.1 or 2.2 shall be taken into account in determining the amount or -value of any payment or license. - - 8.4. In the event of termination under Sections 8.1 or 8.2 above, all -end user license agreements (excluding distributors and resellers) which have -been validly granted by You or any distributor hereunder prior to termination -shall survive termination. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT -(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL -DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY -SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, -SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, -WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER -FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, -EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH -DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH -OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT -APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE -EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS -EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in 48 -C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and -"commercial computer software documentation," as such terms are used in 48 -C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. -227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users -acquire Covered Code with only those rights set forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject matter -hereof. If any provision of this License is held to be unenforceable, such -provision shall be reformed only to the extent necessary to make it -enforceable. This License shall be governed by California law provisions -(except to the extent applicable law, if any, provides otherwise), excluding -its conflict-of-law provisions. With respect to disputes in which at least one -party is a citizen of, or an entity chartered or registered to do business in -the United States of America, any litigation relating to this License shall be -subject to the jurisdiction of the Federal Courts of the Northern District of -California, with venue lying in Santa Clara County, California, with the -losing party responsible for costs, including without limitation, court costs -and reasonable attorneys' fees and expenses. The application of the United -Nations Convention on Contracts for the International Sale of Goods is -expressly excluded. Any law or regulation which provides that the language of -a contract shall be construed against the drafter shall not apply to this -License. - -12. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is -responsible for claims and damages arising, directly or indirectly, out of its -utilization of rights under this License and You agree to work with Initial -Developer and Contributors to distribute such responsibility on an equitable -basis. Nothing herein is intended or shall be deemed to constitute any -admission of liability. - -13. MULTIPLE-LICENSED CODE. - - Initial Developer may designate portions of the Covered Code as -Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits -you to utilize portions of the Covered Code under Your choice of the MPL or -the alternative licenses, if any, specified by the Initial Developer in the -file described in Exhibit A. - - -EXHIBIT A -Mozilla Public License. - - ``The contents of this file are subject to the Mozilla Public License -Version 1.1 (the "License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF - ANY KIND, either express or implied. See the License for the specific -language governing rights and - limitations under the License. - - The Original Code is ______________________________________. - - The Initial Developer of the Original Code is ________________________. -Portions created by - ______________________ are Copyright (C) ______ -_______________________. All Rights - Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the terms of -the _____ license (the [___] License), in which case the provisions of -[______] License are applicable instead of those above. If you wish to allow -use of your version of this file only under the terms of the [____] License -and not to allow others to use your version of this file under the MPL, -indicate your decision by deleting the provisions above and replace them -with the notice and other provisions required by the [___] License. If you do -not delete the provisions above, a recipient may use your version of this file -under either the MPL or the [___] License." - - [NOTE: The text of this Exhibit A may differ slightly from the text of -the notices in the Source Code files of the Original Code. You should use the -text of this Exhibit A rather than the text found in the Original Code Source -Code for Your Modifications.] - - -=============================================================================== - -For the JAX-WS Reference Implementation component: - -COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 - - - 1. Definitions. - - 1.1. "Contributor" means each individual or entity that - creates or contributes to the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the - Original Software, prior Modifications used by a - Contributor (if any), and the Modifications made by that - particular Contributor. - - 1.3. "Covered Software" means (a) the Original Software, or - (b) Modifications, or (c) the combination of files - containing Original Software with files containing - Modifications, in each case including portions thereof. - - 1.4. "Executable" means the Covered Software in any form - other than Source Code. - - 1.5. "Initial Developer" means the individual or entity - that first makes Original Software available under this - License. - - 1.6. "Larger Work" means a work which combines Covered - Software or portions thereof with code not governed by the - terms of this License. - - 1.7. "License" means this document. - - 1.8. "Licensable" means having the right to grant, to the - maximum extent possible, whether at the time of the initial - grant or subsequently acquired, any and all of the rights - conveyed herein. - - 1.9. "Modifications" means the Source Code and Executable - form of any of the following: - - A. Any file that results from an addition to, - deletion from or modification of the contents of a - file containing Original Software or previous - Modifications; - - B. Any new file that contains any part of the - Original Software or previous Modification; or - - C. Any new file that is contributed or otherwise made - available under the terms of this License. - - 1.10. "Original Software" means the Source Code and - Executable form of computer software code that is - originally released under this License. - - 1.11. "Patent Claims" means any patent claim(s), now owned - or hereafter acquired, including without limitation, - method, process, and apparatus claims, in any patent - Licensable by grantor. - - 1.12. "Source Code" means (a) the common form of computer - software code in which modifications are made and (b) - associated documentation included in or with such code. - - 1.13. "You" (or "Your") means an individual or a legal - entity exercising rights under, and complying with all of - the terms of, this License. For legal entities, "You" - includes any entity which controls, is controlled by, or is - under common control with You. For purposes of this - definition, "control" means (a) the power, direct or - indirect, to cause the direction or management of such - entity, whether by contract or otherwise, or (b) ownership - of more than fifty percent (50%) of the outstanding shares - or beneficial ownership of such entity. - - 2. License Grants. - - 2.1. The Initial Developer Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, the - Initial Developer hereby grants You a world-wide, - royalty-free, non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Initial Developer, - to use, reproduce, modify, display, perform, - sublicense and distribute the Original Software (or - portions thereof), with or without Modifications, - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, - using or selling of Original Software, to make, have - made, use, practice, sell, and offer for sale, and/or - otherwise dispose of the Original Software (or - portions thereof). - - (c) The licenses granted in Sections 2.1(a) and (b) - are effective on the date Initial Developer first - distributes or otherwise makes the Original Software - available to a third party under the terms of this - License. - - (d) Notwithstanding Section 2.1(b) above, no patent - license is granted: (1) for code that You delete from - the Original Software, or (2) for infringements - caused by: (i) the modification of the Original - Software, or (ii) the combination of the Original - Software with other software or devices. - - 2.2. Contributor Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, each - Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Contributor to - use, reproduce, modify, display, perform, sublicense - and distribute the Modifications created by such - Contributor (or portions thereof), either on an - unmodified basis, with other Modifications, as - Covered Software and/or as part of a Larger Work; and - - - (b) under Patent Claims infringed by the making, - using, or selling of Modifications made by that - Contributor either alone and/or in combination with - its Contributor Version (or portions of such - combination), to make, use, sell, offer for sale, - have made, and/or otherwise dispose of: (1) - Modifications made by that Contributor (or portions - thereof); and (2) the combination of Modifications - made by that Contributor with its Contributor Version - (or portions of such combination). - - (c) The licenses granted in Sections 2.2(a) and - 2.2(b) are effective on the date Contributor first - distributes or otherwise makes the Modifications - available to a third party. - - (d) Notwithstanding Section 2.2(b) above, no patent - license is granted: (1) for any code that Contributor - has deleted from the Contributor Version; (2) for - infringements caused by: (i) third party - modifications of Contributor Version, or (ii) the - combination of Modifications made by that Contributor - with other software (except as part of the - Contributor Version) or other devices; or (3) under - Patent Claims infringed by Covered Software in the - absence of Modifications made by that Contributor. - - 3. Distribution Obligations. - - 3.1. Availability of Source Code. - - Any Covered Software that You distribute or otherwise make - available in Executable form must also be made available in - Source Code form and that Source Code form must be - distributed only under the terms of this License. You must - include a copy of this License with every copy of the - Source Code form of the Covered Software You distribute or - otherwise make available. You must inform recipients of any - such Covered Software in Executable form as to how they can - obtain such Covered Software in Source Code form in a - reasonable manner on or through a medium customarily used - for software exchange. - - 3.2. Modifications. - - The Modifications that You create or to which You - contribute are governed by the terms of this License. You - represent that You believe Your Modifications are Your - original creation(s) and/or You have sufficient rights to - grant the rights conveyed by this License. - - 3.3. Required Notices. - - You must include a notice in each of Your Modifications - that identifies You as the Contributor of the Modification. - You may not remove or alter any copyright, patent or - trademark notices contained within the Covered Software, or - any notices of licensing or any descriptive text giving - attribution to any Contributor or the Initial Developer. - - 3.4. Application of Additional Terms. - - You may not offer or impose any terms on any Covered - Software in Source Code form that alters or restricts the - applicable version of this License or the recipients' - rights hereunder. You may choose to offer, and to charge a - fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Software. - However, you may do so only on Your own behalf, and not on - behalf of the Initial Developer or any Contributor. You - must make it absolutely clear that any such warranty, - support, indemnity or liability obligation is offered by - You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred - by the Initial Developer or such Contributor as a result of - warranty, support, indemnity or liability terms You offer. - - - 3.5. Distribution of Executable Versions. - - You may distribute the Executable form of the Covered - Software under the terms of this License or under the terms - of a license of Your choice, which may contain terms - different from this License, provided that You are in - compliance with the terms of this License and that the - license for the Executable form does not attempt to limit - or alter the recipient's rights in the Source Code form - from the rights set forth in this License. If You - distribute the Covered Software in Executable form under a - different license, You must make it absolutely clear that - any terms which differ from this License are offered by You - alone, not by the Initial Developer or Contributor. You - hereby agree to indemnify the Initial Developer and every - Contributor for any liability incurred by the Initial - Developer or such Contributor as a result of any such terms - You offer. - - 3.6. Larger Works. - - You may create a Larger Work by combining Covered Software - with other code not governed by the terms of this License - and distribute the Larger Work as a single product. In such - a case, You must make sure the requirements of this License - are fulfilled for the Covered Software. - - 4. Versions of the License. - - 4.1. New Versions. - - Sun Microsystems, Inc. is the initial license steward and - may publish revised and/or new versions of this License - from time to time. Each version will be given a - distinguishing version number. Except as provided in - Section 4.3, no one other than the license steward has the - right to modify this License. - - 4.2. Effect of New Versions. - - You may always continue to use, distribute or otherwise - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. If the Initial Developer includes a - notice in the Original Software prohibiting it from being - distributed or otherwise made available under any - subsequent version of the License, You must distribute and - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. Otherwise, You may also choose to - use, distribute or otherwise make the Covered Software - available under the terms of any subsequent version of the - License published by the license steward. - - 4.3. Modified Versions. - - When You are an Initial Developer and You want to create a - new license for Your Original Software, You may create and - use a modified version of this License if You: (a) rename - the license and remove any references to the name of the - license steward (except to note that the license differs - from this License); and (b) otherwise make it clear that - the license contains terms which differ from this License. - - - 5. DISCLAIMER OF WARRANTY. - - COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" - BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, - INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED - SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR - PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND - PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY - COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE - INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF - ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF - WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS - DISCLAIMER. - - 6. TERMINATION. - - 6.1. This License and the rights granted hereunder will - terminate automatically if You fail to comply with terms - herein and fail to cure such breach within 30 days of - becoming aware of the breach. Provisions which, by their - nature, must remain in effect beyond the termination of - this License shall survive. - - 6.2. If You assert a patent infringement claim (excluding - declaratory judgment actions) against Initial Developer or - a Contributor (the Initial Developer or Contributor against - whom You assert such claim is referred to as "Participant") - alleging that the Participant Software (meaning the - Contributor Version where the Participant is a Contributor - or the Original Software where the Participant is the - Initial Developer) directly or indirectly infringes any - patent, then any and all rights granted directly or - indirectly to You by such Participant, the Initial - Developer (if the Initial Developer is not the Participant) - and all Contributors under Sections 2.1 and/or 2.2 of this - License shall, upon 60 days notice from Participant - terminate prospectively and automatically at the expiration - of such 60 day notice period, unless if within such 60 day - period You withdraw Your claim with respect to the - Participant Software against such Participant either - unilaterally or pursuant to a written agreement with - Participant. - - 6.3. In the event of termination under Sections 6.1 or 6.2 - above, all end user licenses that have been validly granted - by You or any distributor hereunder prior to termination - (excluding licenses granted to You by any distributor) - shall survive termination. - - 7. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE - INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF - COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE - LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR - CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT - LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK - STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL - INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT - APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO - NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR - CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT - APPLY TO YOU. - - 8. U.S. GOVERNMENT END USERS. - - The Covered Software is a "commercial item," as that term is - defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial - computer software" (as that term is defined at 48 C.F.R. - 252.227-7014(a)(1)) and "commercial computer software - documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. - 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 - through 227.7202-4 (June 1995), all U.S. Government End Users - acquire Covered Software with only those rights set forth herein. - This U.S. Government Rights clause is in lieu of, and supersedes, - any other FAR, DFAR, or other clause or provision that addresses - Government rights in computer software under this License. - - 9. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the - extent necessary to make it enforceable. This License shall be - governed by the law of the jurisdiction specified in a notice - contained within the Original Software (except to the extent - applicable law, if any, provides otherwise), excluding such - jurisdiction's conflict-of-law provisions. Any litigation - relating to this License shall be subject to the jurisdiction of - the courts located in the jurisdiction and venue specified in a - notice contained within the Original Software, with the losing - party responsible for costs, including, without limitation, court - costs and reasonable attorneys' fees and expenses. The - application of the United Nations Convention on Contracts for the - International Sale of Goods is expressly excluded. Any law or - regulation which provides that the language of a contract shall - be construed against the drafter shall not apply to this License. - You agree that You alone are responsible for compliance with the - United States export administration regulations (and the export - control laws and regulation of any other countries) when You use, - distribute or otherwise make available any Covered Software. - - 10. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or - indirectly, out of its utilization of rights under this License - and You agree to work with Initial Developer and Contributors to - distribute such responsibility on an equitable basis. Nothing - herein is intended or shall be deemed to constitute any admission - of liability. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/resources/META-INF/NOTICE b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/resources/META-INF/NOTICE deleted file mode 100644 index d48810c0ec..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/resources/META-INF/NOTICE +++ /dev/null @@ -1,18 +0,0 @@ -========================================================================= -== NOTICE file corresponding to the section 4 d of == -== the Apache License, Version 2.0, == -== in this case for the Apache Tuscany distribution. == -========================================================================= - -This product includes software developed by the Apache Software Foundation -(http://www.apache.org/). - -This product also includes software developed by: -- the Eclipse Modeling Framework project (http://www.eclipse.org/emf/) -- the Celtix project (http://celtix.objectweb.org/) -- the Mozilla Rhino project (http://www.mozilla.org/rhino/) -- the GlassFish JAX-WS project (https://jax-ws.dev.java.net/) - -Please read the LICENSE.txt file present in the root directory of this -distribution. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/resources/META-INF/README.txt b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/resources/META-INF/README.txt deleted file mode 100644 index 9b26d1690a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/resources/META-INF/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -Apache Tuscany M1 build (May, 2006) -=================================== - -http://incubator.apache.org/tuscany/ - -Tuscany is an effort undergoing incubation at the Apache Software Foundation -(ASF), sponsored by the Web Services PMC. - -Incubation is required of all newly accepted projects until a further review -indicates that the infrastructure, communications, and decision making process -have stabilized in a manner consistent with other successful ASF projects. - -While incubation status is not necessarily a reflection of the completeness or -stability of the code, it does indicate that the project has yet to be fully -endorsed by the ASF. - - -Support -------- - -Any problem with this release can be reported to the Tuscany mailing list -or in the JIRA issue tracker. - -Mailing list subscription: - tuscany-dev-subscribe@ws.apache.org - -Jira: - http://issues.apache.org/jira/browse/Tuscany - - -Thank you for using Tuscany! - - -The Tuscany Team. - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/resources/RemotableInterfaceTemplate.xsl b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/resources/RemotableInterfaceTemplate.xsl deleted file mode 100644 index e3da5da20f..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/main/resources/RemotableInterfaceTemplate.xsl +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - - - - - /** - * .java - * - * This file was auto-generated from WSDL - * by the Apache Axis2 version: #axisVersion# #today# - */ - package ; - - import org.osoa.sca.annotations.Remotable; - import org.apache.tuscany.api.annotation.DataType; - - /* - * java interface - */ - - @Remotable - @DataType(name="commonj.sdo.DataObject") - public interface { - - - - - - - - /** - * Auto generated method signatures - * @param - */ - public void - ( - - , - ) throws java.rmi.RemoteException; - - - - - - /** - * Auto generated method signature - * @param - */ - - public void start( - - - , - ,final . callback) throws java.rmi.RemoteException; - - - - - - - - - /** - * Auto generated method signature - - *@param - - */ - public void - ( - - , - - ) throws java.rmi.RemoteException; - - - - - - // - } - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.java deleted file mode 100644 index e679496509..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerValue.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.tools.java2wsdl.generate; - -import org.apache.tuscany.tools.java2wsdl.generate.customer.Customer; - -public class CustomerValue { - - public int getValue(String custId, String stockSymbol) { - return 0; - } - - public Customer getCustomerDetails(String custId) { - return new Customer(); - } - - public String noArgsServiceMethod() - { - return new String(); - } - - private void privateServiceMethod() - { - - } - -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.java deleted file mode 100644 index 4b5a795f2c..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/CustomerWithAccount.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.tools.java2wsdl.generate; - -import org.apache.tuscany.tools.java2wsdl.generate.account.Account; -import org.apache.tuscany.tools.java2wsdl.generate.customer.Customer; - -public class CustomerWithAccount { - - private Customer customer = new Customer(); - - private Account[] accounts; - - public int getValue(String custId, String stockSymbol) { - return 123; - } - - public Customer getCustomerDetails(String custId) { - return customer; - } - - public Account getCustomerAccount(String custId, String accountId) { - return accounts[0]; - } - - public Account[] getAccounts() { - return accounts; - } - - public void setAccounts(Account[] accounts) { - this.accounts = accounts; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.java deleted file mode 100644 index a72321c9b1..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/TuscanyJava2WSDLTestCase.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.tools.java2wsdl.generate; - -import java.io.File; - -import junit.framework.TestCase; - -/** - * A JUnit test case to test the Tuscany Java 2 WSDL Generation - */ -public class TuscanyJava2WSDLTestCase extends TestCase { - - /** - * setup the pre-requisites for the test case to run - * - * @exception Exception - */ - protected void setUp() throws Exception { - // System.out.println("inside setup"); - super.setUp(); - } - - /** - * @exception Exception - */ - protected void tearDown() throws Exception { - // System.out.println("inside tearDown"); - super.tearDown(); - } - - - /** - * Simple WSDL generation test. - */ - public void testSimpleWSDLGeneration() { - String[] arguments = new String[] { "-cn","org.apache.tuscany.tools.java2wsdl.generate.CustomerValue", - "-o", "target/java2wsdl-source", - "-xc", "org.apache.tuscany.tools.java2wsdl.generate.extra.GoldCustomer"}; - - - Java2WSDL.main(arguments); - - File file = new File("target/java2wsdl-source/CustomerValue.wsdl"); - assertTrue(file.exists() && file.isFile()); - } - - /** - * Test WSDL generation where a parameter Object[] is involved. - */ - public void testWsdlGeneration2() { - - String[] arguments = new String[] - { - "-cn", - "org.apache.tuscany.tools.java2wsdl.generate.CustomerWithAccount", - "-o", "target/java2wsdl-source", }; - Java2WSDL.main(arguments); - - File file = new File("target/java2wsdl-source/CustomerWithAccount.wsdl"); - assertTrue(file.exists() && file.isFile()); - } - - public void testWsdlGeneration_SDO_Static() - { - //tests for SDOs where XSD exist. Hence no XSDs must be generated - String[] arguments = new String[] { - "-cn", - "org.soapinterop.CreditScoreDocLit", - "-o", "target/java2wsdl-source", - "-ixsd", "[http://www.example.org/creditscore/doclit/," + - "http://www.example.org/creditscore/doclit/xsd]"}; - Java2WSDL.main(arguments); - - File file = new File("target/java2wsdl-source/CreditScoreDocLit.wsdl"); - assertTrue(file.exists() && file.isFile()); - } - - - - /** - * Test WSDL generation from a java interface and then generate the java - * interface using the generated WSDL. - */ - public void _testRoundTrip() { - // TODO implement round trip - // this should re-generate java interfaces from the generated wsdl - // and compile (?) the generated java code. - // fail(); - - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.java deleted file mode 100644 index 84d59164ee..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/account/Account.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.tools.java2wsdl.generate.account; - -import java.math.BigDecimal; - -public class Account { - int accountType; - - String accountNo; - - BigDecimal balance; - - public String getAccountNo() { - return accountNo; - } - - public void setAccountNo(String accountNo) { - this.accountNo = accountNo; - } - - public int getAccountType() { - return accountType; - } - - public void setAccountType(int accountType) { - this.accountType = accountType; - } - - public BigDecimal getBalance() { - return balance; - } - - public void setBalance(BigDecimal balance) { - this.balance = balance; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.java deleted file mode 100644 index a28399e7fe..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/customer/Customer.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.tools.java2wsdl.generate.customer; - -public class Customer { - private String name = ""; - - public int custType = 0; - - public String getName() { - return name; - } -} - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.java deleted file mode 100644 index afc68a3217..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/java2wsdl/generate/extra/GoldCustomer.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.tools.java2wsdl.generate.extra; - -import org.apache.tuscany.tools.java2wsdl.generate.customer.Customer; - - - - -public class GoldCustomer extends Customer { - public String goldCustNumber = ""; - - public String getGoldCustNumber() { - return goldCustNumber; - } - - public void setGoldCustNumber(String goldCustNumber) { - this.goldCustNumber = goldCustNumber; - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGeneratorTestCase.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGeneratorTestCase.java deleted file mode 100644 index e2a2d332c5..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/apache/tuscany/tools/wsdl2java/generate/WSDL2JavaGeneratorTestCase.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.tools.wsdl2java.generate; - -import java.io.IOException; -import java.io.FileReader; -import java.io.Reader; - -import junit.framework.TestCase; - -/** - * Test case for WSDL2Java - */ -public class WSDL2JavaGeneratorTestCase extends TestCase { - - public void testAccountService() { - - String basedir = System.getProperty("basedir"); - if (basedir == null) - basedir ="."; - - - String[] args=new String[] { "-targetDirectory", basedir + "/target/wsdl2java-source", - "-javaPackage", "org.apache.tuscany.tools.wsdl2java.generate.account", - basedir + "/src/test/resources/AccountService.wsdl"}; - - WSDL2JavaGenerator.main(args); - - } - - public void testDynamicSDO() throws IOException { - String basedir = System.getProperty("basedir"); - if (basedir == null) - basedir ="."; - - String[] args=new String[] { "-targetDirectory", basedir + "/target/wsdl2java-source", - "-javaPackage", "org.apache.tuscany.tools.wsdl2java.generate.account", - "-dynamicSDO", - basedir + "/src/test/resources/AccountService.wsdl"}; - - WSDL2JavaGenerator.main(args); - - char buffer[] = new char[1024]; - Reader file = new FileReader("target/wsdl2java-source/org/apache/tuscany/tools/wsdl2java/generate/account/AccountService.java"); - file.read(buffer); - file.close(); - assertTrue(new String(buffer).indexOf("commonj.sdo.DataObject") != -1); - } -} diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/soapinterop/CreditScoreDocLit.java b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/soapinterop/CreditScoreDocLit.java deleted file mode 100644 index e9e8aa882a..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/java/org/soapinterop/CreditScoreDocLit.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 org.soapinterop; - -public interface CreditScoreDocLit { - public org.example.creditscore.doclit.CreditReport getCreditScore( - org.example.creditscore.doclit.Customer param0) throws java.rmi.RemoteException; - } - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/AccountService.wsdl b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/AccountService.wsdl deleted file mode 100644 index e7be3ce5ba..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/AccountService.wsdl +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/CreditScoreDocLit.wsdl b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/CreditScoreDocLit.wsdl deleted file mode 100644 index 09d1a58589..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/CreditScoreDocLit.wsdl +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/helloworld.wsdl b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/helloworld.wsdl deleted file mode 100644 index 051f604bb2..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/helloworld.wsdl +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/interopdoc.wsdl b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/interopdoc.wsdl deleted file mode 100644 index 820c26ca34..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/interopdoc.wsdl +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/sequences.xsd b/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/sequences.xsd deleted file mode 100644 index a565f3fa65..0000000000 --- a/branches/sca-java-integration/sca/extensions/axis2/tools/wsdl2java/src/test/resources/sequences.xsd +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/LICENSE.txt b/branches/sca-java-integration/sca/extensions/jms/binding/LICENSE.txt deleted file mode 100644 index 5f6ab3e05c..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/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-integration/sca/extensions/jms/binding/NOTICE.txt b/branches/sca-java-integration/sca/extensions/jms/binding/NOTICE.txt deleted file mode 100644 index ecc68a9614..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/NOTICE.txt +++ /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-integration/sca/extensions/jms/binding/pom.xml b/branches/sca-java-integration/sca/extensions/jms/binding/pom.xml deleted file mode 100644 index 623d04348e..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/pom.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - org.apache.tuscany.sca.extensions.jms - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - tuscany-jms - Apache Tuscany Binding for JMS - Implementation of the SCA JMS Binding - - - - - geronimo-spec - geronimo-spec-jms - - - - activemq - activemq-core - - - - geronimo-spec - geronimo-spec-j2ee-management - - - - org.apache.tuscany.sca.kernel - tuscany-spi - - - - org.apache.tuscany.sca.services.idl - tuscany-wsdl - - - - org.apache.tuscany.sca.extensions.axis2 - databinding-axiom - ${extensionVersion} - compile - - - - - org.easymock - easymock - - - - junit - junit - 4.2 - test - - - - xmlunit - xmlunit - 1.0 - test - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/DefaultOperationAndDataBinding.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/DefaultOperationAndDataBinding.java deleted file mode 100644 index c96bb76b1b..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/DefaultOperationAndDataBinding.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.jms; - -import java.io.Serializable; -import java.io.StringReader; - -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.ObjectMessage; -import javax.jms.Session; -import javax.jms.TextMessage; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.impl.builder.StAXOMBuilder; - -public class DefaultOperationAndDataBinding implements OperationAndDataBinding { - - protected String operationPropertyName; - - private boolean xmlFormat; - - public DefaultOperationAndDataBinding(JMSBindingDefinition jmsBinding) { - this.operationPropertyName = jmsBinding.getOperationSelectorPropertyName(); - this.xmlFormat = jmsBinding.isXMLFormat(); - } - - /* - * (non-Javadoc) - * - * @see org.apache.tuscany.binding.jms.OperationAndDataBinding#getOperationName(javax.jms.Message) - */ - public String getOperationName(Message message) { - try { - - return message.getStringProperty(operationPropertyName); - - } catch (JMSException e) { - throw new JMSBindingException("Exception retreiving operation name from message", e); - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.tuscany.binding.jms.OperationAndDataBinding#setOperationName(javax.jms.Message, - * java.lang.String) - */ - public void setOperationName(String operationName, Message message) { - try { - - message.setStringProperty(operationPropertyName, operationName); - - } catch (JMSException e) { - throw new JMSBindingException("Exception setting the operation name on message", e); - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.tuscany.binding.jms.OperationAndDataBinding#extractPayload(javax.jms.Session, - * java.lang.Object) - */ - public Message createJMSMessage(Session session, Object o) { - if (xmlFormat) { - return createXMLJMSMessage(session, o); - } else { - return createObjectJMSMessage(session, o); - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.tuscany.binding.jms.OperationAndDataBinding#extractPayload(javax.jms.Message) - */ - public Object extractPayload(Message msg) { - if (xmlFormat) { - return extractXMLPayload(msg); - } else { - return extractObjectPayload(msg); - } - } - - protected Object extractXMLPayload(Message msg) { - try { - - String xml = ((TextMessage)msg).getText(); - - XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xml)); - StAXOMBuilder builder = new StAXOMBuilder(reader); - OMElement omElement = builder.getDocumentElement(); - - return new Object[] {omElement}; - - } catch (XMLStreamException e) { - throw new JMSBindingException(e); - } catch (JMSException e) { - throw new JMSBindingException(e); - } - } - - protected Message createXMLJMSMessage(Session session, Object o) { - try { - - TextMessage message = session.createTextMessage(); - - if (o instanceof OMElement) { - message.setText(o.toString()); - } else { - message.setText(((Object[])o)[0].toString()); - } - - return message; - - } catch (JMSException e) { - throw new JMSBindingException(e); - } - } - - protected Object extractObjectPayload(Message msg) { - try { - - return ((ObjectMessage)msg).getObject(); - - } catch (JMSException e) { - throw new JMSBindingException(e); - } - } - - protected Message createObjectJMSMessage(Session session, Object o) { - try { - - ObjectMessage message = session.createObjectMessage(); // default - message.setObject((Serializable)o); - return message; - - } catch (JMSException e) { - throw new JMSBindingException(e); - } - } -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSBindingBuilder.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSBindingBuilder.java deleted file mode 100644 index c0bf6ea225..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSBindingBuilder.java +++ /dev/null @@ -1,177 +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.binding.jms; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import javax.jms.Destination; -import javax.naming.NamingException; - -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.component.ServiceBinding; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.extension.BindingBuilderExtension; -import org.apache.tuscany.spi.model.AbstractReferenceDefinition; -import org.apache.tuscany.spi.model.ServiceDefinition; -import org.apache.tuscany.spi.model.ServiceContract; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.idl.wsdl.WSDLServiceContract; - -/** - * Builds a Service or Reference for JMS binding. - * - * @version $Rev: 449970 $ $Date: 2006-09-26 06:05:35 -0400 (Tue, 26 Sep 2006) $ - */ - -public class JMSBindingBuilder extends BindingBuilderExtension { - - private static final String DEFAULT_JMS_RESOURCE_FACTORY = - "org.apache.tuscany.binding.jms.SimpleJMSResourceFactory"; - - private static final String OM_DATA_BINDING = OMElement.class.getName(); - - protected Class getBindingType() { - return JMSBindingDefinition.class; - } - - public ServiceBinding build(CompositeComponent parent, - ServiceDefinition serviceDefinition, - JMSBindingDefinition jmsBinding, - DeploymentContext deploymentContext) { - - Class interfaze = serviceDefinition.getServiceContract().getInterfaceClass(); - - ServiceContract serviceContract = serviceDefinition.getServiceContract(); - jmsBinding.setXMLFormat(serviceContract instanceof WSDLServiceContract); - - JMSResourceFactory jmsResourceFactory = getJMSResourceFactory(jmsBinding); - - if (serviceContract instanceof WSDLServiceContract) { - serviceContract.setDataBinding(OM_DATA_BINDING); - } - - OperationAndDataBinding requestODB = - getRequestOperationAndDatabinding(jmsBinding, deploymentContext.getClassLoader()); - OperationAndDataBinding responseODB = - getRequestOperationAndDatabinding(jmsBinding, deploymentContext.getClassLoader()); - - return new JMSServiceBinding(serviceDefinition.getName(), parent, jmsBinding, jmsResourceFactory, - serviceContract, requestODB, responseODB, interfaze); - } - - public JMSReferenceBinding build(CompositeComponent parent, - AbstractReferenceDefinition referenceDefinition, - JMSBindingDefinition jmsBinding, - DeploymentContext deploymentContext) { - - String name = referenceDefinition.getName(); - ServiceContract serviceContract; - try { - serviceContract = (ServiceContract) referenceDefinition.getServiceContract().clone(); - } catch (CloneNotSupportedException e) { - throw new JMSBindingException("Couldn't clone the Service Contract", e); - } - serviceContract.setDataBinding(OM_DATA_BINDING); - - JMSResourceFactory jmsResourceFactory = getJMSResourceFactory(jmsBinding); - - Destination requestDest; - Destination replyDest = null; - try { - requestDest = jmsResourceFactory.lookupDestination(jmsBinding.getDestinationName()); - if (jmsBinding.getResponseDestinationName() != null) { - replyDest = jmsResourceFactory.lookupDestination(jmsBinding.getResponseDestinationName()); - } - } catch (NamingException e) { - throw new JMSBindingException(e); - } - - OperationAndDataBinding requestODB = - getRequestOperationAndDatabinding(jmsBinding, deploymentContext.getClassLoader()); - OperationAndDataBinding responseODB = - getRequestOperationAndDatabinding(jmsBinding, deploymentContext.getClassLoader()); - - return new JMSReferenceBinding(name, parent, jmsBinding, jmsResourceFactory, serviceContract, requestODB, responseODB, - requestDest, replyDest); - - } - - private JMSResourceFactory getJMSResourceFactory(JMSBindingDefinition jmsBinding) { - String className = jmsBinding.getJmsResourceFactoryName(); - if (className != null && !className.equals("")) { - try { - Class factoryClass = Class.forName(className != null ? className : DEFAULT_JMS_RESOURCE_FACTORY); - Constructor constructor = factoryClass.getDeclaredConstructor(new Class[]{JMSBindingDefinition.class}); - return (JMSResourceFactory) constructor.newInstance(jmsBinding); - } catch (ClassNotFoundException e) { - throw new JMSBindingException("Error loading the JMSResourceFactory", e); - } catch (SecurityException e) { - throw new JMSBindingException("Error loading the JMSResourceFactory", e); - } catch (NoSuchMethodException e) { - throw new JMSBindingException("Error loading the JMSResourceFactory", e); - } catch (IllegalArgumentException e) { - throw new JMSBindingException("Error loading the JMSResourceFactory", e); - } catch (InstantiationException e) { - throw new JMSBindingException("Error loading the JMSResourceFactory", e); - } catch (IllegalAccessException e) { - throw new JMSBindingException("Error loading the JMSResourceFactory", e); - } catch (InvocationTargetException e) { - throw new JMSBindingException("Error loading the JMSResourceFactory", e); - } - } else { - return new SimpleJMSResourceFactory(jmsBinding); - } - - } - - protected OperationAndDataBinding getRequestOperationAndDatabinding(JMSBindingDefinition jmsBinding, - ClassLoader cl) { - String className = jmsBinding.getRequestOperationAndDatabindingName(); - OperationAndDataBinding operationAndDataBinding = instantiateClass(jmsBinding, cl, className); - return operationAndDataBinding; - } - - protected OperationAndDataBinding getResponseOperationAndDatabinding(JMSBindingDefinition jmsBinding, - ClassLoader cl) { - String className = jmsBinding.getResponseOperationAndDatabindingName(); - OperationAndDataBinding operationAndDataBinding = instantiateClass(jmsBinding, cl, className); - return operationAndDataBinding; - } - - protected OperationAndDataBinding instantiateClass(JMSBindingDefinition jmsBinding, ClassLoader cl, - String className) { - OperationAndDataBinding operationAndDataBinding; - if (cl == null) { - cl = this.getClass().getClassLoader(); - } - try { - Class clazz; - try { - clazz = cl.loadClass(className); - } catch (ClassNotFoundException e) { - clazz = this.getClass().getClassLoader().loadClass(className); - } - Constructor constructor = clazz.getDeclaredConstructor(new Class[]{JMSBindingDefinition.class}); - operationAndDataBinding = (OperationAndDataBinding) constructor.newInstance(jmsBinding); - - } catch (Throwable e) { - throw new JMSBindingException("Exception instantiating OperationAndDataBinding class", e); - } - return operationAndDataBinding; - } -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSBindingDefinition.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSBindingDefinition.java deleted file mode 100644 index c1ad28c272..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSBindingDefinition.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.jms; - -import javax.jms.DeliveryMode; - -import org.apache.tuscany.spi.model.BindingDefinition; - -/** - * Represents a binding to a JMS resource. - */ - -public class JMSBindingDefinition extends BindingDefinition { - - public final static int DESTINATION_TYPE_QUEUE = 0; - public final static int DESTINATION_TYPE_TOPIC = 1; - - private int destinationType = DESTINATION_TYPE_QUEUE; - - private String destinationName; - - // Topic or Query factory name - private String connectionFactoryName; - - private String activationSpecName; - - private String initialContextFactoryName; // "org.apache.activemq.jndi.ActiveMQInitialContextFactory" - - private String jNDIProviderURL; // "tcp://hostname:61616" - - // Maps to javax.jms.DeliveryMode - private int deliveryMode = DeliveryMode.NON_PERSISTENT; - - private int timeToLive = 1000; // in mili seconds - - private int priority; - - private String replyTo; - - private String jmsResourceFactoryName; - - private String operationSelectorName; - - private String operationSelectorPropertyName = DEFAULT_OPERATION_PROP_NAME; - - private String correlationScheme; - private String responseDestinationName; - - private String requestOperationAndDatabindingName = DEFAULT_ODB_CLASSNAME; - private String responseOperationAndDatabindingName = DEFAULT_ODB_CLASSNAME; - - private boolean xmlFormat; - - public static final String DEFAULT_ODB_CLASSNAME = DefaultOperationAndDataBinding.class.getName(); - public static final String DEFAULT_OPERATION_PROP_NAME = "scaOperationName"; - - public JMSBindingDefinition(int destinationType, - String destinationName, - String connectionFactoryName, - String activationSpecName, - String initialContextFactoryName, - String providerURL, - int deliveryMode, - int timeToLive, - int priority, - String replyTo) { - super(); - this.destinationType = destinationType; - this.destinationName = destinationName; - this.connectionFactoryName = connectionFactoryName; - this.activationSpecName = activationSpecName; - this.initialContextFactoryName = initialContextFactoryName; - this.jNDIProviderURL = providerURL; - this.deliveryMode = deliveryMode; - this.timeToLive = timeToLive; - this.priority = priority; - this.replyTo = replyTo; - } - - public JMSBindingDefinition() { - super(); - } - - public String getActivationSpecName() { - return activationSpecName; - } - - public void setActivationSpecName(String activationSpecName) { - this.activationSpecName = activationSpecName; - } - - public String getConnectionFactoryName() { - return connectionFactoryName; - } - - public void setConnectionFactoryName(String connectionFactoryName) { - this.connectionFactoryName = connectionFactoryName; - } - - public int getDeliveryMode() { - return deliveryMode; - } - - public void setDeliveryMode(int deliveryMode) { - this.deliveryMode = deliveryMode; - } - - public String getDestinationName() { - return destinationName; - } - - public void setDestinationName(String destinationName) { - this.destinationName = destinationName; - } - - public String getInitialContextFactoryName() { - return initialContextFactoryName; - } - - public void setInitialContextFactoryName(String initialContextFactoryName) { - this.initialContextFactoryName = initialContextFactoryName; - } - - public String getJNDIProviderURL() { - return jNDIProviderURL; - } - - public void setJNDIProviderURL(String providerURL) { - jNDIProviderURL = providerURL; - } - - public int getPriority() { - return priority; - } - - public void setPriority(int priority) { - this.priority = priority; - } - - public String getReplyTo() { - return replyTo; - } - - public void setReplyTo(String replyTo) { - this.replyTo = replyTo; - } - - public int getTimeToLive() { - return timeToLive; - } - - public void setTimeToLive(int timeToLive) { - this.timeToLive = timeToLive; - } - - public int getDestinationType() { - return destinationType; - } - - public void setDestinationType(int destinationType) { - this.destinationType = destinationType; - } - - public String getJmsResourceFactoryName() { - return jmsResourceFactoryName; - } - - public void setJmsResourceFactoryName(String jmsResourceFactoryName) { - this.jmsResourceFactoryName = jmsResourceFactoryName; - } - - public String getOperationSelectorName() { - return operationSelectorName; - } - - public void setOperationSelectorName(String operationSelectorName) { - this.operationSelectorName = operationSelectorName; - } - - public String getOperationSelectorPropertyName() { - return operationSelectorPropertyName; - } - - public void setOperationSelectorPropertyName(String operationSelectorPropertyName) { - this.operationSelectorPropertyName = operationSelectorPropertyName; - } - - public void setCorrelationScheme(String correlationScheme) { - this.correlationScheme = correlationScheme; - } - - public String getCorrelationScheme() { - return correlationScheme; - } - - public void setCreateDestination(String create) { - } - - public void setResponseDestinationName(String name) { - this.responseDestinationName = name; - } - - public String getResponseDestinationName() { - return responseDestinationName; - } - - public void setResponseDestinationType(int destination_type_queue2) { - // TODO Auto-generated method stub - - } - - public void setCreateResponseDestination(String create) { - // TODO Auto-generated method stub - - } - - public void setRequestOperationAndDatabindingName(String name) { - this.requestOperationAndDatabindingName = name; - } - - public String getRequestOperationAndDatabindingName() { - return requestOperationAndDatabindingName; - } - - public void setResponseOperationAndDatabindingName(String name) { - this.responseOperationAndDatabindingName = name; - } - - public String getResponseOperationAndDatabindingName() { - return responseOperationAndDatabindingName; - } - - public boolean isXMLFormat() { - return xmlFormat; - } - - public void setXMLFormat(boolean b) { - this.xmlFormat = b; - } - - public Object clone() { - - JMSBindingDefinition clone = new JMSBindingDefinition(); - clone.destinationType = this.destinationType; - clone.destinationType = this.destinationType; - clone.connectionFactoryName = this.connectionFactoryName; - clone.activationSpecName = this.activationSpecName; - clone.initialContextFactoryName = this.initialContextFactoryName; - clone.jNDIProviderURL = this.jNDIProviderURL; - clone.deliveryMode = this.deliveryMode; - clone.timeToLive = this.timeToLive; - clone.priority = this.priority; - clone.replyTo = this.replyTo; - - return clone(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSBindingException.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSBindingException.java deleted file mode 100644 index a197eeffc6..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSBindingException.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.binding.jms; - -import org.apache.tuscany.api.TuscanyRuntimeException; - -public class JMSBindingException extends TuscanyRuntimeException { - private static final long serialVersionUID = 1L; - - public JMSBindingException() { - super(); - } - - public JMSBindingException(String arg0, Throwable arg1) { - super(arg0, arg1); - } - - public JMSBindingException(String arg0) { - super(arg0); - } - - public JMSBindingException(Throwable arg0) { - super(arg0); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSBindingLoader.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSBindingLoader.java deleted file mode 100644 index 5ffa8695ad..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSBindingLoader.java +++ /dev/null @@ -1,199 +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.binding.jms; - -import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; -import static javax.xml.stream.XMLStreamConstants.START_ELEMENT; -import static org.osoa.sca.Constants.SCA_NS; - -import java.util.Arrays; -import java.util.List; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.extension.LoaderExtension; -import org.apache.tuscany.spi.loader.LoaderException; -import org.apache.tuscany.spi.loader.LoaderRegistry; -import org.apache.tuscany.spi.model.ModelObject; -import org.osoa.sca.annotations.Scope; - -/** - * Loader for handling elements based on the 0.96 draft 1 spec. - */ -@Scope("COMPOSITE") -public class JMSBindingLoader extends LoaderExtension { - - public static final QName BINDING_JMS = - new QName(SCA_NS, "binding.jms"); - - public static final List VALID_CORRELATION_SCHEMES = - Arrays.asList(new String[] {"requestmsgidtocorrelid", "requestcorrelidtocorrelid", "none"}); - - public JMSBindingLoader(@Autowire LoaderRegistry registry) { - super(registry); - } - - public QName getXMLType() { - return BINDING_JMS; - } - - public JMSBindingDefinition load(CompositeComponent parent, - ModelObject modelObject, - XMLStreamReader reader, - DeploymentContext deploymentContext) throws XMLStreamException, LoaderException { - - JMSBindingDefinition jmsBinding = new JMSBindingDefinition(); - - String uri = reader.getAttributeValue(null, "uri"); - if (uri != null && uri.length() > 0) { - parseURI(jmsBinding, uri); - } - - String correlationScheme = reader.getAttributeValue(null, "correlationScheme"); - if (correlationScheme != null && correlationScheme.length() > 0) { - if (VALID_CORRELATION_SCHEMES.contains(correlationScheme.toLowerCase())) { - jmsBinding.setCorrelationScheme(correlationScheme); - } else { - throw new LoaderException("invalid correlationScheme: " + correlationScheme); - } - } - - String initialContextFactory = reader.getAttributeValue(null, "initialContextFactory"); - if (initialContextFactory != null && initialContextFactory.length() > 0) { - jmsBinding.setInitialContextFactoryName(initialContextFactory); - } - - String jndiProviderURL = reader.getAttributeValue(null, "JNDIProviderURL"); - if (jndiProviderURL != null && jndiProviderURL.length() > 0) { - jmsBinding.setJNDIProviderURL(jndiProviderURL); - } - - while (true) { - switch (reader.next()) { - case START_ELEMENT: - String elementName = reader.getName().getLocalPart(); - if ("destination".equals(elementName)) { - parseDestination(reader, jmsBinding); - } else if ("connectionFactory".equals(elementName)) { - parseConnectionFactory(reader, jmsBinding); - } else if ("activationSpec".equals(elementName)) { - parseActivationSpec(reader, jmsBinding); - } else if ("response".equals(elementName)) { - parseResponse(reader, jmsBinding); - } else if ("headers".equals(elementName)) { - parseHeaders(reader, jmsBinding); - } else if ("operationAndDataBinding".equals(elementName)) { - parseOperationAndDataBinding(reader, jmsBinding); - } else if ("operation".equals(elementName)) { - parseOperation(reader, jmsBinding); - } else if ("resourceAdapter".equals(elementName)) { - parseResourceAdapter(reader, jmsBinding); - } - reader.next(); - break; - - case END_ELEMENT: - QName x = reader.getName(); - if (x.equals(BINDING_JMS)) { - return jmsBinding; - } - throw new RuntimeException("Incomplete binding.jms definition"); - } - } - } - - protected void parseActivationSpec(XMLStreamReader reader, JMSBindingDefinition jmsBinding) { - String name = reader.getAttributeValue(null, "name"); - if (name != null && name.length() > 0) { - jmsBinding.setActivationSpecName(name); - } else { - throw new RuntimeException("missing ActivationSpec name"); - } - } - - protected void parseConnectionFactory(XMLStreamReader reader, JMSBindingDefinition jmsBinding) { - String name = reader.getAttributeValue(null, "name"); - if (name != null && name.length() > 0) { - jmsBinding.setConnectionFactoryName(name); - } else { - throw new RuntimeException("missing connectionFactory name"); - } - } - - protected void parseResponse(XMLStreamReader reader, JMSBindingDefinition jmsBinding) { - // TODO Auto-generated method stub - - } - - protected void parseResourceAdapter(XMLStreamReader reader, JMSBindingDefinition jmsBinding) throws XMLStreamException { - // TODO Auto-generated method stub - } - - protected void parseOperation(XMLStreamReader reader, JMSBindingDefinition jmsBinding) throws XMLStreamException { - // TODO Auto-generated method stub - } - - protected void parseOperationAndDataBinding(XMLStreamReader reader, JMSBindingDefinition jmsBinding) - throws XMLStreamException { - String name = reader.getAttributeValue(null, "name"); - String use = reader.getAttributeValue(null, "use"); - if (name != null && name.length() > 0) { - if ("request".equalsIgnoreCase(use)) { - jmsBinding.setRequestOperationAndDatabindingName(name); - } else if ("response".equalsIgnoreCase(use)) { - jmsBinding.setResponseOperationAndDatabindingName(name); - } else { - jmsBinding.setRequestOperationAndDatabindingName(name); - jmsBinding.setResponseOperationAndDatabindingName(name); - } - } - } - - protected void parseHeaders(XMLStreamReader reader, JMSBindingDefinition jmsBinding) throws XMLStreamException { - // TODO Auto-generated method stub - } - - protected void parseDestination(XMLStreamReader reader, JMSBindingDefinition jmsBinding) throws XMLStreamException { - String name = reader.getAttributeValue(null, "name"); - if (name != null && name.length() > 0) { - jmsBinding.setDestinationName(name); - } - String type = reader.getAttributeValue(null, "type"); - if (type != null && type.length() > 0) { - if ("queue".equalsIgnoreCase(type)) { - jmsBinding.setDestinationType(JMSBindingDefinition.DESTINATION_TYPE_QUEUE); - } else if ("topic".equalsIgnoreCase("type")) { - jmsBinding.setDestinationType(JMSBindingDefinition.DESTINATION_TYPE_TOPIC); - } else { - throw new RuntimeException("invalid destination type: " + type); - } - } - String create = reader.getAttributeValue(null, "create"); - if (create != null && create.length() > 0) { - jmsBinding.setCreateDestination(create); - } - } - - protected void parseURI(JMSBindingDefinition jmsBinding, String uri) { - // TODO Auto-generated method stub - } -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSProxy.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSProxy.java deleted file mode 100644 index 56e367eca2..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSProxy.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.jms; - -import java.lang.reflect.Method; - -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.MessageProducer; -import javax.jms.Session; -import javax.naming.NamingException; - -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.wire.InboundWire; -import org.apache.tuscany.spi.wire.Interceptor; -import org.apache.tuscany.spi.wire.InvocationChain; -import org.apache.tuscany.spi.wire.MessageImpl; - -public class JMSProxy implements MessageListener { - - protected Method operationMethod; - protected JMSResourceFactory jmsResourceFactory; - protected OperationAndDataBinding requestOperationAndDataBinding; - protected OperationAndDataBinding responseOperationAndDataBinding; - protected InboundWire inboundWire; - protected String correlationScheme; - - public JMSProxy(InboundWire inboundWire, - JMSResourceFactory jmsResourceFactory, - OperationAndDataBinding requestOperationAndDataBinding, - OperationAndDataBinding responseOperationAndDataBinding, - String correlationScheme) throws NamingException { - - this.jmsResourceFactory = jmsResourceFactory; - this.requestOperationAndDataBinding = requestOperationAndDataBinding; - this.responseOperationAndDataBinding = responseOperationAndDataBinding; - this.inboundWire = inboundWire; - this.correlationScheme = correlationScheme; - } - - public void onMessage(Message requestJMSMsg) { - try { - Object responsePayload = invokeService(requestJMSMsg); - sendReply(requestJMSMsg, responsePayload); - } catch (Exception e) { - sendFaultReply(requestJMSMsg, e); - } - } - - protected Object invokeService(Message requestJMSMsg) throws JMSException { - - String operationName = requestOperationAndDataBinding.getOperationName(requestJMSMsg); - Object requestPayload = requestOperationAndDataBinding.extractPayload(requestJMSMsg); - - Operation op = (Operation)inboundWire.getServiceContract().getOperations().get(operationName); - InvocationChain chain = inboundWire.getInvocationChains().get(op); - - org.apache.tuscany.spi.wire.Message tuscanyRequestMsg = new MessageImpl(); - tuscanyRequestMsg.setTargetInvoker(chain.getTargetInvoker()); - tuscanyRequestMsg.setBody(requestPayload); - - org.apache.tuscany.spi.wire.Message tuscanyResponseMsg = null; - - Interceptor headInterceptor = chain.getHeadInterceptor(); - if (headInterceptor != null) { - tuscanyResponseMsg = headInterceptor.invoke(tuscanyRequestMsg); - } - - // TODO: what if headInterceptor is null? - - return tuscanyResponseMsg.getBody(); - } - - protected void sendReply(Message requestJMSMsg, Object responsePayload) { - try { - - if (requestJMSMsg.getJMSReplyTo() == null) { - // assume no reply is expected - return; - } - - Session session = jmsResourceFactory.createSession(); - Message replyJMSMsg = responseOperationAndDataBinding.createJMSMessage(session, responsePayload); - - replyJMSMsg.setJMSDeliveryMode(requestJMSMsg.getJMSDeliveryMode()); - replyJMSMsg.setJMSPriority(requestJMSMsg.getJMSPriority()); - - if (correlationScheme == null || "RequestMsgIDToCorrelID".equalsIgnoreCase(correlationScheme)) { - replyJMSMsg.setJMSCorrelationID(requestJMSMsg.getJMSMessageID()); - } else if ("RequestCorrelIDToCorrelID".equalsIgnoreCase(correlationScheme)) { - replyJMSMsg.setJMSCorrelationID(requestJMSMsg.getJMSCorrelationID()); - } - - Destination destination = requestJMSMsg.getJMSReplyTo(); - MessageProducer producer = session.createProducer(destination); - - producer.send(replyJMSMsg); - - producer.close(); - session.close(); - - } catch (JMSException e) { - throw new JMSBindingException(e); - } catch (NamingException e) { - throw new JMSBindingException(e); - } - } - - protected void sendFaultReply(Message requestJMSMsg, Exception e) { - sendReply(requestJMSMsg, new JMSBindingException("exception invoking JMS service", e)); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSReferenceBinding.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSReferenceBinding.java deleted file mode 100644 index 0fdb95af7c..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSReferenceBinding.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.binding.jms; - -import javax.jms.Destination; -import javax.xml.namespace.QName; - -import static org.osoa.sca.Constants.SCA_NS; - -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.extension.ReferenceBindingExtension; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.model.ServiceContract; -import org.apache.tuscany.spi.wire.TargetInvoker; - -/** - * @version $Rev: 449970 $ $Date: 2006-09-26 06:05:35 -0400 (Tue, 26 Sep 2006) $ - */ -public class JMSReferenceBinding extends ReferenceBindingExtension { - private static final QName BINDING_JMS = new QName(SCA_NS, "binding.jms"); - - protected JMSBindingDefinition jmsBinding; - protected JMSResourceFactory jmsResourceFactory; - protected OperationAndDataBinding requestOperationAndDataBinding; - protected OperationAndDataBinding responseOperationAndDataBinding; - protected Destination requestDest; - protected Destination replyDest; - - public JMSReferenceBinding(String name, - CompositeComponent parent, - JMSBindingDefinition jmsBinding, - JMSResourceFactory jmsResourceFactory, - ServiceContract bindingServiceContract, - OperationAndDataBinding requestOperationAndDataBinding, - OperationAndDataBinding responseOperationAndDataBinding, - Destination requestDest, - Destination replyDest) { - - super(name, parent); - this.bindingServiceContract = bindingServiceContract; - this.jmsBinding = jmsBinding; - this.jmsResourceFactory = jmsResourceFactory; - this.requestOperationAndDataBinding = requestOperationAndDataBinding; - this.responseOperationAndDataBinding = responseOperationAndDataBinding; - this.requestDest = requestDest; - this.replyDest = replyDest; - } - - public QName getBindingType() { - return BINDING_JMS; - } - - public TargetInvoker createTargetInvoker(ServiceContract contract, Operation operation) { - return new JMSTargetInvoker(jmsResourceFactory, jmsBinding, operation.getName(), - requestOperationAndDataBinding, responseOperationAndDataBinding, requestDest, - replyDest); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSResourceFactory.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSResourceFactory.java deleted file mode 100644 index dbc43a6d34..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSResourceFactory.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.binding.jms; - -import javax.jms.Connection; -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.Session; -import javax.naming.NamingException; - -public interface JMSResourceFactory { - - public abstract Connection getConnection() throws NamingException, JMSException; - - public abstract Session createSession() throws JMSException, NamingException; - - public abstract void startConnection() throws JMSException, NamingException; - - public abstract void closeConnection() throws JMSException, NamingException; - - public abstract Destination lookupDestination(String jndiName) throws NamingException; -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSServiceBinding.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSServiceBinding.java deleted file mode 100644 index 51b4c501d6..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSServiceBinding.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.binding.jms; - -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.MessageConsumer; -import javax.jms.Session; -import javax.naming.NamingException; -import javax.xml.namespace.QName; - -import static org.osoa.sca.Constants.SCA_NS; - -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.extension.ServiceBindingExtension; -import org.apache.tuscany.spi.model.ServiceContract; - -/** - * @version $Rev: 449970 $ $Date: 2006-09-26 06:05:35 -0400 (Tue, 26 Sep 2006) $ - */ -public class JMSServiceBinding extends ServiceBindingExtension { - private static final QName BINDING_JMS = new QName(SCA_NS, "binding.jms"); - - private JMSBindingDefinition jmsBinding; - private JMSResourceFactory jmsResourceFactory; - private MessageConsumer consumer; - protected OperationAndDataBinding requestOperationAndDataBinding; - protected OperationAndDataBinding responseOperationAndDataBinding; - - public JMSServiceBinding(String name, - CompositeComponent parent, - JMSBindingDefinition jmsBinding, - JMSResourceFactory jmsResourceFactory, - ServiceContract serviceBindingContract, - OperationAndDataBinding requestOperationAndDataBinding, - OperationAndDataBinding responseOperationAndDataBinding, - Class service) { - super(name, parent); - - this.jmsBinding = jmsBinding; - this.jmsResourceFactory = jmsResourceFactory; - this.bindingServiceContract = serviceBindingContract; - this.requestOperationAndDataBinding = requestOperationAndDataBinding; - this.responseOperationAndDataBinding = responseOperationAndDataBinding; - } - - public void start() { - super.start(); - try { - registerListerner(); - } catch (Exception e) { - throw new JMSBindingException("Error starting JMSServiceBinding", e); - } - } - - public void stop() { - - try { - consumer.close(); - jmsResourceFactory.closeConnection(); - } catch (Exception e) { - throw new JMSBindingException("Error stopping JMSServiceBinding", e); - } - - super.stop(); - } - - private void registerListerner() throws NamingException, JMSException { - - Session session = jmsResourceFactory.createSession(); - Destination destination = session.createQueue(jmsBinding.getDestinationName()); - - consumer = session.createConsumer(destination); - consumer.setMessageListener(new JMSProxy(getInboundWire(), jmsResourceFactory, requestOperationAndDataBinding, - responseOperationAndDataBinding, jmsBinding.getCorrelationScheme())); - - jmsResourceFactory.startConnection(); - - } - - public QName getBindingType() { - return BINDING_JMS; - } -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSTargetInvoker.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSTargetInvoker.java deleted file mode 100644 index 61e838c41a..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/JMSTargetInvoker.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.jms; - -import java.lang.reflect.InvocationTargetException; - -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageConsumer; -import javax.jms.MessageProducer; -import javax.jms.Session; -import javax.naming.NamingException; - -import org.apache.tuscany.spi.extension.TargetInvokerExtension; - -/** - * Invoke a JMS reference. - */ -public class JMSTargetInvoker extends TargetInvokerExtension { - - protected JMSBindingDefinition jmsBinding; - protected JMSResourceFactory jmsResourceFactory; - - protected String operationName; - protected OperationAndDataBinding requestOperationAndDataBinding; - protected OperationAndDataBinding responseOperationAndDataBinding; - - protected Destination requestDest; - protected Destination replyDest; - - public JMSTargetInvoker(JMSResourceFactory jmsResourceFactory, - JMSBindingDefinition jmsBinding, - String operationName, - OperationAndDataBinding requestOperationAndDataBinding, - OperationAndDataBinding responseOperationAndDataBinding, - Destination requestDest, - Destination replyDest) { - super(null, null, null); - this.jmsBinding = jmsBinding; - this.jmsResourceFactory = jmsResourceFactory; - this.operationName = operationName; - this.requestOperationAndDataBinding = requestOperationAndDataBinding; - this.responseOperationAndDataBinding = responseOperationAndDataBinding; - this.requestDest = requestDest; - this.replyDest = replyDest; - } - - public Object invokeTarget(Object payload, final short sequence) throws InvocationTargetException { - try { - Session session = jmsResourceFactory.createSession(); - try { - - Destination replyToDest = (replyDest != null) ? replyDest : session.createTemporaryQueue(); - Message requestMsg = sendRequest((Object[])payload, session, replyToDest); - Message replyMsg = receiveReply(session, replyToDest, requestMsg.getJMSMessageID()); - - return responseOperationAndDataBinding.extractPayload(replyMsg); - - } finally { - session.close(); - } - } catch (JMSException e) { - throw new InvocationTargetException(e); - } catch (NamingException e) { - throw new InvocationTargetException(e); - } - } - - protected Message sendRequest(Object[] payload, Session session, Destination replyToDest) throws JMSException { - - Message requestMsg = requestOperationAndDataBinding.createJMSMessage(session, payload); - - requestMsg.setJMSDeliveryMode(jmsBinding.getDeliveryMode()); - requestMsg.setJMSPriority(jmsBinding.getPriority()); - - requestOperationAndDataBinding.setOperationName(operationName, requestMsg); - requestMsg.setJMSReplyTo(replyToDest); - - MessageProducer producer = session.createProducer(requestDest); - try { - producer.send(requestMsg); - } finally { - producer.close(); - } - return requestMsg; - } - - protected Message receiveReply(Session session, Destination replyToDest, String requestMsgId) throws JMSException, - NamingException { - String msgSelector = "JMSCorrelationID = '" + requestMsgId + "'"; - MessageConsumer consumer = session.createConsumer(replyToDest, msgSelector); - Message replyMsg; - try { - jmsResourceFactory.startConnection(); - replyMsg = consumer.receive(jmsBinding.getTimeToLive()); - } finally { - consumer.close(); - } - return replyMsg; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/OperationAndDataBinding.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/OperationAndDataBinding.java deleted file mode 100644 index 9867f7d97b..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/OperationAndDataBinding.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.binding.jms; - -import javax.jms.Message; -import javax.jms.Session; - -/** - * Interface for a component that does operation selection and message payload - * databinding - */ -public interface OperationAndDataBinding { - - /** - * Get the operation name from a JMS Message - */ - public abstract String getOperationName(Message message); - - /** - * Set the operation name on a JMS Message - */ - public abstract void setOperationName(String operationName, Message message); - - /** - * Extracts the payload from a JMS Message - */ - public abstract Object extractPayload(Message msg); - - /** - * Create a JMS Message containing the payload - */ - public abstract Message createJMSMessage(Session session, Object payload); -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/SimpleJMSResourceFactory.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/SimpleJMSResourceFactory.java deleted file mode 100644 index 86cdfa272e..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/SimpleJMSResourceFactory.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.binding.jms; - -import java.util.Properties; - -import javax.jms.Connection; -import javax.jms.ConnectionFactory; -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.Session; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; - -public class SimpleJMSResourceFactory implements JMSResourceFactory { - - private JMSBindingDefinition jmsBinding; - private Connection con; - private Context context; - private boolean isConnectionStarted; - - public SimpleJMSResourceFactory(JMSBindingDefinition jmsBinding) { - this.jmsBinding = jmsBinding; - } - - /* - * This is a simple implementation where a connection is created per binding - * Ideally the resource factory should be able to leverage the host - * environment to provide connection pooling if it can. For ex If Tuscany is - * running inside an AppServer Then we could leverage the JMS resources it - * provides - * - * @see org.apache.tuscany.binding.jms.JMSResourceFactory#getConnection() - */ - public Connection getConnection() throws NamingException, JMSException { - if (con == null) { - createConnection(); - } - return con; - } - - /* - * (non-Javadoc) - * - * @see org.apache.tuscany.binding.jms.JMSResourceFactory#createSession() - */ - public Session createSession() throws JMSException, NamingException { - return getConnection().createSession(false, Session.AUTO_ACKNOWLEDGE); - } - - /* - * (non-Javadoc) - * - * @see org.apache.tuscany.binding.jms.JMSResourceFactory#startConnection() - */ - public void startConnection() throws JMSException, NamingException { - if (!isConnectionStarted) { - getConnection().start(); - isConnectionStarted = true; - } - } - - /* - * (non-Javadoc) - * - * @see org.apache.tuscany.binding.jms.JMSResourceFactory#closeConnection() - */ - public void closeConnection() throws JMSException, NamingException { - if (con != null) { - con.close(); - } - } - - private void createConnection() throws NamingException, JMSException { - if (context == null) { - createInitialContext(); - } - ConnectionFactory conFac = (ConnectionFactory)context.lookup(jmsBinding.getConnectionFactoryName()); - con = conFac.createConnection(); - } - - private void createInitialContext() throws NamingException { - Properties props = new Properties(); - props.setProperty(Context.INITIAL_CONTEXT_FACTORY, jmsBinding.getInitialContextFactoryName().trim()); - props.setProperty(Context.PROVIDER_URL, jmsBinding.getJNDIProviderURL().trim()); - - context = new InitialContext(props); - } - - public Destination lookupDestination(String jndiName) throws NamingException { - if (context == null) { - createInitialContext(); - } - return (Destination)context.lookup(jndiName); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/AbstractJmsTransformer.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/AbstractJmsTransformer.java deleted file mode 100644 index d535af71c6..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/AbstractJmsTransformer.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.binding.jms.databinding; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.ObjectStreamClass; - -import org.apache.tuscany.spi.databinding.DataBindingRegistry; -import org.apache.tuscany.spi.databinding.Mediator; -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; - -/** - * This is a special transformer to transform the input from one IDL to the - * other one - */ -public abstract class AbstractJmsTransformer extends TransformerExtension implements PullTransformer { - - protected static final String JMS_INPUT = "jms:input"; - protected static final String JMS_OUTPUT = "jms:output"; - - protected DataBindingRegistry dataBindingRegistry; - - protected Mediator mediator; - - public AbstractJmsTransformer() { - super(); - } - - /** - * @see org.apache.tuscany.spi.databinding.Transformer#getWeight() - */ - public int getWeight() { - return 10; - } - - protected Object read(byte[] bytes) { - try { - ByteArrayInputStream bis = new ByteArrayInputStream(bytes); - ObjectInputStream ois = new ObjectInputStream(bis) { - - @Override - protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { - try { - return Class.forName(desc.getName(), false, this.getClass().getClassLoader()); - } catch (ClassNotFoundException e) { - return super.resolveClass(desc); - } - } - - }; - Object object = ois.readObject(); - ois.close(); - bis.close(); - - return object; - } catch (Exception e) { - throw new TransformationException(e); - } - } - - protected byte[] write(Object source) { - try { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(bos); - oos.writeObject(source); - oos.close(); - bos.close(); - return bos.toByteArray(); - } catch (IOException e) { - throw new TransformationException(e); - } - - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/Input2JmsInputTransformer.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/Input2JmsInputTransformer.java deleted file mode 100644 index 568cb21f4f..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/Input2JmsInputTransformer.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.binding.jms.databinding; - -import org.apache.tuscany.spi.databinding.DataBinding; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.Transformer; -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 Input2JmsInputTransformer extends AbstractJmsTransformer { - - public Input2JmsInputTransformer() { - super(); - } - - @Override - public String getSourceDataBinding() { - return DataBinding.IDL_INPUT; - } - - @Override - public String getTargetDataBinding() { - return JMS_INPUT; - } - - /** - * @see org.apache.tuscany.spi.databinding.extension.TransformerExtension#getSourceType() - */ - @Override - protected Class getSourceType() { - return Object[].class; - } - - /** - * @see org.apache.tuscany.spi.databinding.extension.TransformerExtension#getTargetType() - */ - @Override - protected Class getTargetType() { - return Object[].class; - } - - @SuppressWarnings("unchecked") - public Object[] transform(Object[] source, TransformationContext context) { - return new Object[] {write(source)}; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/JmsInput2InputTransformer.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/JmsInput2InputTransformer.java deleted file mode 100644 index 4055e4ce86..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/JmsInput2InputTransformer.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.binding.jms.databinding; - -import org.apache.tuscany.spi.databinding.DataBinding; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.Transformer; -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 JmsInput2InputTransformer extends AbstractJmsTransformer { - - public JmsInput2InputTransformer() { - super(); - } - - @Override - public String getSourceDataBinding() { - return JMS_INPUT; - } - - @Override - public String getTargetDataBinding() { - return DataBinding.IDL_INPUT; - } - - /** - * @see org.apache.tuscany.spi.databinding.extension.TransformerExtension#getSourceType() - */ - @Override - protected Class getSourceType() { - return Object[].class; - } - - /** - * @see org.apache.tuscany.spi.databinding.extension.TransformerExtension#getTargetType() - */ - @Override - protected Class getTargetType() { - return Object[].class; - } - - @SuppressWarnings("unchecked") - public Object[] transform(Object[] source, TransformationContext context) { - return (Object[])read((byte[])source[0]); - } -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/JmsOutput2OutputTransformer.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/JmsOutput2OutputTransformer.java deleted file mode 100644 index 35ac98ec51..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/JmsOutput2OutputTransformer.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.binding.jms.databinding; - -import org.apache.tuscany.spi.databinding.DataBinding; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.Transformer; -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 JmsOutput2OutputTransformer extends AbstractJmsTransformer { - - /** - * @param wrapperHandler - */ - public JmsOutput2OutputTransformer() { - super(); - } - - @Override - public String getSourceDataBinding() { - return JMS_OUTPUT; - } - - @Override - public String getTargetDataBinding() { - return DataBinding.IDL_OUTPUT; - } - - /** - * @see org.apache.tuscany.spi.databinding.extension.TransformerExtension#getSourceType() - */ - @Override - protected Class getSourceType() { - return Object.class; - } - - /** - * @see org.apache.tuscany.spi.databinding.extension.TransformerExtension#getTargetType() - */ - @Override - protected Class getTargetType() { - return Object.class; - } - - @SuppressWarnings("unchecked") - public Object transform(Object response, TransformationContext context) { - return read((byte[])response); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/Output2JmsOutputTransformer.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/Output2JmsOutputTransformer.java deleted file mode 100644 index 6786491091..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/java/org/apache/tuscany/binding/jms/databinding/Output2JmsOutputTransformer.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.binding.jms.databinding; - -import org.apache.tuscany.spi.databinding.DataBinding; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.Transformer; -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 Output2JmsOutputTransformer extends AbstractJmsTransformer { - /** - * @param wrapperHandler - */ - public Output2JmsOutputTransformer() { - super(); - } - - @Override - public String getSourceDataBinding() { - return DataBinding.IDL_OUTPUT; - } - - @Override - public String getTargetDataBinding() { - return JMS_OUTPUT; - } - - /** - * @see org.apache.tuscany.spi.databinding.extension.TransformerExtension#getSourceType() - */ - @Override - protected Class getSourceType() { - return Object.class; - } - - /** - * @see org.apache.tuscany.spi.databinding.extension.TransformerExtension#getTargetType() - */ - @Override - protected Class getTargetType() { - return Object.class; - } - - @SuppressWarnings("unchecked") - public Object transform(Object response, TransformationContext context) { - return write(response); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/resources/META-INF/sca/binding.jms.scdl b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/resources/META-INF/sca/binding.jms.scdl deleted file mode 100644 index 7bc0691c57..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/resources/META-INF/sca/binding.jms.scdl +++ /dev/null @@ -1,52 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.jms - tuscany-jms - 1.0-incubator-SNAPSHOT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/resources/META-INF/sca/default.scdl b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/resources/META-INF/sca/default.scdl deleted file mode 100644 index fe1704eb39..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/resources/META-INF/sca/default.scdl +++ /dev/null @@ -1,52 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.jms - tuscany-jms - 1.0-incubator-SNAPSHOT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/resources/META-INF/sca/extension.composite b/branches/sca-java-integration/sca/extensions/jms/binding/src/main/resources/META-INF/sca/extension.composite deleted file mode 100644 index ee865ce923..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/main/resources/META-INF/sca/extension.composite +++ /dev/null @@ -1,22 +0,0 @@ - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/GreetingService.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/GreetingService.java deleted file mode 100644 index 24472afa53..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/GreetingService.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.binding.jms; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface GreetingService { - String greet(String name); -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/GreetingServiceImpl.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/GreetingServiceImpl.java deleted file mode 100644 index abf7ecef88..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/GreetingServiceImpl.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.binding.jms; - -public class GreetingServiceImpl implements GreetingService { - - public String greet(String name) { - return "Hello " + name; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/HelloworldService.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/HelloworldService.java deleted file mode 100644 index 21c40bd6b6..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/HelloworldService.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.binding.jms; - -import org.osoa.sca.annotations.Remotable; - -@Remotable -public interface HelloworldService { - String getGreetings(String name); -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/HelloworldServiceImpl.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/HelloworldServiceImpl.java deleted file mode 100644 index 8119bde323..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/HelloworldServiceImpl.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.binding.jms; - -public class HelloworldServiceImpl implements HelloworldService { - - public String getGreetings(String name) { - return "Hello " + name; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/IntroService.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/IntroService.java deleted file mode 100644 index 0b5acb44cc..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/IntroService.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.jms; - -public interface IntroService { - public String greet(String name); -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/IntroServiceImpl.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/IntroServiceImpl.java deleted file mode 100644 index 6222f368ad..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/IntroServiceImpl.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.binding.jms; - -import org.osoa.sca.annotations.Reference; - -public class IntroServiceImpl implements IntroService { - - private GreetingService extService; - - @Reference - public void setExtService(GreetingService extService) { - this.extService = extService; - } - - public String greet(String name) { - return extService.greet(name); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/JMSBindingLoaderTestCase.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/JMSBindingLoaderTestCase.java deleted file mode 100644 index 646432d81e..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/JMSBindingLoaderTestCase.java +++ /dev/null @@ -1,91 +0,0 @@ -package org.apache.tuscany.binding.jms; - -import java.io.StringReader; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.spi.loader.LoaderException; -import static org.osoa.sca.Constants.SCA_NS; - -public class JMSBindingLoaderTestCase extends TestCase { - - private JMSBindingLoader loader; - - public void testMinimal() throws LoaderException, XMLStreamException { - String xml = ""; - XMLStreamReader reader = createReader(xml); - JMSBindingDefinition jmsBinding = loader.load(null, null, reader, null); - assertNotNull(jmsBinding); - } - - public void testCorrelationScheme() throws LoaderException, XMLStreamException { - XMLStreamReader reader = - createReader(""); - JMSBindingDefinition jmsBinding = loader.load(null, null, reader, null); - assertEquals("RequestMsgIDToCorrelID", jmsBinding.getCorrelationScheme()); - - reader = createReader(""); - jmsBinding = loader.load(null, null, reader, null); - assertEquals("RequestCorrelIDToCorrelID", jmsBinding.getCorrelationScheme()); - - reader = createReader(""); - jmsBinding = loader.load(null, null, reader, null); - assertEquals("none", jmsBinding.getCorrelationScheme()); - - reader = createReader(""); - try { - jmsBinding = loader.load(null, null, reader, null); - fail("expecting invalid correlationScheme"); - } catch (LoaderException e) { - // expected - } - } - - public void testDestination() throws LoaderException, XMLStreamException { - XMLStreamReader reader = createReader(""); - JMSBindingDefinition jmsBinding = loader.load(null, null, reader, null); - assertEquals("foo", jmsBinding.getDestinationName()); - } - - public void testInitialContextFactory() throws LoaderException, XMLStreamException { - XMLStreamReader reader = createReader(""); - JMSBindingDefinition jmsBinding = loader.load(null, null, reader, null); - assertEquals("myicf", jmsBinding.getInitialContextFactoryName()); - } - - public void testJNDIProviderURL() throws LoaderException, XMLStreamException { - XMLStreamReader reader = createReader(""); - JMSBindingDefinition jmsBinding = loader.load(null, null, reader, null); - assertEquals("myURL", jmsBinding.getJNDIProviderURL()); - } - - public void testConnectionFactory() throws LoaderException, XMLStreamException { - XMLStreamReader reader = createReader(" "); - JMSBindingDefinition jmsBinding = loader.load(null, null, reader, null); - assertEquals("myfactory", jmsBinding.getConnectionFactoryName()); - } - - public void testActivationSpec() throws LoaderException, XMLStreamException { - XMLStreamReader reader = createReader(" "); - JMSBindingDefinition jmsBinding = loader.load(null, null, reader, null); - assertEquals("myas", jmsBinding.getActivationSpecName()); - } - - private XMLStreamReader createReader(String xml) throws XMLStreamException { - XMLInputFactory factory = XMLInputFactory.newInstance(); - - String xxx = "" + xml + ""; - XMLStreamReader reader = factory.createXMLStreamReader(new StringReader(xxx)); - reader.nextTag(); - reader.nextTag(); - return reader; - } - - protected void setUp() throws Exception { - this.loader = new JMSBindingLoader(null); - } -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/JMSBindingTestCaseX.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/JMSBindingTestCaseX.java deleted file mode 100644 index 8479f27532..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/JMSBindingTestCaseX.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.jms; - -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; - -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.naming.NamingException; -import javax.xml.parsers.ParserConfigurationException; - -import junit.framework.TestCase; - -import org.activemq.broker.BrokerContainer; -import org.activemq.broker.impl.BrokerContainerImpl; -import org.activemq.store.vm.VMPersistenceAdapter; -import org.apache.tuscany.api.SCARuntime; -import org.custommonkey.xmlunit.Diff; -import org.custommonkey.xmlunit.XMLUnit; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; -import org.xml.sax.SAXException; - -public class JMSBindingTestCaseX extends TestCase { - - private IntroService introService; - private BrokerContainer broker; - - protected static final String REQUEST_XML = - "petra"; - protected static final String REPLY_XML = - "Hello petra"; - - public void testJMSBinding() throws InvocationTargetException, SAXException, IOException, - ParserConfigurationException, NamingException, JMSException { - String reply = introService.greet("Rajith"); - assertEquals("Hello Rajith", reply); - - // TODO: the rest should be in a seperate test method but that doesn't - // work as you get broker conflicts - JMSTargetInvoker invoker = createJMSInvoker(); - Object[] response = (Object[])invoker.invokeTarget(new Object[] {REQUEST_XML}, (short)0); - - Diff diff = XMLUnit.compareXML(REPLY_XML, response[0].toString()); - assertTrue(diff.toString(), diff.similar()); - - } - - private JMSTargetInvoker createJMSInvoker() throws NamingException, JMSException { - JMSBindingDefinition binding = new JMSBindingDefinition(); - binding.setInitialContextFactoryName("org.activemq.jndi.ActiveMQInitialContextFactory"); - binding.setConnectionFactoryName("ConnectionFactory"); - binding.setJNDIProviderURL("tcp://localhost:61616"); - binding.setDestinationName("dynamicQueues/HelloworldServiceQueue"); - binding.setTimeToLive(3000); - binding.setXMLFormat(true); - JMSResourceFactory rf = new SimpleJMSResourceFactory(binding); - Destination requestDest = rf.lookupDestination(binding.getDestinationName()); - DefaultOperationAndDataBinding odb = new DefaultOperationAndDataBinding(binding); - JMSTargetInvoker invoker = new JMSTargetInvoker(rf, binding, "getGreetings", odb, odb, requestDest, null); - return invoker; - } - - protected void setUp() throws Exception { - startBroker(); - SCARuntime.start("META-INF/sca/default.scdl"); - super.setUp(); - CompositeContext context = CurrentCompositeContext.getContext(); - introService = context.locateService(IntroService.class, "IntroServiceComponent"); - } - - protected void tearDown() throws Exception { - super.tearDown(); - broker.stop(); - } - - public static void main(String[] args) { - JMSBindingTestCaseX test = new JMSBindingTestCaseX(); - try { - test.setUp(); - test.testJMSBinding(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void startBroker() throws Exception { - broker = new BrokerContainerImpl("JMS BindingDefinition Test"); - // configure the broker - broker.addConnector("tcp://localhost:61616"); - broker.setPersistenceAdapter(new VMPersistenceAdapter()); - broker.start(); - } -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/JMSProxyTestCase.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/JMSProxyTestCase.java deleted file mode 100644 index 63a82ab6da..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/JMSProxyTestCase.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.binding.jms; - -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageProducer; -import javax.jms.ObjectMessage; -import javax.jms.Session; -import javax.naming.NamingException; - -import junit.framework.TestCase; - -import org.easymock.EasyMock; - -public class JMSProxyTestCase extends TestCase { - - /** - * Tests the jms response msg has correlation id set to the request msg id - */ - public void testOnMessageRequestMsgIDToCorrelID() throws NamingException, JMSException { - - String id = "123"; - - MessageProducer producer = EasyMock.createNiceMock(MessageProducer.class); - - Session session = EasyMock.createNiceMock(Session.class); - EasyMock.expect(session.createProducer(EasyMock.isA(Destination.class))).andReturn(producer); - EasyMock.replay(session); - - ObjectMessage responseJMSMsg = EasyMock.createMock(ObjectMessage.class); - responseJMSMsg.setJMSDeliveryMode(1); - responseJMSMsg.setJMSPriority(1); - responseJMSMsg.setJMSCorrelationID(id); - EasyMock.replay(responseJMSMsg); - - JMSResourceFactory jmsResourceFactory = EasyMock.createMock(JMSResourceFactory.class); - EasyMock.expect(jmsResourceFactory.createSession()).andReturn(session); - - OperationAndDataBinding odb = EasyMock.createMock(OperationAndDataBinding.class); - EasyMock.expect(odb.createJMSMessage(EasyMock.eq(session), EasyMock.isA(Exception.class))) - .andReturn(responseJMSMsg); - EasyMock.replay(odb); - - JMSProxy jmsProxy = new JMSProxy(null, jmsResourceFactory, null, odb, null); - - Message requestJMSMsg = EasyMock.createMock(Message.class); - EasyMock.expect(requestJMSMsg.getJMSReplyTo()).andReturn(new Destination() { - }); - - EasyMock.expect(requestJMSMsg.getJMSDeliveryMode()).andReturn(1); - EasyMock.expect(requestJMSMsg.getJMSPriority()).andReturn(1); - - EasyMock.expect(requestJMSMsg.getJMSReplyTo()).andReturn(new Destination() { - }); - EasyMock.expect(requestJMSMsg.getJMSMessageID()).andReturn(id); - - producer.send(EasyMock.isA(Message.class)); - EasyMock.replay(producer); - - EasyMock.replay(requestJMSMsg); - EasyMock.replay(jmsResourceFactory); - - jmsProxy.onMessage(requestJMSMsg); - - EasyMock.verify(requestJMSMsg); - EasyMock.verify(jmsResourceFactory); - EasyMock.verify(producer); - EasyMock.verify(session); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/databinding/JmsTransformerTestCase.java b/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/databinding/JmsTransformerTestCase.java deleted file mode 100644 index 7c9420b7f9..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/java/org/apache/tuscany/binding/jms/databinding/JmsTransformerTestCase.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.binding.jms.databinding; - -import junit.framework.TestCase; - -/** - * Test cases for transformers - */ -public class JmsTransformerTestCase extends TestCase { - private Input2JmsInputTransformer t1; - private JmsInput2InputTransformer t2; - private Output2JmsOutputTransformer t3; - private JmsOutput2OutputTransformer t4; - - /** - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - t1 = new Input2JmsInputTransformer(); - t2 = new JmsInput2InputTransformer(); - t3 = new Output2JmsOutputTransformer(); - t4 = new JmsOutput2OutputTransformer(); - } - - public void testInput() { - Object[] args1 = new Object[] {1, "ABC", 1.0d}; - Object[] args2 = t1.transform(args1, null); - assertEquals(1, args2.length); - assertTrue(args2[0] instanceof byte[]); - Object[] args3 = t2.transform(args2, null); - for (int i = 0; i < args3.length; i++) { - assertEquals(args1[i], args3[i]); - } - - } - - public void testOutput() { - Object args1 = "ABC"; - Object args2 = t3.transform(args1, null); - assertTrue(args2 instanceof byte[]); - Object args3 = t4.transform(args2, null); - assertEquals(args1, args3); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/resources/META-INF/sca/default.scdl b/branches/sca-java-integration/sca/extensions/jms/binding/src/test/resources/META-INF/sca/default.scdl deleted file mode 100644 index 7291363978..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/resources/META-INF/sca/default.scdl +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - GretingServiceComponent - - - - - - - - - GreetingJMSReference - - - - - - - - - - - - - - - - - HelloworldComponent - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/resources/wsdl/helloworld.wsdl b/branches/sca-java-integration/sca/extensions/jms/binding/src/test/resources/wsdl/helloworld.wsdl deleted file mode 100644 index f1a62d8570..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/binding/src/test/resources/wsdl/helloworld.wsdl +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jms/pom.xml b/branches/sca-java-integration/sca/extensions/jms/pom.xml deleted file mode 100644 index 5f6aecd9ee..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/pom.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - org.apache.tuscany.sca.extensions - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - org.apache.tuscany.sca.extensions.jms - parent - pom - Tuscany JMS Extension - - - binding - samples - - - - - - - activemq - activemq-core - 3.2 - compile - - - - geronimo-spec - geronimo-spec-jms - 1.1-rc4 - compile - - - - geronimo-spec - geronimo-spec-j2ee-management - 1.0-rc4 - compile - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/pom.xml b/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/pom.xml deleted file mode 100644 index 6439099456..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/pom.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.jms.samples - parent - 0.1-integration-incubating-SNAPSHOT - - 4.0.0 - sample-helloworld-jmsReference - jar - Tuscany JMS Reference Helloworld Sample - A helloworld sample using a JMS Reference - - - - org.apache.tuscany.sca.kernel - tuscany-api - 0.1-integration-incubating-SNAPSHOT - compile - - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - - junit - junit - 4.2 - test - - - - org.apache.tuscany.sca.extensions.jms - tuscany-jms - ${extensionVersion} - test - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - helloworld.HelloWorldJmsClient - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/src/main/java/helloworld/HelloWorldImpl.java b/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/src/main/java/helloworld/HelloWorldImpl.java deleted file mode 100644 index 6195be003a..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/src/main/java/helloworld/HelloWorldImpl.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 helloworld; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -/** - * This class implements the HelloWorld service. - */ -@Service(HelloWorldService.class) -public class HelloWorldImpl implements HelloWorldService -{ - @Reference - private HelloWorldService extService = null; - - public HelloWorldService getExtService() { - return extService; - } - - @Reference - public void setExtService(HelloWorldService extService) { - this.extService = extService; - } - - public String sayHello(String name) - { - return extService.sayHello(name); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/src/main/java/helloworld/HelloWorldService.java b/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/src/main/java/helloworld/HelloWorldService.java deleted file mode 100644 index 13f0574a0f..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/src/main/java/helloworld/HelloWorldService.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 helloworld; - - - -/** - * This is the business interface of the HelloWorld greetings service. - */ -public interface HelloWorldService { - - public String sayHello(String name) ; - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/src/main/resources/META-INF/sca/default.scdl b/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/src/main/resources/META-INF/sca/default.scdl deleted file mode 100644 index 01930b3aaf..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/src/main/resources/META-INF/sca/default.scdl +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - HelloWorldJmsService - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/src/test/java/helloworld/HelloWorldJmsClient.java b/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/src/test/java/helloworld/HelloWorldJmsClient.java deleted file mode 100644 index 4a8a8fb249..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsReference/src/test/java/helloworld/HelloWorldJmsClient.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 helloworld; - -import junit.framework.TestCase; - -import org.apache.tuscany.api.SCARuntime; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * @author administrator - * - */ -public class HelloWorldJmsClient extends TestCase{ - private HelloWorldService helloWorldService; - protected void setUp() throws Exception { - SCARuntime.start("META-INF/sca/default.scdl"); - - CompositeContext context = CurrentCompositeContext.getContext(); - helloWorldService = context.locateService(HelloWorldService.class, "HelloWorldServiceComponent"); - } - - protected void tearDown() throws Exception { - SCARuntime.stop(); - } - - public void testHelloWorld(){ - assertEquals("Hello World", helloWorldService.sayHello("World")); - } - public static void main(String[] args) { - try { - HelloWorldJmsClient helloWorldJmsServer = new HelloWorldJmsClient(); - helloWorldJmsServer.setUp(); - helloWorldJmsServer.testHelloWorld(); - } catch ( Exception e ) { - e.printStackTrace(); - } - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/pom.xml b/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/pom.xml deleted file mode 100644 index 217b8b5575..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.jms.samples - parent - 0.1-integration-incubating-SNAPSHOT - - 4.0.0 - sample-helloworld-jmsService - jar - Tuscany JMS Service Helloworld Sample - A helloworld sample hosting JMS Service - - - - org.apache.tuscany.sca.kernel - tuscany-api - 0.1-integration-incubating-SNAPSHOT - compile - - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - - org.apache.tuscany.sca.extensions.jms - tuscany-jms - ${extensionVersion} - test - - - - junit - junit - 4.2 - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - helloworld.HelloWorldJmsServer - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/src/main/java/helloworld/HelloWorldImpl.java b/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/src/main/java/helloworld/HelloWorldImpl.java deleted file mode 100644 index 342d8813e6..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/src/main/java/helloworld/HelloWorldImpl.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 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) - { - System.out.println("[HelloWorld from JMSBinding] " + "Hello " + name); - return "Hello " + name; - } -} diff --git a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/src/main/java/helloworld/HelloWorldService.java b/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/src/main/java/helloworld/HelloWorldService.java deleted file mode 100644 index ef86a04f77..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/src/main/java/helloworld/HelloWorldService.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 helloworld; - - - -/** - * This is the business interface of the HelloWorld greetings service. - */ -public interface HelloWorldService { - - public String sayHello(String name); - -} diff --git a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/src/main/resources/META-INF/sca/default.scdl b/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/src/main/resources/META-INF/sca/default.scdl deleted file mode 100644 index a3b335f292..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/src/main/resources/META-INF/sca/default.scdl +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - HelloWorldServiceComponent - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/src/test/java/helloworld/HelloWorldJmsServer.java b/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/src/test/java/helloworld/HelloWorldJmsServer.java deleted file mode 100644 index 44f9b9bc3c..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/samples/helloworld.jmsService/src/test/java/helloworld/HelloWorldJmsServer.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 helloworld; - -import junit.framework.TestCase; - -import org.activemq.broker.BrokerContainer; -import org.activemq.broker.impl.BrokerContainerImpl; -import org.activemq.store.vm.VMPersistenceAdapter; -import org.apache.tuscany.api.SCARuntime; -import org.osoa.sca.CurrentCompositeContext; - - -/** - * @author administrator - */ -public class HelloWorldJmsServer extends TestCase{ - private BrokerContainer broker; - - public HelloWorldJmsServer() { - if (broker == null) - broker = new BrokerContainerImpl("JMS BindingDefinition Test"); - } - - private void startBroker() throws Exception { - // configure the broker - broker.addConnector("tcp://localhost:61616"); - broker.setPersistenceAdapter(new VMPersistenceAdapter()); - broker.start(); - } - - protected void setUp() throws Exception { - startBroker(); - SCARuntime.start( "META-INF/sca/default.scdl"); - - CurrentCompositeContext.getContext(); - } - - protected void tearDown() throws Exception { - SCARuntime.stop(); - } - - public void testJMSServer(){ - try { - System.out.println("Service Started and Running..."); - System.out.println("Hit ENTER to exit"); - System.in.read(); - System.out.println("Server Stopped!"); - System.exit(0); - } catch ( Exception e ) { - e.printStackTrace(); - } - } - public static void main(String[] args) { - try { - HelloWorldJmsServer helloWorldJmsServer = new HelloWorldJmsServer(); - helloWorldJmsServer.setUp(); - helloWorldJmsServer.testJMSServer(); - } catch ( Exception e ) { - e.printStackTrace(); - } - } -} diff --git a/branches/sca-java-integration/sca/extensions/jms/samples/pom.xml b/branches/sca-java-integration/sca/extensions/jms/samples/pom.xml deleted file mode 100644 index ee6af3fa90..0000000000 --- a/branches/sca-java-integration/sca/extensions/jms/samples/pom.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - org.apache.tuscany.sca.extensions.jms - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - org.apache.tuscany.sca.extensions.jms.samples - parent - pom - Tuscany Samples for the JMS extension - - - - - apache.snapshots - Apache Snapshot Repository - http://people.apache.org/repo/m2-snapshot-repository - - false - - - true - - - - apache.incubator - Apache Incubator Repository - http://people.apache.org/repo/m2-incubating-repository/ - - true - - - false - - - - - - helloworld.jmsService - helloworld.jmsReference - - - - - - org.codehaus.mojo - dependency-maven-plugin - - - - org.apache.tuscany.distribution.sca - standalone - ${scaImplVersion} - bin - zip - - - ${project.build.directory}/distribution - - - - - - - - - org.osoa - sca-api-r1.0 - 0.1-integration-incubating-SNAPSHOT - compile - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/.ruleset b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/.ruleset deleted file mode 100644 index ac8671859d..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/LICENSE.txt b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/pom.xml b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/pom.xml deleted file mode 100644 index f01aafafab..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/pom.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - org.apache.tuscany.sca.extensions.jsonrpc - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - tuscany-jsonrpc - Apache Tuscany Binding for JSON-RPC - Implementation of the SCA JSON-RPC Binding - - - - - org.apache.tuscany.sca.kernel - tuscany-spi - - - - com.metaparadigm - json-rpc - - - - javax.servlet - servlet-api - 2.5 - - - - org.easymock - easymockclassextension - - - - net.sf.json-lib - json-lib - test - - - - httpunit - httpunit - test - - - - diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingBuilder.java b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingBuilder.java deleted file mode 100644 index 0f78a641c6..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingBuilder.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.binding.jsonrpc; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.component.ServiceBinding; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.extension.BindingBuilderExtension; -import org.apache.tuscany.spi.host.ServletHost; -import org.apache.tuscany.spi.model.ServiceDefinition; -import org.apache.tuscany.spi.wire.WireService; - -/** - * Builds a Service for JSON-RPC binding. - * - * @version $Rev$ $Date$ - */ -public class JSONRPCBindingBuilder extends BindingBuilderExtension { - - private ServletHost servletHost; - private WireService wireService; - - @Autowire() - public void setServletHost(ServletHost servletHost) { - this.servletHost = servletHost; - } - - @Autowire - public void setWireService(WireService wireService) { - this.wireService = wireService; - } - - - public ServletHost getServletHost() { - return servletHost; - } - - protected Class getBindingType() { - return JSONRPCBindingDefinition.class; - } - - @SuppressWarnings("unchecked") - public ServiceBinding build(CompositeComponent parent, - ServiceDefinition serviceDefinition, - JSONRPCBindingDefinition bindingDefinition, DeploymentContext deploymentContext) { - return new JSONRPCServiceBinding(serviceDefinition.getName(), parent, this.wireService, servletHost); - } - -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingDefinition.java b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingDefinition.java deleted file mode 100644 index dc785e066a..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingDefinition.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.binding.jsonrpc; - -import org.apache.tuscany.spi.model.BindingDefinition; - -/** - * Represents a binding to an RMI service. - * - * @version $Rev$ $Date$ - */ -public class JSONRPCBindingDefinition extends BindingDefinition { - String uri; - - public String getURI() { - return uri; - } - - public void setURI(String uri) { - this.uri = uri; - } -} diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingLoader.java b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingLoader.java deleted file mode 100644 index 71d6623b0d..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingLoader.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.binding.jsonrpc; - -import static org.osoa.sca.Constants.SCA_NS; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.extension.LoaderExtension; -import org.apache.tuscany.spi.loader.LoaderException; -import org.apache.tuscany.spi.loader.LoaderRegistry; -import org.apache.tuscany.spi.model.ModelObject; -import org.osoa.sca.annotations.Scope; - -/** - * Loader for handling elements. - * - * @version $Rev$ $Date$ - */ -@Scope("COMPOSITE") -public class JSONRPCBindingLoader extends LoaderExtension { - public static final QName BINDING_JSON = new QName(SCA_NS, "binding.jsonrpc"); - - public JSONRPCBindingLoader(@Autowire LoaderRegistry registry) { - super(registry); - } - - public QName getXMLType() { - return BINDING_JSON; - } - - public JSONRPCBindingDefinition load(CompositeComponent parent, ModelObject object, XMLStreamReader reader, DeploymentContext deploymentContext) throws XMLStreamException, - LoaderException { - - return new JSONRPCBindingDefinition(); - } -} diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCEntryPointServlet.java b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCEntryPointServlet.java deleted file mode 100644 index 4407949f2e..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCEntryPointServlet.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.jsonrpc; - -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.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.tuscany.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 - 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-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCServiceBinding.java b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCServiceBinding.java deleted file mode 100644 index 06105ee869..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/JSONRPCServiceBinding.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.binding.jsonrpc; - -import javax.xml.namespace.QName; - -import static org.osoa.sca.Constants.SCA_NS; -import org.osoa.sca.annotations.Destroy; - -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.extension.ServiceBindingExtension; -import org.apache.tuscany.spi.host.ServletHost; -import org.apache.tuscany.spi.wire.WireService; - -/** - * @version $Rev$ $Date$ - */ -public class JSONRPCServiceBinding extends ServiceBindingExtension { - public static final QName BINDING_JSON = new QName(SCA_NS, "binding.jsonrpc"); - - private static int servletRegistrationCount = 0; - - private ServletHost servletHost; - - private WireService wireService; - - public static final String SCRIPT_GETTER_SERVICE_MAPPING = "/SCA/scripts"; - - public JSONRPCServiceBinding(String theName, CompositeComponent parent, WireService wireService, - ServletHost servletHost) { - - super(theName, parent); - - this.servletHost = servletHost; - this.wireService = wireService; - } - - public synchronized void start() { - super.start(); - JSONRPCEntryPointServlet servlet; - // FIXME this should not have to create a proxy but should instead dispatch directly down an invocation chain - Class aClass = getInboundWire().getServiceContract().getInterfaceClass(); - Object instance = - wireService.createProxy(aClass, getInboundWire()); - servlet = new JSONRPCEntryPointServlet(getName(), aClass, instance); - - // register the servlet based on the service name - servletHost.registerMapping("/" + getName(), servlet); - - // if the script getter servlet is not already registered then register it - if ((servletRegistrationCount == 0) && (!servletHost.isMappingRegistered("/SCA/scripts"))) { - servletHost.registerMapping(SCRIPT_GETTER_SERVICE_MAPPING, new ScriptGetterServlet()); - } - - // increase the registered servlet count - servletRegistrationCount++; - } - - @Destroy - public synchronized void stop() { - // unregister the service servlet - servletHost.unregisterMapping("/" + getName()); - - // decrement the registered servlet count - servletRegistrationCount--; - - // if this was the last servlet, we can now unregister the script getter servlet - if (servletRegistrationCount == 0) { - servletHost.unregisterMapping(SCRIPT_GETTER_SERVICE_MAPPING); - } - - super.stop(); - } - - public QName getBindingType() { - return BINDING_JSON; - } -} diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/ScriptGetterServlet.java b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/ScriptGetterServlet.java deleted file mode 100644 index 50e8ed7ae0..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/ScriptGetterServlet.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.binding.jsonrpc; - -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 ScriptGetterServlet 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-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/util/JavaToSmd.java b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/binding/jsonrpc/util/JavaToSmd.java deleted file mode 100644 index 537fccc967..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/java/org/apache/tuscany/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.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-integration/sca/extensions/jsonrpc/binding/src/main/resources/META-INF/sca/binding.jsonrpc.scdl b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/resources/META-INF/sca/binding.jsonrpc.scdl deleted file mode 100644 index 2777607424..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/resources/META-INF/sca/binding.jsonrpc.scdl +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - org.apache.tuscany.sca.extensions.jsonrpc - tuscany-jsonrpc - 1.0-incubator-SNAPSHOT - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/resources/META-INF/sca/default.scdl b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/resources/META-INF/sca/default.scdl deleted file mode 100644 index 7bb1a4e02f..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/resources/META-INF/sca/default.scdl +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - org.apache.tuscany.sca.extensions.jsonrpc - tuscany-jsonrpc - 1.0-incubator-SNAPSHOT - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/resources/META-INF/sca/extension.composite b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/resources/META-INF/sca/extension.composite deleted file mode 100644 index 83c194b4d7..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/resources/META-INF/sca/extension.composite +++ /dev/null @@ -1,22 +0,0 @@ - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/resources/org/apache/tuscany/binding/jsonrpc/jsonrpc.js b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/resources/org/apache/tuscany/binding/jsonrpc/jsonrpc.js deleted file mode 100644 index 2b9efbb55c..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/main/resources/org/apache/tuscany/binding/jsonrpc/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-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingBuilderTestCase.java b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingBuilderTestCase.java deleted file mode 100644 index a158d3e4e8..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingBuilderTestCase.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.binding.jsonrpc; - -import static org.easymock.classextension.EasyMock.createMock; -import static org.easymock.classextension.EasyMock.replay; -import junit.framework.TestCase; - -import org.apache.tuscany.spi.host.ServletHost; - -public class JSONRPCBindingBuilderTestCase extends TestCase { - - public void testSetServletHost() { - JSONRPCBindingBuilder bindingBuilder = new JSONRPCBindingBuilder(); - ServletHost mockServletHost = createMock(ServletHost.class); - replay(mockServletHost); - bindingBuilder.setServletHost(mockServletHost); - assertEquals(mockServletHost, bindingBuilder.getServletHost()); - } - - public void testGetBindingType() { - JSONRPCBindingBuilder bindingBuilder = new JSONRPCBindingBuilder(); - assertEquals(JSONRPCBindingDefinition.class, bindingBuilder.getBindingType()); - } - - @SuppressWarnings("unchecked") - public void testBuildCompositeComponentServiceDefinitionOfJSONRPCBindingDeploymentContext() { -// JSONRPCBindingBuilder bindingBuilder = new JSONRPCBindingBuilder(); -// CompositeComponent mockParent = createMock(CompositeComponent.class); -// replay(mockParent); -// ServiceDefinition mockServiceDefinition = createMock((new ServiceDefinition()).getClass()); -// JavaInterfaceProcessorRegistry registry = new JavaInterfaceProcessorRegistryImpl(); -// try { -// ServiceContract contract = registry.introspect(JSONRPCServiceBinding.class); -// -// expect(mockServiceDefinition.getServiceContract()).andStubReturn(contract); -// expect(mockServiceDefinition.getName()).andReturn("test_service"); -// replay(mockServiceDefinition); -// DeploymentContext mockDeploymentContext = createMock(DeploymentContext.class); -// replay(mockDeploymentContext); -// -// JSONRPCServiceBinding jsonService = -// (JSONRPCServiceBinding) bindingBuilder.build(mockParent, mockServiceDefinition, null, -// mockDeploymentContext); -// assertEquals(JSONRPCServiceBinding.class, jsonService.getClass()); -// -// } catch (InvalidServiceContractException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// fail(e.toString()); -// } - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingLoaderTestCase.java b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingLoaderTestCase.java deleted file mode 100644 index de1df7de97..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingLoaderTestCase.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.binding.jsonrpc; - -import static org.easymock.classextension.EasyMock.createMock; -import static org.easymock.classextension.EasyMock.replay; - -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.loader.LoaderException; -import org.apache.tuscany.spi.loader.LoaderRegistry; -import org.apache.tuscany.spi.model.ModelObject; - -public class JSONRPCBindingLoaderTestCase extends TestCase { - - public void testJSONRPCBindingLoader() { - LoaderRegistry mockRegistry = createMock(LoaderRegistry.class); - replay(mockRegistry); - JSONRPCBindingLoader loader = new JSONRPCBindingLoader(mockRegistry); - assertNotNull(loader); - } - - public void testGetXMLType() { - LoaderRegistry mockRegistry = createMock(LoaderRegistry.class); - replay(mockRegistry); - JSONRPCBindingLoader loader = new JSONRPCBindingLoader(mockRegistry); - assertNotNull(loader); - assertEquals(JSONRPCBindingLoader.BINDING_JSON, loader.getXMLType()); - } - - public void testLoad() { - LoaderRegistry mockRegistry = createMock(LoaderRegistry.class); - replay(mockRegistry); - JSONRPCBindingLoader loader = new JSONRPCBindingLoader(mockRegistry); - assertNotNull(loader); - - CompositeComponent mockParent = createMock(CompositeComponent.class); - replay(mockParent); - ModelObject mockModelObject = createMock(ModelObject.class); - replay(mockModelObject); - XMLStreamReader mockReader = createMock(XMLStreamReader.class); - replay(mockReader); - DeploymentContext mockDeploymentContext = createMock(DeploymentContext.class); - replay(mockDeploymentContext); - - try { - JSONRPCBindingDefinition jsonBinding = loader.load(mockParent, mockModelObject, mockReader, mockDeploymentContext); - assertNotNull(jsonBinding); - } catch (LoaderException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - fail(e.toString()); - } catch (XMLStreamException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - fail(e.toString()); - } - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingTestCase.java b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingTestCase.java deleted file mode 100644 index 945259e801..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCBindingTestCase.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.binding.jsonrpc; - -import junit.framework.TestCase; - -public class JSONRPCBindingTestCase extends TestCase { - - public void testGetURI() { - JSONRPCBindingDefinition jsonBinding = new JSONRPCBindingDefinition(); - jsonBinding.uri = "test_uri"; - assertEquals("test_uri", jsonBinding.getURI()); - } - - public void testSetURI() { - JSONRPCBindingDefinition jsonBinding = new JSONRPCBindingDefinition(); - jsonBinding.setURI("test_uri"); - assertEquals("test_uri", jsonBinding.uri); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCEntryPointServletTestCase.java b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCEntryPointServletTestCase.java deleted file mode 100644 index 112640798d..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCEntryPointServletTestCase.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.binding.jsonrpc; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.text.ParseException; -import java.util.HashMap; - -import javax.servlet.ServletException; - -import junit.framework.TestCase; - -import org.json.JSONArray; -import org.json.JSONObject; - -import com.meterware.httpunit.GetMethodWebRequest; -import com.meterware.httpunit.PostMethodWebRequest; -import com.meterware.httpunit.WebRequest; -import com.meterware.httpunit.WebResponse; -import com.meterware.servletunit.InvocationContext; -import com.meterware.servletunit.ServletRunner; -import com.meterware.servletunit.ServletUnitClient; - -public class JSONRPCEntryPointServletTestCase extends TestCase implements TestInterface{ - - private static final String MESSAGE = "Testing..1..2..3"; - private static final String SERVICE_PATH = "JsonRpc/Test"; - private static final String SERVICE_URL = "http://localhost/" + SERVICE_PATH; - ServletRunner sr = null; - - - protected void setUp() throws Exception - { - sr = new ServletRunner(); - sr.registerServlet( SERVICE_PATH, JSONRPCEntryPointServlet.class.getName() ); - } - - public void testJSONRPCEntryPointServletContruct() { - JSONRPCEntryPointServlet servlet = new JSONRPCEntryPointServlet("serviceName",TestInterface.class, this); - assertEquals("serviceName", servlet.serviceName); - assertEquals(TestInterface.class, servlet.serviceInterface); - assertEquals(this, servlet.serviceInstance); - } - - public void testGetSmd() throws IOException { - ServletUnitClient sc = sr.newClient(); - WebRequest request = new GetMethodWebRequest( SERVICE_URL ); - request.setParameter( "smd", "" ); - InvocationContext ic = sc.newInvocation( request ); - try { - JSONRPCEntryPointServlet jsonServlet = (JSONRPCEntryPointServlet)ic.getServlet(); - jsonServlet.serviceName = "Test"; - jsonServlet.serviceInterface = TestInterface.class; - jsonServlet.serviceInstance = this; - - ic.service(); - WebResponse response = ic.getServletResponse(); - assertEquals(200, response.getResponseCode()); - JSONObject jsonResp = new JSONObject(response.getText()); - assertEquals("TestInterface", jsonResp.getString("objectName")); - assertEquals("JSON-RPC", jsonResp.getString("serviceType")); - assertEquals(SERVICE_URL, jsonResp.getString("serviceURL")); - JSONArray jsonMethods = jsonResp.getJSONArray("methods"); - assertNotNull(jsonMethods); - assertEquals(2, jsonMethods.length()); - HashMap hashMethods = new HashMap(); - for(int i = 0; i < jsonMethods.length(); i++) - { - JSONObject method = jsonMethods.getJSONObject(i); - assertNotNull(method); - assertNotNull(method.getString("name")); - hashMethods.put(method.getString("name"), method); - } - JSONObject echoMethod = hashMethods.get("echo"); - assertNotNull(echoMethod); - JSONArray echoParameters = echoMethod.getJSONArray("parameters"); - assertNotNull(echoParameters); - assertEquals(1,echoParameters.length()); - assertEquals("param0",echoParameters.getJSONObject(0).getString("name")); - assertEquals("STRING",echoParameters.getJSONObject(0).getString("type")); - JSONObject getMessageMethod = hashMethods.get("getMessage"); - assertNotNull(getMessageMethod); - JSONArray getMessageParameters = getMessageMethod.getJSONArray("parameters"); - assertNotNull(getMessageParameters); - assertEquals(0,getMessageParameters.length()); - - } catch (ServletException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - fail(e.toString()); - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - fail(e.toString()); - } - - - } - - public void testZeroParameterMethodCall() throws IOException { - ServletUnitClient sc = sr.newClient(); - - try { - JSONObject jsonRequest = new JSONObject("{ \"method\": \"getMessage\", \"params\": [], \"id\": 1}"); - - WebRequest request = new PostMethodWebRequest( SERVICE_URL, new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")),"application/json"); - InvocationContext ic = sc.newInvocation( request ); - - JSONRPCEntryPointServlet jsonServlet = (JSONRPCEntryPointServlet)ic.getServlet(); - jsonServlet.serviceName = "Test"; - jsonServlet.serviceInterface = TestInterface.class; - jsonServlet.serviceInstance = this; - - ic.service(); - WebResponse response = ic.getServletResponse(); - assertEquals(200, response.getResponseCode()); - JSONObject jsonResp = new JSONObject(response.getText()); - assertEquals(MESSAGE, jsonResp.getString("result")); - } catch (ServletException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - fail(e.toString()); - } catch (ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - fail(e.toString()); - } - - - } - - public void testMalformedJSON() throws IOException { - ServletUnitClient sc = sr.newClient(); - - try { - String badJsonRequest = "{\"no close brace\""; - - WebRequest request = new PostMethodWebRequest( SERVICE_URL, new ByteArrayInputStream(badJsonRequest.getBytes("UTF-8")),"application/json"); - InvocationContext ic = sc.newInvocation( request ); - - JSONRPCEntryPointServlet jsonServlet = (JSONRPCEntryPointServlet)ic.getServlet(); - jsonServlet.serviceName = "Test"; - jsonServlet.serviceInterface = TestInterface.class; - jsonServlet.serviceInstance = this; - - ic.service(); - fail("Expected runtime exception from malformed JSON resquest"); - - } catch (ServletException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - fail(e.toString()); - } catch (RuntimeException e) { - // expected runtime exception from malformed JSON request - assertEquals(true, e.getCause() instanceof ParseException); - } - - - } - - public String echo(String message) { - return message; - } - - public String getMessage() { - return MESSAGE; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCServiceTestCase.java b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCServiceTestCase.java deleted file mode 100644 index cc5efb2221..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/JSONRPCServiceTestCase.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.binding.jsonrpc; - -import javax.servlet.Servlet; - -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.host.ServletHost; -import org.apache.tuscany.spi.wire.WireService; -import org.apache.tuscany.spi.wire.InboundWire; -import org.apache.tuscany.spi.model.ServiceContract; - -import static org.easymock.classextension.EasyMock.*; -import org.easymock.EasyMock; - -import junit.framework.TestCase; - -public class JSONRPCServiceTestCase extends TestCase { - private static final String SERVICE_NAME = "test_service_name"; - - @SuppressWarnings({"unchecked"}) - public void testStart() { - CompositeComponent mockParent = createMock(CompositeComponent.class); - replay(mockParent); - WireService mockWireService = createMock(WireService.class); - expect(mockWireService.createProxy(EasyMock.isA(Class.class), EasyMock.isA(InboundWire.class))).andReturn(this); - replay(mockWireService); - ServletHost mockServletHost = createMock(ServletHost.class); - expect(mockServletHost.isMappingRegistered(JSONRPCServiceBinding.SCRIPT_GETTER_SERVICE_MAPPING)).andReturn(false); - mockServletHost.registerMapping(eq("/" + SERVICE_NAME), (Servlet) notNull()); - mockServletHost.registerMapping(eq(JSONRPCServiceBinding.SCRIPT_GETTER_SERVICE_MAPPING), (Servlet) notNull()); - replay(mockServletHost); - - ServiceContract contract = new ServiceContract(Object.class){ - - }; - JSONRPCServiceBinding jsonRpcService = new JSONRPCServiceBinding(SERVICE_NAME, mockParent, mockWireService, mockServletHost ); - InboundWire wire = EasyMock.createNiceMock(InboundWire.class); - EasyMock.expect(wire.getServiceContract()).andReturn(contract); - EasyMock.replay(wire); - jsonRpcService.setInboundWire(wire); - jsonRpcService.start(); - } - - @SuppressWarnings({"unchecked"}) - public void testStop() { - CompositeComponent mockParent = createMock(CompositeComponent.class); - replay(mockParent); - WireService mockWireService = createMock(WireService.class); - expect(mockWireService.createProxy(EasyMock.isA(Class.class), EasyMock.isA(InboundWire.class))).andReturn(this); - replay(mockWireService); - ServletHost mockServletHost = createMock(ServletHost.class); - expect(mockServletHost.isMappingRegistered(JSONRPCServiceBinding.SCRIPT_GETTER_SERVICE_MAPPING)).andReturn(false); - mockServletHost.registerMapping(eq("/" + SERVICE_NAME), (Servlet) notNull()); - mockServletHost.registerMapping(eq(JSONRPCServiceBinding.SCRIPT_GETTER_SERVICE_MAPPING), (Servlet) notNull()); - expect(mockServletHost.unregisterMapping(eq("/" + SERVICE_NAME))).andReturn(null); - expect(mockServletHost.unregisterMapping(eq(JSONRPCServiceBinding.SCRIPT_GETTER_SERVICE_MAPPING))).andReturn(null); - replay(mockServletHost); - - ServiceContract contract = new ServiceContract(Object.class){ - - }; - JSONRPCServiceBinding jsonRpcService = new JSONRPCServiceBinding(SERVICE_NAME, mockParent, mockWireService, mockServletHost ); - InboundWire wire = EasyMock.createNiceMock(InboundWire.class); - EasyMock.expect(wire.getServiceContract()).andReturn(contract); - EasyMock.replay(wire); - jsonRpcService.setInboundWire(wire); - jsonRpcService.start(); - jsonRpcService.stop(); - } - - public void testJSONRPCService() { - CompositeComponent mockParent = createMock(CompositeComponent.class); - replay(mockParent); - WireService mockWireService = createMock(WireService.class); - replay(mockWireService); - ServletHost mockServletHost = createMock(ServletHost.class); - replay(mockServletHost); - - JSONRPCServiceBinding jsonRpcService = new JSONRPCServiceBinding(SERVICE_NAME, mockParent, mockWireService, mockServletHost ); - assertNotNull(jsonRpcService); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/ScriptGetterServletTestCase.java b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/ScriptGetterServletTestCase.java deleted file mode 100644 index da7d52d21f..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/ScriptGetterServletTestCase.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.binding.jsonrpc; - -import java.io.IOException; - -import junit.framework.TestCase; - -import org.xml.sax.SAXException; - -import com.meterware.httpunit.GetMethodWebRequest; -import com.meterware.httpunit.WebRequest; -import com.meterware.httpunit.WebResponse; -import com.meterware.servletunit.ServletRunner; -import com.meterware.servletunit.ServletUnitClient; - -public class ScriptGetterServletTestCase extends TestCase { - - private static final String SERVICE_PATH = "JsonRpc/ScriptGetterTest"; - private static final String SERVICE_URL = "http://localhost/" + SERVICE_PATH; - ServletRunner sr = null; - - - protected void setUp() throws Exception { - sr = new ServletRunner(); - sr.registerServlet( SERVICE_PATH, ScriptGetterServlet.class.getName() ); - } - - public void testGetScript() throws IOException { - ServletUnitClient sc = sr.newClient(); - WebRequest request = new GetMethodWebRequest( SERVICE_URL ); - try { - WebResponse response = sc.getResponse(request); - assertEquals(200, response.getResponseCode()); - } catch (SAXException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - fail(e1.toString()); - } - } -} diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/TestInterface.java b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/TestInterface.java deleted file mode 100644 index ac39700dda..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/TestInterface.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 org.apache.tuscany.binding.jsonrpc; - -public interface TestInterface { - String getMessage(); - String echo(String message); - -} diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/util/JavaToSmdTestCase.java b/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/util/JavaToSmdTestCase.java deleted file mode 100644 index f61866eea5..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/binding/src/test/java/org/apache/tuscany/binding/jsonrpc/util/JavaToSmdTestCase.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.binding.jsonrpc.util; - -import net.sf.json.JSONArray; -import net.sf.json.JSONObject; -import junit.framework.TestCase; - -public class JavaToSmdTestCase extends TestCase { - - public void testInstantiate() { - // this test is only really here to get 100% test coverage - JavaToSmd test = new JavaToSmd(); - assertNotNull(test); - } - - public void testInterfaceToSmd() { - String serviceUrl = "/testServiceUrl"; - String smd = JavaToSmd.interfaceToSmd(java.util.Observer.class,serviceUrl); - assertNotNull(smd); - JSONObject json = new JSONObject(smd); - assertNotNull(json); - assertEquals(".1", json.getString("SMDVersion")); - assertEquals("Observer", json.getString("objectName")); - assertEquals("JSON-RPC", json.getString("serviceType")); - assertEquals(serviceUrl, json.getString("serviceURL")); - JSONArray methodsArray = json.getJSONArray("methods"); - assertNotNull(methodsArray); - assertEquals(1, methodsArray.length()); - JSONObject methodJson = methodsArray.getJSONObject(0); - assertNotNull(methodJson); - assertEquals("update", methodJson.getString("name")); - JSONArray parametersArray = methodJson.getJSONArray("parameters"); - assertNotNull(parametersArray); - assertEquals(2, parametersArray.length()); - JSONObject param0Json = parametersArray.getJSONObject(0); - assertNotNull(param0Json); - assertEquals("param0", param0Json.getString("name")); - assertEquals("STRING", param0Json.getString("type")); - JSONObject param1Json = parametersArray.getJSONObject(1); - assertNotNull(param1Json); - assertEquals("param1", param1Json.getString("name")); - assertEquals("STRING", param1Json.getString("type")); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/pom.xml b/branches/sca-java-integration/sca/extensions/jsonrpc/pom.xml deleted file mode 100644 index 51a15db751..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/pom.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - org.apache.tuscany.sca.extensions - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - org.apache.tuscany.sca.extensions.jsonrpc - parent - pom - Apache Tuscany SCA Extensions for JSONRPC - - - binding - samples - - - - - - - com.metaparadigm - json-rpc - 1.0 - compile - - - - net.sf.json-lib - json-lib - 0.8 - test - - - - httpunit - httpunit - 1.6.1 - test - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/.ruleset b/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/.ruleset deleted file mode 100644 index ac8671859d..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/build.xml b/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/build.xml deleted file mode 100644 index 76a8171a3b..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/build.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/pom.xml b/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/pom.xml deleted file mode 100644 index 876ba3ea85..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/pom.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - org.apache.tuscany.sca.extensions.jsonrpc.samples - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - sample-helloworldjsonrpc - war - Tuscany HelloWorld JSON-RPC Sample - A sample HelloWorld Web application using JSON-RPC - - - - org.osoa - sca-api-r1.0 - - - - org.apache.tuscany.sca.kernel - tuscany-api - 0.1-integration-incubating-SNAPSHOT - compile - - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - - junit - junit - 4.2 - test - - - - - sample-helloworldjsonrpc - - - org.apache.maven.plugins - maven-antrun-plugin - - - install-dojo - validate - - run - - - - - - - - - - - copy-dojo-files - generate-resources - - run - - - - - - - - - - - - clean-dojo-files - clean - - run - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/java/helloworldjsonrpc/HelloWorldService.java b/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/java/helloworldjsonrpc/HelloWorldService.java deleted file mode 100644 index 38258ac83a..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/java/helloworldjsonrpc/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 helloworldjsonrpc; - -/** - * This is the business interface of the HelloWorld service component. - */ -public interface HelloWorldService { - - String getGreetings(String name); - -} diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/java/helloworldjsonrpc/HelloWorldServiceImpl.java b/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/java/helloworldjsonrpc/HelloWorldServiceImpl.java deleted file mode 100644 index 0372ded214..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/java/helloworldjsonrpc/HelloWorldServiceImpl.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 helloworldjsonrpc; - -import org.osoa.sca.annotations.Service; - -/** - * This class implements the HelloWorld service component. - */ -@Service(HelloWorldService.class) -public class HelloWorldServiceImpl implements HelloWorldService { - - /* - * @see org.apache.tuscany.samples.helloworld.HelloWorldServiceComponent#getGreetings() - */ - public String getGreetings(String name) { - return "jsonrpcHello " + name; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/HelloWorldJSONRPC.html b/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/HelloWorldJSONRPC.html deleted file mode 100644 index bd082525bb..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/HelloWorldJSONRPC.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - Tuscany JSON-RPC HelloWorld Example - - - - - - - - - - - - - - - - -

Tuscany JSON-RPC HelloWorld Examples

- - - - - - - - - - - - - - - -
Non-Dojo Example
- This example uses the JavaScript served from - services/SCA/scripts - to make JSON-RPC requests to the service located at - services/HelloWorldJSONService -
RequestResponse
-

- Name please:     - - -

- -
-
None Yet.
-
- -
- - - - - - - - - - - - - - - - - - -
Dojo Example
-

This example uses the Dojo Toolkit - to create a JavaScript object helloWorldService for the service at - services/HelloWorldJSONService - using Dojo's RPC classes - and providing them with services/HelloWorldJSONService?smd - for Simple Method Description (SMD) input.

-

It then creates a Dojo button that will envoke the getGreetings method of the helloWorldService object.

-
RequestResponse
-
helloWorldService.getGreetings("Dojo").addCallback(contentCallBack);

-
-
None Yet.
-
-
Dojo Debug:
-
- - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/META-INF/LICENSE.txt b/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/META-INF/LICENSE.txt deleted file mode 100644 index 25d78feeac..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/META-INF/LICENSE.txt +++ /dev/null @@ -1,1277 +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. - - -APACHE TUSCANY SUBCOMPONENTS: - -The Apache Tuscany distribution includes a number of subcomponents with -separate copyright notices and license terms. Your use of the source -code for the these subcomponents is subject to the terms and -conditions of the following licenses. - -=============================================================================== - -For the Eclipse Modeling Framework component and the Celtix binding: - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE -PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF -THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and -documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: - -i) changes to the Program, and - -ii) additions to the Program; - -where such changes and/or additions to the Program originate from and -are distributed by that particular Contributor. A Contribution -'originates' from a Contributor if it was added to the Program by such -Contributor itself or anyone acting on such Contributor's behalf. -Contributions do not include additions to the Program which: (i) are -separate modules of software distributed in conjunction with the -Program under their own license agreement, and (ii) are not derivative -works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents " mean patent claims licensable by a Contributor -which are necessarily infringed by the use or sale of its Contribution -alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this -Agreement. - -"Recipient" means anyone who receives the Program under this -Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free copyright -license to reproduce, prepare derivative works of, publicly display, -publicly perform, distribute and sublicense the Contribution of such -Contributor, if any, and such derivative works, in source code and -object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby -grants Recipient a non-exclusive, worldwide, royalty-free patent -license under Licensed Patents to make, use, sell, offer to sell, -import and otherwise transfer the Contribution of such Contributor, if -any, in source code and object code form. This patent license shall -apply to the combination of the Contribution and the Program if, at -the time the Contribution is added by the Contributor, such addition -of the Contribution causes such combination to be covered by the -Licensed Patents. The patent license shall not apply to any other -combinations which include the Contribution. No hardware per se is -licensed hereunder. - -c) Recipient understands that although each Contributor grants the -licenses to its Contributions set forth herein, no assurances are -provided by any Contributor that the Program does not infringe the -patent or other intellectual property rights of any other entity. Each -Contributor disclaims any liability to Recipient for claims brought by -any other entity based on infringement of intellectual property rights -or otherwise. As a condition to exercising the rights and licenses -granted hereunder, each Recipient hereby assumes sole responsibility -to secure any other intellectual property rights needed, if any. For -example, if a third party patent license is required to allow -Recipient to distribute the Program, it is Recipient's responsibility -to acquire that license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient -copyright rights in its Contribution, if any, to grant the copyright -license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form -under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - -i) effectively disclaims on behalf of all Contributors all warranties -and conditions, express and implied, including warranties or -conditions of title and non-infringement, and implied warranties or -conditions of merchantability and fitness for a particular purpose; - -ii) effectively excludes on behalf of all Contributors all liability -for damages, including direct, indirect, special, incidental and -consequential damages, such as lost profits; - -iii) states that any provisions which differ from this Agreement are -offered by that Contributor alone and not by any other party; and - -iv) states that source code for the Program is available from such -Contributor, and informs licensees how to obtain it in a reasonable -manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the -Program. - -Contributors may not remove or alter any copyright notices contained -within the Program. - -Each Contributor must identify itself as the originator of its -Contribution, if any, in a manner that reasonably allows subsequent -Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain -responsibilities with respect to end users, business partners and the -like. While this license is intended to facilitate the commercial use -of the Program, the Contributor who includes the Program in a -commercial product offering should do so in a manner which does not -create potential liability for other Contributors. Therefore, if a -Contributor includes the Program in a commercial product offering, -such Contributor ("Commercial Contributor") hereby agrees to defend -and indemnify every other Contributor ("Indemnified Contributor") -against any losses, damages and costs (collectively "Losses") arising -from claims, lawsuits and other legal actions brought by a third party -against the Indemnified Contributor to the extent caused by the acts -or omissions of such Commercial Contributor in connection with its -distribution of the Program in a commercial product offering. The -obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. -In order to qualify, an Indemnified Contributor must: a) promptly -notify the Commercial Contributor in writing of such claim, and b) -allow the Commercial Contributor to control, and cooperate with the -Commercial Contributor in, the defense and any related settlement -negotiations. The Indemnified Contributor may participate in any such -claim at its own expense. - -For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those -performance claims and warranties, and if a court requires any other -Contributor to pay any damages as a result, the Commercial Contributor -must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS -PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY -WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY -OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely -responsible for determining the appropriateness of using and -distributing the Program and assumes all risks associated with its -exercise of rights under this Agreement , including but not limited to -the risks and costs of program errors, compliance with applicable -laws, damage to or loss of data, programs or equipment, and -unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR -ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING -WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR -DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED -HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further -action by the parties hereto, such provision shall be reformed to the -minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that -the Program itself (excluding combinations of the Program with other -software or hardware) infringes such Recipient's patent(s), then such -Recipient's rights granted under Section 2(b) shall terminate as of -the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of -time after becoming aware of such noncompliance. If all Recipient's -rights under this Agreement terminate, Recipient agrees to cease use -and distribution of the Program as soon as reasonably practicable. -However, Recipient's obligations under this Agreement and any licenses -granted by Recipient relating to the Program shall continue and -survive. - -Everyone is permitted to copy and distribute copies of this Agreement, -but in order to avoid inconsistency the Agreement is copyrighted and -may only be modified in the following manner. The Agreement Steward -reserves the right to publish new versions (including revisions) of -this Agreement from time to time. No one other than the Agreement -Steward has the right to modify this Agreement. The Eclipse Foundation -is the initial Agreement Steward. The Eclipse Foundation may assign -the responsibility to serve as the Agreement Steward to a suitable -separate entity. Each new version of the Agreement will be given a -distinguishing version number. The Program (including Contributions) -may always be distributed subject to the version of the Agreement -under which it was received. In addition, after a new version of the -Agreement is published, Contributor may elect to distribute the -Program (including its Contributions) under the new version. Except as -expressly stated in Sections 2(a) and 2(b) above, Recipient receives -no rights or licenses to the intellectual property of any Contributor -under this Agreement, whether expressly, by implication, estoppel or -otherwise. All rights in the Program not expressly granted under this -Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and -the intellectual property laws of the United States of America. No -party to this Agreement will bring a legal action under this Agreement -more than one year after the cause of action arose. Each party waives -its rights to a jury trial in any resulting litigation. - -=============================================================================== - -For the Rhino JavaScript container component: - -Mozilla Public License 1.1 (MPL 1.1) - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the -Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to -the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original Code, -prior Modifications used by a Contributor, and the Modifications made by that -particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the -combination of the Original Code and Modifications, in each case including -portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally -accepted in the software development community for the electronic transfer of -data. - - 1.5. "Executable" means Covered Code in any form other than Source -Code. - - 1.6. "Initial Developer" means the individual or entity identified as -the Initial Developer in the Source Code notice required by Exhibit A. - - 1.7. "Larger Work" means a work which combines Covered Code or -portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum -extent possible, whether at the time of the initial grant or subsequently -acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the -substance or structure of either the Original Code or any previous -Modifications. When Covered Code is released as a series of files, a -Modification is: - A. Any addition to or deletion from the contents of a file -containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or -previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code -which is described in the Source Code notice required by Exhibit A as Original -Code, and which, at the time of its release under this License is not already -Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or -hereafter acquired, including without limitation, method, process, and -apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for -making modifications to it, including all modules it contains, plus any -associated interface definition files, scripts used to control compilation and -installation of an Executable, or source code differential comparisons against -either the Original Code or another well known, available Covered Code of the -Contributor's choice. The Source Code can be in a compressed or archival form, -provided the appropriate decompression or de-archiving software is widely -available for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity -exercising rights under, and complying with all of the terms of, this License -or a future version of this License issued under Section 6.1. For legal -entities, "You" includes any entity which controls, is controlled by, or is -under common control with You. For purposes of this definition, "control" -means (a) the power, direct or indirect, to cause the direction or management -of such entity, whether by contract or otherwise, or (b) ownership of more -than fifty percent (50%) of the outstanding shares or beneficial ownership of -such entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - The Initial Developer hereby grants You a world-wide, royalty-free, -non-exclusive license, subject to third party intellectual property claims: - (a) under intellectual property rights (other than patent or -trademark) Licensable by Initial Developer to use, reproduce, modify, display, -perform, sublicense and distribute the Original Code (or portions thereof) -with or without Modifications, and/or as part of a Larger Work; and - - (b) under Patents Claims infringed by the making, using or selling -of Original Code, to make, have made, use, practice, sell, and offer for sale, -and/or otherwise dispose of the Original Code (or portions thereof). - (c) the licenses granted in this Section 2.1(a) and -(b) are effective on the date Initial Developer first distributes Original -Code under the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is -granted: 1) for code that You delete from the Original Code; 2) separate from -the Original Code; or 3) for infringements caused by: i) the modification of -the Original Code or ii) the combination of the Original Code with other -software or devices. - - 2.2. Contributor Grant. - Subject to third party intellectual property claims, each Contributor -hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or -trademark) Licensable by Contributor, to use, reproduce, modify, display, -perform, sublicense and distribute the Modifications created by such -Contributor (or portions thereof) either on an unmodified basis, with other -Modifications, as Covered Code and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, using, or selling -of Modifications made by that Contributor either alone and/or in combination -with its Contributor Version (or portions of such combination), to make, use, -sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications -made by that Contributor (or portions thereof); and 2) the combination of -Modifications made by that Contributor with its Contributor Version (or -portions of such combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are -effective on the date Contributor first makes Commercial Use of the Covered -Code. - - (d) Notwithstanding Section 2.2(b) above, no patent license is -granted: 1) for any code that Contributor has deleted from the Contributor -Version; 2) separate from the Contributor Version; 3) for infringements -caused by: i) third party modifications of Contributor Version or ii) the -combination of Modifications made by that Contributor with other software -(except as part of the Contributor Version) or other devices; or 4) under -Patent Claims infringed by Covered Code in the absence of Modifications made -by that Contributor. - - -3. Distribution Obligations. - - 3.1. Application of License. - The Modifications which You create or to which You contribute are -governed by the terms of this License, including without limitation Section -2.2. The Source Code version of Covered Code may be distributed only under the -terms of this License or a future version of this License released under -Section 6.1, and You must include a copy of this License with every copy of -the Source Code You distribute. You may not offer or impose any terms on any -Source Code version that alters or restricts the applicable version of this -License or the recipients' rights hereunder. However, You may include an -additional document offering the additional rights described in Section 3.5. - - 3.2. Availability of Source Code. - Any Modification which You create or to which You contribute must be -made available in Source Code form under the terms of this License either on -the same media as an Executable version or via an accepted Electronic -Distribution Mechanism to anyone to whom you made an Executable version -available; and if made available via Electronic Distribution Mechanism, must -remain available for at least twelve (12) months after the date it initially -became available, or at least six (6) months after a subsequent version of -that particular Modification has been made available to such recipients. You -are responsible for ensuring that the Source Code version remains available -even if the Electronic Distribution Mechanism is maintained by a third party. - - 3.3. Description of Modifications. - You must cause all Covered Code to which You contribute to contain a -file documenting the changes You made to create that Covered Code and the date -of any change. You must include a prominent statement that the Modification is -derived, directly or indirectly, from Original Code provided by the Initial -Developer and including the name of the Initial Developer in (a) the Source -Code, and (b) in any notice in an Executable version or related documentation -in which You describe the origin or ownership of the Covered Code. - - 3.4. Intellectual Property Matters - (a) Third Party Claims. - If Contributor has knowledge that a license under a third party's -intellectual property rights is required to exercise the rights granted by -such Contributor under Sections 2.1 or 2.2, Contributor must include a text -file with the Source Code distribution titled "LEGAL" which describes the -claim and the party making the claim in sufficient detail that a recipient -will know whom to contact. If Contributor obtains such knowledge after the -Modification is made available as described in Section 3.2, Contributor shall -promptly modify the LEGAL file in all copies Contributor makes available -thereafter and shall take other steps (such as notifying appropriate mailing -lists or newsgroups) reasonably calculated to inform those who received the -Covered Code that new knowledge has been obtained. - - (b) Contributor APIs. - If Contributor's Modifications include an application programming -interface and Contributor has knowledge of patent licenses which are -reasonably necessary to implement that API, Contributor must also include this -information in the LEGAL file. - - (c) Representations. - Contributor represents that, except as disclosed pursuant to -Section 3.4(a) above, Contributor believes that Contributor's Modifications -are Contributor's original creation(s) and/or Contributor has sufficient -rights to grant the rights conveyed by this License. - - - 3.5. Required Notices. - You must duplicate the notice in Exhibit A in each file of the Source -Code. If it is not possible to put such notice in a particular Source Code -file due to its structure, then You must include such notice in a location -(such as a relevant directory) where a user would be likely to look for such a -notice. If You created one or more Modification(s) You may add your name as a -Contributor to the notice described in Exhibit A. You must also duplicate -this License in any documentation for the Source Code where You describe -recipients' rights or ownership rights relating to Covered Code. You may -choose to offer, and to charge a fee for, warranty, support, indemnity or -liability obligations to one or more recipients of Covered Code. However, You -may do so only on Your own behalf, and not on behalf of the Initial Developer -or any Contributor. You must make it absolutely clear than any such warranty, -support, indemnity or liability obligation is offered by You alone, and You -hereby agree to indemnify the Initial Developer and every Contributor for any -liability incurred by the Initial Developer or such Contributor as a result of -warranty, support, indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - You may distribute Covered Code in Executable form only if the -requirements of Section 3.1-3.5 have been met for that Covered Code, and if -You include a notice stating that the Source Code version of the Covered Code -is available under the terms of this License, including a description of how -and where You have fulfilled the obligations of Section 3.2. The notice must -be conspicuously included in any notice in an Executable version, related -documentation or collateral in which You describe recipients' rights relating -to the Covered Code. You may distribute the Executable version of Covered Code -or ownership rights under a license of Your choice, which may contain terms -different from this License, provided that You are in compliance with the -terms of this License and that the license for the Executable version does not -attempt to limit or alter the recipient's rights in the Source Code version -from the rights set forth in this License. If You distribute the Executable -version under a different license You must make it absolutely clear that any -terms which differ from this License are offered by You alone, not by the -Initial Developer or any Contributor. You hereby agree to indemnify the -Initial Developer and every Contributor for any liability incurred by the -Initial Developer or such Contributor as a result of any such terms You offer. - - 3.7. Larger Works. - You may create a Larger Work by combining Covered Code with other code -not governed by the terms of this License and distribute the Larger Work as a -single product. In such a case, You must make sure the requirements of this -License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Code due to statute, -judicial order, or regulation then You must: (a) comply with the terms of this -License to the maximum extent possible; and (b) describe the limitations and -the code they affect. Such description must be included in the LEGAL file -described in Section 3.4 and must be included with all distributions of the -Source Code. Except to the extent prohibited by statute or regulation, such -description must be sufficiently detailed for a recipient of ordinary skill to -be able to understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has attached -the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - Netscape Communications Corporation ("Netscape") may publish revised -and/or new versions of the License from time to time. Each version will be -given a distinguishing version number. - - 6.2. Effect of New Versions. - Once Covered Code has been published under a particular version of the -License, You may always continue to use it under the terms of that version. -You may also choose to use such Covered Code under the terms of any subsequent -version of the License published by Netscape. No one other than Netscape has -the right to modify the terms applicable to Covered Code created under this -License. - - 6.3. Derivative Works. - If You create or use a modified version of this License (which you may -only do in order to apply it to code which is not already Covered Code -governed by this License), You must (a) rename Your license so that the -phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or -any confusingly similar phrase do not appear in your license (except to note -that your license differs from this License) and (b) otherwise make it clear -that Your version of the license contains terms which differ from the Mozilla -Public License and Netscape Public License. (Filling in the name of the -Initial Developer, Original Code or Contributor in the notice described in -Exhibit A shall not of themselves be deemed to be modifications of this -License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT -LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, -FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE -QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED -CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY -OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR -CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS -LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS -DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate -automatically if You fail to comply with terms herein and fail to cure such -breach within 30 days of becoming aware of the breach. All sublicenses to the -Covered Code which are properly granted shall survive any termination of this -License. Provisions which, by their nature, must remain in effect beyond the -termination of this License shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement -claim (excluding declatory judgment actions) against Initial Developer or a -Contributor (the Initial Developer or Contributor against whom You file such -action is referred to as "Participant") alleging that: - - (a) such Participant's Contributor Version directly or indirectly -infringes any patent, then any and all rights granted by such Participant to -You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice -from Participant terminate prospectively, unless if within 60 days after -receipt of notice You either: (i) agree in writing to pay Participant a -mutually agreeable reasonable royalty for Your past and future use of -Modifications made by such Participant, or (ii) withdraw Your litigation claim -with respect to the Contributor Version against such Participant. If within -60 days of notice, a reasonable royalty and payment arrangement are not -mutually agreed upon in writing by the parties or the litigation claim is not -withdrawn, the rights granted by Participant to You under Sections 2.1 and/or -2.2 automatically terminate at the expiration of the 60 day notice period -specified above. - - (b) any software, hardware, or device, other than such Participant's -Contributor Version, directly or indirectly infringes any patent, then any -rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are -revoked effective as of the date You first made, used, sold, distributed, or -had made, Modifications made by that Participant. - - 8.3. If You assert a patent infringement claim against Participant -alleging that such Participant's Contributor Version directly or indirectly -infringes any patent where such claim is resolved (such as by license or -settlement) prior to the initiation of patent infringement litigation, then -the reasonable value of the licenses granted by such Participant under -Sections 2.1 or 2.2 shall be taken into account in determining the amount or -value of any payment or license. - - 8.4. In the event of termination under Sections 8.1 or 8.2 above, all -end user license agreements (excluding distributors and resellers) which have -been validly granted by You or any distributor hereunder prior to termination -shall survive termination. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT -(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL -DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY -SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, -SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, -WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER -FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, -EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH -DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH -OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT -APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE -EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS -EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in 48 -C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and -"commercial computer software documentation," as such terms are used in 48 -C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. -227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users -acquire Covered Code with only those rights set forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject matter -hereof. If any provision of this License is held to be unenforceable, such -provision shall be reformed only to the extent necessary to make it -enforceable. This License shall be governed by California law provisions -(except to the extent applicable law, if any, provides otherwise), excluding -its conflict-of-law provisions. With respect to disputes in which at least one -party is a citizen of, or an entity chartered or registered to do business in -the United States of America, any litigation relating to this License shall be -subject to the jurisdiction of the Federal Courts of the Northern District of -California, with venue lying in Santa Clara County, California, with the -losing party responsible for costs, including without limitation, court costs -and reasonable attorneys' fees and expenses. The application of the United -Nations Convention on Contracts for the International Sale of Goods is -expressly excluded. Any law or regulation which provides that the language of -a contract shall be construed against the drafter shall not apply to this -License. - -12. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is -responsible for claims and damages arising, directly or indirectly, out of its -utilization of rights under this License and You agree to work with Initial -Developer and Contributors to distribute such responsibility on an equitable -basis. Nothing herein is intended or shall be deemed to constitute any -admission of liability. - -13. MULTIPLE-LICENSED CODE. - - Initial Developer may designate portions of the Covered Code as -Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits -you to utilize portions of the Covered Code under Your choice of the MPL or -the alternative licenses, if any, specified by the Initial Developer in the -file described in Exhibit A. - - -EXHIBIT A -Mozilla Public License. - - ``The contents of this file are subject to the Mozilla Public License -Version 1.1 (the "License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" -basis, WITHOUT WARRANTY OF - ANY KIND, either express or implied. See the License for the specific -language governing rights and - limitations under the License. - - The Original Code is ______________________________________. - - The Initial Developer of the Original Code is ________________________. -Portions created by - ______________________ are Copyright (C) ______ -_______________________. All Rights - Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the terms of -the _____ license (the [___] License), in which case the provisions of -[______] License are applicable instead of those above. If you wish to allow -use of your version of this file only under the terms of the [____] License -and not to allow others to use your version of this file under the MPL, -indicate your decision by deleting the provisions above and replace them -with the notice and other provisions required by the [___] License. If you do -not delete the provisions above, a recipient may use your version of this file -under either the MPL or the [___] License." - - [NOTE: The text of this Exhibit A may differ slightly from the text of -the notices in the Source Code files of the Original Code. You should use the -text of this Exhibit A rather than the text found in the Original Code Source -Code for Your Modifications.] - - -=============================================================================== - -For the JAX-WS Reference Implementation component: - -COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 - - - 1. Definitions. - - 1.1. "Contributor" means each individual or entity that - creates or contributes to the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the - Original Software, prior Modifications used by a - Contributor (if any), and the Modifications made by that - particular Contributor. - - 1.3. "Covered Software" means (a) the Original Software, or - (b) Modifications, or (c) the combination of files - containing Original Software with files containing - Modifications, in each case including portions thereof. - - 1.4. "Executable" means the Covered Software in any form - other than Source Code. - - 1.5. "Initial Developer" means the individual or entity - that first makes Original Software available under this - License. - - 1.6. "Larger Work" means a work which combines Covered - Software or portions thereof with code not governed by the - terms of this License. - - 1.7. "License" means this document. - - 1.8. "Licensable" means having the right to grant, to the - maximum extent possible, whether at the time of the initial - grant or subsequently acquired, any and all of the rights - conveyed herein. - - 1.9. "Modifications" means the Source Code and Executable - form of any of the following: - - A. Any file that results from an addition to, - deletion from or modification of the contents of a - file containing Original Software or previous - Modifications; - - B. Any new file that contains any part of the - Original Software or previous Modification; or - - C. Any new file that is contributed or otherwise made - available under the terms of this License. - - 1.10. "Original Software" means the Source Code and - Executable form of computer software code that is - originally released under this License. - - 1.11. "Patent Claims" means any patent claim(s), now owned - or hereafter acquired, including without limitation, - method, process, and apparatus claims, in any patent - Licensable by grantor. - - 1.12. "Source Code" means (a) the common form of computer - software code in which modifications are made and (b) - associated documentation included in or with such code. - - 1.13. "You" (or "Your") means an individual or a legal - entity exercising rights under, and complying with all of - the terms of, this License. For legal entities, "You" - includes any entity which controls, is controlled by, or is - under common control with You. For purposes of this - definition, "control" means (a) the power, direct or - indirect, to cause the direction or management of such - entity, whether by contract or otherwise, or (b) ownership - of more than fifty percent (50%) of the outstanding shares - or beneficial ownership of such entity. - - 2. License Grants. - - 2.1. The Initial Developer Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, the - Initial Developer hereby grants You a world-wide, - royalty-free, non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Initial Developer, - to use, reproduce, modify, display, perform, - sublicense and distribute the Original Software (or - portions thereof), with or without Modifications, - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, - using or selling of Original Software, to make, have - made, use, practice, sell, and offer for sale, and/or - otherwise dispose of the Original Software (or - portions thereof). - - (c) The licenses granted in Sections 2.1(a) and (b) - are effective on the date Initial Developer first - distributes or otherwise makes the Original Software - available to a third party under the terms of this - License. - - (d) Notwithstanding Section 2.1(b) above, no patent - license is granted: (1) for code that You delete from - the Original Software, or (2) for infringements - caused by: (i) the modification of the Original - Software, or (ii) the combination of the Original - Software with other software or devices. - - 2.2. Contributor Grant. - - Conditioned upon Your compliance with Section 3.1 below and - subject to third party intellectual property claims, each - Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - (a) under intellectual property rights (other than - patent or trademark) Licensable by Contributor to - use, reproduce, modify, display, perform, sublicense - and distribute the Modifications created by such - Contributor (or portions thereof), either on an - unmodified basis, with other Modifications, as - Covered Software and/or as part of a Larger Work; and - - - (b) under Patent Claims infringed by the making, - using, or selling of Modifications made by that - Contributor either alone and/or in combination with - its Contributor Version (or portions of such - combination), to make, use, sell, offer for sale, - have made, and/or otherwise dispose of: (1) - Modifications made by that Contributor (or portions - thereof); and (2) the combination of Modifications - made by that Contributor with its Contributor Version - (or portions of such combination). - - (c) The licenses granted in Sections 2.2(a) and - 2.2(b) are effective on the date Contributor first - distributes or otherwise makes the Modifications - available to a third party. - - (d) Notwithstanding Section 2.2(b) above, no patent - license is granted: (1) for any code that Contributor - has deleted from the Contributor Version; (2) for - infringements caused by: (i) third party - modifications of Contributor Version, or (ii) the - combination of Modifications made by that Contributor - with other software (except as part of the - Contributor Version) or other devices; or (3) under - Patent Claims infringed by Covered Software in the - absence of Modifications made by that Contributor. - - 3. Distribution Obligations. - - 3.1. Availability of Source Code. - - Any Covered Software that You distribute or otherwise make - available in Executable form must also be made available in - Source Code form and that Source Code form must be - distributed only under the terms of this License. You must - include a copy of this License with every copy of the - Source Code form of the Covered Software You distribute or - otherwise make available. You must inform recipients of any - such Covered Software in Executable form as to how they can - obtain such Covered Software in Source Code form in a - reasonable manner on or through a medium customarily used - for software exchange. - - 3.2. Modifications. - - The Modifications that You create or to which You - contribute are governed by the terms of this License. You - represent that You believe Your Modifications are Your - original creation(s) and/or You have sufficient rights to - grant the rights conveyed by this License. - - 3.3. Required Notices. - - You must include a notice in each of Your Modifications - that identifies You as the Contributor of the Modification. - You may not remove or alter any copyright, patent or - trademark notices contained within the Covered Software, or - any notices of licensing or any descriptive text giving - attribution to any Contributor or the Initial Developer. - - 3.4. Application of Additional Terms. - - You may not offer or impose any terms on any Covered - Software in Source Code form that alters or restricts the - applicable version of this License or the recipients' - rights hereunder. You may choose to offer, and to charge a - fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Software. - However, you may do so only on Your own behalf, and not on - behalf of the Initial Developer or any Contributor. You - must make it absolutely clear that any such warranty, - support, indemnity or liability obligation is offered by - You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred - by the Initial Developer or such Contributor as a result of - warranty, support, indemnity or liability terms You offer. - - - 3.5. Distribution of Executable Versions. - - You may distribute the Executable form of the Covered - Software under the terms of this License or under the terms - of a license of Your choice, which may contain terms - different from this License, provided that You are in - compliance with the terms of this License and that the - license for the Executable form does not attempt to limit - or alter the recipient's rights in the Source Code form - from the rights set forth in this License. If You - distribute the Covered Software in Executable form under a - different license, You must make it absolutely clear that - any terms which differ from this License are offered by You - alone, not by the Initial Developer or Contributor. You - hereby agree to indemnify the Initial Developer and every - Contributor for any liability incurred by the Initial - Developer or such Contributor as a result of any such terms - You offer. - - 3.6. Larger Works. - - You may create a Larger Work by combining Covered Software - with other code not governed by the terms of this License - and distribute the Larger Work as a single product. In such - a case, You must make sure the requirements of this License - are fulfilled for the Covered Software. - - 4. Versions of the License. - - 4.1. New Versions. - - Sun Microsystems, Inc. is the initial license steward and - may publish revised and/or new versions of this License - from time to time. Each version will be given a - distinguishing version number. Except as provided in - Section 4.3, no one other than the license steward has the - right to modify this License. - - 4.2. Effect of New Versions. - - You may always continue to use, distribute or otherwise - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. If the Initial Developer includes a - notice in the Original Software prohibiting it from being - distributed or otherwise made available under any - subsequent version of the License, You must distribute and - make the Covered Software available under the terms of the - version of the License under which You originally received - the Covered Software. Otherwise, You may also choose to - use, distribute or otherwise make the Covered Software - available under the terms of any subsequent version of the - License published by the license steward. - - 4.3. Modified Versions. - - When You are an Initial Developer and You want to create a - new license for Your Original Software, You may create and - use a modified version of this License if You: (a) rename - the license and remove any references to the name of the - license steward (except to note that the license differs - from this License); and (b) otherwise make it clear that - the license contains terms which differ from this License. - - - 5. DISCLAIMER OF WARRANTY. - - COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" - BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, - INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED - SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR - PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND - PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY - COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE - INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF - ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF - WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS - DISCLAIMER. - - 6. TERMINATION. - - 6.1. This License and the rights granted hereunder will - terminate automatically if You fail to comply with terms - herein and fail to cure such breach within 30 days of - becoming aware of the breach. Provisions which, by their - nature, must remain in effect beyond the termination of - this License shall survive. - - 6.2. If You assert a patent infringement claim (excluding - declaratory judgment actions) against Initial Developer or - a Contributor (the Initial Developer or Contributor against - whom You assert such claim is referred to as "Participant") - alleging that the Participant Software (meaning the - Contributor Version where the Participant is a Contributor - or the Original Software where the Participant is the - Initial Developer) directly or indirectly infringes any - patent, then any and all rights granted directly or - indirectly to You by such Participant, the Initial - Developer (if the Initial Developer is not the Participant) - and all Contributors under Sections 2.1 and/or 2.2 of this - License shall, upon 60 days notice from Participant - terminate prospectively and automatically at the expiration - of such 60 day notice period, unless if within such 60 day - period You withdraw Your claim with respect to the - Participant Software against such Participant either - unilaterally or pursuant to a written agreement with - Participant. - - 6.3. In the event of termination under Sections 6.1 or 6.2 - above, all end user licenses that have been validly granted - by You or any distributor hereunder prior to termination - (excluding licenses granted to You by any distributor) - shall survive termination. - - 7. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE - INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF - COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE - LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR - CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT - LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK - STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL - INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT - APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO - NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR - CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT - APPLY TO YOU. - - 8. U.S. GOVERNMENT END USERS. - - The Covered Software is a "commercial item," as that term is - defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial - computer software" (as that term is defined at 48 C.F.R. - 252.227-7014(a)(1)) and "commercial computer software - documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. - 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 - through 227.7202-4 (June 1995), all U.S. Government End Users - acquire Covered Software with only those rights set forth herein. - This U.S. Government Rights clause is in lieu of, and supersedes, - any other FAR, DFAR, or other clause or provision that addresses - Government rights in computer software under this License. - - 9. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the - extent necessary to make it enforceable. This License shall be - governed by the law of the jurisdiction specified in a notice - contained within the Original Software (except to the extent - applicable law, if any, provides otherwise), excluding such - jurisdiction's conflict-of-law provisions. Any litigation - relating to this License shall be subject to the jurisdiction of - the courts located in the jurisdiction and venue specified in a - notice contained within the Original Software, with the losing - party responsible for costs, including, without limitation, court - costs and reasonable attorneys' fees and expenses. The - application of the United Nations Convention on Contracts for the - International Sale of Goods is expressly excluded. Any law or - regulation which provides that the language of a contract shall - be construed against the drafter shall not apply to this License. - You agree that You alone are responsible for compliance with the - United States export administration regulations (and the export - control laws and regulation of any other countries) when You use, - distribute or otherwise make available any Covered Software. - - 10. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or - indirectly, out of its utilization of rights under this License - and You agree to work with Initial Developer and Contributors to - distribute such responsibility on an equitable basis. Nothing - herein is intended or shall be deemed to constitute any admission - of liability. - diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/META-INF/NOTICE b/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/META-INF/NOTICE deleted file mode 100644 index d48810c0ec..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/META-INF/NOTICE +++ /dev/null @@ -1,18 +0,0 @@ -========================================================================= -== NOTICE file corresponding to the section 4 d of == -== the Apache License, Version 2.0, == -== in this case for the Apache Tuscany distribution. == -========================================================================= - -This product includes software developed by the Apache Software Foundation -(http://www.apache.org/). - -This product also includes software developed by: -- the Eclipse Modeling Framework project (http://www.eclipse.org/emf/) -- the Celtix project (http://celtix.objectweb.org/) -- the Mozilla Rhino project (http://www.mozilla.org/rhino/) -- the GlassFish JAX-WS project (https://jax-ws.dev.java.net/) - -Please read the LICENSE.txt file present in the root directory of this -distribution. - diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/WEB-INF/default.scdl b/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/WEB-INF/default.scdl deleted file mode 100644 index 7344783958..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/WEB-INF/default.scdl +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - HelloWorldServiceComponent - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/WEB-INF/web.xml b/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index f103b8e456..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - Tuscany sample HelloWorld JSON-RPC - - - HelloWorldJSONRPC.html - - - - tuscany.online - false - - - - org.apache.tuscany.runtime.webapp.TuscanyContextListener - - - - TuscanyServlet - Tuscany Servlet - org.apache.tuscany.runtime.webapp.TuscanyServlet - - - - TuscanyServlet - /services/* - - - diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/style.css b/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/style.css deleted file mode 100644 index eb246aaf14..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/helloworld/src/main/webapp/style.css +++ /dev/null @@ -1,4 +0,0 @@ -* { font-family: arial; } - -table, th, td { border: 2px solid blue; border-collapse: collapse; } -th { color: white; background-color: blue; } diff --git a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/pom.xml b/branches/sca-java-integration/sca/extensions/jsonrpc/samples/pom.xml deleted file mode 100644 index c61621c441..0000000000 --- a/branches/sca-java-integration/sca/extensions/jsonrpc/samples/pom.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - org.apache.tuscany.sca.extensions.jsonrpc - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - org.apache.tuscany.sca.extensions.jsonrpc.samples - parent - pom - Tuscany Samples for the JSONRPC extension - - - - - apache.snapshots - Apache Snapshot Repository - http://people.apache.org/repo/m2-snapshot-repository - - false - - - true - - - - apache.incubator - Apache Incubator Repository - http://people.apache.org/repo/m2-incubating-repository/ - - true - - - false - - - - - - helloworld - - - - - - org.codehaus.mojo - dependency-maven-plugin - - - - org.apache.tuscany.distribution.sca - standalone - ${scaImplVersion} - bin - zip - - - ${project.build.directory}/distribution - - - - - - - - - org.osoa - sca-api-r1.0 - 0.1-integration-incubating-SNAPSHOT - compile - - - - - diff --git a/branches/sca-java-integration/sca/extensions/pom.xml b/branches/sca-java-integration/sca/extensions/pom.xml deleted file mode 100644 index 55e92af872..0000000000 --- a/branches/sca-java-integration/sca/extensions/pom.xml +++ /dev/null @@ -1,159 +0,0 @@ - - - - - org.apache.tuscany.sca - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - org.apache.tuscany.sca.extensions - parent - 0.1-integration-incubating-SNAPSHOT - pom - Apache Tuscany SCA Extensions - - - 0.1-integration-incubating-SNAPSHOT - 0.1-integration-incubating-SNAPSHOT - 0.1-integration-incubating-SNAPSHOT - 1.0 - 0.1-integration-incubating-SNAPSHOT - 1.0-incubator-SNAPSHOT - - - - - - apache.snapshots - Apache Snapshot Repository - http://people.apache.org/repo/m2-snapshot-repository - - false - - - true - - - - apache.incubator - Apache Incubator Repository - http://people.apache.org/repo/m2-incubating-repository/ - - true - - - false - - - - - - - - stable - - true - - - axis2 - jms - - - - - integration - - axis2 - script - jms - jsonrpc - - - - - unstable - - axis2 - script - jms - jsonrpc - - - - - - - - - - org.osoa - sca-api-r1.0 - 0.1-integration-incubating-SNAPSHOT - compile - - - - junit - junit - 4.2 - test - - - - org.easymock - easymock - 2.2 - test - - - - org.easymock - easymockclassextension - 2.2 - test - - - - org.apache.tuscany.sca.kernel - tuscany-api - ${scaKernelVersion} - compile - - - - org.apache.tuscany.sca.kernel - tuscany-spi - ${scaKernelVersion} - compile - - - - org.apache.tuscany.sca.services.idl - tuscany-wsdl - ${scaKernelVersion} - compile - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/.ruleset b/branches/sca-java-integration/sca/extensions/script/container.bsf/.ruleset deleted file mode 100644 index a1547fea92..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/LICENSE.txt b/branches/sca-java-integration/sca/extensions/script/container.bsf/LICENSE.txt deleted file mode 100755 index 0084319535..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/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-integration/sca/extensions/script/container.bsf/NOTICE.txt b/branches/sca-java-integration/sca/extensions/script/container.bsf/NOTICE.txt deleted file mode 100644 index ecc68a9614..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/NOTICE.txt +++ /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-integration/sca/extensions/script/container.bsf/pom.xml b/branches/sca-java-integration/sca/extensions/script/container.bsf/pom.xml deleted file mode 100644 index a9930d5315..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/pom.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - org.apache.tuscany.sca.extensions - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - tuscany-bsf - Apache Tuscany Script Container - Apache Tuscany Script Container using BSF - - - - - org.apache.tuscany.sca.kernel - tuscany-spi - 0.1-integration-incubating-SNAPSHOT - compile - - - - org.apache.tuscany.sca.kernel - tuscany-api - 0.1-integration-incubating-SNAPSHOT - compile - - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - - junit - junit - 4.2 - test - - - - bsf - bsf - 2.4.0 - compile - - - - commons-logging - commons-logging - 1.1 - runtime - - - - asm - asm - 2.2 - compile - - - - org.easymock - easymock - - - - org.easymock - easymockclassextension - - - - - diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptComponent.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptComponent.java deleted file mode 100644 index f79325170a..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptComponent.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.container.script; - -import static org.objectweb.asm.Opcodes.ACC_ABSTRACT; -import static org.objectweb.asm.Opcodes.ACC_INTERFACE; -import static org.objectweb.asm.Opcodes.ACC_PUBLIC; -import static org.objectweb.asm.Opcodes.V1_5; - -import java.util.Arrays; - -import org.apache.tuscany.spi.ObjectCreationException; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.component.TargetResolutionException; -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.extension.AtomicComponentExtension; -import org.apache.tuscany.spi.extension.ExecutionMonitor; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.model.Scope; -import org.apache.tuscany.spi.model.ServiceContract; -import org.apache.tuscany.spi.services.work.WorkScheduler; -import org.apache.tuscany.spi.wire.InboundWire; -import org.apache.tuscany.spi.wire.OutboundWire; -import org.apache.tuscany.spi.wire.TargetInvoker; -import org.apache.tuscany.spi.wire.WireObjectFactory; -import org.apache.tuscany.spi.wire.WireService; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.Type; - -/** - * A component implementation for script languages. - */ -public class ScriptComponent extends AtomicComponentExtension { - - private ScriptInstanceFactory factory; - - public ScriptComponent(String name, - CompositeComponent parent, - WireService wireService, - WorkContext workContext, - WorkScheduler workScheduler, - ExecutionMonitor monitor, - int initLevel, - ScriptInstanceFactory factory, - Scope scope) { - super(name, parent, wireService, workContext, workScheduler, monitor, initLevel); - this.factory = factory; - this.scope = scope; - setPassByReferenceMethods(Arrays.asList(new String[]{})); - } - - public Object createInstance() throws ObjectCreationException { - return factory.getInstance(); - } - - public TargetInvoker createTargetInvoker(String targetName, Operation operation, InboundWire callbackWire) { - return new ScriptTargetInvoker(operation.getName(), this); - } - - @SuppressWarnings({"unchecked"}) - protected void onReferenceWire(OutboundWire wire) { - Class clazz = wire.getServiceContract().getInterfaceClass(); - if (clazz == null) { - clazz = createInterfaceClass(wire.getServiceContract()); - } - factory.addContextObjectFactory(wire.getReferenceName(), clazz, new WireObjectFactory(clazz, wire, wireService)); - } - - public Object getTargetInstance() throws TargetResolutionException { - return scopeContainer.getInstance(this); - } - - /** - * Create an Java interface class for the WSDL ServiceContract - * TODO: this should probably be moved to wsdl idl module - */ - private Class createInterfaceClass(ServiceContract serviceContract) { - ClassWriter cw = new ClassWriter(false); - - // Generate the interface - String interfaceName = serviceContract.getInterfaceName(); - cw.visit(V1_5, - ACC_PUBLIC + ACC_ABSTRACT + ACC_INTERFACE, - interfaceName, - null, - "java/lang/Object", - new String[0]); - - // Generate methods from the WSDL operations - for (Object o : serviceContract.getOperations().values()) { - Operation operation = (Operation)o; - String inputType = Type.getDescriptor(Object.class); - String outputType = Type.getDescriptor(Object.class); - cw.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, - operation.getName(), - "(" + inputType + ")" + outputType, - null, - null).visitEnd(); - } - - // Generate the bytecodes - cw.visitEnd(); - byte[] bytes = cw.toByteArray(); - - Class interfaceClass = new GeneratedClassLoader().defineClass(bytes); - - return interfaceClass; - } - - private class GeneratedClassLoader extends ClassLoader { - public Class defineClass(byte[] byteArray) { - try { - return defineClass(null, byteArray, 0, byteArray.length); - } catch (Throwable e) { - return null; - } - } - } -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptComponentBuilder.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptComponentBuilder.java deleted file mode 100644 index fee815680f..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptComponentBuilder.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.container.script; - -import org.apache.tuscany.spi.builder.BuilderConfigException; -import org.apache.tuscany.spi.component.Component; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.component.ScopeContainer; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.extension.ComponentBuilderExtension; -import org.apache.tuscany.spi.idl.java.JavaServiceContract; -import org.apache.tuscany.spi.model.ComponentDefinition; -import org.apache.tuscany.spi.model.PropertyValue; -import org.apache.tuscany.spi.model.Scope; -import org.apache.tuscany.spi.model.ServiceContract; -import org.apache.tuscany.spi.model.ServiceDefinition; - -/** - * Extension point for creating {@link ScriptComponent}s from an assembly configuration - * - * @version $Rev$ $Date$ - */ -public class ScriptComponentBuilder extends ComponentBuilderExtension { - - public ScriptComponentBuilder() { - } - - protected Class getImplementationType() { - return ScriptImplementation.class; - } - - public Component build(CompositeComponent parent, ComponentDefinition componentDefinition, - DeploymentContext deploymentContext) throws BuilderConfigException { - - ScriptImplementation implementation = componentDefinition.getImplementation(); - - for (ServiceDefinition service : implementation.getComponentType().getServices().values()) { - // if its not a Java interface assume WSDL and want XML databinding - ServiceContract contract = service.getServiceContract(); - if (!(contract instanceof JavaServiceContract)) { - service.getServiceContract().setDataBinding("org.mozilla.javascript.xmlimpl.XML"); - } - } - - ScriptInstanceFactory instanceFactory = createInstanceFactory(componentDefinition, implementation); - - String name = componentDefinition.getName(); - Scope scope = getScope(deploymentContext, implementation.getComponentType()); - - return new ScriptComponent(name, parent, wireService, workContext, workScheduler, null, 0, instanceFactory, scope); - } - - private ScriptInstanceFactory createInstanceFactory(ComponentDefinition componentDefinition, ScriptImplementation implementation) { - - String className = implementation.getClassName(); - String scriptSource = implementation.getScriptSource(); - String scriptName = implementation.getScriptName(); - ClassLoader cl = implementation.getClassLoader(); - - ScriptInstanceFactory instanceFactory = new ScriptInstanceFactory(scriptName, className, scriptSource, cl); - - // add the properties for the component - for (PropertyValue propertyValue : componentDefinition.getPropertyValues().values()) { - instanceFactory.addContextObjectFactory(propertyValue.getName(), propertyValue.getValueFactory()); - } - - return instanceFactory; - } - - protected Scope getScope(DeploymentContext deploymentContext, ScriptComponentType componentType) { - ScopeContainer scopeContainer; - Scope scope = componentType.getImplementationScope(); - if (Scope.COMPOSITE == scope) { - scopeContainer = deploymentContext.getCompositeScope(); - } else { - scopeContainer = scopeRegistry.getScopeContainer(scope); - } - return scopeContainer.getScope(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptComponentType.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptComponentType.java deleted file mode 100644 index 70ec3e88c7..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptComponentType.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.container.script; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.spi.model.ComponentType; -import org.apache.tuscany.spi.model.Property; -import org.apache.tuscany.spi.model.ReferenceDefinition; -import org.apache.tuscany.spi.model.Scope; -import org.apache.tuscany.spi.model.ServiceDefinition; - -/** - * A componentType for script components TODO: need lifecycle methods - * init/destroy - */ -public class ScriptComponentType extends ComponentType> { - - public ScriptComponentType() { - this.implementationScope = Scope.COMPOSITE; - } - - @Override - public Property getProperty(String name) { - Property p = super.getProperty(name); - if (p == null) { - p = new Property(name, new QName("http://www.w3.org/2001/XMLSchema", "any"), null); - } - return p; - } -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptComponentTypeLoader.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptComponentTypeLoader.java deleted file mode 100644 index 5c3e420b29..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptComponentTypeLoader.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.container.script; - -import java.net.URL; - -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.extension.ComponentTypeLoaderExtension; -import org.apache.tuscany.spi.loader.LoaderException; -import org.apache.tuscany.spi.loader.MissingSideFileException; -import org.apache.tuscany.spi.model.ComponentType; - -/** - * ComponentType loader for script components - */ -public class ScriptComponentTypeLoader extends ComponentTypeLoaderExtension { - - public ScriptComponentTypeLoader() { - } - - @Override - protected Class getImplementationClass() { - return ScriptImplementation.class; - } - - public void load(CompositeComponent parent, - ScriptImplementation implementation, - DeploymentContext deploymentContext) throws LoaderException { - String sideFile = getSideFileName(implementation.getResourceName()); - URL resource = implementation.getClassLoader().getResource(sideFile); - ScriptComponentType componentType; - if (resource == null) { - throw new MissingSideFileException("Component type side file not found", sideFile); - // TODO: or else implement introspection - } else { - componentType = loadFromSidefile(parent, resource, deploymentContext); - } - implementation.setComponentType(componentType); - } - - @SuppressWarnings("unchecked") - protected ScriptComponentType loadFromSidefile(CompositeComponent parent, - URL url, - DeploymentContext deploymentContext) - throws LoaderException { - ScriptComponentType scriptComponentType = new ScriptComponentType(); - return (ScriptComponentType) loaderRegistry - .load(parent, scriptComponentType, url, ComponentType.class, deploymentContext); - } - - protected String getSideFileName(String resourceName) { - int lastDot = resourceName.lastIndexOf('.'); - if (lastDot != -1) { - resourceName = resourceName.substring(0, lastDot); - } - return resourceName + ".componentType"; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementation.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementation.java deleted file mode 100644 index 8b54944cf4..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementation.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.container.script; - -import org.apache.tuscany.spi.model.AtomicImplementation; - -/** - * Model object for a script implementation. - */ -public class ScriptImplementation extends AtomicImplementation { - - private String resourceName; - private String className; - private String scriptSource; - private String scriptName; - private ClassLoader classLoader; - - public String getResourceName() { - return resourceName; - } - - public void setResourceName(String resourceName) { - this.resourceName = resourceName; - } - - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - public String getScriptSource() { - return scriptSource; - } - - public void setScriptSource(String scriptSource) { - this.scriptSource = scriptSource; - } - - public String getScriptName() { - return scriptName; - } - - public void setScriptName(String scriptName) { - this.scriptName = scriptName; - } - - public ClassLoader getClassLoader() { - return classLoader; - } - - public void setClassLoader(ClassLoader classLoader) { - this.classLoader = classLoader; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementationJavaScriptLoader.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementationJavaScriptLoader.java deleted file mode 100644 index 1e48309dc6..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementationJavaScriptLoader.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.container.script; - -import static org.osoa.sca.Constants.SCA_NS; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.loader.LoaderRegistry; -import org.osoa.sca.annotations.Constructor; - -public class ScriptImplementationJavaScriptLoader extends ScriptImplementationLoader { - - private static final QName IMPLEMENTATION_JS = new QName(SCA_NS, "implementation.js"); - - @Constructor({"registry"}) - public ScriptImplementationJavaScriptLoader(@Autowire LoaderRegistry registry) { - super(registry); - } - - public QName getXMLType() { - return IMPLEMENTATION_JS; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementationLoader.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementationLoader.java deleted file mode 100644 index 2751011443..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementationLoader.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.container.script; - -import static org.osoa.sca.Constants.SCA_NS; - -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.net.URL; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.extension.LoaderExtension; -import org.apache.tuscany.spi.loader.LoaderException; -import org.apache.tuscany.spi.loader.LoaderRegistry; -import org.apache.tuscany.spi.loader.LoaderUtil; -import org.apache.tuscany.spi.loader.MissingResourceException; -import org.apache.tuscany.spi.model.ModelObject; -import org.osoa.sca.annotations.Constructor; - -/** - * Loader for handling implementation.script elements. - *

- * - * - * @version $Rev$ $Date$ - */ -public class ScriptImplementationLoader extends LoaderExtension { - - private static final QName IMPLEMENTATION_SCRIPT = new QName(SCA_NS, "implementation.script"); - - @Constructor({"registry"}) - public ScriptImplementationLoader(@Autowire LoaderRegistry registry) { - super(registry); - } - - public QName getXMLType() { - return IMPLEMENTATION_SCRIPT; - } - - public ScriptImplementation load(CompositeComponent parent, ModelObject mo, XMLStreamReader reader, - DeploymentContext deploymentContext) throws XMLStreamException, LoaderException { - String scriptName = reader.getAttributeValue(null, "script"); - if (scriptName == null) { - throw new MissingResourceException("implementation element has no 'script' attribute"); - } - - String className = reader.getAttributeValue(null, "class"); - - LoaderUtil.skipToEndElement(reader); - - ClassLoader cl = deploymentContext.getClassLoader(); - String scriptSource = loadSource(cl, scriptName); - - ScriptImplementation implementation = new ScriptImplementation(); - implementation.setResourceName(scriptName); - implementation.setScriptSource(scriptSource); - implementation.setClassName(className); - implementation.setScriptName(scriptName); - implementation.setClassLoader(cl); - - registry.loadComponentType(parent, implementation, deploymentContext); - - return implementation; - } - - protected String loadSource(ClassLoader cl, String resource) throws LoaderException { - URL url = cl.getResource(resource); - if (url == null) { - throw new MissingResourceException(resource); - } - InputStream is; - try { - is = url.openStream(); - } catch (IOException e) { - throw new MissingResourceException(resource, e); - } - try { - Reader reader = new InputStreamReader(is, "UTF-8"); - char[] buffer = new char[1024]; - StringBuilder source = new StringBuilder(); - int count; - while ((count = reader.read(buffer)) > 0) { - source.append(buffer, 0, count); - } - return source.toString(); - } catch (IOException e) { - throw new LoaderException(resource, e); - } finally { - try { - is.close(); - } catch (IOException e) { - // ignore - } - } - } -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementationPythonLoader.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementationPythonLoader.java deleted file mode 100644 index 9836794e3a..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementationPythonLoader.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.container.script; - -import static org.osoa.sca.Constants.SCA_NS; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.loader.LoaderException; -import org.apache.tuscany.spi.loader.LoaderRegistry; -import org.apache.tuscany.spi.loader.LoaderUtil; -import org.apache.tuscany.spi.loader.MissingResourceException; -import org.apache.tuscany.spi.model.ModelObject; -import org.osoa.sca.annotations.Constructor; - -public class ScriptImplementationPythonLoader extends ScriptImplementationLoader { - - private static final QName IMPLEMENTATION_PYTHON = new QName(SCA_NS, "implementation.python"); - - @Constructor({"registry"}) - public ScriptImplementationPythonLoader(@Autowire LoaderRegistry registry) { - super(registry); - } - - public QName getXMLType() { - return IMPLEMENTATION_PYTHON; - } - - @Override - public ScriptImplementation load(CompositeComponent parent, ModelObject mo, XMLStreamReader reader, - DeploymentContext deploymentContext) throws XMLStreamException, LoaderException { - String scriptName = reader.getAttributeValue(null, "module"); - if (scriptName == null) { - throw new MissingResourceException("implementation element has no 'module' attribute"); - } - - String className = reader.getAttributeValue(null, "class"); - - LoaderUtil.skipToEndElement(reader); - - ClassLoader cl = deploymentContext.getClassLoader(); - String scriptSource = loadSource(cl, scriptName); - - ScriptImplementation implementation = new ScriptImplementation(); - implementation.setResourceName(scriptName); - implementation.setScriptSource(scriptSource); - implementation.setClassName(className); - implementation.setScriptName(scriptName); - implementation.setClassLoader(cl); - - registry.loadComponentType(parent, implementation, deploymentContext); - - return implementation; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementationRubyLoader.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementationRubyLoader.java deleted file mode 100644 index 42dab55246..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptImplementationRubyLoader.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.container.script; - -import static org.osoa.sca.Constants.SCA_NS; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.loader.LoaderRegistry; -import org.osoa.sca.annotations.Constructor; - -public class ScriptImplementationRubyLoader extends ScriptImplementationLoader { - - private static final QName IMPLEMENTATION_RUBY = new QName(SCA_NS, "implementation.ruby"); - - @Constructor({"registry"}) - public ScriptImplementationRubyLoader(@Autowire LoaderRegistry registry) { - super(registry); - } - - public QName getXMLType() { - return IMPLEMENTATION_RUBY; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptInstance.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptInstance.java deleted file mode 100644 index 988d2a96c2..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptInstance.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.container.script; - -import java.lang.reflect.InvocationTargetException; - -import org.apache.bsf.BSFEngine; -import org.apache.bsf.BSFException; - -/** - * An invokable instance of a script - * - * Basically just a wrapper around a BSF engine with an optional script class object. - */ -public class ScriptInstance { - - protected BSFEngine bsfEngine; - protected Object clazz; - - public ScriptInstance(BSFEngine bsfEngine, Object clazz) { - this.bsfEngine = bsfEngine; - this.clazz = clazz; - } - - public Object invokeTarget(String operationName, Object[] args) throws InvocationTargetException { - try { - return bsfEngine.call(clazz, operationName, args); - } catch (BSFException e) { - throw new InvocationTargetException(e.getTargetException() != null ? e.getTargetException() : e); - } catch (Exception e) { - throw new InvocationTargetException(e); - } - } -} - diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptInstanceFactory.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptInstanceFactory.java deleted file mode 100644 index 201af2265a..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptInstanceFactory.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.container.script; - -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.spi.ObjectCreationException; -import org.apache.tuscany.spi.ObjectFactory; - -import org.apache.bsf.BSFEngine; -import org.apache.bsf.BSFException; -import org.apache.bsf.BSFManager; - -/** - * ScriptFactory creates ScriptInstances for a script - */ -public class ScriptInstanceFactory implements ObjectFactory { - protected String resourceName; - protected ClassLoader classLoader; - private String className; - private String scriptSource; - private Map contextObjects; - private Map contextTypes; - - public ScriptInstanceFactory(String resourceName, String className, String scriptSource, ClassLoader classLoader) { - this.resourceName = resourceName; - this.classLoader = classLoader; - this.className = className; - this.scriptSource = scriptSource; - this.contextObjects = new HashMap(); - this.contextTypes = new HashMap(); - } - - /** - * Create a new invokeable instance of the script

objects to add to - * scope of the script instance - * - * @return a RhinoScriptInstance - */ - // public ScriptInstanceImpl createInstance(List> serviceBindings, - // Map context) { - public ScriptInstance getInstance() throws ObjectCreationException { - try { - - // TODO: this uses a new manager and recompiles the scrip each time, - // may be able to optimize - // but need to be careful about instance scoping - - BSFManager bsfManager = new BSFManager(); - bsfManager.setClassLoader(BSFManager.class.getClassLoader()); - - // TODO: hack to get Ruby working with the standalone launcher - Thread.currentThread().setContextClassLoader(BSFManager.class.getClassLoader()); - - // register any context objects (SCA properties and references) - for (Map.Entry entry : contextObjects.entrySet()) { - Object value = entry.getValue().getInstance(); - Class type = contextTypes.get(entry.getKey()); - if (type == null) { - type = value.getClass(); - } - bsfManager.declareBean(entry.getKey(), value, type); - } - - String scriptLanguage = BSFManager.getLangFromFilename(resourceName); - BSFEngine bsfEngine = bsfManager.loadScriptingEngine(scriptLanguage); - bsfEngine.exec(resourceName, 0, 0, scriptSource); - - // register any context objects (SCA properties and references) - for (Map.Entry entry : contextObjects.entrySet()) { - Object value = entry.getValue().getInstance(); - Class type = contextTypes.get(entry.getKey()); - if (type == null) { - type = value.getClass(); - } - // TODO: Hack to bypass bug in BSF javascript engine - if (!("javascript".equals(scriptLanguage)) || (value instanceof Number) || (value instanceof String) || (value instanceof Boolean)) { - bsfManager.declareBean(entry.getKey(), value, type); - } - } - - // if there's a className then get the class object - Object clazz = null; - if (className != null) { - // special case for Ruby which requires a .new call - if ("ruby".equals(scriptLanguage)) { - clazz = bsfEngine.eval(null, 1, 1, className + ".new"); - } else { - clazz = bsfEngine.call(null, className, null); - } - } - - return new ScriptInstance(bsfEngine, clazz); - - } catch (BSFException e) { - if (e.getTargetException() != null) { - throw new ObjectCreationException(e.getTargetException()); - } - throw new ObjectCreationException(e.getTargetException()); - } - } - - public String getResourceName() { - return resourceName; - } - - public ClassLoader getClassLoader() { - return classLoader; - } - - protected Map getResponseClasses(List services) { - Map responseClasses = new HashMap(); - if (services != null) { - for (Class s : services) { - for (Method m : s.getMethods()) { - responseClasses.put(m.getName(), m.getReturnType()); - } - } - } - return responseClasses; - } - - public void addContextObjectFactory(String name, ObjectFactory factory) { - contextObjects.put(name, factory); - } - - public void addContextObjectFactory(String name, Class type, ObjectFactory factory) { - contextObjects.put(name, factory); - contextTypes.put(name, type); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptTargetInvoker.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptTargetInvoker.java deleted file mode 100644 index 21b84bb83b..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/java/org/apache/tuscany/container/script/ScriptTargetInvoker.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.container.script; - -import java.lang.reflect.InvocationTargetException; - -import org.apache.tuscany.spi.component.TargetException; -import org.apache.tuscany.spi.extension.TargetInvokerExtension; - -/** - * TargetInvoker implementation that calls a function on a ScriptInstanceImpl - * - * @version $Rev$ $Dev$ - */ -public class ScriptTargetInvoker extends TargetInvokerExtension { - - protected ScriptComponent component; - protected String functionName; - - public ScriptTargetInvoker(String functionName, ScriptComponent component) { - super(null, null, null); - this.functionName = functionName; - this.component = component; - } - - public Object invokeTarget(final Object payload, final short sequence) throws InvocationTargetException { - ScriptInstance target; - try { - target = (ScriptInstance) component.getTargetInstance(); - } catch (TargetException e) { - throw new InvocationTargetException(e); - } - try { - return target.invokeTarget(functionName, (Object[]) payload); - } catch (Exception e) { - throw new InvocationTargetException(e); - } - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/resources/META-INF/sca/default.scdl b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/resources/META-INF/sca/default.scdl deleted file mode 100644 index 149fa2696c..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/resources/META-INF/sca/default.scdl +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/resources/META-INF/sca/extension.composite b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/resources/META-INF/sca/extension.composite deleted file mode 100644 index 1795216154..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/resources/META-INF/sca/extension.composite +++ /dev/null @@ -1,22 +0,0 @@ - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/resources/META-INF/sca/script.system.scdl b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/resources/META-INF/sca/script.system.scdl deleted file mode 100644 index f08d7d0fc0..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/main/resources/META-INF/sca/script.system.scdl +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptComponentBuilderTestCase.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptComponentBuilderTestCase.java deleted file mode 100644 index c8f3240272..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptComponentBuilderTestCase.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.container.script; - -import org.apache.tuscany.spi.ObjectFactory; -import org.apache.tuscany.spi.component.Component; -import org.apache.tuscany.spi.component.ScopeContainer; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.idl.java.JavaServiceContract; -import org.apache.tuscany.spi.model.ComponentDefinition; -import org.apache.tuscany.spi.model.PropertyValue; -import org.apache.tuscany.spi.model.Scope; -import org.apache.tuscany.spi.model.ServiceContract; -import org.apache.tuscany.spi.model.ServiceDefinition; - -import junit.framework.TestCase; -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import org.easymock.IAnswer; - -public class ScriptComponentBuilderTestCase extends TestCase { - - public void testGetImplementationType() { - ScriptComponentBuilder builder = new ScriptComponentBuilder(); - assertEquals(ScriptImplementation.class, builder.getImplementationType()); - } - - @SuppressWarnings("unchecked") - public void testBuild() throws Exception { - ScriptComponentBuilder builder = new ScriptComponentBuilder(); - DeploymentContext deploymentContext = createMock(DeploymentContext.class); - final ScopeContainer scopeContainer = createMock(ScopeContainer.class); - expect(scopeContainer.getScope()).andStubAnswer(new IAnswer() { - public Object answer() throws Throwable { - return Scope.COMPOSITE; - } - }); - expect(deploymentContext.getCompositeScope()).andStubAnswer(new IAnswer() { - public Object answer() throws Throwable { - return scopeContainer; - } - }); - replay(deploymentContext); - ComponentDefinition impl = - new ComponentDefinition(new ScriptImplementation()); - ScriptComponentType componentType = new ScriptComponentType(); - ServiceDefinition service = new ServiceDefinition(); - ServiceContract serviceContract = new JavaServiceContract(); - service.setServiceContract(serviceContract); - componentType.add(service); - impl.getImplementation().setComponentType(componentType); - - PropertyValue pv = new PropertyValue("foo", "", ""); - ObjectFactory pvFactory = (ObjectFactory) createMock(ObjectFactory.class); - expect(pvFactory.getInstance()).andStubAnswer(new IAnswer() { - public Object answer() throws Throwable { - return null; - } - }); - replay(pvFactory); - pv.setValueFactory(pvFactory); - impl.add(pv); - - Component component = builder.build(null, impl, deploymentContext); - assertNotNull(component); - } - - @SuppressWarnings("unchecked") - public void testBuildCompositeScope() throws Exception { - ScriptComponentBuilder builder = new ScriptComponentBuilder(); - DeploymentContext deploymentContext = createMock(DeploymentContext.class); - final ScopeContainer scopeContainer = createMock(ScopeContainer.class); - expect(scopeContainer.getScope()).andStubAnswer(new IAnswer() { - public Object answer() throws Throwable { - return Scope.COMPOSITE; - } - }); - expect(deploymentContext.getCompositeScope()).andStubAnswer(new IAnswer() { - public Object answer() throws Throwable { - return scopeContainer; - } - }); - replay(deploymentContext); - ComponentDefinition impl = - new ComponentDefinition(new ScriptImplementation()); - ScriptComponentType componentType = new ScriptComponentType(); - ServiceDefinition service = new ServiceDefinition(); - ServiceContract serviceContract = new JavaServiceContract(); - service.setServiceContract(serviceContract); - componentType.add(service); - impl.getImplementation().setComponentType(componentType); - Component component = builder.build(null, impl, deploymentContext); - assertNotNull(component); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - } -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptComponentTestCase.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptComponentTestCase.java deleted file mode 100644 index 00bde59069..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptComponentTestCase.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.container.script; - -import static org.apache.tuscany.spi.model.Operation.NO_CONVERSATION; - -import java.lang.reflect.Type; -import java.util.List; - -import junit.framework.TestCase; - -import org.apache.tuscany.spi.component.ScopeContainer; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.model.Scope; -import org.apache.tuscany.spi.model.ServiceContract; -import org.apache.tuscany.spi.wire.TargetInvoker; -import org.easymock.EasyMock; - -public class ScriptComponentTestCase extends TestCase { - - private ScopeContainer container; - - @SuppressWarnings("unchecked") - public void testCreateTargetInvoker() { - ScriptComponent component = new ScriptComponent("foo", null, null, null, null,null,0,null, container.getScope()); - Operation operation = new Operation("hashCode", null, null, null, false, null, NO_CONVERSATION); - operation.setServiceContract(new Contract(List.class)); - TargetInvoker invoker = component.createTargetInvoker("hashCode", operation, null); - assertNotNull(invoker); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - container = EasyMock.createMock(ScopeContainer.class); - EasyMock.expect(container.getScope()).andReturn(Scope.COMPOSITE); - EasyMock.replay(container); - } - - private class Contract extends ServiceContract { - - public Contract(Class interfaceClass) { - super(interfaceClass); - } - } - -// TODO commented out the following test since it doesn't test refernences. -// TODO have a reference injeciton test in ScriptInstanceFactory that tests an actual invocation -// -// @SuppressWarnings("unchecked") -// public void testCreateInstanceWithRef() throws IOException { -// WireService wireService = createMock(WireService.class); -// expect(wireService.createProxy(isA(Wire.class))).andStubAnswer(new IAnswer() { -// public Object answer() throws Throwable { -// return Scope.MODULE; -// } -// }); -// -// ScriptComponent pc = new ScriptComponent(null, createBSFEasy(), new HashMap(), null, null, -// scopeContainer, wireService, null, null); -// OutboundWire wire = EasyMock.createMock(OutboundWire.class); -// EasyMock.expect(wire.getReferenceName()).andReturn("foo").atLeastOnce(); -// EasyMock.replay(wire); -// pc.addOutboundWire(wire); -// Object o = pc.createInstance(); -// assertNotNull(o); -// assertTrue(o instanceof ScriptInstance); -// } -// - - -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptComponentTypeLoaderTestCase.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptComponentTypeLoaderTestCase.java deleted file mode 100644 index 60893ec5f5..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptComponentTypeLoaderTestCase.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.container.script; - -import java.net.MalformedURLException; -import java.net.URL; - -import javax.xml.stream.XMLStreamException; - -import junit.framework.TestCase; - -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.loader.LoaderException; -import org.apache.tuscany.spi.loader.LoaderRegistry; -import org.apache.tuscany.spi.loader.MissingSideFileException; -import org.easymock.EasyMock; -import org.easymock.IAnswer; - -public class ScriptComponentTypeLoaderTestCase extends TestCase { - - public void testGetSideFileName() { - ScriptComponentTypeLoader loader = new ScriptComponentTypeLoader(); - assertEquals("BSFEasyTestCase.componentType", loader.getSideFileName("BSFEasyTestCase.mock")); - } - - public void testGetSideFileNameNoDot() { - ScriptComponentTypeLoader loader = new ScriptComponentTypeLoader(); - assertEquals("BSFEasyTestCase.componentType", loader.getSideFileName("BSFEasyTestCase")); - } - - @SuppressWarnings("unchecked") - public void testLoad() throws MalformedURLException, LoaderException, XMLStreamException { - CompositeComponent parent = EasyMock.createNiceMock(CompositeComponent.class); - DeploymentContext context = EasyMock.createNiceMock(DeploymentContext.class); - LoaderRegistry registry = EasyMock.createMock(LoaderRegistry.class); - registry.load(EasyMock.eq(parent), - EasyMock.isA(ScriptComponentType.class), - EasyMock.isA(URL.class), - EasyMock.isA(Class.class), - EasyMock.eq(context)); - EasyMock.expectLastCall().andStubAnswer(new IAnswer() { - public Object answer() throws Throwable { - return EasyMock.getCurrentArguments()[1]; - } - }); - EasyMock.replay(registry); - - ScriptImplementation implementation = new ScriptImplementation(); - implementation.setResourceName("org/apache/tuscany/container/script/helper/foo.componentType"); - implementation.setClassLoader(getClass().getClassLoader()); - ScriptComponentTypeLoader loader = new ScriptComponentTypeLoader(); - loader.setLoaderRegistry(registry); - loader.load(parent, implementation, context); - assertNotNull(implementation.getComponentType()); - } - - @SuppressWarnings("unchecked") - public void testLoadMissingSideFile() throws MalformedURLException, LoaderException, XMLStreamException { - CompositeComponent parent = EasyMock.createNiceMock(CompositeComponent.class); - DeploymentContext context = EasyMock.createNiceMock(DeploymentContext.class); - LoaderRegistry registry = EasyMock.createMock(LoaderRegistry.class); - registry.load(EasyMock.eq(parent), - EasyMock.isA(ScriptComponentType.class), - EasyMock.isA(URL.class), - EasyMock.isA(Class.class), - EasyMock.eq(context)); - EasyMock.expectLastCall().andStubAnswer(new IAnswer() { - public Object answer() throws Throwable { - return EasyMock.getCurrentArguments()[1]; - } - }); - EasyMock.replay(registry); - - ScriptImplementation implementation = new ScriptImplementation(); - implementation.setResourceName("notthere"); - implementation.setClassLoader(getClass().getClassLoader()); - ScriptComponentTypeLoader loader = new ScriptComponentTypeLoader(); - loader.setLoaderRegistry(registry); - try { - loader.load(parent, implementation, context); - fail(); - } catch (MissingSideFileException e) { - //expected - } - } - - public void testGetImplementationClass() { - ScriptComponentTypeLoader loader = new ScriptComponentTypeLoader(); - assertEquals(ScriptImplementation.class, loader.getImplementationClass()); - } - - @Override - public void setUp() throws Exception { - super.setUp(); - } -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptComponentTypeTestCase.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptComponentTypeTestCase.java deleted file mode 100644 index 7809c63d99..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptComponentTypeTestCase.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.container.script; - -import org.apache.tuscany.spi.model.Scope; - -import junit.framework.TestCase; - -public class ScriptComponentTypeTestCase extends TestCase { - - public void testLifecycleScope() { - ScriptComponentType ct = new ScriptComponentType(); - assertEquals(Scope.COMPOSITE, ct.getImplementationScope()); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptImplementationLoaderLoadingTestCase.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptImplementationLoaderLoadingTestCase.java deleted file mode 100644 index f30c1dca65..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptImplementationLoaderLoadingTestCase.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.container.script; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.loader.LoaderException; -import org.apache.tuscany.spi.loader.LoaderRegistry; -import org.apache.tuscany.spi.loader.MissingResourceException; -import org.apache.tuscany.spi.model.ModelObject; - -import junit.framework.TestCase; -import static org.easymock.classextension.EasyMock.createMock; - -/** - * - */ -public class ScriptImplementationLoaderLoadingTestCase extends TestCase { - - private LoaderRegistry registry; - - private ScriptImplementationLoader loader; - - public void testLoadSource() throws LoaderException { - String script = - loader.loadSource(getClass().getClassLoader(), "org/apache/tuscany/container/script/helper/foo.mock"); - assertTrue(script.startsWith("hello")); - } - - public void testLoadSourceMissingResource() throws LoaderException { - try { - loader.loadSource(getClass().getClassLoader(), "doesnt.exist"); - fail(); - } catch (MissingResourceException e) { - // expected - } - } - - public void testGetXMLType() throws LoaderException { - assertEquals("http://foo", loader.getXMLType().getNamespaceURI()); - assertEquals("bar", loader.getXMLType().getLocalPart()); - } - - protected void setUp() throws Exception { - super.setUp(); - registry = createMock(LoaderRegistry.class); - loader = new ScriptImplementationLoader(registry) { - public QName getXMLType() { - return new QName("http://foo", "bar"); - } - - public ScriptImplementation load(CompositeComponent arg0, ModelObject arg1, XMLStreamReader arg2, - DeploymentContext arg3) throws XMLStreamException, LoaderException { - return null; - } - }; - } -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptImplementationLoaderTestCase.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptImplementationLoaderTestCase.java deleted file mode 100644 index 62a5ee3110..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptImplementationLoaderTestCase.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.container.script; - -import static org.easymock.EasyMock.expect; -import static org.easymock.classextension.EasyMock.createMock; -import static org.easymock.classextension.EasyMock.replay; -import static org.easymock.classextension.EasyMock.verify; -import static org.osoa.sca.Constants.SCA_NS; - -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import junit.framework.TestCase; - -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.loader.LoaderException; -import org.apache.tuscany.spi.loader.LoaderRegistry; -import org.apache.tuscany.spi.loader.MissingResourceException; - -/** - * - */ -public class ScriptImplementationLoaderTestCase extends TestCase { - private CompositeComponent parent; - - private XMLStreamReader reader; - - private DeploymentContext deploymentContext; - - private ClassLoader classLoader; - - private LoaderRegistry registry; - - private ScriptImplementationLoader loader; - - public void testLoadNoScriptAttribute() throws LoaderException, XMLStreamException { - expect(reader.getAttributeValue(null, "script")).andReturn(null); - replay(reader); - replay(deploymentContext); - - try { - loader.load(parent, null, reader, deploymentContext); - fail(); - } catch (MissingResourceException e) { - // ok - } - verify(reader); - verify(deploymentContext); - } - - public void testLoad() throws LoaderException, XMLStreamException { - expect(reader.getAttributeValue(null, "script")).andReturn("foo.mock"); - expect(reader.getAttributeValue(null, "class")).andReturn(null); - expect(reader.next()).andReturn(XMLStreamConstants.END_ELEMENT); - expect(deploymentContext.getClassLoader()).andReturn(classLoader); - - replay(reader); - replay(deploymentContext); - - ScriptImplementationLoader mockLoader = new ScriptImplementationLoader(registry) { - protected String loadSource(ClassLoader cl, String resource) throws LoaderException { - assertSame(classLoader, cl); - assertEquals("foo.mock", resource); - return "bar"; - } - }; - mockLoader.load(parent, null, reader, deploymentContext); - verify(reader); - verify(deploymentContext); - } - - public void testLoadNoScriptPresent() throws LoaderException, XMLStreamException { - expect(reader.getAttributeValue(null, "script")).andReturn("foo.py"); - expect(reader.getAttributeValue(null, "class")).andReturn(null); - expect(reader.next()).andReturn(XMLStreamConstants.END_ELEMENT); - expect(deploymentContext.getClassLoader()).andReturn(classLoader); - - replay(reader); - replay(deploymentContext); - - ScriptImplementationLoader mockLoader = new ScriptImplementationLoader(registry) { - protected String loadSource(ClassLoader cl, String resource) throws LoaderException { - assertSame(classLoader, cl); - assertEquals("foo.py", resource); - throw new MissingResourceException(resource); - } - }; - try { - mockLoader.load(parent, null, reader, deploymentContext); - fail(); - } catch (MissingResourceException e) { - assertEquals("Missing resource", e.getMessage()); - assertEquals("foo.py", e.getIdentifier()); - } - verify(reader); - verify(deploymentContext); - } - - public void testGetXMLType() throws LoaderException { - assertEquals(SCA_NS, loader.getXMLType().getNamespaceURI()); - assertEquals("implementation.script", loader.getXMLType().getLocalPart()); - } - - protected void setUp() throws Exception { - super.setUp(); - registry = createMock(LoaderRegistry.class); - loader = new ScriptImplementationLoader(registry); - - parent = createMock(CompositeComponent.class); - reader = createMock(XMLStreamReader.class); - deploymentContext = createMock(DeploymentContext.class); - classLoader = createMock(ClassLoader.class); - } -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptImplementationTestCase.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptImplementationTestCase.java deleted file mode 100644 index 11a99b5854..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptImplementationTestCase.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.container.script; - -import junit.framework.TestCase; - -public class ScriptImplementationTestCase extends TestCase { - - public void testGetResourceName() { - ScriptImplementation impl = new ScriptImplementation(); - impl.setResourceName("foo"); - assertEquals("foo", impl.getResourceName()); - } - - public void setUp() throws Exception { - super.setUp(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptInstanceFactoryTestCase.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptInstanceFactoryTestCase.java deleted file mode 100644 index 40645e8dc8..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptInstanceFactoryTestCase.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.container.script; - -import java.lang.reflect.InvocationTargetException; -import java.util.Arrays; -import java.util.Map; - -import org.apache.tuscany.spi.ObjectCreationException; -import org.apache.tuscany.spi.ObjectFactory; - -import junit.framework.TestCase; -import org.apache.bsf.BSFManager; -import org.apache.tuscany.container.script.mock.MockBSFEngine; - -public class ScriptInstanceFactoryTestCase extends TestCase { - - public void testCreateInstance() throws InvocationTargetException { - BSFManager.registerScriptingEngine("mock", MockBSFEngine.class.getName(), new String[]{"mock"}); - ScriptInstanceFactory factory = - new ScriptInstanceFactory("foo.mock", "bar", "baz", getClass().getClassLoader()); - factory.addContextObjectFactory("foo", String.class, new SingletonObjectFactory("bar")); - ScriptInstance instance = (ScriptInstance) factory.getInstance(); - assertNotNull(instance); - assertNotNull(instance.bsfEngine); - } - - public void testCreateInstanceNoClass() throws InvocationTargetException { - BSFManager.registerScriptingEngine("mock", MockBSFEngine.class.getName(), new String[]{"mock"}); - ScriptInstanceFactory factory = - new ScriptInstanceFactory("foo.mock", null, "baz", getClass().getClassLoader()); - factory.addContextObjectFactory("foo", String.class, new SingletonObjectFactory("bar")); - ScriptInstance instance = (ScriptInstance) factory.getInstance(); - assertNotNull(instance); - assertNotNull(instance.bsfEngine); - } - - public void testCreateInstanceRuby() throws InvocationTargetException { - BSFManager.registerScriptingEngine("ruby", MockBSFEngine.class.getName(), new String[]{"mock"}); - ScriptInstanceFactory factory = - new ScriptInstanceFactory("foo.mock", "bar", "baz", getClass().getClassLoader()); - factory.addContextObjectFactory("foo", String.class, new SingletonObjectFactory("bar")); - ScriptInstance instance = (ScriptInstance) factory.getInstance(); - assertNotNull(instance); - assertNotNull(instance.bsfEngine); - } - - public void testBadCreateInstance() throws InvocationTargetException { - ScriptInstanceFactory factory = - new ScriptInstanceFactory("foo", "bar", "baz", getClass().getClassLoader()); - try { - factory.getInstance(); - fail(); - } catch (ObjectCreationException e) { - // expected - } - } - - public void testGetters() throws InvocationTargetException { - ScriptInstanceFactory factory = - new ScriptInstanceFactory("foo", "bar", "baz", getClass().getClassLoader()); - assertEquals(getClass().getClassLoader(), factory.getClassLoader()); - } - - - public void testGetResponseClasses() { - ScriptInstanceFactory factory = - new ScriptInstanceFactory("foo.mock", "bar", "baz", getClass().getClassLoader()); - Map classes = factory.getResponseClasses(Arrays.asList(new Class[]{Runnable.class})); - assertEquals(1, classes.size()); - assertEquals("run", classes.keySet().iterator().next()); - assertEquals(void.class, classes.get("run")); - } - - protected void setUp() throws Exception { - super.setUp(); - } - - private class SingletonObjectFactory implements ObjectFactory { - private Object instance; - - public SingletonObjectFactory(Object instance) { - this.instance = instance; - } - - public Object getInstance() throws ObjectCreationException { - return instance; - } - } -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptInstanceTestCase.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptInstanceTestCase.java deleted file mode 100644 index 0cf7d80723..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptInstanceTestCase.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.container.script; - -import java.lang.reflect.InvocationTargetException; - -import junit.framework.TestCase; -import org.apache.tuscany.container.script.mock.MockBSFEngine; - -public class ScriptInstanceTestCase extends TestCase { - private ScriptInstance instance; - - public void testInvokeTarget() throws InvocationTargetException { - assertEquals("hello:", instance.invokeTarget("hello", null)); - } - - public void testInvokeTargetException() throws InvocationTargetException { - try { - instance.invokeTarget("bang", null); - fail(); - } catch (InvocationTargetException e) { - // expected - } - } - - protected void setUp() throws Exception { - super.setUp(); - this.instance = new ScriptInstance(new MockBSFEngine(), null); - } -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptInvokerTestCase.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptInvokerTestCase.java deleted file mode 100644 index 5597d37e60..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/ScriptInvokerTestCase.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.container.script; - -import java.lang.reflect.InvocationTargetException; - -import org.apache.tuscany.spi.wire.TargetInvoker; - -import junit.framework.TestCase; -import org.easymock.IAnswer; -import org.easymock.classextension.EasyMock; - -public class ScriptInvokerTestCase extends TestCase { - - @SuppressWarnings("unchecked") - public void testInvokeTarget() throws Exception { - ScriptInstance instance = EasyMock.createMock(ScriptInstance.class); - instance.invokeTarget(EasyMock.eq("operation"), (Object[]) EasyMock.notNull()); - EasyMock.expectLastCall().andStubAnswer(new IAnswer() { - public Object answer() throws Throwable { - assertEquals(2, EasyMock.getCurrentArguments().length); - assertEquals("operation", EasyMock.getCurrentArguments()[0]); - return "hello"; - } - }); - - EasyMock.replay(instance); - ScriptComponent component = EasyMock.createMock(ScriptComponent.class); - EasyMock.expect(component.getTargetInstance()).andReturn(instance); - EasyMock.replay(component); - ScriptTargetInvoker invoker = new ScriptTargetInvoker("operation", component); - assertEquals("hello", invoker.invokeTarget(new Object[]{"petra"}, TargetInvoker.NONE)); - EasyMock.verify(instance); - EasyMock.verify(component); - } - - @SuppressWarnings("unchecked") - public void testInvokeTargetException() throws Exception { - ScriptInstance instance = EasyMock.createMock(ScriptInstance.class); - instance.invokeTarget(EasyMock.eq("operation"), (Object[]) EasyMock.notNull()); - EasyMock.expectLastCall().andStubAnswer(new IAnswer() { - public Object answer() throws Throwable { - throw new RuntimeException(); - } - }); - - EasyMock.replay(instance); - ScriptComponent component = EasyMock.createMock(ScriptComponent.class); - EasyMock.expect(component.getTargetInstance()).andReturn(instance); - EasyMock.replay(component); - ScriptTargetInvoker invoker = new ScriptTargetInvoker("operation", component); - try { - invoker.invokeTarget(new Object[]{"petra"}, TargetInvoker.NONE); - fail(); - } catch (InvocationTargetException e) { - // expected - } - EasyMock.verify(instance); - EasyMock.verify(component); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/mock/MockBSFEngine.java b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/mock/MockBSFEngine.java deleted file mode 100644 index 2bf1c21478..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/java/org/apache/tuscany/container/script/mock/MockBSFEngine.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.apache.tuscany.container.script.mock; - -import org.apache.bsf.BSFDeclaredBean; -import org.apache.bsf.BSFException; -import org.apache.bsf.util.BSFEngineImpl; - -public class MockBSFEngine extends BSFEngineImpl { - - public Object call(Object object, String name, Object[] args) throws BSFException { - if ("bang".equals(name)) { - throw new RuntimeException(name); - } - - String resp = name + ":"; - if (args != null) { - for (Object o : args) { - resp += " " + String.valueOf(o); - } - } - return resp; - } - - public Object eval(String source, int lineNo, int columnNo, Object expr) throws BSFException { - // not used for the mock tests - return null; - } - - public void declareBean(BSFDeclaredBean bean) throws BSFException { - } -} diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/resources/org/apache/tuscany/container/script/foo.componentType b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/resources/org/apache/tuscany/container/script/foo.componentType deleted file mode 100644 index 9c37e1cb3e..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/resources/org/apache/tuscany/container/script/foo.componentType +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/resources/org/apache/tuscany/container/script/foo.mock b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/resources/org/apache/tuscany/container/script/foo.mock deleted file mode 100644 index b6fc4c620b..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/resources/org/apache/tuscany/container/script/foo.mock +++ /dev/null @@ -1 +0,0 @@ -hello \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/resources/org/apache/tuscany/container/script/helper/foo.componentType b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/resources/org/apache/tuscany/container/script/helper/foo.componentType deleted file mode 100644 index 9c37e1cb3e..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/resources/org/apache/tuscany/container/script/helper/foo.componentType +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/resources/org/apache/tuscany/container/script/helper/foo.mock b/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/resources/org/apache/tuscany/container/script/helper/foo.mock deleted file mode 100644 index b6fc4c620b..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/container.bsf/src/test/resources/org/apache/tuscany/container/script/helper/foo.mock +++ /dev/null @@ -1 +0,0 @@ -hello \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/LICENSE.txt b/branches/sca-java-integration/sca/extensions/script/databinding.e4x/LICENSE.txt deleted file mode 100644 index 0084319535..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/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-integration/sca/extensions/script/databinding.e4x/NOTICE.txt b/branches/sca-java-integration/sca/extensions/script/databinding.e4x/NOTICE.txt deleted file mode 100644 index d83ebbe236..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/NOTICE.txt +++ /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-integration/sca/extensions/script/databinding.e4x/pom.xml b/branches/sca-java-integration/sca/extensions/script/databinding.e4x/pom.xml deleted file mode 100644 index eae5e5c7da..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/pom.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - org.apache.tuscany.sca.extensions - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - tuscany-e4x - Apache Tuscany JavaScript E4X DataBinding - Apache Tuscany JavaScript E4X DataBinding - - - - - wso2-thilina - http://www-lk.wso2.com/~thilina/repository - - true - - legacy - - - - - wso2 - http://dist.wso2.org/maven - - true - - legacy - - - - - - - org.apache.tuscany.sca.kernel - tuscany-spi - 0.1-integration-incubating-SNAPSHOT - compile - - - - org.apache.tuscany.sca.kernel - tuscany-api - 0.1-integration-incubating-SNAPSHOT - compile - - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - - junit - junit - 4.2 - test - - - - org.mozilla.javascript - js-core - SNAPSHOT - compile - - - - org.wso2.javascript.rhino - js-axiom - SNAPSHOT - compile - - - - org.apache.ws.commons.axiom - axiom-impl - compile - - - - org.apache.tuscany.sca.extensions.axis2 - databinding-axiom - 0.1-integration-incubating-SNAPSHOT - runtime - - - - org.easymock - easymock - - - - org.easymock - easymockclassextension - - - - - diff --git a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/E4X2OMElement.java b/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/E4X2OMElement.java deleted file mode 100644 index 82d4f0b9a4..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/E4X2OMElement.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.extensions.script.databinding.e4x; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.mozilla.javascript.xmlimpl.XML; -import org.osoa.sca.annotations.Service; - -@Service(Transformer.class) -public class E4X2OMElement extends TransformerExtension implements PullTransformer { - - public OMElement transform(XML source, TransformationContext context) { - return (OMElement)source.getAxiomFromXML(); - } - - public Class getSourceType() { - return XML.class; - } - - public Class getTargetType() { - return OMElement.class; - } - - public int getWeight() { - return 10; - } - - -} diff --git a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/E4X2Object.java b/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/E4X2Object.java deleted file mode 100644 index 06c578866d..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/E4X2Object.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.extensions.script.databinding.e4x; - -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.SimpleType2JavaTransformer; -import org.mozilla.javascript.xmlimpl.XML; -import org.osoa.sca.annotations.Service; - -/** - * Transformer to convert data from a simple java bject to OMElement - */ -@Service(Transformer.class) -public class E4X2Object extends SimpleType2JavaTransformer { - - private E4X2OMElement e4x2om; - - public E4X2Object() { - e4x2om = new E4X2OMElement(); - } - - @Override - protected String getText(XML source) { - return e4x2om.transform(source, null).getText(); - } - - public Class getSourceType() { - return XML.class; - } -} diff --git a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/E4XDataBinding.java b/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/E4XDataBinding.java deleted file mode 100644 index c9172b1229..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/E4XDataBinding.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.extensions.script.databinding.e4x; - -import org.apache.tuscany.spi.databinding.DataBinding; -import org.apache.tuscany.spi.databinding.WrapperHandler; -import org.apache.tuscany.spi.databinding.extension.DataBindingExtension; -import org.mozilla.javascript.xmlimpl.XML; -import org.osoa.sca.annotations.Service; - -/** - * DataBinding for E4X - * - * This requires Rhino using the WSO2 Axiom based E4X impl - */ -@Service(DataBinding.class) -public class E4XDataBinding extends DataBindingExtension { - - public static final String NAME = XML.class.getName(); - public static final String[] ALIASES = new String[] {"e4x"}; - - public E4XDataBinding() { - super(NAME, ALIASES, XML.class); - } - - /** - * @see org.apache.tuscany.spi.databinding.extension.DataBindingExtension#getWrapperHandler() - */ - @Override - public WrapperHandler getWrapperHandler() { - return new E4XWrapperHandler(); - } - - /** - * Treat E4X as pass-by-ref - */ - public Object copy(Object source) { - return source; - } -} diff --git a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/E4XWrapperHandler.java b/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/E4XWrapperHandler.java deleted file mode 100644 index 6182aad77b..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/E4XWrapperHandler.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.extensions.script.databinding.e4x; - -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.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.WrapperHandler; -import org.apache.tuscany.spi.idl.ElementInfo; -import org.mozilla.javascript.xmlimpl.XML; - -/** - * OMElement wrapper handler implementation - */ -public class E4XWrapperHandler implements WrapperHandler { - - private OMFactory factory; - private OMElement2E4X om2e4x; - private E4X2OMElement e4x2om; - - public E4XWrapperHandler() { - this.factory = OMAbstractFactory.getOMFactory(); - om2e4x = new OMElement2E4X(); - e4x2om = new E4X2OMElement(); - } - - public XML create(ElementInfo element, TransformationContext context) { - OMElement wrapper = factory.createOMElement(element.getQName(), null); - return om2e4x.transform(wrapper, null); - } - - public void setChild(XML wrapper, int i, ElementInfo childElement, Object value) { - OMElement omWrapper = e4x2om.transform(wrapper, null); - OMElement element = e4x2om.transform((XML)value, null); - QName elementName = childElement.getQName(); - OMNamespace namespace = factory.createOMNamespace(elementName.getNamespaceURI(), elementName.getPrefix()); - element.setNamespace(namespace); - element.setLocalName(childElement.getQName().getLocalPart()); - omWrapper.addChild(element); - } - - public List getChildren(XML wrapper) { - OMElement omWrapper = e4x2om.transform(wrapper, null); - List elements = new ArrayList(); - for (Iterator i = omWrapper.getChildElements(); i.hasNext();) { - elements.add(om2e4x.transform((OMElement)i.next(), null)); - } - return elements; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/OMElement2E4X.java b/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/OMElement2E4X.java deleted file mode 100644 index 6ab0e42a75..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/OMElement2E4X.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.extensions.script.databinding.e4x; - -import org.apache.axiom.om.OMElement; -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.mozilla.javascript.Context; -import org.mozilla.javascript.ScriptableObject; -import org.mozilla.javascript.xmlimpl.XML; -import org.osoa.sca.annotations.Service; - -@Service(Transformer.class) -public class OMElement2E4X extends TransformerExtension implements PullTransformer { - - private ScriptableObject scope; - - public OMElement2E4X() { - Context cx = Context.enter(); - try { - - this.scope = cx.initStandardObjects(); - - } finally { - Context.exit(); - } - } - - public Class getSourceType() { - return OMElement.class; - } - - public Class getTargetType() { - return XML.class; - } - - public int getWeight() { - return 10; - } - - public XML transform(OMElement source, TransformationContext context) { - Context cx = Context.enter(); - try { - - return (XML)cx.newObject(scope, "XML", new Object[] {source}); - - } finally { - Context.exit(); - } - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/Object2E4X.java b/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/Object2E4X.java deleted file mode 100644 index 31810d969b..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/java/org/apache/tuscany/extensions/script/databinding/e4x/Object2E4X.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.extensions.script.databinding.e4x; - -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.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.Java2SimpleTypeTransformer; -import org.mozilla.javascript.xmlimpl.XML; -import org.osoa.sca.annotations.Service; - -/** - * Transformer to convert data from an simple OMElement to Java Object - */ -@Service(Transformer.class) -public class Object2E4X extends Java2SimpleTypeTransformer { - - private OMFactory factory; - private OMElement2E4X om2e4x; - - public Object2E4X() { - factory = OMAbstractFactory.getOMFactory(); - om2e4x = new OMElement2E4X(); - } - - protected XML createElement(QName element, String text, TransformationContext context) { - OMElement omElement = factory.createOMElement(element, null); - factory.createOMText(omElement, text); - return om2e4x.transform(omElement, context); - } - - @Override - public Class getTargetType() { - return XML.class; - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/resources/META-INF/sca/databinding.e4x.scdl b/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/resources/META-INF/sca/databinding.e4x.scdl deleted file mode 100644 index 66f7d9d9c1..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/resources/META-INF/sca/databinding.e4x.scdl +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - org.apache.tuscany.sca.extensions.script - databinding-e4x - 0.1-integration-incubating-SNAPSHOT - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/resources/META-INF/sca/default.scdl b/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/resources/META-INF/sca/default.scdl deleted file mode 100644 index 3428495aa6..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/resources/META-INF/sca/default.scdl +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - org.apache.tuscany.sca.extensions.script - databinding-e4x - 0.1-integration-incubating-SNAPSHOT - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/resources/META-INF/sca/extension.composite b/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/resources/META-INF/sca/extension.composite deleted file mode 100644 index 9156c64d54..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/databinding.e4x/src/main/resources/META-INF/sca/extension.composite +++ /dev/null @@ -1,22 +0,0 @@ - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/pom.xml b/branches/sca-java-integration/sca/extensions/script/itests/pom.xml deleted file mode 100644 index 72fa6c5616..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/pom.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - org.apache.tuscany.sca.extensions - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - tuscany-bsf-itests - Apache Tuscany Script Container ITests - Apache Tuscany Script Container Itests - - - - - ant - http://people.apache.org/~antelder/maven2 - - true - - - - - - - - org.osoa - sca-api-r1.0 - - - org.apache.tuscany.sca.kernel - tuscany-api - compile - 0.1-integration-incubating-SNAPSHOT - - - - org.apache.tuscany.sca.kernel - tuscany-core - 0.1-integration-incubating-SNAPSHOT - runtime - - - - junit - junit - 4.2 - test - - - - org.apache.tuscany.sca.extensions - tuscany-bsf - 0.1-integration-incubating-SNAPSHOT - compile - - - - org.apache.tuscany.sca.extensions - tuscany-e4x - 0.1-integration-incubating-SNAPSHOT - compile - - - - org.jruby - jruby - 0.9.2 - test - - - - jython - jython - 2.2b1 - test - - - - groovy - groovy-all - 1.0 - test - - - - org.apache.tuscany.sca.services.idl - tuscany-wsdl - 0.1-integration-incubating-SNAPSHOT - test - - - - org.apache.tuscany.sca.extensions.axis2 - databinding-axiom - 0.1-integration-incubating-SNAPSHOT - test - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - helloworld.HelloWorldServer - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/java/calculator/CalculatorService.java b/branches/sca-java-integration/sca/extensions/script/itests/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 5fc0a052c5..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/java/calculator/CalculatorService.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 calculator; - -public interface CalculatorService { - - double add(double n1, double n2); - - double sub(double n1, double n2); - - double mul(double n1, double n2); - - double div(double n1, double n2); - -} diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/java/calculator/DivideService.java b/branches/sca-java-integration/sca/extensions/script/itests/src/main/java/calculator/DivideService.java deleted file mode 100644 index 56a556ce3b..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/java/calculator/DivideService.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 calculator; - -public interface DivideService { - double divide(double n1, double n2); -} diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/java/helloworld/HelloWorldService.java b/branches/sca-java-integration/sca/extensions/script/itests/src/main/java/helloworld/HelloWorldService.java deleted file mode 100644 index bd527ff8e2..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/java/helloworld/HelloWorldService.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 helloworld; - -import org.osoa.sca.annotations.Remotable; -import org.osoa.sca.annotations.Service; - -/** - * This is the business interface of the HelloWorld greetings service. - */ -@Remotable -@Service -public interface HelloWorldService { - - public String getGreetings(String name); -} - diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/META-INF/sca/helloworld.composite b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/META-INF/sca/helloworld.composite deleted file mode 100644 index 14977b87db..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/META-INF/sca/helloworld.composite +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/META-INF/sca/properties.composite b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/META-INF/sca/properties.composite deleted file mode 100644 index 17378bafe8..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/META-INF/sca/properties.composite +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - Namaskaar - - - - - - - - - Namaste - - - - - - - - - Namaskaar - - - - - - - - - Namaste - - - - - - - - - Namaskaar - - - - - - - - - Namaste - - - diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/META-INF/sca/references.composite b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/META-INF/sca/references.composite deleted file mode 100644 index ff51f9f429..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/META-INF/sca/references.composite +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - HelloWorldJSComponent - - - - - HelloWorldJSComponent - - - - - HelloWorldJSComponent - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/META-INF/sca/xml.composite b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/META-INF/sca/xml.composite deleted file mode 100644 index 14b048eeac..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/META-INF/sca/xml.composite +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - HelloWorldXMLJSComponent - - - - - - - - - HelloWorldXMLProxyJSComponent - - - - - HelloWorldXMLJSComponent - - - - diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/CalculatorImpl.componentType b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/CalculatorImpl.componentType deleted file mode 100644 index adbfd29266..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/CalculatorImpl.componentType +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/CalculatorImpl.py b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/CalculatorImpl.py deleted file mode 100644 index 86dbef9e4d..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/CalculatorImpl.py +++ /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. -# -# -# -# -# This Python code is a simple sample that provides a Python implementation of -# the Calculator sample -# - - -# The module-level add function -def add(val1, val2): - result = float(val1) + float(val2) - print "Python - CalculatorImpl.add " + str(val1) + " + " + str(val2) + " = " + str(result) - return result - -# The module-level sub function -def sub(val1, val2): - result = float(val1) - float(val2) - print "Python - CalculatorImpl.sub " + str(val1) + " - " + str(val2) + " = " + str(result) - return result - -# The module-level mul function -def mul(val1, val2): - result = float(val1) * float(val2) - print "Python - CalculatorImpl.mul " + str(val1) + " * " + str(val2) + " = " + str(result) - return result - -# The module-level div function -def div(val1, val2): - - - print "Python - CalculatorImpl.div calling divideService to determine " + str(val1) + " / " + str(val2) - - # Use the divideService reference - result = divideService.divide(val1, val2) - - print "Python - CalculatorImpl.div divideService returned " + str(result) - - return result - diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/CalculatorImpl.rb b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/CalculatorImpl.rb deleted file mode 100644 index c198719b89..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/CalculatorImpl.rb +++ /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. -# -# - -class CalculatorImpl - - attr_writer :divideService - - def initialize() - print "Ruby - CalculatorImpl.initialize\n" - end - - def div(arg1, arg2) - print "Ruby - CalculatorImpl.div\n" - $divideService.divide(arg1.to_f, arg2.to_f) - end - - def add(arg1, arg2) - print "Ruby - CalculatorImpl.add\n" - arg1.to_f + arg2.to_f - end - - def sub(arg1, arg2) - print "Ruby - CalculatorImpl.sub\n" - arg1.to_f - arg2.to_f - end - - def mul(arg1, arg2) - print "Ruby - CalculatorImpl.mul\n" - arg1.to_f * arg2.to_f - end - -end \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/DivideImpl.componentType b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/DivideImpl.componentType deleted file mode 100644 index 38704e597b..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/DivideImpl.componentType +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - false - false - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/DivideImpl.py b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/DivideImpl.py deleted file mode 100644 index 3921731de6..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/DivideImpl.py +++ /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. -# -# -# -# -# This Python code is a simple sample that provides a Python implementation of -# the Divide Service used in the Calculator sample -# -# Either use the divide function in the DivideClass class (using classes allows -# composite scoping to be used) -# e.g. in CalculatorComposite.composite use the line: -# -# -# Or just use the module-level divide function -# e.g. in CalculatorComposite.composite use the line: -# -# - - -class DivideClass: - "A class to handle dividing" - - def __init__(self): - print "Python - DivideImpl.DivideClass constructor" - - # The class-level divide function - def divide(self, val1, val2): - result = float(val1) / float(val2) - - print "Python - DivideImpl.DivideClass.divide " + str( val1 ) + " / " + str(val2) + " = " + str(result) - - # Use the doRounding property - if doRounding: - result = round(result) - print "Python - DivideImpl.DivideClass.divide is rounding the result to " + str(result) - - return result - -# The module-level divide function -def divide(val1, val2): - result = float(val1) / float(val2) - print "Python - DivideImpl.divide " + str(val1) + " / " + str(val2) + " = " + str(result) - - # Use the doRounding property - if doRounding: - result = round(result) - print "Python - DivideImpl.divide is rounding the result to " + str(result) - - return result - diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/DivideImpl.rb b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/DivideImpl.rb deleted file mode 100644 index c6615bfcfa..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/DivideImpl.rb +++ /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. -# -# - -class DivideImpl - - attr_writer :round - - def initialize() - print "Ruby - DivideImpl.initialize\n" - end - - def divide(arg1, arg2) - print "Ruby - DivideImpl.divide ", arg1, " / ", arg2, "\n" - res = arg1.to_f / arg2.to_f - if @round then - res = res.round - print "DivideImpl.divide rounding\n" - end - print "DivideImpl.divide ", res, "\n" - res - end - -end \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/sample.calculator.composite b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/sample.calculator.composite deleted file mode 100644 index 4006d3efe0..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/calculator/sample.calculator.composite +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - RubyDivideComponent - - - - - true - - - - - PythonDivideComponent - - - - - false - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.componentType b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.componentType deleted file mode 100644 index 31bfe88206..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.componentType +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.groovy b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.groovy deleted file mode 100644 index 7b42990e11..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.groovy +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -String getGreetings(s) { - return "groovyHello " + s; -} diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.js b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.js deleted file mode 100644 index d1ecf36dbf..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -function getGreetings(s) { - return "jsHello " + s; -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.py b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.py deleted file mode 100644 index f082e01963..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.py +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -def getGreetings(s): - return "pyHello " + s \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.rb b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.rb deleted file mode 100644 index 16488714d5..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/helloworld/helloworld.rb +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -def getGreetings(s) - return "rbHello " + s -end - diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworld.componentType b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworld.componentType deleted file mode 100644 index b35967862b..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworld.componentType +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - Kia Ora - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworld.js b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworld.js deleted file mode 100644 index 0e2333d3a7..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworld.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -function getGreetings(s) { - return "js" + GREETING + " " + s; -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworld.py b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworld.py deleted file mode 100644 index d8c47be953..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworld.py +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -def getGreetings(s): - return "py" + GREETING + " " + s \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworld.rb b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworld.rb deleted file mode 100644 index bc3a5a5c9e..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworld.rb +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -def getGreetings(s) - return "rb" + $GREETING + " " + s -end - diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworldDyn.componentType b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworldDyn.componentType deleted file mode 100644 index 31bfe88206..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworldDyn.componentType +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworldDyn.js b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworldDyn.js deleted file mode 100644 index a55706dfe0..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworldDyn.js +++ /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. - */ - -var GREETING = "Yo!"; - -function getGreetings(s) { - return "js" + GREETING + " " + s; -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworldDyn.py b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworldDyn.py deleted file mode 100644 index a8365597a9..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworldDyn.py +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -GREETING = "Yo!" - -def getGreetings(s): - return "py" + GREETING + " " + s \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworldDyn.rb b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworldDyn.rb deleted file mode 100644 index 5c86c179c0..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/properties/helloworldDyn.rb +++ /dev/null @@ -1,23 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -$GREETING = "Yo!" - -def getGreetings(s) - return "rb" + $GREETING + " " + s -end - diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/references/helloworldProxy.componentType b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/references/helloworldProxy.componentType deleted file mode 100644 index 297c1d28c0..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/references/helloworldProxy.componentType +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/references/helloworldProxy.js b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/references/helloworldProxy.js deleted file mode 100644 index 60f18e66f7..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/references/helloworldProxy.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -function getGreetings(s) { - return "jsproxy" + ref.getGreetings(s); -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/references/helloworldProxy.py b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/references/helloworldProxy.py deleted file mode 100644 index edb3e0f04e..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/references/helloworldProxy.py +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -def getGreetings(s): - return "pyproxy" + ref.getGreetings(s) \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/references/helloworldProxy.rb b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/references/helloworldProxy.rb deleted file mode 100644 index 9b503a3e05..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/references/helloworldProxy.rb +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -def getGreetings(s) - return "rbproxy" + $ref.getGreetings(s) -end - diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/wsdl/helloworld.wsdl b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/wsdl/helloworld.wsdl deleted file mode 100644 index 68174d1ecd..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/wsdl/helloworld.wsdl +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworld.componentType b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworld.componentType deleted file mode 100644 index 297c1d28c0..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworld.componentType +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworld.js b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworld.js deleted file mode 100644 index 2e6a35a695..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworld.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -function getGreetings(s) { - java.lang.System.out.println("in helloworld.js s:" + s); - return ref.getGreetings(s); -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworldXML.componentType b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworldXML.componentType deleted file mode 100644 index 24b65f8f2d..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworldXML.componentType +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworldXML.js b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworldXML.js deleted file mode 100644 index 929dddf04e..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworldXML.js +++ /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. - */ - -function getGreetings(xmlIn) { - java.lang.System.out.println(xmlIn); - var s = "e4xHi " + xmlIn..*::name; - var xmlOut = - - { s } - ; - - return xmlOut; -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworldXMLProxy.componentType b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworldXMLProxy.componentType deleted file mode 100644 index 8ccd5cce98..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworldXMLProxy.componentType +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworldXMLProxy.js b/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworldXMLProxy.js deleted file mode 100644 index 6d403c2965..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/main/resources/xml/helloworldXMLProxy.js +++ /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. - */ - -function getGreetings(xmlIn) { - java.lang.System.out.println("via proxy type of in: " + typeof xmlIn); - - var xmlOut = ref.getGreetings(xmlIn); - - java.lang.System.out.println("via proxy type of out: " + typeof xmlOut); - return xmlOut; -} \ No newline at end of file diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/calculator/CalculatorClientTestCase.java b/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/calculator/CalculatorClientTestCase.java deleted file mode 100644 index a98e3f000b..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/calculator/CalculatorClientTestCase.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 calculator; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.api.SCARuntime; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * Test case for caluclator service - */ -public class CalculatorClientTestCase extends TestCase { - - private CompositeContext compositeContext; - - public void testCalculatorRuby() throws Exception { - CalculatorService calculatorService = compositeContext.locateService(CalculatorService.class, "RubyCalculatorComponent"); - Assert.assertEquals(3.0, calculatorService.add(1,2)); - Assert.assertEquals(1.5, calculatorService.div(3,2)); - } - - public void testCalculatorPython() throws Exception { - CalculatorService calculatorService = compositeContext.locateService(CalculatorService.class, "PythonCalculatorComponent"); - Assert.assertEquals(3.0, calculatorService.add(1,2)); - Assert.assertEquals(1.5, calculatorService.div(3,2)); - } - - @Override - protected void setUp() throws Exception { - SCARuntime.start("calculator/sample.calculator.composite"); - this.compositeContext = CurrentCompositeContext.getContext(); - } - - @Override - protected void tearDown() throws Exception { - SCARuntime.stop(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/HelloWorldClientTestCase.java b/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/HelloWorldClientTestCase.java deleted file mode 100644 index e1c382a6bc..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/HelloWorldClientTestCase.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 helloworld; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.api.SCARuntime; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * Test case for helloworld web service client - */ -public class HelloWorldClientTestCase extends TestCase { - - private CompositeContext compositeContext; - - public void testHelloWorldJavaScript() throws Exception { - HelloWorldService helloWorldService = compositeContext.locateService(HelloWorldService.class, "HelloWorldJSComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("jsHello Petra", msg); - } - - public void testHelloWorldRuby() throws Exception { - HelloWorldService helloWorldService = compositeContext.locateService(HelloWorldService.class, "HelloWorldRubyComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("rbHello Petra", msg); - } - - public void testHelloWorldPython() throws Exception { - HelloWorldService helloWorldService = compositeContext.locateService(HelloWorldService.class, "HelloWorldPythonComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("pyHello Petra", msg); - } - -// TODO: Groovy doesn't work yet. Looks like a bug in the Groovy BSF engine -// public void testHelloWorldGroovy() throws Exception { -// HelloWorldService helloWorldService = compositeContext.locateService(HelloWorldService.class, "HelloWorldGroovyComponent"); -// String msg = helloWorldService.getGreetings("Petra"); -// Assert.assertEquals("groovyHello Petra", msg); -// } - - @Override - protected void setUp() throws Exception { - SCARuntime.start("META-INF/sca/helloworld.composite"); - this.compositeContext = CurrentCompositeContext.getContext(); - } - - @Override - protected void tearDown() throws Exception { - SCARuntime.stop(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/JavaScriptPropertiesTestCase.java b/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/JavaScriptPropertiesTestCase.java deleted file mode 100644 index b87e96d365..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/JavaScriptPropertiesTestCase.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 helloworld; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.api.SCARuntime; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * Test case for using references in script components - */ -public class JavaScriptPropertiesTestCase extends TestCase { - - private CompositeContext compositeContext; - - public void testJavaScriptDefault() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldJSDefaultComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("jsKia Ora Petra", msg); - } - - public void testJavaScriptOverride() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldJSOverrideComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("jsNamaskaar Petra", msg); - } - - public void testJavaScriptDynDefault() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldJSDynDefaultComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("jsYo! Petra", msg); - } - - public void testJavaScriptDynOverride() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldJSDynOverrideComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("jsNamaste Petra", msg); - } - - @Override - protected void setUp() throws Exception { - SCARuntime.start("META-INF/sca/properties.composite"); - this.compositeContext = CurrentCompositeContext.getContext(); - } - - @Override - protected void tearDown() throws Exception { - SCARuntime.stop(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/PythonPropertiesTestCase.java b/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/PythonPropertiesTestCase.java deleted file mode 100644 index c26fddff70..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/PythonPropertiesTestCase.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 helloworld; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.api.SCARuntime; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * Test case for using references in script components - */ -public class PythonPropertiesTestCase extends TestCase { - - private CompositeContext compositeContext; - - public void testPythonDefault() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldPythonDefaultComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("pyKia Ora Petra", msg); - } - public void testPythonOverride() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldPythonOverrideComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("pyNamaskaar Petra", msg); - } - - public void testPythonDynDefault() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldPythonDynDefaultComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("pyYo! Petra", msg); - } - - public void testPythonDynOverride() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldPythonDynOverrideComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("pyNamaste Petra", msg); - } - - @Override - protected void setUp() throws Exception { - SCARuntime.start("META-INF/sca/properties.composite"); - this.compositeContext = CurrentCompositeContext.getContext(); - } - - @Override - protected void tearDown() throws Exception { - SCARuntime.stop(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/ReferencesTestCase.java b/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/ReferencesTestCase.java deleted file mode 100644 index 04a7bf0de3..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/ReferencesTestCase.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 helloworld; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.api.SCARuntime; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * Test case for using references in script components - */ -public class ReferencesTestCase extends TestCase { - - private CompositeContext compositeContext; - - public void testHelloWorldJavaScript() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldJSProxyComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("jsproxyjsHello Petra", msg); - } - - public void testHelloWorldPython() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldPythonProxyComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("pyproxyjsHello Petra", msg); - } - - public void testHelloWorldRuby() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldRubyProxyComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("rbproxyjsHello Petra", msg); - } - - @Override - protected void setUp() throws Exception { - SCARuntime.start("META-INF/sca/references.composite"); - this.compositeContext = CurrentCompositeContext.getContext(); - } - - @Override - protected void tearDown() throws Exception { - SCARuntime.stop(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/RubyPropertiesTestCase.java b/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/RubyPropertiesTestCase.java deleted file mode 100644 index 262141f680..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/RubyPropertiesTestCase.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES 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 junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.api.SCARuntime; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * Test case for using references in script components - */ -public class RubyPropertiesTestCase extends TestCase { - - private CompositeContext compositeContext; - - public void testRubyDefault() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldRubyDefaultComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("rbKia Ora Petra", msg); - } - public void testRubyOverride() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldRubyOverrideComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("rbNamaskaar Petra", msg); - } - - public void testRubyDynDefault() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldRubyDynDefaultComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("rbYo! Petra", msg); - } - public void testRubyDynOverride() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldRubyDynOverrideComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("rbNamaste Petra", msg); - } - - @Override - protected void setUp() throws Exception { - SCARuntime.start("META-INF/sca/properties.composite"); - this.compositeContext = CurrentCompositeContext.getContext(); - } - - @Override - protected void tearDown() throws Exception { - SCARuntime.stop(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/XMLTestCase.java b/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/XMLTestCase.java deleted file mode 100644 index 4099559a2a..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/itests/src/test/java/helloworld/XMLTestCase.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 helloworld; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.tuscany.api.SCARuntime; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.CurrentCompositeContext; - -/** - * Test case for using XML in script components - */ -public class XMLTestCase extends TestCase { - - private CompositeContext compositeContext; - - public void testHelloWorldJavaScript() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldJSComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("e4xHi Petra", msg); - } - - public void testHelloWorldJavaScript2() throws Exception { - HelloWorldService helloWorldService = - compositeContext.locateService(HelloWorldService.class, "HelloWorldJSViaProxyComponent"); - String msg = helloWorldService.getGreetings("Petra"); - Assert.assertEquals("e4xHi Petra", msg); - } - - @Override - protected void setUp() throws Exception { - SCARuntime.start("META-INF/sca/xml.composite"); - this.compositeContext = CurrentCompositeContext.getContext(); - } - - @Override - protected void tearDown() throws Exception { - SCARuntime.stop(); - } - -} diff --git a/branches/sca-java-integration/sca/extensions/script/pom.xml b/branches/sca-java-integration/sca/extensions/script/pom.xml deleted file mode 100644 index ff2eb81b50..0000000000 --- a/branches/sca-java-integration/sca/extensions/script/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - org.apache.tuscany.sca.extensions - parent - 0.1-integration-incubating-SNAPSHOT - - - 4.0.0 - org.apache.tuscany.sca.extensions.script - parent - pom - Apache Tuscany SCA Extensions for Scripting - - - container.bsf - databinding.e4x - itests - - - diff --git a/branches/sca-java-integration/sca/kernel/api/.checkstyle b/branches/sca-java-integration/sca/kernel/api/.checkstyle deleted file mode 100644 index 3e57539570..0000000000 --- a/branches/sca-java-integration/sca/kernel/api/.checkstyle +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/branches/sca-java-integration/sca/kernel/api/.pmd b/branches/sca-java-integration/sca/kernel/api/.pmd deleted file mode 100644 index ffc4fe2bbb..0000000000 --- a/branches/sca-java-integration/sca/kernel/api/.pmd +++ /dev/null @@ -1,20 +0,0 @@ - - -true diff --git a/branches/sca-java-integration/sca/kernel/api/.ruleset b/branches/sca-java-integration/sca/kernel/api/.ruleset deleted file mode 100644 index 3886f07f2d..0000000000 --- a/branches/sca-java-integration/sca/kernel/api/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/kernel/api/LICENSE.txt b/branches/sca-java-integration/sca/kernel/api/LICENSE.txt deleted file mode 100644 index 0084319535..0000000000 --- a/branches/sca-java-integration/sca/kernel/api/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-integration/sca/kernel/api/NOTICE.txt b/branches/sca-java-integration/sca/kernel/api/NOTICE.txt deleted file mode 100644 index d83ebbe236..0000000000 --- a/branches/sca-java-integration/sca/kernel/api/NOTICE.txt +++ /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-integration/sca/kernel/api/pom.xml b/branches/sca-java-integration/sca/kernel/api/pom.xml deleted file mode 100644 index 6738f93bd5..0000000000 --- a/branches/sca-java-integration/sca/kernel/api/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - org.apache.tuscany.sca.kernel - parent - 0.1-integration-incubating-SNAPSHOT - - 4.0.0 - tuscany-api - jar - Apache Tuscany SCA API - Tuscany Application Programming Interfaces. - - - - org.osoa - sca-api-r${scaSpecVersion} - - - junit - junit - - - diff --git a/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/SCARuntime.java b/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/SCARuntime.java deleted file mode 100644 index 15b9731121..0000000000 --- a/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/SCARuntime.java +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.api; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URL; -import java.security.AccessController; -import java.security.PrivilegedAction; - -import org.osoa.sca.ComponentContext; - -/** - * SCARuntime is used to start a Tuscany SCA runtime. - */ -public abstract class SCARuntime { - public static final String DEFAULT_SYSTEM_SCDL = "META-INF/tuscany/default-system.composite"; - public static final String SYSTEM_SCDL = "system.composite"; - public static final String EXTENSION_SCDL = "META-INF/sca/extension.composite"; - public static final String SERVICE_SCDL = "META-INF/sca/service.composite"; - public static final String META_APPLICATION_SCDL = "META-INF/sca/application.composite"; - public static final String APPLICATION_SCDL = "application.composite"; - - private static SCARuntime instance; - - /** - * Read the service name from a configuration file - * - * @param classLoader - * @param name The name of the service class - * @return A class name which extends/implements the service class - * @throws IOException - */ - private static String getServiceName(ClassLoader classLoader, String name) throws IOException { - InputStream is = classLoader.getResourceAsStream("META-INF/services/" + name); - if (is == null) { - return null; - } - BufferedReader reader = null; - try { - reader = new BufferedReader(new InputStreamReader(is)); - while (true) { - String line = reader.readLine(); - if (line == null) { - break; - } else if (!line.startsWith("#")) { - return line.trim(); - } - } - } finally { - if (reader != null) { - reader.close(); - } - } - return null; - } - - /** - * Returns a SCARuntime instance. If the system property "org.apache.tuscany.api.SCARuntime" is set, its value is - * used as the name of the implementation class. Otherwise, if the resource - * "META-INF/services/org.apache.tuscany.api.SCARuntime" can be loaded from the supplied classloader. Otherwise, it - * will use "org.apache.tuscany.core.bootstrap.DefaultSCARuntime" as the default. The named class is loaded from the - * supplied classloader and instantiated using its default (no-arg) constructor. - * - * @return - */ - private static SCARuntime newInstance(final ClassLoader classLoader) { - - try { - final String name = SCARuntime.class.getName(); - String className = AccessController.doPrivileged(new PrivilegedAction() { - public String run() { - return System.getProperty(name); - } - }); - - if (className == null) { - className = getServiceName(classLoader, name); - } - if (className == null) { - className = "org.apache.tuscany.core.bootstrap.DefaultSCARuntime"; - } - Class cls = Class.forName(className, true, classLoader); - return (SCARuntime)cls.newInstance(); // NOPMD lresende - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - - /** - * Get an instance of SCA Runtime - * - * @return The instance - */ - public synchronized static SCARuntime getInstance() { // NOPMD - if (instance != null) { - return instance; - } - ClassLoader classLoader = SCARuntime.class.getClassLoader(); - instance = newInstance(classLoader); - return instance; - } - - /** - * Start the Tuscany runtime using default SCDLs - */ - public static void start() { - try { - getInstance().startup(null, null, null, null); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - - /** - * Start the SCA Runtime with the given SCDLs - * - * @param system The URL for the system SCDL - * @param extensions An array of URLs for extensions - * @param application The URL for the application SCDL - */ - public static void start(URL system, URL[] extensions, URL application, String compositePath) { - try { - getInstance().startup(system, extensions, application, compositePath); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - - /** - * Start the SCA Runtime with the given SCDL - * - * @param application The URL for the application SCDL - */ - public static void start(URL application, String compositePath) { - try { - getInstance().startup(null, null, application, compositePath); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - - /** - * Start the SCA Runtime with the given SCDL - * - * @param compositePath The path of the application SCDL - */ - public static void start(String compositePath) { - try { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - URL applicationURL = cl.getResource(compositePath); - getInstance().startup(null, null, applicationURL, compositePath); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - - /** - * Start the SCA Runtime with the given SCDL - * - * @param compositePath The path of the system SCDL - * @param compositePath The path of the application SCDL - */ - public static void start(String system, String compositePath) { - try { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - URL systemURL = cl.getResource(system); - URL applicationURL = cl.getResource(compositePath); - getInstance().startup(systemURL, null, applicationURL, compositePath); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - - /** - * Get the ComponentContext by name - * - * @param componentName - * @return - */ - public static ComponentContext getComponentContext(String componentName) { - return getInstance().getContext(componentName); - } - - /** - * Get access to a system service - * - * @param serviceName - * @return - */ - protected abstract Object getSystemService(String serviceName); - - /** - * Stop the SCA Runtime - */ - public static void stop() { - try { - getInstance().shutdown(); - } catch (Exception e) { - throw new IllegalStateException(e); - } finally { - instance = null; - } - } - - /** - * Look up the ComponentContext by name - * - * @param componentName - * @return - */ - protected abstract ComponentContext getContext(String componentName); - - /** - * Start up the runtime - * - * @param system The URL of the SCDL for tuscany system composite - * @param extensions The URLs of the SCDLs for tuscany extension composites - * @param application The URL of the SCDL for the application composite - * @param compositePath The path of the application composite relative to the application URL - * @throws Exception - */ - protected abstract void startup(URL system, URL[] extensions, URL application, String compositePath) - throws Exception; - - /** - * Shutdown the runtime - * - * @throws Exception - */ - protected abstract void shutdown() throws Exception; -} diff --git a/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/TuscanyException.java b/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/TuscanyException.java deleted file mode 100644 index ad649d716f..0000000000 --- a/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/TuscanyException.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.api; - -import java.util.ArrayList; -import java.util.List; -import java.util.Collections; -import java.io.PrintWriter; - -/** - * The root checked exception for the Tuscany runtime. - * - * @version $Rev$ $Date$ - */ -public abstract class TuscanyException extends Exception { - private static final long serialVersionUID = -7847121698339635268L; - private List contextStack; - private final String identifier; - - /** - * Override constructor from Exception. - * - * @see Exception - */ - public TuscanyException() { - super(); - this.identifier = null; - } - - /** - * Override constructor from Exception. - * - * @param message passed to Exception - * @see Exception - */ - public TuscanyException(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 TuscanyException(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 TuscanyException(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 TuscanyException(String message, String identifier, Throwable cause) { - super(message, cause); - this.identifier = identifier; - } - - /** - * Override constructor from Exception. - * - * @param cause passed to Exception - * @see Exception - */ - public TuscanyException(Throwable cause) { - super(cause); - this.identifier = null; - } - - /** - * Returns a collection of names representing the context call stack where the error occured. The top of the stack - * is the first element in the collection. - * - * @return a collection of names representing the context call stack - */ - public List returnContextNames() { - if (contextStack == null) { - contextStack = new ArrayList(); - } - return Collections.unmodifiableList(contextStack); - } - - /** - * Pushes a context name where an error occured onto the call stack. - * - * @param name the name of a context to push on the stack - */ - public void addContextName(String name) { - if (contextStack == null) { - contextStack = new ArrayList(); - } - contextStack.add(name); - } - - /** - * 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 && contextStack == null) { - if (super.getMessage() == null) { - return writer; - } - return writer.append(super.getMessage()); - } - if (super.getMessage() != null) { - writer.append(super.getMessage()); - } - if (identifier != null) { - writer.append(" [").append(identifier).append(']'); - } - return writer; - } - - public PrintWriter appendContextStack(PrintWriter writer) { - if (contextStack != null) { - writer.append("\nContext stack trace: "); - for (int i = contextStack.size() - 1; i >= 0; i--) { - writer.append('[').append(contextStack.get(i)).append(']'); - } - } - return writer; - } -} diff --git a/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/TuscanyRuntimeException.java b/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/TuscanyRuntimeException.java deleted file mode 100644 index fc92c57fa0..0000000000 --- a/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/TuscanyRuntimeException.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.api; - -import java.util.ArrayList; -import java.util.List; -import java.util.Collections; -import java.io.PrintWriter; - -/** - * The root unchecked exception for the Tuscany runtime. - * - * @version $Rev$ $Date$ - */ - -public abstract class TuscanyRuntimeException extends RuntimeException { - private static final long serialVersionUID = -759677431966121786L; - private List contextStack; - private final String identifier; - - /** - * Override constructor from RuntimeException. - * - * @see RuntimeException - */ - public TuscanyRuntimeException() { - super(); - this.identifier = null; - } - - /** - * Override constructor from RuntimeException. - * - * @param message passed to RuntimeException - * @see RuntimeException - */ - public TuscanyRuntimeException(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 - */ - protected TuscanyRuntimeException(String message, String identifier) { - super(message); - this.identifier = identifier; - } - - /** - * Override constructor from RuntimeException. - * - * @param message passed to RuntimeException - * @param cause passed to RuntimeException - * @see RuntimeException - */ - public TuscanyRuntimeException(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 RuntimeException - * @see Exception - */ - protected TuscanyRuntimeException(String message, String identifier, Throwable cause) { - super(message, cause); - this.identifier = identifier; - } - - /** - * Override constructor from RuntimeException. - * - * @param cause passed to RuntimeException - * @see RuntimeException - */ - public TuscanyRuntimeException(Throwable cause) { - super(cause); - this.identifier = null; - } - - /** - * Returns a collection of names representing the context call stack where the error occured. The top of the stack - * is the first element in the collection. - * - * @return a collection of names representing the context call stack - */ - public List returnContextNames() { - if (contextStack == null) { - contextStack = new ArrayList(); - } - return Collections.unmodifiableList(contextStack); - } - - /** - * Pushes a context name where an error occured onto the call stack. - * - * @param name the name of a context to push on the stack - */ - public void addContextName(String name) { - if (contextStack == null) { - contextStack = new ArrayList(); - } - contextStack.add(name); - } - - /** - * 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 && contextStack == null) { - if (super.getMessage() == null) { - return writer; - } - return writer.append(super.getMessage()); - } - if (super.getMessage() != null) { - writer.append(super.getMessage()); - } - if (identifier != null) { - writer.append(" [").append(identifier).append(']'); - } - return writer; - } - - public PrintWriter appendContextStack(PrintWriter writer) { - if (contextStack != null) { - writer.append("Context stack trace: "); - for (int i = contextStack.size() - 1; i >= 0; i--) { - writer.append('[').append(contextStack.get(i)).append(']'); - } - } - return writer; - } - -} diff --git a/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/DataType.java b/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/DataType.java deleted file mode 100644 index 33e67a60ae..0000000000 --- a/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/DataType.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.api.annotation; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.ElementType.PARAMETER; -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, FIELD, PARAMETER}) -@Retention(RUNTIME) -public @interface DataType { - - /** - * Returns the unique name of the data binding - * @return the unique name of the data binding - */ - String name(); - -} diff --git a/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/IDLMapping.java b/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/IDLMapping.java deleted file mode 100644 index e8c88b6176..0000000000 --- a/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/IDLMapping.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.api.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; - -/** - * Annotation that can be applied to interfaces or methods to provide IDL mapping metadata - * - * @version $Rev$ $Date$ - */ -@Target({METHOD, TYPE}) -@Retention(RUNTIME) -public @interface IDLMapping { - - /** - * The name of the databinding for the wrapper - */ - String dataBinding() default ""; - - /** - * To indicate if the java interface/method is generated from a WSDL using wrapper style. - * - * @see javax.xml.ws.RequestWrapper - * @see javax.xml.ws.RequestWrapper - * - * @return - */ - boolean wrapperStyle() default true; -} diff --git a/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/LogLevel.java b/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/LogLevel.java deleted file mode 100644 index 83c5df26d9..0000000000 --- a/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/LogLevel.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.api.annotation; - -import static java.lang.annotation.ElementType.METHOD; -import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Target; - -/** - * Annotation that can be applied to methods in a monitoring interface to indicate to logging frameworks the severity of - * the event. - * - * @version $Rev$ $Date$ - */ -@Target({METHOD}) -@Retention(RUNTIME) -public @interface LogLevel { - - /** - * The log level as specified by {@link java.util.logging.Level}. - */ - @SuppressWarnings({"JavaDoc"}) String value(); -} diff --git a/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/Monitor.java b/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/Monitor.java deleted file mode 100644 index dea9489e5b..0000000000 --- a/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/Monitor.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.api.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * A system annotation to inject a monitor - * - * @version $Rev$ $Date$ - */ -@Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Monitor { -} diff --git a/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/Resource.java b/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/Resource.java deleted file mode 100644 index a7158ab6b8..0000000000 --- a/branches/sca-java-integration/sca/kernel/api/src/main/java/org/apache/tuscany/api/annotation/Resource.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.api.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotation used to indicate a resource should be provided to an implementation by the runtime. - * - * @version $Rev$ $Date$ - */ -@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Resource { - - /** - * Denotes the name of the resource declared by the implementation. - */ - String name() default ""; - - /** - * Denotes if the resource is optional - */ - boolean optional() default false; - - /** - * Denotes the default name of the resource provided by the runtime environment. - */ - String mappedName() default ""; -} diff --git a/branches/sca-java-integration/sca/kernel/api/src/test/java/org/apache/tuscany/api/TuscanyExceptionTestCase.java b/branches/sca-java-integration/sca/kernel/api/src/test/java/org/apache/tuscany/api/TuscanyExceptionTestCase.java deleted file mode 100644 index 9f0674238f..0000000000 --- a/branches/sca-java-integration/sca/kernel/api/src/test/java/org/apache/tuscany/api/TuscanyExceptionTestCase.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.api; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.List; - -import junit.framework.TestCase; - -/** - * @version $Rev$ $Date$ - */ -public class TuscanyExceptionTestCase extends TestCase { - private static final Throwable CAUSE = new Throwable("Cause"); - private static final String IDENTIFIER = "IDENTIFIER"; - private static final String MESSAGE = "Message"; - private static final String CONTEXT1 = "CONTEXT1"; - private static final String CONTEXT2 = "CONTEXT2"; - - public void testNoArgConstructor() { - TuscanyException ex = new DummyException(); - assertNull(ex.getMessage()); - assertNull(ex.getCause()); - assertNull(ex.getIdentifier()); - assertTrue(ex.returnContextNames().isEmpty()); - } - - public void testMessageConstructor() { - TuscanyException ex = new DummyException(MESSAGE); - assertEquals(MESSAGE, ex.getMessage()); - assertNull(ex.getCause()); - assertNull(ex.getIdentifier()); - assertTrue(ex.returnContextNames().isEmpty()); - } - - public void testAppendBaseMessage() { - TuscanyException ex = new DummyException(MESSAGE, IDENTIFIER); - StringWriter writer = new StringWriter(); - PrintWriter pw = new PrintWriter(writer); - ex.appendBaseMessage(pw); - assertEquals("Message [IDENTIFIER]", writer.toString()); - } - - public void testAppendBaseMessageNoIdentifier() { - TuscanyException ex = new DummyException(MESSAGE); - StringWriter writer = new StringWriter(); - PrintWriter pw = new PrintWriter(writer); - ex.appendBaseMessage(pw); - assertEquals("Message", writer.toString()); - } - - public void testThrowableConstructor() { - TuscanyException ex = new DummyException(CAUSE); - assertEquals(CAUSE.getClass().getName() + ": " + CAUSE.getMessage(), ex.getMessage()); - assertEquals(CAUSE, ex.getCause()); - assertNull(ex.getIdentifier()); - assertTrue(ex.returnContextNames().isEmpty()); - } - - public void testMessageThrowableConstructor() { - TuscanyException ex = new DummyException(MESSAGE, CAUSE); - assertEquals(MESSAGE, ex.getMessage()); - assertEquals(CAUSE, ex.getCause()); - assertNull(ex.getIdentifier()); - assertTrue(ex.returnContextNames().isEmpty()); - } - - public void testContextStack() { - TuscanyException ex = new DummyException(MESSAGE); - List contexts = new ArrayList(); - contexts.add(CONTEXT1); - ex.addContextName(CONTEXT1); - assertEquals(contexts, ex.returnContextNames()); - contexts.add(CONTEXT2); - ex.addContextName(CONTEXT2); - assertEquals(contexts, ex.returnContextNames()); - } - - public void testAppendContextMessage() { - TuscanyException ex = new DummyException(MESSAGE); - ex.addContextName(CONTEXT1); - ex.addContextName(CONTEXT2); - StringWriter writer = new StringWriter(); - PrintWriter pw = new PrintWriter(writer); - ex.appendContextStack(pw); - assertEquals("\nContext stack trace: [CONTEXT2][CONTEXT1]", writer.toString()); - } - - public void testAddContext() throws Exception { - TuscanyException e = new DummyException(); - e.addContextName("foo"); - e.addContextName("bar"); - assertEquals("foo", e.returnContextNames().get(0)); - assertEquals("bar", e.returnContextNames().get(1)); - } - - public void testEmptyContext() throws Exception { - TuscanyException e = new DummyException(); - assertEquals(0, e.returnContextNames().size()); - } - - public void testGetMessage() throws Exception { - TuscanyException e = new DummyException(); - e.getMessage(); - } - - public void testFullMessage() throws Exception { - TuscanyException e = new DummyException("message", "foo"); - e.addContextName("foo"); - e.getMessage(); - } - - public void testImmutableContextNames() { - TuscanyException e = new DummyException("message", "foo"); - try { - e.returnContextNames().add("foo"); - fail(); - } catch (UnsupportedOperationException e1) { - // expected - } - } - - - public static class DummyException extends TuscanyException { - - public DummyException() { - } - - public DummyException(String message) { - super(message); - } - - - public DummyException(String message, String identifier) { - super(message, identifier); - } - - public DummyException(String message, Throwable cause) { - super(message, cause); - } - - public DummyException(Throwable cause) { - super(cause); - } - } -} diff --git a/branches/sca-java-integration/sca/kernel/api/src/test/java/org/apache/tuscany/api/TuscanyRuntimeExceptionTestCase.java b/branches/sca-java-integration/sca/kernel/api/src/test/java/org/apache/tuscany/api/TuscanyRuntimeExceptionTestCase.java deleted file mode 100644 index 4addd5ab38..0000000000 --- a/branches/sca-java-integration/sca/kernel/api/src/test/java/org/apache/tuscany/api/TuscanyRuntimeExceptionTestCase.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.api; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.List; - -import junit.framework.TestCase; - -/** - * @version $Rev$ $Date$ - */ -public class TuscanyRuntimeExceptionTestCase extends TestCase { - private static final Throwable CAUSE = new Throwable("Cause"); - private static final String MESSAGE = "Message"; - private static final String IDENTIFIER = "IDENTIFIER"; - private static final String CONTEXT1 = "CONTEXT1"; - private static final String CONTEXT2 = "CONTEXT2"; - - public void testNoArgConstructor() { - TuscanyRuntimeException ex = new DummyException(); - assertNull(ex.getMessage()); - assertNull(ex.getCause()); - assertNull(ex.getIdentifier()); - assertTrue(ex.returnContextNames().isEmpty()); - } - - public void testMessageConstructor() { - TuscanyRuntimeException ex = new DummyException(MESSAGE); - assertSame(MESSAGE, ex.getMessage()); - assertNull(ex.getCause()); - assertNull(ex.getIdentifier()); - assertTrue(ex.returnContextNames().isEmpty()); - } - - public void testThrowableConstructor() { - TuscanyRuntimeException ex = new DummyException(CAUSE); - assertEquals(CAUSE.getClass().getName() + ": " + CAUSE.getMessage(), ex.getMessage()); - assertSame(CAUSE, ex.getCause()); - assertNull(ex.getIdentifier()); - assertTrue(ex.returnContextNames().isEmpty()); - } - - public void testMessageThrowableConstructor() { - TuscanyRuntimeException ex = new DummyException(MESSAGE, CAUSE); - assertSame(MESSAGE, ex.getMessage()); - assertSame(CAUSE, ex.getCause()); - assertNull(ex.getIdentifier()); - assertTrue(ex.returnContextNames().isEmpty()); - } - - public void testIdentifier() { - TuscanyRuntimeException ex = new DummyException(MESSAGE, IDENTIFIER); - assertEquals(IDENTIFIER, ex.getIdentifier()); - } - - public void testContextStack() { - TuscanyRuntimeException ex = new DummyException(MESSAGE); - List contexts = new ArrayList(); - contexts.add(CONTEXT1); - ex.addContextName(CONTEXT1); - assertEquals(contexts, ex.returnContextNames()); - contexts.add(CONTEXT2); - ex.addContextName(CONTEXT2); - assertEquals(contexts, ex.returnContextNames()); - } - - public void testAppendContextMessage() { - TuscanyRuntimeException ex = new DummyException(MESSAGE); - ex.addContextName(CONTEXT1); - ex.addContextName(CONTEXT2); - StringWriter writer = new StringWriter(); - PrintWriter pw = new PrintWriter(writer); - ex.appendContextStack(pw); - assertEquals("Context stack trace: [CONTEXT2][CONTEXT1]", writer.toString()); - } - - public void testAppendBaseMessage() { - TuscanyRuntimeException ex = new DummyException(MESSAGE, IDENTIFIER); - StringWriter writer = new StringWriter(); - PrintWriter pw = new PrintWriter(writer); - ex.appendBaseMessage(pw); - assertEquals("Message [IDENTIFIER]", writer.toString()); - } - - public void testAppendBaseMessageNoIdentifier() { - TuscanyRuntimeException ex = new DummyException(MESSAGE); - StringWriter writer = new StringWriter(); - PrintWriter pw = new PrintWriter(writer); - ex.appendBaseMessage(pw); - assertEquals("Message", writer.toString()); - } - - public void testImmutableContextNames() { - TuscanyRuntimeException e = new DummyException("message", "foo"); - try { - e.returnContextNames().add("foo"); - fail(); - } catch (UnsupportedOperationException e1) { - // expected - } - } - - public static class DummyException extends TuscanyRuntimeException { - public DummyException() { - } - - public DummyException(String message) { - super(message); - } - - public DummyException(String message, String identifier) { - super(message, identifier); - } - - public DummyException(String message, Throwable cause) { - super(message, cause); - } - - public DummyException(Throwable cause) { - super(cause); - } - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/.checkstyle b/branches/sca-java-integration/sca/kernel/core/.checkstyle deleted file mode 100644 index 142759d295..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/.checkstyle +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/branches/sca-java-integration/sca/kernel/core/.pmd b/branches/sca-java-integration/sca/kernel/core/.pmd deleted file mode 100644 index 9606e17e2d..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/.pmd +++ /dev/null @@ -1,2 +0,0 @@ - -truefalse \ No newline at end of file diff --git a/branches/sca-java-integration/sca/kernel/core/.ruleset b/branches/sca-java-integration/sca/kernel/core/.ruleset deleted file mode 100644 index ba9b5ce886..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/.ruleset +++ /dev/null @@ -1,190 +0,0 @@ - - - - PMD Plugin preferences rule set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-integration/sca/kernel/core/LICENSE.txt b/branches/sca-java-integration/sca/kernel/core/LICENSE.txt deleted file mode 100644 index 0084319535..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, serviceDefinition marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/branches/sca-java-integration/sca/kernel/core/NOTICE.txt b/branches/sca-java-integration/sca/kernel/core/NOTICE.txt deleted file mode 100644 index d83ebbe236..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/NOTICE.txt +++ /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-integration/sca/kernel/core/pom.xml b/branches/sca-java-integration/sca/kernel/core/pom.xml deleted file mode 100644 index 7d902e083c..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/pom.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - org.apache.tuscany.sca.kernel - parent - 0.1-integration-incubating-SNAPSHOT - - 4.0.0 - tuscany-core - jar - Apache Tuscany SCA Core - Core Tuscany runtime. - - - - org.apache.tuscany.sca.kernel - tuscany-spi - ${pom.version} - compile - - - - org.apache.tuscany.sca.kernel - tuscany-host-api - ${sca.version} - compile - - - - org.apache.tuscany - commonj-api_r1.1 - - - - org.codehaus.woodstox - wstx-asl - - - - javax.servlet - servlet-api - 2.5 - - - - org.apache.geronimo.specs - geronimo-j2ee-connector_1.5_spec - - - - junit - junit - - - - org.easymock - easymockclassextension - - - - - - - src/main/resources - true - - - ${notice.dir} - META-INF - true - - LICENSE.txt - NOTICE.txt - - - - - diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/AbstractLocalTargetInvoker.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/AbstractLocalTargetInvoker.java deleted file mode 100644 index 7727759a88..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/AbstractLocalTargetInvoker.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.core.binding.local; - -import java.lang.reflect.InvocationTargetException; - -import org.apache.tuscany.spi.wire.Interceptor; -import org.apache.tuscany.spi.wire.InvocationRuntimeException; -import org.apache.tuscany.spi.wire.Message; -import org.apache.tuscany.spi.wire.OutboundInvocationChain; -import org.apache.tuscany.spi.wire.TargetInvoker; - -/** - * Base class for dispatching to a composite reference using the local binding - * - * @version $Rev$ $Date$ - */ -public abstract class AbstractLocalTargetInvoker implements TargetInvoker { - protected boolean cacheable; - - 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 Object invokeTarget(final Object payload, short sequence) throws InvocationTargetException { - throw new InvocationTargetException(new UnsupportedOperationException()); - } - - protected Message invoke(OutboundInvocationChain chain, TargetInvoker invoker, Message msg) throws Throwable { - Interceptor headInterceptor = chain.getHeadInterceptor(); - if (headInterceptor == null) { - try { - // short-circuit the dispatch and invoke the target directly - if (invoker == null) { - String name = chain.getOperation().getName(); - throw new AssertionError("No target invoker [" + name + "]"); - } - return invoker.invoke(msg); - } catch (InvocationRuntimeException e) { - // the cause was thrown by the target so throw it - throw e.getCause(); - } - } else { - msg.setTargetInvoker(invoker); - return headInterceptor.invoke(msg); - } - } - - @Override - public AbstractLocalTargetInvoker clone() throws CloneNotSupportedException { - return (AbstractLocalTargetInvoker) super.clone(); - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalBindingBuilder.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalBindingBuilder.java deleted file mode 100644 index c62523889d..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalBindingBuilder.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.core.binding.local; - -import org.apache.tuscany.spi.builder.BuilderException; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.component.ReferenceBinding; -import org.apache.tuscany.spi.component.ServiceBinding; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.extension.BindingBuilderExtension; -import org.apache.tuscany.spi.model.AbstractReferenceDefinition; -import org.apache.tuscany.spi.model.ServiceDefinition; - -/** - * Creates runtime artifacts for the local binding - * - * @version $Rev$ $Date$ - */ -public class LocalBindingBuilder extends BindingBuilderExtension { - - protected Class getBindingType() { - return LocalBindingDefinition.class; - } - - public ServiceBinding build(CompositeComponent parent, - ServiceDefinition serviceDefinition, - LocalBindingDefinition bindingDefinition, - DeploymentContext deploymentContext) - throws BuilderException { - return new LocalServiceBinding(serviceDefinition.getName(), parent); - } - - - public ReferenceBinding build(CompositeComponent parent, - AbstractReferenceDefinition referenceDefinition, - LocalBindingDefinition bindingDefinition, - DeploymentContext deploymentContext) throws BuilderException { - return new LocalReferenceBinding(referenceDefinition.getName(), parent); - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalBindingDefinition.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalBindingDefinition.java deleted file mode 100644 index 4df3e413dc..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalBindingDefinition.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.core.binding.local; - -import java.net.URI; - -import org.apache.tuscany.spi.model.BindingDefinition; - - -/** - * Represents the local by-reference binding - * - * @version $Rev$ $Date$ - */ -public class LocalBindingDefinition extends BindingDefinition implements Cloneable { - - public LocalBindingDefinition() { - } - - public LocalBindingDefinition(URI targetUri) { - super(targetUri); - } - - public Object clone() { - LocalBindingDefinition clone = new LocalBindingDefinition(); - clone.setTargetUri(URI.create(getTargetUri().toString())); - return clone; - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalBindingLoader.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalBindingLoader.java deleted file mode 100644 index 777beeb00e..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalBindingLoader.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.core.binding.local; - -import java.net.URI; -import java.net.URISyntaxException; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.extension.LoaderExtension; -import org.apache.tuscany.spi.loader.LoaderException; -import org.apache.tuscany.spi.loader.LoaderRegistry; -import org.apache.tuscany.spi.model.ModelObject; -import org.apache.tuscany.spi.wire.Wire; - -/** - * Loader responsible for handling the local binding - * - * @version $Rev$ $Date$ - */ -public class LocalBindingLoader extends LoaderExtension { - - /** - * Constructor specifies the registry to register with. - * - * @param registry the LoaderRegistry this loader should register with - */ - public LocalBindingLoader(@Autowire LoaderRegistry registry) { - super(registry); - } - - public QName getXMLType() { - return Wire.LOCAL_BINDING; - } - - public LocalBindingDefinition load(CompositeComponent parent, - ModelObject object, - XMLStreamReader reader, - DeploymentContext deploymentContext) throws XMLStreamException, LoaderException { - String uri = reader.getAttributeValue(null, "uri"); - if (uri != null) { - try { - return new LocalBindingDefinition(new URI(uri)); - } catch (URISyntaxException e) { - throw new LoaderException(e); - } - } - return new LocalBindingDefinition(); - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvoker.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvoker.java deleted file mode 100644 index 03f42ca99c..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalCallbackTargetInvoker.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.core.binding.local; - -import java.util.Map; - -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.wire.InboundWire; -import org.apache.tuscany.spi.wire.InvocationRuntimeException; -import org.apache.tuscany.spi.wire.Message; -import org.apache.tuscany.spi.wire.MessageImpl; -import org.apache.tuscany.spi.wire.OutboundInvocationChain; -import org.apache.tuscany.spi.wire.TargetInvoker; - -/** - * Dispatches a callback invocation to the callback instance - * - * @version $Rev$ $Date$ - */ -public class LocalCallbackTargetInvoker extends AbstractLocalTargetInvoker { - private Operation operation; - private InboundWire inboundWire; - - public LocalCallbackTargetInvoker(Operation operation, InboundWire inboundWire) { - assert operation != null : "Operation method cannot be null"; - this.operation = operation; - this.inboundWire = inboundWire; - } - - public Message invoke(Message msg) throws InvocationRuntimeException { - try { - return invoke(operation, msg); - } catch (Throwable e) { - Message faultMsg = new MessageImpl(); - faultMsg.setBodyWithFault(e); - return faultMsg; - } - } - - private Message invoke(Operation operation, Message msg) throws Throwable { - Object targetAddress = msg.popFromAddress(); - if (targetAddress == null) { - throw new AssertionError("Popped a null from address from message"); - } - //TODO optimize as this is slow in local invocations - Map, OutboundInvocationChain> sourceCallbackInvocationChains = - inboundWire.getSourceCallbackInvocationChains(targetAddress); - OutboundInvocationChain chain = sourceCallbackInvocationChains.get(operation); - TargetInvoker invoker = chain.getTargetInvoker(); - return invoke(chain, invoker, msg); - } - - @Override - public LocalCallbackTargetInvoker clone() throws CloneNotSupportedException { - return (LocalCallbackTargetInvoker) super.clone(); - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalReferenceBinding.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalReferenceBinding.java deleted file mode 100644 index 9117fe903e..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalReferenceBinding.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.core.binding.local; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.spi.CoreRuntimeException; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.component.TargetInvokerCreationException; -import org.apache.tuscany.spi.extension.ReferenceBindingExtension; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.model.ServiceContract; -import org.apache.tuscany.spi.wire.TargetInvoker; -import org.apache.tuscany.spi.wire.Wire; - -/** - * The runtime representaion of the local reference binding - * - * @version $Rev$ $Date$ - */ -public class LocalReferenceBinding extends ReferenceBindingExtension { - - public LocalReferenceBinding(String name, CompositeComponent parent) throws CoreRuntimeException { - super(name, parent); - } - - public QName getBindingType() { - return Wire.LOCAL_BINDING; - } - - public TargetInvoker createTargetInvoker(ServiceContract contract, Operation operation) - throws TargetInvokerCreationException { - if (operation.isCallback()) { - return new LocalCallbackTargetInvoker(operation, inboundWire); - } else { - return new LocalTargetInvoker(operation, outboundWire); - } - } - - public TargetInvoker createCallbackTargetInvoker(ServiceContract contract, Operation operation) - throws TargetInvokerCreationException { - return new LocalCallbackTargetInvoker(operation, inboundWire); - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalServiceBinding.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalServiceBinding.java deleted file mode 100644 index 6205172d7b..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalServiceBinding.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.core.binding.local; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.spi.CoreRuntimeException; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.component.TargetInvokerCreationException; -import org.apache.tuscany.spi.extension.ServiceBindingExtension; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.model.ServiceContract; -import org.apache.tuscany.spi.wire.TargetInvoker; -import org.apache.tuscany.spi.wire.Wire; - -/** - * The runtime representaion of the local service binding - * - * @version $Rev$ $Date$ - */ -public class LocalServiceBinding extends ServiceBindingExtension { - - public LocalServiceBinding(String name, CompositeComponent parent) throws CoreRuntimeException { - super(name, parent); - } - - public QName getBindingType() { - return Wire.LOCAL_BINDING; - } - - public TargetInvoker createTargetInvoker(ServiceContract contract, Operation operation) - throws TargetInvokerCreationException { - if (operation.isCallback()) { - return new LocalCallbackTargetInvoker(operation, getInboundWire()); - } else { - return new LocalTargetInvoker(operation, outboundWire); - } - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalTargetInvoker.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalTargetInvoker.java deleted file mode 100644 index 5b564c93b8..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/binding/local/LocalTargetInvoker.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.binding.local; - -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.wire.InvocationRuntimeException; -import org.apache.tuscany.spi.wire.Message; -import org.apache.tuscany.spi.wire.MessageImpl; -import org.apache.tuscany.spi.wire.OutboundInvocationChain; -import org.apache.tuscany.spi.wire.OutboundWire; -import org.apache.tuscany.spi.wire.TargetInvoker; - -/** - * Dispatches an invocation through a composite service or reference using the local binding - * - * @version $Rev$ $Date$ - */ -public class LocalTargetInvoker extends AbstractLocalTargetInvoker { - private OutboundInvocationChain chain; - private Object fromAddress; - private boolean contractHasCallback; - - public LocalTargetInvoker(Operation operation, OutboundWire outboundWire) { - assert operation != null; - chain = outboundWire.getInvocationChains().get(operation); - assert chain != null; - fromAddress = (outboundWire.getContainer() == null) ? null : outboundWire.getContainer().getName(); - contractHasCallback = outboundWire.getServiceContract().getCallbackClass() != null; - } - - @Override - public LocalTargetInvoker clone() throws CloneNotSupportedException { - return (LocalTargetInvoker) super.clone(); - } - - public Message invoke(Message msg) throws InvocationRuntimeException { - try { - TargetInvoker invoker = chain.getTargetInvoker(); - assert invoker != null; - // Pushing the from address only needs to happen in the outbound (forward) direction for callbacks - if (contractHasCallback) { - msg.pushFromAddress(fromAddress); - } - - return invoke(chain, invoker, msg); - } catch (Throwable e) { - Message faultMsg = new MessageImpl(); - faultMsg.setBodyWithFault(e); - return faultMsg; - } - } - - - public boolean isOptimizable() { - return true; - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/Bootstrapper.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/Bootstrapper.java deleted file mode 100644 index 0f6b4a2c92..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/Bootstrapper.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.core.bootstrap; - -import org.apache.tuscany.host.MonitorFactory; -import org.apache.tuscany.spi.bootstrap.RuntimeComponent; -import org.apache.tuscany.spi.builder.Connector; -import org.apache.tuscany.spi.component.ScopeRegistry; -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.deployer.Deployer; -import org.apache.tuscany.spi.implementation.java.Introspector; -import org.apache.tuscany.spi.loader.Loader; -import org.apache.tuscany.spi.loader.PropertyObjectFactory; - -/** - * Interface that abstracts the process used to create a running Tuscany system. Implementation of this may provide - * different mechanisms for creating the primoridal system components used to boot the core to the level where it can - * support end-user applications. - * - * @version $Rev$ $Date$ - */ -public interface Bootstrapper { - /** - * Return the MonitorFactory being used by the implementation to provide monitor interfaces for the primordial - * components. - * - * @return the MonitorFactory being used by the bootstrapper - */ - MonitorFactory getMonitorFactory(); - - /** - * Create the RuntimeComponent that forms the fundamental root of the component assembly. This component has two - * children: a {@link org.apache.tuscany.spi.component.CompositeComponent} that is the root for all system - * components, and a {@link org.apache.tuscany.spi.component.CompositeComponent} that is the root for all - * application components. - * - * @return a new RuntimeComponent; basically a new Tuscany instance - */ - RuntimeComponent createRuntime(); - - /** - * Create a Deployer that can be used to deploy the system definition. This will most likely only support a small - * subset of the available programming model. - * - * @return a new primordial Deployer - */ - Deployer createDeployer(); - - /** - * Create a Loader for parsing a system definition represented as a XML SCDL file. - * - * @param propertyFactory the StAXPropertyFactory to be used to parse property values - * @param introspector the introspector to be used to extract component type information from a Java class - * @return a new prmordial Loader - */ - Loader createLoader(PropertyObjectFactory propertyFactory, Introspector introspector); - - /** - * Create a ScopeRegistry that supports the Scopes supported for primordial components - * - * @param workContext the WorkContext the Scopes should use - * @return a new primordial ScopeRegistry - */ - ScopeRegistry createScopeRegistry(WorkContext workContext); - - /** - * Create a Connector that can wire together primordial components. - * - * @return a new primordial Connector - */ - Connector createConnector(); -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultBootstrapper.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultBootstrapper.java deleted file mode 100644 index 762568eb01..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultBootstrapper.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.bootstrap; - -import javax.xml.stream.XMLInputFactory; - -import org.apache.tuscany.spi.bootstrap.ComponentNames; -import org.apache.tuscany.spi.bootstrap.RuntimeComponent; -import org.apache.tuscany.spi.builder.Builder; -import org.apache.tuscany.spi.builder.Connector; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.component.ScopeContainerMonitor; -import org.apache.tuscany.spi.component.ScopeRegistry; -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.deployer.Deployer; -import org.apache.tuscany.spi.extension.LoaderExtension; -import org.apache.tuscany.spi.idl.java.JavaInterfaceProcessorRegistry; -import org.apache.tuscany.spi.implementation.java.ImplementationProcessorService; -import org.apache.tuscany.spi.implementation.java.Introspector; -import org.apache.tuscany.spi.loader.LoaderRegistry; -import org.apache.tuscany.spi.loader.PropertyObjectFactory; -import org.apache.tuscany.spi.services.management.TuscanyManagementService; - -import org.apache.tuscany.core.binding.local.LocalBindingBuilder; -import org.apache.tuscany.core.binding.local.LocalBindingDefinition; -import org.apache.tuscany.core.binding.local.LocalBindingLoader; -import org.apache.tuscany.core.builder.BuilderRegistryImpl; -import org.apache.tuscany.core.builder.ConnectorImpl; -import org.apache.tuscany.core.component.WorkContextImpl; -import org.apache.tuscany.core.component.scope.CompositeScopeObjectFactory; -import org.apache.tuscany.core.component.scope.ScopeRegistryImpl; -import org.apache.tuscany.core.deployer.DeployerImpl; -import org.apache.tuscany.core.idl.java.InterfaceJavaLoader; -import org.apache.tuscany.core.idl.java.JavaInterfaceProcessorRegistryImpl; -import org.apache.tuscany.core.implementation.IntrospectionRegistryImpl; -import org.apache.tuscany.core.implementation.composite.CompositeComponentImpl; -import org.apache.tuscany.core.implementation.composite.CompositeLoader; -import org.apache.tuscany.core.implementation.processor.ConstructorProcessor; -import org.apache.tuscany.core.implementation.processor.DestroyProcessor; -import org.apache.tuscany.core.implementation.processor.EagerInitProcessor; -import org.apache.tuscany.core.implementation.processor.HeuristicPojoProcessor; -import org.apache.tuscany.core.implementation.processor.ImplementationProcessorServiceImpl; -import org.apache.tuscany.core.implementation.processor.InitProcessor; -import org.apache.tuscany.core.implementation.processor.MonitorProcessor; -import org.apache.tuscany.core.implementation.processor.PropertyProcessor; -import org.apache.tuscany.core.implementation.processor.ReferenceProcessor; -import org.apache.tuscany.core.implementation.processor.ResourceProcessor; -import org.apache.tuscany.core.implementation.processor.ScopeProcessor; -import org.apache.tuscany.core.implementation.processor.ServiceProcessor; -import org.apache.tuscany.core.implementation.system.builder.SystemComponentBuilder; -import org.apache.tuscany.core.implementation.composite.SystemCompositeBuilder; -import org.apache.tuscany.core.implementation.system.loader.SystemComponentTypeLoader; -import org.apache.tuscany.core.implementation.system.loader.SystemCompositeComponentTypeLoader; -import org.apache.tuscany.core.implementation.system.loader.SystemImplementationLoader; -import org.apache.tuscany.core.implementation.system.model.SystemCompositeImplementation; -import org.apache.tuscany.core.implementation.system.model.SystemImplementation; -import org.apache.tuscany.core.loader.ComponentLoader; -import org.apache.tuscany.core.loader.ComponentTypeElementLoader; -import org.apache.tuscany.core.loader.IncludeLoader; -import org.apache.tuscany.core.loader.LoaderRegistryImpl; -import org.apache.tuscany.core.loader.PropertyLoader; -import org.apache.tuscany.core.loader.ReferenceLoader; -import org.apache.tuscany.core.loader.ServiceLoader; -import org.apache.tuscany.core.property.PropertyObjectFactoryImpl; -import org.apache.tuscany.core.wire.jdk.JDKWireService; -import org.apache.tuscany.host.MonitorFactory; - -/** - * A default implementation of a Bootstrapper. Please see the documentation on the individual methods for how the - * primordial components are created. - * - * @version $Rev$ $Date$ - */ -public class DefaultBootstrapper implements Bootstrapper { - private final MonitorFactory monitorFactory; - private final XMLInputFactory xmlFactory; - private final TuscanyManagementService managementService; - - /** - * Create a default bootstrapper. - * - * @param monitorFactory the MonitorFactory to be used to create monitors for the primordial components - * @param xmlFactory the XMLInputFactory to be used by the components to load XML artifacts - * @param managementService management service used by the runtime. - */ - public DefaultBootstrapper(MonitorFactory monitorFactory, - XMLInputFactory xmlFactory, - TuscanyManagementService managementService) { - this.monitorFactory = monitorFactory; - this.xmlFactory = xmlFactory; - this.managementService = managementService; - } - - /** - * Returns the MonitorFactory being used by this bootstrapper. - * - * @return the MonitorFactory being used by this bootstrapper - */ - public MonitorFactory getMonitorFactory() { - return monitorFactory; - } - - /** - * Create the RuntimeComponent that will form the root of the component tree. Returns an new instance of a {@link - * DefaultRuntime} with the system and application root components initialized with default composite components. - * - * @return a newly created root for the component tree - */ - public RuntimeComponent createRuntime() { - DefaultRuntime runtime = new DefaultRuntime(); - CompositeComponent systemComponent = - new CompositeComponentImpl(ComponentNames.TUSCANY_SYSTEM_ROOT, runtime, null, true); - runtime.setSystemComponent(systemComponent); - CompositeComponent rootComponent = - new CompositeComponentImpl(ComponentNames.TUSCANY_APPLICATION_ROOT, runtime, null, null); - runtime.setRootComponent(rootComponent); - return runtime; - } - - /** - * Create primordial deployer that can be used to load the system definition. - * - * @return the primordial deployer - */ - public Deployer createDeployer() { - ScopeRegistry scopeRegistry = createScopeRegistry(new WorkContextImpl()); - Builder builder = createBuilder(scopeRegistry); - JavaInterfaceProcessorRegistry interfaceIntrospector = new JavaInterfaceProcessorRegistryImpl(); - Introspector introspector = createIntrospector(interfaceIntrospector); - LoaderRegistry loader = createLoader(new PropertyObjectFactoryImpl(), introspector); - DeployerImpl deployer = new DeployerImpl(xmlFactory, loader, builder); - deployer.setMonitor(getMonitorFactory().getMonitor(ScopeContainerMonitor.class)); - return deployer; - } - - /** - * Create a basic ScopeRegistry containing the ScopeContainers that are available to components in the system - * definition. The implementation returned only support COMPOSITE scope. - * - * @param workContext the WorkContext the scopes should use - * @return a new ScopeRegistry - */ - public ScopeRegistry createScopeRegistry(WorkContext workContext) { - ScopeRegistry scopeRegistry = new ScopeRegistryImpl(); - new CompositeScopeObjectFactory(scopeRegistry, monitorFactory.getMonitor(ScopeContainerMonitor.class)); - return scopeRegistry; - } - - /** - * Create a Loader that can be used to parse an XML file containing the SCDL for the system definition. The - * following Implementation types are supported:
  • SystemImplementation
  • - *
  • SystemCompositeImplementation
and the following SCDL elements are supported:
    - *
  • composite
  • component
  • componentType
  • interface.java
  • property
  • - *
  • reference
  • service
  • implementation.system
Note the Java component type and the - * WSDL interface type are not supported. - * - * @param propertyFactory the StAXPropertyFactory to be used for parsing Property values - * @param introspector the Introspector to be used to inspect component implementations - * @return a new StAX XML loader - */ - public LoaderRegistry createLoader(PropertyObjectFactory propertyFactory, Introspector introspector) { - LoaderRegistryImpl loaderRegistry = - new LoaderRegistryImpl(monitorFactory.getMonitor(LoaderRegistryImpl.Monitor.class)); - - // register component type loaders - loaderRegistry.registerLoader(SystemImplementation.class, new SystemComponentTypeLoader(introspector)); - loaderRegistry.registerLoader(SystemCompositeImplementation.class, - new SystemCompositeComponentTypeLoader(loaderRegistry)); - - // register element loaders - registerLoader(loaderRegistry, new ComponentLoader(loaderRegistry, propertyFactory)); - registerLoader(loaderRegistry, new ComponentTypeElementLoader(loaderRegistry)); - registerLoader(loaderRegistry, new CompositeLoader(loaderRegistry, null)); - registerLoader(loaderRegistry, new IncludeLoader(loaderRegistry)); - JavaInterfaceProcessorRegistryImpl processorRegistry = new JavaInterfaceProcessorRegistryImpl(); - registerLoader(loaderRegistry, new InterfaceJavaLoader(loaderRegistry, processorRegistry)); - registerLoader(loaderRegistry, new PropertyLoader(loaderRegistry)); - registerLoader(loaderRegistry, new ReferenceLoader(loaderRegistry)); - registerLoader(loaderRegistry, new ServiceLoader(loaderRegistry)); - registerLoader(loaderRegistry, new SystemImplementationLoader(loaderRegistry)); - registerLoader(loaderRegistry, new LocalBindingLoader(loaderRegistry)); - return loaderRegistry; - } - - /** - * Create new Introspector for extracting a ComponentType definition from a Java class. - * - * @return a new Introspector - */ - public Introspector createIntrospector(JavaInterfaceProcessorRegistry registry) { - ImplementationProcessorService service = new ImplementationProcessorServiceImpl(registry); - IntrospectionRegistryImpl.Monitor monitor = monitorFactory.getMonitor(IntrospectionRegistryImpl.Monitor.class); - IntrospectionRegistryImpl introspectionRegistry = new IntrospectionRegistryImpl(monitor); - introspectionRegistry.registerProcessor(new ConstructorProcessor(service)); - introspectionRegistry.registerProcessor(new DestroyProcessor()); - introspectionRegistry.registerProcessor(new InitProcessor()); - introspectionRegistry.registerProcessor(new EagerInitProcessor()); - introspectionRegistry.registerProcessor(new ScopeProcessor()); - introspectionRegistry.registerProcessor(new PropertyProcessor(service)); - introspectionRegistry.registerProcessor(new ReferenceProcessor(registry)); - introspectionRegistry.registerProcessor(new ResourceProcessor()); - introspectionRegistry.registerProcessor(new ServiceProcessor(service)); - introspectionRegistry.registerProcessor(new HeuristicPojoProcessor(service)); - introspectionRegistry.registerProcessor(new MonitorProcessor(monitorFactory, service)); - return introspectionRegistry; - } - - /** - * Create a new Connector that can be used to wire primordial components together. - * - * @return a new Connector - */ - public Connector createConnector() { - return new ConnectorImpl(); - } - - /** - * Helper method for registering a loader with the registry. The Loader is registered once for the QName returned by - * its {@link LoaderExtension#getXMLType()} method. - * - * @param registry the LoaderRegistry to register with - * @param loader the Loader to register - */ - protected void registerLoader(LoaderRegistry registry, LoaderExtension loader) { - registry.registerLoader(loader.getXMLType(), loader); - } - - /** - * Create a Builder that can be used to build the components in the system definition. The default implementation - * only supports implementations from the system programming model. - * - * @param scopeRegistry the ScopeRegistry defining the component scopes that will be supported - * @return a new Builder - */ - private Builder createBuilder(ScopeRegistry scopeRegistry) { - BuilderRegistryImpl builderRegistry = - new BuilderRegistryImpl(scopeRegistry, new JDKWireService()); - SystemCompositeBuilder builder = - new SystemCompositeBuilder(builderRegistry, createConnector(), managementService); - builderRegistry.register(SystemCompositeImplementation.class, builder); - builderRegistry.register(SystemImplementation.class, new SystemComponentBuilder()); - builderRegistry.register(LocalBindingDefinition.class, new LocalBindingBuilder()); - return builderRegistry; - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultRuntime.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultRuntime.java deleted file mode 100644 index 978d10fc37..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultRuntime.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.bootstrap; - -import java.util.HashMap; -import java.util.Map; - -import org.w3c.dom.Document; - -import org.apache.tuscany.spi.bootstrap.ComponentNames; -import org.apache.tuscany.spi.bootstrap.RuntimeComponent; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.component.TargetResolutionException; -import org.apache.tuscany.spi.deployer.Deployer; -import org.apache.tuscany.spi.wire.InboundWire; - -import org.apache.tuscany.core.implementation.composite.CompositeComponentImpl; - -/** - * The default implementation of the Tuscany runtime component - * - * @version $Rev$ $Date$ - */ -public class DefaultRuntime extends CompositeComponentImpl implements RuntimeComponent { - private CompositeComponent rootComponent; - private CompositeComponent systemComponent; - - /** - * Initialize a default runtime with an empty set of Property values. - */ - public DefaultRuntime() { - this(new HashMap()); - } - - /** - * Initialize a runtime with the a set of properties - * - * @param runtimeProperties Property values for the runtime itself - */ - public DefaultRuntime(Map runtimeProperties) { - super(ComponentNames.TUSCANY_RUNTIME, null, null, runtimeProperties); - } - - protected void setRootComponent(CompositeComponent rootComponent) { - this.rootComponent = rootComponent; - } - - protected void setSystemComponent(CompositeComponent systemComponent) { - this.systemComponent = systemComponent; - } - - public CompositeComponent getRootComponent() { - return rootComponent; - } - - public CompositeComponent getSystemComponent() { - return systemComponent; - } - - public Deployer getDeployer() throws TargetResolutionException { - InboundWire wire = systemComponent.resolveExternalAutowire(Deployer.class); - if (wire != null) { - return (Deployer) wire.getTargetService(); - } - return null; - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultSCARuntime.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultSCARuntime.java deleted file mode 100644 index 15172c60c0..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/DefaultSCARuntime.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.core.bootstrap; - -import java.net.URI; -import java.net.URL; -import java.util.Arrays; -import java.util.List; - -import org.apache.tuscany.api.SCARuntime; -import org.apache.tuscany.api.TuscanyException; -import org.apache.tuscany.core.component.ComponentContextImpl; -import org.apache.tuscany.core.launcher.CompositeContextImpl; -import org.apache.tuscany.core.runtime.mini.SimpleRuntime; -import org.apache.tuscany.core.runtime.mini.SimpleRuntimeImpl; -import org.apache.tuscany.core.runtime.mini.SimpleRuntimeInfo; -import org.apache.tuscany.core.runtime.mini.SimpleRuntimeInfoImpl; -import org.apache.tuscany.spi.component.Component; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.component.TargetResolutionException; -import org.osoa.sca.ComponentContext; -import org.osoa.sca.CurrentCompositeContext; -import org.osoa.sca.ServiceUnavailableException; - -/** - * Default implementation of SCARuntime. - * - * @version $Rev$ $Date$ - */ -@SuppressWarnings("deprecation") -public class DefaultSCARuntime extends SCARuntime { - protected CompositeComponent application; - protected CompositeContextImpl context; - - protected SimpleRuntime runtime; - - protected void startup(URL system, URL[] exts, URL applicationSCDL, String compositePath) throws Exception { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - List extensions = exts == null ? null : Arrays.asList(exts); - URI contributionURI = URI.create("/default"); - SimpleRuntimeInfo runtimeInfo = - new SimpleRuntimeInfoImpl(cl, system, extensions, contributionURI, applicationSCDL, compositePath); - runtime = new SimpleRuntimeImpl(runtimeInfo); - - try { - application = runtime.start(); - } catch (TuscanyException e) { - throw e; - } - - } - - protected void shutdown() throws Exception { - runtime.destroy(); - } - - @Override - protected ComponentContext getContext(String componentName) { - CompositeComponent composite = ((CompositeContextImpl)context).getComposite(); - Component component = (Component)composite.getChild(componentName); - return new ComponentContextImpl(CurrentCompositeContext.getContext(), component); - } - - public CompositeComponent getCompsiteComponent() { - return application; - } - - @Override - public Object getSystemService(String serviceName) { - try { - return runtime.getSystemService(Object.class, serviceName); - } catch (TargetResolutionException e) { - throw new ServiceUnavailableException(e); - } - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/BuilderRegistryImpl.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/BuilderRegistryImpl.java deleted file mode 100644 index 2bb0524201..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/BuilderRegistryImpl.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.core.builder; - -import java.net.URI; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.core.binding.local.LocalBindingDefinition; -import org.apache.tuscany.core.implementation.composite.ReferenceImpl; -import org.apache.tuscany.core.implementation.composite.ServiceImpl; -import org.apache.tuscany.spi.QualifiedName; -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.builder.BindingBuilder; -import org.apache.tuscany.spi.builder.BuilderException; -import org.apache.tuscany.spi.builder.BuilderRegistry; -import org.apache.tuscany.spi.builder.ComponentBuilder; -import org.apache.tuscany.spi.builder.GenericBuilder; -import org.apache.tuscany.spi.builder.MissingWireTargetException; -import org.apache.tuscany.spi.builder.ScopeNotFoundException; -import org.apache.tuscany.spi.component.AtomicComponent; -import org.apache.tuscany.spi.component.Component; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.component.Reference; -import org.apache.tuscany.spi.component.ReferenceBinding; -import org.apache.tuscany.spi.component.SCAObject; -import org.apache.tuscany.spi.component.ScopeContainer; -import org.apache.tuscany.spi.component.ScopeRegistry; -import org.apache.tuscany.spi.component.Service; -import org.apache.tuscany.spi.component.ServiceBinding; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.model.BindingDefinition; -import org.apache.tuscany.spi.model.ComponentDefinition; -import org.apache.tuscany.spi.model.ComponentType; -import org.apache.tuscany.spi.model.ComponentTypeReferenceDefinition; -import org.apache.tuscany.spi.model.Implementation; -import org.apache.tuscany.spi.model.InteractionScope; -import org.apache.tuscany.spi.model.ModelObject; -import org.apache.tuscany.spi.model.AbstractReferenceDefinition; -import org.apache.tuscany.spi.model.Scope; -import org.apache.tuscany.spi.model.ServiceContract; -import org.apache.tuscany.spi.model.ServiceDefinition; -import org.apache.tuscany.spi.wire.WireService; -import org.osoa.sca.annotations.EagerInit; - -/** - * The default builder registry in the runtime - * - * @version $Rev$ $Date$ - */ -@EagerInit -public class BuilderRegistryImpl implements BuilderRegistry { - protected WireService wireService; - protected ScopeRegistry scopeRegistry; - - private final Map>, ComponentBuilder>> componentBuilders = - new HashMap>, ComponentBuilder>>(); - private final Map, BindingBuilder> bindingBuilders = - new HashMap, BindingBuilder>(); - private final Map, GenericBuilder> genericBuilders = - new HashMap, GenericBuilder>(); - - public BuilderRegistryImpl(@Autowire - ScopeRegistry scopeRegistry, @Autowire - WireService wireService) { - this.scopeRegistry = scopeRegistry; - this.wireService = wireService; - } - - public > void register(Class implClass, ComponentBuilder builder) { - componentBuilders.put(implClass, builder); - } - - public > void unregisterComponentBuilder(Class implClass) { - componentBuilders.remove(implClass); - } - - public void register(Class implClass, BindingBuilder builder) { - bindingBuilders.put(implClass, builder); - } - - @SuppressWarnings("unchecked") - public > Component build(CompositeComponent parent, - ComponentDefinition componentDefinition, - DeploymentContext context) throws BuilderException { - - Class implClass = componentDefinition.getImplementation().getClass(); - // noinspection SuspiciousMethodCalls - ComponentBuilder componentBuilder = (ComponentBuilder)componentBuilders.get(implClass); - try { - if (componentBuilder == null) { - String name = implClass.getName(); - throw new NoRegisteredBuilderException("No builder registered for implementation", name); - } - - Component component = componentBuilder.build(parent, componentDefinition, context); - if (component != null) { - component.setDefaultPropertyValues(componentDefinition.getPropertyValues()); - Scope scope = componentDefinition.getImplementation().getComponentType().getImplementationScope(); - if (scope == Scope.SYSTEM || scope == Scope.COMPOSITE) { - component.setScopeContainer(context.getCompositeScope()); - } else { - // Check for conversational contract if conversational scope - if (scope == Scope.CONVERSATION) { - boolean hasConversationalContract = false; - ComponentType componentType = - componentDefinition.getImplementation().getComponentType(); - Map services = componentType.getServices(); - for (ServiceDefinition serviceDef : services.values()) { - InteractionScope intScope = serviceDef.getServiceContract().getInteractionScope(); - if (intScope == InteractionScope.CONVERSATIONAL) { - hasConversationalContract = true; - break; - } - } - if (!hasConversationalContract) { - Map references = componentType.getReferences(); - for (AbstractReferenceDefinition refDef : references.values()) { - // TODO check for a conversational callback - // contract - // refDef.getServiceContract() ... - } - } - if (!hasConversationalContract) { - String name = implClass.getName(); - throw new NoConversationalContractException("No conversational contract for conversational implementation", - name); - } - } - // Now it's ok to set the scope container - ScopeContainer scopeContainer = scopeRegistry.getScopeContainer(scope); - if (scopeContainer == null) { - throw new ScopeNotFoundException(scope.toString()); - } - component.setScopeContainer(scopeContainer); - } - } - ComponentType componentType = componentDefinition.getImplementation().getComponentType(); - assert componentType != null : "Component type must be set"; - // create wires for the component - if (wireService != null && component instanceof AtomicComponent) { - wireService.createWires((AtomicComponent)component, componentDefinition); - } - // FIXME: Can we merge all the extensions at the component level? - buildExtensions(component, componentType, context); - buildExtensions(component, componentDefinition.getImplementation(), context); - buildExtensions(component, componentDefinition, context); - return component; - } catch (BuilderException e) { - e.addContextName(componentDefinition.getName()); - throw e; - } - } - - @SuppressWarnings({"unchecked"}) - public Service build(CompositeComponent parent, - ServiceDefinition serviceDefinition, - DeploymentContext deploymentContext) throws BuilderException { - String name = serviceDefinition.getName(); - ServiceContract serviceContract = serviceDefinition.getServiceContract(); - if (serviceDefinition.getBindings().isEmpty()) { - // if no bindings are configured, default to the local binding. - // this should be changed to allow runtime selection - if (serviceDefinition.getBindings().isEmpty()) { - // TODO JFM implement capability for the runtime to choose a - // binding - serviceDefinition.addBinding(new LocalBindingDefinition()); - } - } - boolean system = parent.isSystem(); - URI targetUri = serviceDefinition.getTarget(); - Service service = new ServiceImpl(name, parent, serviceContract, targetUri, system); - for (BindingDefinition definition : serviceDefinition.getBindings()) { - Class bindingClass = definition.getClass(); - // noinspection SuspiciousMethodCalls - BindingBuilder bindingBuilder = bindingBuilders.get(bindingClass); - if (bindingBuilder == null) { - throw new NoRegisteredBuilderException("No builder registered for type", bindingClass.getName()); - } - ServiceBinding binding = bindingBuilder.build(parent, serviceDefinition, definition, deploymentContext); - if (wireService != null) { - URI uri = serviceDefinition.getTarget(); - if (uri == null) { - throw new MissingWireTargetException("Service uri not specified"); - } - String path = uri.getPath(); - ServiceContract contract = serviceDefinition.getServiceContract(); - wireService.createWires(binding, contract, path); - } - buildExtensions(binding, definition, deploymentContext); - service.addServiceBinding(binding); - } - buildExtensions(service, serviceDefinition, deploymentContext); - return service; - } - - @SuppressWarnings("unchecked") - public Reference build(CompositeComponent parent, - AbstractReferenceDefinition referenceDefinition, - DeploymentContext context) - throws BuilderException { - String name = referenceDefinition.getName(); - ServiceContract contract = referenceDefinition.getServiceContract(); - if (referenceDefinition.getBindings().isEmpty()) { - // if no bindings are configured, default to the local binding. - // this should be changed to allow runtime selection - if (referenceDefinition.getBindings().isEmpty()) { - // TODO JFM implement capability for the runtime to choose a - // binding - referenceDefinition.addBinding(new LocalBindingDefinition()); - } - } - - Reference reference = new ReferenceImpl(name, parent, contract); - for (BindingDefinition bindingDefinition : referenceDefinition.getBindings()) { - Class bindingClass = bindingDefinition.getClass(); - // noinspection SuspiciousMethodCalls - BindingBuilder bindingBuilder = bindingBuilders.get(bindingClass); - ReferenceBinding binding = bindingBuilder.build(parent, referenceDefinition, bindingDefinition, context); - // create wires for the component - if (wireService != null) { - URI targetUri = bindingDefinition.getTargetUri(); - // it is possible for a binding to not have a URI - QualifiedName targetName = null; - if (targetUri != null) { - targetName = new QualifiedName(targetUri.getPath()); - } - wireService.createWires(binding, contract, targetName); - - } - buildExtensions(binding, bindingDefinition, context); - reference.addReferenceBinding(binding); - - } - buildExtensions(reference, referenceDefinition, context); - return reference; - } - - @SuppressWarnings("unchecked") - public SCAObject build(SCAObject parent, ModelObject modelObject, DeploymentContext context) - throws BuilderException { - if (modelObject != null) { - GenericBuilder builder = genericBuilders.get(modelObject.getClass()); - if (builder != null) { - return builder.build(parent, modelObject, context); - } - } - return null; - } - - // We need to include all the extensions from the include - private void buildExtensions(SCAObject parent, ModelObject model, DeploymentContext deploymentContext) - throws BuilderException { - for (Object o : model.getExtensions().values()) { - if (o instanceof ModelObject) { - SCAObject scaObject = build(parent, (ModelObject)o, deploymentContext); - if (scaObject != null) { - parent.getExtensions().put(scaObject.getName(), scaObject); - } - } - } - } - - public void register(Class modelClass, - GenericBuilder builder) { - genericBuilders.put(modelClass, builder); - } - - public void unregisterBindingBuilder(Class implClass) { - bindingBuilders.remove(implClass); - } - - public void unregisterGenericBuilder(Class modelClass) { - genericBuilders.remove(modelClass); - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java deleted file mode 100644 index 728b0b8fc9..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java +++ /dev/null @@ -1,627 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tuscany.core.builder; - -import java.util.List; -import java.util.Map; - -import org.osoa.sca.annotations.Constructor; - -import org.apache.tuscany.spi.QualifiedName; -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.builder.Connector; -import org.apache.tuscany.spi.builder.MissingWireTargetException; -import org.apache.tuscany.spi.builder.WiringException; -import org.apache.tuscany.spi.component.Component; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.component.Reference; -import org.apache.tuscany.spi.component.ReferenceBinding; -import org.apache.tuscany.spi.component.SCAObject; -import org.apache.tuscany.spi.component.Service; -import org.apache.tuscany.spi.component.ServiceBinding; -import org.apache.tuscany.spi.component.TargetInvokerCreationException; -import org.apache.tuscany.spi.component.TargetResolutionException; -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.idl.java.JavaServiceContract; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.model.Scope; -import org.apache.tuscany.spi.model.ServiceContract; -import org.apache.tuscany.spi.services.work.WorkScheduler; -import org.apache.tuscany.spi.wire.InboundInvocationChain; -import org.apache.tuscany.spi.wire.InboundWire; -import org.apache.tuscany.spi.wire.IncompatibleServiceContractException; -import org.apache.tuscany.spi.wire.Interceptor; -import org.apache.tuscany.spi.wire.OutboundInvocationChain; -import org.apache.tuscany.spi.wire.OutboundWire; -import org.apache.tuscany.spi.wire.TargetInvoker; -import org.apache.tuscany.spi.wire.WirePostProcessorRegistry; -import org.apache.tuscany.spi.wire.WireService; - -import org.apache.tuscany.core.wire.LoopBackWire; -import org.apache.tuscany.core.wire.NonBlockingBridgingInterceptor; -import org.apache.tuscany.core.wire.SynchronousBridgingInterceptor; -import org.apache.tuscany.core.wire.WireUtils; - -/** - * The default connector implmentation - * - * @version $$Rev$$ $$Date$$ - */ -public class ConnectorImpl implements Connector { - private WirePostProcessorRegistry postProcessorRegistry; - private WireService wireService; - private WorkContext workContext; - private WorkScheduler scheduler; - - public ConnectorImpl() { - } - - @Constructor - public ConnectorImpl(@Autowire WireService wireService, - @Autowire WirePostProcessorRegistry processorRegistry, - @Autowire WorkScheduler scheduler, - @Autowire WorkContext workContext) { - this.postProcessorRegistry = processorRegistry; - this.wireService = wireService; - this.scheduler = scheduler; - this.workContext = workContext; - } - - public void connect(SCAObject source) throws WiringException { - if (source instanceof Component) { - handleComponent((Component) source); - } else if (source instanceof Reference) { - handleReference((Reference) source); - } else if (source instanceof Service) { - handleService((Service) source); - } else { - throw new AssertionError("Invalid source type"); - } - } - - public void connect(InboundWire sourceWire, OutboundWire targetWire, boolean optimizable) - throws WiringException { - Map, OutboundInvocationChain> targetChains = targetWire.getInvocationChains(); - if (sourceWire.getContainer() != null && sourceWire.getContainer().isSystem()) { - sourceWire.setTargetWire(targetWire); - // system services do not need to have their chains processed, return - return; - } - for (InboundInvocationChain inboundChain : sourceWire.getInvocationChains().values()) { - // match invocation chains - OutboundInvocationChain outboundChain = targetChains.get(inboundChain.getOperation()); - if (outboundChain == null) { - throw new IncompatibleInterfacesException(sourceWire, targetWire); - } - connect(inboundChain, outboundChain); - } - if (postProcessorRegistry != null) { - // run wire post-processors - postProcessorRegistry.process(sourceWire, targetWire); - } - if (optimizable && WireUtils.isOptimizable(sourceWire) && WireUtils.isOptimizable(targetWire)) { - sourceWire.setOptimizable(true); - sourceWire.setTargetWire(targetWire); - } - } - - /** - * Connects the source outbound wire to a corresponding target inbound wire - * - * @param sourceWire the source wire to connect - * @param targetWire the target wire to connect to - * @param optimizable true if the wire connection can be optimized - * @throws WiringException - */ - public void connect(OutboundWire sourceWire, InboundWire targetWire, boolean optimizable) - throws WiringException { - SCAObject source = sourceWire.getContainer(); - assert source != null; - SCAObject target = targetWire.getContainer(); - assert target != null; - Map, InboundInvocationChain> targetChains = targetWire.getInvocationChains(); - if (sourceWire.getContainer() != null && sourceWire.getContainer().isSystem()) { - sourceWire.setTargetWire(targetWire); - // system services do not need to have their chains processed, return - return; - } - - // FIXME: [rfeng] The targetWire is provided by the system - if (targetWire.getContainer() != null && targetWire.getContainer().isSystem()) { - sourceWire.setOptimizable(true); - sourceWire.setTargetWire(targetWire); - // system services do not need to have their chains processed, return - return; - } - - // match outbound to inbound chains - for (OutboundInvocationChain outboundChain : sourceWire.getInvocationChains().values()) { - Operation operation = outboundChain.getOperation(); - - // TODO: TUSCANY-1111, can't use targetChains.get with different IDLs so use simple name matching - // InboundInvocationChain inboundChain = targetChains.get(operation); - InboundInvocationChain inboundChain = null; // = targetChains.get(operation); - for (InboundInvocationChain ic: targetChains.values()) { - if (ic.getOperation().equals(operation)) { - inboundChain = ic; - break; - } - } - if (inboundChain == null) { - throw new IncompatibleInterfacesException(sourceWire, targetWire); - } - Operation inboundOperation = inboundChain.getOperation(); - boolean isOneWayOperation = operation.isNonBlocking(); - TargetInvoker invoker; - if (target instanceof Component) { - Component component = (Component) target; - QualifiedName wireTargetName = sourceWire.getTargetName(); - String portName = null; - if (wireTargetName != null) { - portName = wireTargetName.getPortName(); - } - try { - invoker = component.createTargetInvoker(portName, inboundOperation, targetWire); - } catch (TargetInvokerCreationException e) { - throw new WireConnectException("Error connecting source and target", sourceWire, targetWire, e); - } - } else if (target instanceof ReferenceBinding) { - ReferenceBinding referenceBinding = (ReferenceBinding) target; - try { - invoker = referenceBinding.createTargetInvoker(targetWire.getServiceContract(), inboundOperation); - } catch (TargetInvokerCreationException e) { - String targetName = targetWire.getContainer().getName(); - throw new WireConnectException("Error processing inbound wire", null, null, targetName, null, e); - } - } else if (target instanceof ServiceBinding) { - ServiceBinding binding = (ServiceBinding) target; - try { - invoker = binding.createTargetInvoker(targetWire.getServiceContract(), inboundChain.getOperation()); - } catch (TargetInvokerCreationException e) { - String targetName = targetWire.getContainer().getName(); - throw new WireConnectException("Error processing inbound wire", null, null, targetName, null, e); - } - } else { - throw new AssertionError(); - } - - if (source instanceof ServiceBinding) { - // services are a special case: invoker must go on the inbound and outbound chains - if (target instanceof Component && isOneWayOperation) { - // if the target is a component and the operation is non-blocking - connect(outboundChain, inboundChain, invoker, true); - } else { - connect(outboundChain, inboundChain, invoker, false); - } - ServiceBinding binding = (ServiceBinding) source; - InboundInvocationChain chain = binding.getInboundWire().getInvocationChains().get(operation); - chain.setTargetInvoker(invoker); - } else { - if (target instanceof Component && isOneWayOperation) { - // if the target is a component and the operation is non-blocking - connect(outboundChain, inboundChain, invoker, true); - } else { - connect(outboundChain, inboundChain, invoker, false); - } - } - } - - // create source callback chains and connect them if target callback chains exist - Map, OutboundInvocationChain> sourceCallbackChains = - targetWire.getSourceCallbackInvocationChains(source.getName()); - for (InboundInvocationChain inboundChain : sourceWire.getTargetCallbackInvocationChains().values()) { - Operation operation = inboundChain.getOperation(); - if (sourceCallbackChains != null && sourceCallbackChains.get(operation) != null) { - String opName = operation.getName(); - throw new IllegalCallbackException("Source callback chain should not exist for operation", - opName, - sourceWire, - targetWire); - } - - ServiceContract targetContract = targetWire.getServiceContract(); - assert targetContract != null; - String opName = operation.getName(); - assert opName != null; - Operation targetOp = targetContract.getCallbackOperations().get(opName); - OutboundInvocationChain outboundChain = wireService.createOutboundChain(targetOp); - targetWire.addSourceCallbackInvocationChain(source.getName(), targetOp, outboundChain); - if (source instanceof Component) { - Component component = (Component) source; - TargetInvoker invoker; - try { - invoker = component.createTargetInvoker(targetOp.getName(), operation, null); - } catch (TargetInvokerCreationException e) { - throw new WireConnectException("Error connecting source and target", sourceWire, targetWire, e); - } - boolean isOneWayOperation = targetOp.isNonBlocking(); - if (target instanceof Component && isOneWayOperation) { - // if the target is a component and the operation is non-blocking - connect(outboundChain, inboundChain, invoker, true); - } else { - connect(outboundChain, inboundChain, invoker, false); - } - } else if (source instanceof ReferenceBinding) { - ReferenceBinding binding = (ReferenceBinding) source; - ServiceContract sourceContract = sourceWire.getServiceContract(); - TargetInvoker invoker; - try { - invoker = binding.createTargetInvoker(sourceContract, operation); - } catch (TargetInvokerCreationException e) { - throw new WireConnectException("Error connecting source and target", sourceWire, targetWire, e); - } - connect(outboundChain, inboundChain, invoker, false); - } else if (source instanceof ServiceBinding) { - ServiceBinding binding = (ServiceBinding) source; - ServiceContract sourceContract = sourceWire.getServiceContract(); - TargetInvoker invoker; - try { - invoker = binding.createTargetInvoker(sourceContract, operation); - } catch (TargetInvokerCreationException e) { - String targetName = sourceWire.getContainer().getName(); - throw new WireConnectException("Error processing callback wire", null, null, targetName, null, e); - } - connect(outboundChain, inboundChain, invoker, false); - } else { - throw new AssertionError(); - } - } - if (postProcessorRegistry != null) { - // run wire post-processors - postProcessorRegistry.process(sourceWire, targetWire); - } - // perform optimization, if possible - if (optimizable && WireUtils.isOptimizable(sourceWire) && WireUtils.isOptimizable(targetWire)) { - sourceWire.setOptimizable(true); - sourceWire.setTargetWire(targetWire); - } - } - - /** - * Connects a source to target chain - * - * @param sourceChain the source chain - * @param targetChain the target chain - * @param invoker the invoker to place on the source chain for dispatching invocations - * @param nonBlocking true if the operation is non-blocking - */ - protected void connect(OutboundInvocationChain sourceChain, - InboundInvocationChain targetChain, - TargetInvoker invoker, - boolean nonBlocking) throws WireConnectException { - Interceptor head = targetChain.getHeadInterceptor(); - if (head == null) { - throw new WireConnectException("Inbound chain must contain at least one interceptor"); - } - if (nonBlocking) { - sourceChain.setTargetInterceptor(new NonBlockingBridgingInterceptor(scheduler, workContext, head)); - } else { - sourceChain.setTargetInterceptor(new SynchronousBridgingInterceptor(head)); - } - sourceChain.prepare(); - sourceChain.setTargetInvoker(invoker); - } - - - /** - * Connects an inbound source chain to an outbound target chain - * - * @param sourceChain the source chain to connect - * @param targetChain the target chain to connect - */ - protected void connect(InboundInvocationChain sourceChain, OutboundInvocationChain targetChain) - throws WireConnectException { - Interceptor head = targetChain.getHeadInterceptor(); - if (head == null) { - throw new WireConnectException("Outbound chain must contain at least one interceptor"); - } - // invocations from inbound to outbound chains are always synchronous as they occur in services and references - sourceChain.addInterceptor(new SynchronousBridgingInterceptor(head)); - } - - /** - * Connects an outbound wire to its target in a composite. - * - * @param sourceWire the source wire to connect - * @throws WiringException - */ - protected void connect(SCAObject source, OutboundWire sourceWire, SCAObject target) throws WiringException { - assert sourceWire.getTargetName() != null; - QualifiedName targetName = sourceWire.getTargetName(); - if (target instanceof Component) { - connect(source, sourceWire, (Component) target); - } else if (target instanceof Reference) { - connect(source, sourceWire, (Reference) target); - } else if (target instanceof Service) { - connect(source, sourceWire, (Service) target); - } else if (target == null) { - String sourceName = sourceWire.getContainer().getName(); - String sourceReference = sourceWire.getReferenceName(); - throw new TargetServiceNotFoundException("Target service not found", - sourceName, - sourceReference, - targetName.getPartName(), - targetName.getPortName()); - } else { - String sourceName = sourceWire.getContainer().getName(); - String sourceRef = sourceWire.getReferenceName(); - String partName = targetName.getPartName(); - String portName = targetName.getPortName(); - throw new InvalidTargetTypeException("Invalid target type", sourceName, sourceRef, partName, portName); - } - } - - protected void connect(SCAObject source, OutboundWire sourceWire, Reference target) throws WiringException { - assert sourceWire.getTargetName() != null; - QualifiedName targetName = sourceWire.getTargetName(); - InboundWire targetWire = null; - for (ReferenceBinding binding : target.getReferenceBindings()) { - InboundWire candidate = binding.getInboundWire(); - if (sourceWire.getBindingType().equals(candidate.getBindingType())) { - targetWire = candidate; - break; - } - } - if (targetWire == null) { - if (target.getReferenceBindings().size() > 0 && source instanceof Component) { - // TODO create a pluggable algorithm for selecting the binding type - targetWire = target.getReferenceBindings().get(0).getInboundWire(); - } - if (targetWire == null) { - throw new NoCompatibleBindingsException(source.getName(), - targetName.getPartName(), - targetName.getPortName()); - } - } - checkIfWireable(sourceWire, targetWire); - boolean optimizable = isOptimizable(source.getScope(), target.getScope()); - connect(sourceWire, targetWire, optimizable); - } - - protected void connect(SCAObject source, OutboundWire sourceWire, Service target) throws WiringException { - assert sourceWire.getTargetName() != null; - QualifiedName targetName = sourceWire.getTargetName(); - InboundWire targetWire = null; - for (ServiceBinding binding : target.getServiceBindings()) { - InboundWire candidate = binding.getInboundWire(); - if (sourceWire.getBindingType().equals(candidate.getBindingType())) { - targetWire = candidate; - break; - } - } - if (targetWire == null) { - throw new NoCompatibleBindingsException(source.getName(), - targetName.getPartName(), - targetName.getPortName()); - } - checkIfWireable(sourceWire, targetWire); - boolean optimizable = isOptimizable(source.getScope(), target.getScope()); - connect(sourceWire, targetWire, optimizable); - } - - protected void connect(SCAObject source, OutboundWire sourceWire, Component target) - throws WiringException { - assert sourceWire.getTargetName() != null; - QualifiedName targetName = sourceWire.getTargetName(); - InboundWire targetWire; - // FIXME JFM should we move getInboundSystemWire up to Component? - if (target instanceof CompositeComponent && source.isSystem()) { - targetWire = ((CompositeComponent) target).getInboundSystemWire(targetName.getPortName()); - } else { - targetWire = target.getInboundWire(targetName.getPortName()); - } - if (targetWire == null) { - String sourceName = sourceWire.getContainer().getName(); - String sourceReference = sourceWire.getReferenceName(); - throw new TargetServiceNotFoundException("Target service does not exist or is not configured with a " - + "local binding", - sourceName, - sourceReference, - targetName.getPartName(), - targetName.getPortName()); - } - checkIfWireable(sourceWire, targetWire); - boolean optimizable = isOptimizable(source.getScope(), target.getScope()); - connect(sourceWire, targetWire, optimizable); - } - - protected void autowire(OutboundWire outboundWire, CompositeComponent parent) - throws WiringException { - // JFM FIXME test coverage for this method - InboundWire targetWire; - try { - Class interfaze = outboundWire.getServiceContract().getInterfaceClass(); - if (CompositeComponent.class.equals(interfaze)) { - JavaServiceContract contract = new JavaServiceContract(CompositeComponent.class); - targetWire = new LoopBackWire(); - targetWire.setServiceContract(contract); - targetWire.setContainer(parent); - outboundWire.setTargetWire(targetWire); - return; - } - if (outboundWire.getContainer().isSystem()) { - targetWire = parent.resolveSystemAutowire(interfaze); - } else { - targetWire = parent.resolveAutowire(interfaze); - } - } catch (TargetResolutionException e) { - String sourceReference = outboundWire.getReferenceName(); - String sourceName = outboundWire.getContainer().getName(); - throw new WireConnectException("Error resolving autowire target", - sourceName, - sourceReference, - null, - null, - e); - } - if (targetWire == null) { - // autowire may return null if it is optional. The client must decide if an error should be thrown - return; - } - Scope sourceScope = outboundWire.getContainer().getScope(); - Scope targetScope = targetWire.getContainer().getScope(); - boolean optimizable = isOptimizable(sourceScope, targetScope); - connect(outboundWire, targetWire, optimizable); - } - - protected void checkIfWireable(OutboundWire sourceWire, InboundWire targetWire) - throws IncompatibleInterfacesException { - if (wireService == null) { - Class sourceInterface = sourceWire.getServiceContract().getInterfaceClass(); - Class targetInterface = targetWire.getServiceContract().getInterfaceClass(); - if (!sourceInterface.isAssignableFrom(targetInterface)) { - throw new IncompatibleInterfacesException(sourceWire, targetWire); - } - } else { - try { - ServiceContract sourceContract = sourceWire.getServiceContract(); - ServiceContract targetContract = targetWire.getServiceContract(); - wireService.checkCompatibility(sourceContract, targetContract, false); - } catch (IncompatibleServiceContractException e) { - throw new IncompatibleInterfacesException(sourceWire, targetWire, e); - } - } - } - - protected boolean isOptimizable(Scope pReferrer, Scope pReferee) { - if (pReferrer == Scope.UNDEFINED - || pReferee == Scope.UNDEFINED - || pReferrer == Scope.CONVERSATION - || pReferee == Scope.CONVERSATION) { - return false; - } - if (pReferee == pReferrer) { - return true; - } else if (pReferrer == Scope.STATELESS) { - return true; - } else if (pReferee == Scope.STATELESS) { - return false; - } else if (pReferrer == Scope.REQUEST && pReferee == Scope.SESSION) { - return true; - } else if (pReferrer == Scope.REQUEST && pReferee == Scope.COMPOSITE) { - return true; - } else if (pReferrer == Scope.REQUEST && pReferee == Scope.SYSTEM) { - return true; - } else if (pReferrer == Scope.SESSION && pReferee == Scope.COMPOSITE) { - return true; - } else if (pReferrer == Scope.SESSION && pReferee == Scope.SYSTEM) { - return true; - } else //noinspection SimplifiableIfStatement - if (pReferrer == Scope.SYSTEM && pReferee == Scope.COMPOSITE) { - // case where a service context points to a composite scoped component - return true; - } else { - return pReferrer == Scope.COMPOSITE && pReferee == Scope.SYSTEM; - } - } - - /** - * Connects wires from a service to a target - * - * @param service the service - * @throws WiringException if an exception connecting the service wires is encountered - */ - private void handleService(Service service) throws WiringException { - CompositeComponent parent = service.getParent(); - assert parent != null; - for (ServiceBinding binding : service.getServiceBindings()) { - InboundWire inboundWire = binding.getInboundWire(); - OutboundWire outboundWire = binding.getOutboundWire(); - // For a composite reference only, since its outbound wire comes from its parent composite, - // the corresponding target would not lie in its parent but rather in its parent's parent - SCAObject target; - if (service.isSystem()) { - target = parent.getSystemChild(outboundWire.getTargetName().getPartName()); - } else { - target = parent.getChild(outboundWire.getTargetName().getPartName()); - } - // connect the outbound service wire to the target - connect(binding, outboundWire, target); - // NB: this connect must be done after the outbound service chain is connected to its target above - connect(inboundWire, outboundWire, true); - } - } - - private void handleReference(Reference reference) throws WiringException { - CompositeComponent parent = reference.getParent(); - assert parent != null; - for (ReferenceBinding binding : reference.getReferenceBindings()) { - InboundWire inboundWire = binding.getInboundWire(); - Map, InboundInvocationChain> inboundChains = inboundWire.getInvocationChains(); - for (InboundInvocationChain chain : inboundChains.values()) { - // add target invoker on inbound side - ServiceContract contract = inboundWire.getServiceContract(); - Operation operation = chain.getOperation(); - TargetInvoker invoker; - try { - invoker = binding.createTargetInvoker(contract, operation); - } catch (TargetInvokerCreationException e) { - String targetName = inboundWire.getContainer().getName(); - throw new WireConnectException("Error processing inbound wire", - null, - null, - targetName, - null, - e); - } - chain.setTargetInvoker(invoker); - chain.prepare(); - } - OutboundWire outboundWire = binding.getOutboundWire(); - // connect the reference's inbound and outbound wires - connect(inboundWire, outboundWire, true); - } - } - - private void handleComponent(Component component) throws WiringException { - CompositeComponent parent = component.getParent(); - assert parent != null; - // connect outbound wires for component references to their targets - for (List referenceWires : component.getOutboundWires().values()) { - for (OutboundWire outboundWire : referenceWires) { - try { - if (component.isSystem()) { - if (outboundWire.isAutowire()) { - autowire(outboundWire, parent); - - } else { - SCAObject target = parent.getSystemChild(outboundWire.getTargetName().getPartName()); - connect(component, outboundWire, target); - } - } else { - if (outboundWire.isAutowire()) { - autowire(outboundWire, parent); - } else { - if (outboundWire.getTargetName() == null) { - String referenceName = outboundWire.getReferenceName(); - throw new MissingWireTargetException("Target name was null", referenceName); - } - SCAObject target = parent.getChild(outboundWire.getTargetName().getPartName()); - connect(component, outboundWire, target); - } - } - } catch (WiringException e) { - e.addContextName(component.getName()); - e.addContextName(parent.getName()); - throw e; - } - } - } - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/IllegalCallbackException.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/IllegalCallbackException.java deleted file mode 100644 index 5ca843e198..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/IllegalCallbackException.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.core.builder; - -import org.apache.tuscany.spi.builder.WiringException; -import org.apache.tuscany.spi.wire.InboundWire; -import org.apache.tuscany.spi.wire.OutboundWire; - -/** - * Denotes an illegal callback - * - * @version $Rev$ $Date$ - */ -public class IllegalCallbackException extends WiringException { - - public IllegalCallbackException(String message, - String identifier, - String sourceName, - String referenceName, - String targetName, - String serviceName) { - super(message, identifier); - setSourceName(sourceName); - setReferenceName(referenceName); - setTargetName(targetName); - setTargetServiceName(serviceName); - } - - - public IllegalCallbackException(String message, String identifier, OutboundWire source, InboundWire target) { - super(message, identifier); - setSourceName(source.getContainer().getName()); - setReferenceName(source.getReferenceName()); - setTargetName(target.getContainer().getName()); - setTargetServiceName(target.getServiceName()); - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/IncompatibleInterfacesException.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/IncompatibleInterfacesException.java deleted file mode 100644 index 4b94983c34..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/IncompatibleInterfacesException.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.core.builder; - -import org.apache.tuscany.spi.builder.WiringException; -import org.apache.tuscany.spi.wire.InboundWire; -import org.apache.tuscany.spi.wire.OutboundWire; - -/** - * Denotes an attempt to wire incompatible interfaces - * - * @version $Rev$ $Date$ - */ -public class IncompatibleInterfacesException extends WiringException { - - - public IncompatibleInterfacesException(String message, - String sourceName, - String referenceName, - String targetName, - String targetServiceName) { - super(message); - setSourceName(sourceName); - setReferenceName(referenceName); - setTargetName(targetName); - setTargetServiceName(targetServiceName); - } - - public IncompatibleInterfacesException(String message, String sourceName, - String referenceName, - String targetName, - String serviceName, - Throwable cause) { - super(message, cause); - setSourceName(sourceName); - setReferenceName(referenceName); - setTargetName(targetName); - setTargetServiceName(serviceName); - } - - public IncompatibleInterfacesException(InboundWire source, OutboundWire target) { - super("Incompatible source and target interfaces"); - setTargetServiceName(source.getServiceName()); - if (source.getContainer() != null) { - setSourceName(source.getContainer().getName()); - } - setReferenceName(target.getReferenceName()); - if (target.getContainer() != null) { - setTargetName(target.getContainer().getName()); - } - } - - public IncompatibleInterfacesException(OutboundWire source, InboundWire target) { - super("Incompatible source and target interfaces"); - setTargetServiceName(target.getServiceName()); - if (source.getContainer() != null) { - setSourceName(source.getContainer().getName()); - } - setReferenceName(source.getReferenceName()); - if (target.getContainer() != null) { - setTargetName(target.getContainer().getName()); - } - } - - public IncompatibleInterfacesException(OutboundWire source, InboundWire target, Throwable throwable) { - super("Incompatible source and target interfaces", throwable); - setTargetServiceName(target.getServiceName()); - if (source.getContainer() != null) { - setSourceName(source.getContainer().getName()); - } - setReferenceName(source.getReferenceName()); - if (target.getContainer() != null) { - setTargetName(target.getContainer().getName()); - } - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/InvalidTargetTypeException.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/InvalidTargetTypeException.java deleted file mode 100644 index e96fb764a0..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/InvalidTargetTypeException.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.core.builder; - -import org.apache.tuscany.spi.builder.WiringException; - -/** - * Denotes an invalid target service for a wire - * - * @version $Rev$ $Date$ - */ -public class InvalidTargetTypeException extends WiringException { - - public InvalidTargetTypeException(String message, - String sourceName, - String referenceName, - String targetName, - String serviceName) { - super(message); - setSourceName(sourceName); - setReferenceName(referenceName); - setTargetName(targetName); - setTargetServiceName(serviceName); - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/NoCompatibleBindingsException.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/NoCompatibleBindingsException.java deleted file mode 100644 index 620fbf6694..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/NoCompatibleBindingsException.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.core.builder; - -import org.apache.tuscany.spi.builder.WiringException; - -/** - * @version $Rev$ $Date$ - */ -public class NoCompatibleBindingsException extends WiringException { - public NoCompatibleBindingsException(String sourceName, - String targetName, - String serviceName) { - super("No compatible bindings for source and target"); - setSourceName(sourceName); - setTargetName(targetName); - setTargetServiceName(serviceName); - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/NoConversationalContractException.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/NoConversationalContractException.java deleted file mode 100644 index 71eb9ebd26..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/NoConversationalContractException.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.core.builder; - -import org.apache.tuscany.spi.builder.BuilderException; - -/** - * Raised when a component has conversational scope but no conversational contract - * - * @version $Rev: 487877 $ $Date: 2006-12-16 15:32:16 -0500 (Sat, 16 Dec 2006) $ - */ -public class NoConversationalContractException extends BuilderException { - - public NoConversationalContractException(String message, String identifier) { - super(message, identifier); - } - - public NoConversationalContractException(String message) { - super(message); - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/NoRegisteredBuilderException.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/NoRegisteredBuilderException.java deleted file mode 100644 index 340a20f239..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/NoRegisteredBuilderException.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.core.builder; - -import org.apache.tuscany.spi.builder.BuilderException; - -/** - * Raised when a builder cannot be found for a SCDL entry type - * - * @version $Rev$ $Date$ - */ -public class NoRegisteredBuilderException extends BuilderException { - - public NoRegisteredBuilderException(String message, String identifier) { - super(message, identifier); - } - - public NoRegisteredBuilderException(String message) { - super(message); - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/TargetServiceNotFoundException.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/TargetServiceNotFoundException.java deleted file mode 100644 index 873bf619b0..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/TargetServiceNotFoundException.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.core.builder; - -import org.apache.tuscany.spi.builder.WiringException; - -/** - * Indicates the target service of a reference was not found - * - * @version $Rev$ $Date$ - */ -public class TargetServiceNotFoundException extends WiringException { - - public TargetServiceNotFoundException(String message, - String sourceName, - String referenceName, - String targetName, - String serviceName) { - super(message); - setSourceName(sourceName); - setReferenceName(referenceName); - setTargetName(targetName); - setTargetServiceName(serviceName); - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/WireConnectException.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/WireConnectException.java deleted file mode 100644 index 89105d27b4..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/WireConnectException.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.core.builder; - -import org.apache.tuscany.spi.builder.WiringException; -import org.apache.tuscany.spi.wire.InboundWire; -import org.apache.tuscany.spi.wire.OutboundWire; - -/** - * Denotes a general error connecting two wires - * - * @version $Rev$ $Date$ - */ -public class WireConnectException extends WiringException { - - public WireConnectException(String message) { - super(message); - } - - public WireConnectException(String message, - String sourceName, - String referenceName, - String targetName, - String serviceName, - Throwable throwable) { - super(message, throwable); - setSourceName(sourceName); - setReferenceName(referenceName); - setTargetName(targetName); - setTargetServiceName(serviceName); - } - - - public WireConnectException(String message, OutboundWire source, InboundWire target, Throwable throwable) { - super(message, throwable); - setSourceName(source.getContainer().getName()); - setReferenceName(source.getReferenceName()); - setTargetName(target.getContainer().getName()); - setTargetServiceName(target.getServiceName()); - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/WirePostProcessorRegistryImpl.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/WirePostProcessorRegistryImpl.java deleted file mode 100644 index 3bc617066a..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/WirePostProcessorRegistryImpl.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.core.builder; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.spi.wire.WirePostProcessor; -import org.apache.tuscany.spi.wire.WirePostProcessorRegistry; -import org.apache.tuscany.spi.wire.InboundWire; -import org.apache.tuscany.spi.wire.OutboundWire; - -/** - * The default implementation of a WirePostProcessor - * - * @version $Rev$ $Date$ - */ -public class WirePostProcessorRegistryImpl implements WirePostProcessorRegistry { - - private final List processors = new ArrayList(); - - public void process(OutboundWire source, InboundWire target) { - for (WirePostProcessor processor : processors) { - processor.process(source, target); - } - } - - public void process(InboundWire source, OutboundWire target) { - for (WirePostProcessor processor : processors) { - processor.process(source, target); - } - } - - public void register(WirePostProcessor processor) { - processors.add(processor); - } - - public void unregister(WirePostProcessor processor) { - processors.remove(processor); - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/WiringExceptionFormatter.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/WiringExceptionFormatter.java deleted file mode 100644 index 16cf27048a..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/WiringExceptionFormatter.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.core.builder; - -import java.io.PrintWriter; - -import org.osoa.sca.annotations.Destroy; -import org.osoa.sca.annotations.EagerInit; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.builder.WiringException; - -import org.apache.tuscany.host.monitor.ExceptionFormatter; -import org.apache.tuscany.host.monitor.FormatterRegistry; - -/** - * Formats {@link WiringException}s - * - * @version $Rev$ $Date$ - */ -@EagerInit -public class WiringExceptionFormatter implements ExceptionFormatter { - private FormatterRegistry factory; - - public WiringExceptionFormatter(@Autowire FormatterRegistry factory) { - this.factory = factory; - factory.register(this); - } - - public boolean canFormat(Class type) { - return WiringException.class.isAssignableFrom(type); - } - - @Destroy - public void destroy() { - factory.unregister(this); - } - - public PrintWriter write(PrintWriter writer, Throwable exception) { - assert exception instanceof WiringException; - WiringException e = (WiringException) exception; - e.appendBaseMessage(writer); - if (e.getSourceName() != null && e.getReferenceName() != null) { - writer.write("\nSource : " + e.getSourceName() + "/" + e.getReferenceName()); - } else if (e.getSourceName() != null) { - writer.write("\nSource : " + e.getSourceName()); - } - if (e.getTargetName() != null && e.getTargetServiceName() != null) { - writer.write("\nTarget : " + e.getTargetName() + "/" + e.getTargetServiceName()); - } else if (e.getTargetName() != null) { - writer.write("\nTarget : " + e.getTargetName()); - } - e.appendContextStack(writer).append("\n"); - return writer; - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/ComponentContextImpl.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/ComponentContextImpl.java deleted file mode 100644 index 6cc06d7646..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/ComponentContextImpl.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.core.component; - -import java.net.URI; - -import org.osoa.sca.CallableReference; -import org.osoa.sca.ComponentContext; -import org.osoa.sca.CompositeContext; -import org.osoa.sca.RequestContext; -import org.osoa.sca.ServiceReference; -import org.osoa.sca.ServiceRuntimeException; - -import org.apache.tuscany.api.TuscanyRuntimeException; -import org.apache.tuscany.spi.component.Component; - -/** - * - * @version $Rev$ $Date$ - */ -public class ComponentContextImpl implements ComponentContext { - private final CompositeContext context; - private final Component component; - - public ComponentContextImpl(CompositeContext context, Component component) { - this.component = component; - this.context = context; - } - - public String getURI() { - try { - return component.getName(); - } catch (TuscanyRuntimeException e) { - throw new ServiceRuntimeException(e.getMessage(), e); - } - } - - public > R cast(B target) throws IllegalArgumentException { - throw new UnsupportedOperationException(); - } - - public B getService(Class businessInterface, String referenceName) { - try { - return context.locateService(businessInterface, component.getName() + "/" + referenceName); - } catch (TuscanyRuntimeException e) { - throw new ServiceRuntimeException(e.getMessage(), e); - } - } - - public ServiceReference getServiceReference(Class businessInterface, String referenceName) { - throw new UnsupportedOperationException(); - } - - public B getProperty(Class type, String propertyName) { - throw new UnsupportedOperationException(); - } - - public ServiceReference createSelfReference(Class businessInterface) { - return null; - } - - public ServiceReference createSelfReference(Class businessInterface, String serviceName) { - return null; - } - - public RequestContext getRequestContext() { - return context.getRequestContext(); - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/ScopeIdentifier.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/ScopeIdentifier.java deleted file mode 100644 index 35125b85ef..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/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.core.component; - -/** - * 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.spi.component.WorkContext - */ -public interface ScopeIdentifier { - - /** - * Returns the scope id for the request. - */ - Object getIdentifier(); -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/WorkContextImpl.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/WorkContextImpl.java deleted file mode 100644 index 8d2afc35d9..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/WorkContextImpl.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.core.component; - -import java.util.ArrayList; -import java.util.IdentityHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.spi.component.AtomicComponent; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.component.WorkContext; - -/** - * An implementation of an {@link org.apache.tuscany.spi.component.WorkContext} that handles event-to-thread - * associations using an InheritableThreadLocal - * - * @version $Rev$ $Date$ - */ -public class WorkContextImpl implements WorkContext { - private static final Object REMOTE_CONTEXT = new Object(); - private static final Object CORRELATION_ID = new Object(); - private static final Object CALLBACK_ROUTING_CHAIN = new Object(); - private static final Object CURRENT_ATOMIC = new Object(); - private static final Object CURRENT_SERVICE_NAMES = new Object(); - - // [rfeng] We cannot use InheritableThreadLocal for message ids here since it's shared by parent and children - private ThreadLocal> workContext = new ThreadLocal>(); - - // [rfeng] Session id requires InheritableThreadLocal - private ThreadLocal> inheritableContext = new InheritableThreadLocal>(); - - public WorkContextImpl() { - super(); - } - - public Object getCurrentCorrelationId() { - Map map = workContext.get(); - if (map == null) { - return null; - } - return map.get(CORRELATION_ID); - } - - public void setCurrentCorrelationId(Object correlationId) { - Map map = getWorkContextMap(); - map.put(CORRELATION_ID, correlationId); - } - - public AtomicComponent getCurrentAtomicComponent() { - Map map = workContext.get(); - if (map == null) { - return null; - } - return (AtomicComponent) map.get(CURRENT_ATOMIC); - } - - public void setCurrentAtomicComponent(AtomicComponent component) { - Map map = getWorkContextMap(); - map.put(CURRENT_ATOMIC, component); - } - - @SuppressWarnings("unchecked") - public LinkedList getCurrentCallbackRoutingChain() { - Map map = workContext.get(); - if (map == null) { - return null; - } - return (LinkedList) map.get(CALLBACK_ROUTING_CHAIN); - } - - public void setCurrentCallbackRoutingChain(LinkedList callbackRoutingChain) { - Map map = getWorkContextMap(); - map.put(CALLBACK_ROUTING_CHAIN, callbackRoutingChain); - } - - public CompositeComponent getRemoteComponent() { - Map map = workContext.get(); - if (map == null) { - return null; - } - return (CompositeComponent) map.get(REMOTE_CONTEXT); - } - - - public void setRemoteComponent(CompositeComponent component) { - Map map = getWorkContextMap(); - map.put(REMOTE_CONTEXT, component); - } - - public Object getIdentifier(Object type) { - Map map = inheritableContext.get(); - if (map == null) { - return null; - } - Object currentId = map.get(type); - if (currentId instanceof ScopeIdentifier) { - currentId = ((ScopeIdentifier) currentId).getIdentifier(); - // once we have accessed the id, replace the lazy wrapper - map.put(type, currentId); - } - return currentId; - } - - public void setIdentifier(Object type, Object identifier) { - Map map = inheritableContext.get(); - if (map == null) { - map = new IdentityHashMap(); - inheritableContext.set(map); - } - map.put(type, identifier); - } - - public void clearIdentifier(Object type) { - if (type == null) { - return; - } - Map map = inheritableContext.get(); - if (map != null) { - map.remove(type); - } - } - - public void clearIdentifiers() { - inheritableContext.remove(); - } - - @SuppressWarnings({"unchecked"}) - public String popServiceName() { - Map map = inheritableContext.get(); - if (map == null) { - return null; - } - List stack = (List) map.get(CURRENT_SERVICE_NAMES); - if (stack == null || stack.size() < 1) { - return null; - } - String name = stack.remove(stack.size() - 1); - if (stack.size() == 0) { - // cleanup to avoid leaks - map.remove(CURRENT_SERVICE_NAMES); - } - return name; - } - - @SuppressWarnings({"unchecked"}) - public String getCurrentServiceName() { - Map map = inheritableContext.get(); - if (map == null) { - return null; - } - List stack = (List) map.get(CURRENT_SERVICE_NAMES); - if (stack == null || stack.size() < 1) { - return null; - } - return stack.get(stack.size() - 1); - } - - @SuppressWarnings({"unchecked"}) - public void pushServiceName(String name) { - Map map = inheritableContext.get(); - List names; - if (map == null) { - map = new IdentityHashMap(); - inheritableContext.set(map); - names = new ArrayList(); - map.put(CURRENT_SERVICE_NAMES, names); - } else { - names = (List) map.get(CURRENT_SERVICE_NAMES); - if (names == null) { - names = new ArrayList(); - map.put(CURRENT_SERVICE_NAMES, names); - } - } - names.add(name); - } - - public void clearServiceNames() { - Map map = inheritableContext.get(); - if (map == null) { - return; - } - map.remove(CURRENT_SERVICE_NAMES); - } - - private Map getWorkContextMap() { - Map map = workContext.get(); - if (map == null) { - map = new IdentityHashMap(); - workContext.set(map); - } - return map; - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/AbstractEvent.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/AbstractEvent.java deleted file mode 100644 index 6d026ca08c..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/AbstractEvent.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.core.component.event; - -import org.apache.tuscany.spi.event.Event; - -/** - * A basic implementation of a runtime event - * - * @version $$Rev$$ $$Date$$ - */ -public abstract class AbstractEvent implements Event { - protected Object source; - - public AbstractEvent(Object source) { - assert source != null : "Source id was null"; - this.source = source; - } - - public Object getSource() { - return source; - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/AbstractRequestEvent.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/AbstractRequestEvent.java deleted file mode 100644 index 762b917600..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/AbstractRequestEvent.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.core.component.event; - -/** - * Base implementation of a request event - * - * @version $$Rev$$ $$Date$$ - */ -public abstract class AbstractRequestEvent extends AbstractEvent implements RequestEvent { - - /** - * Creates a new event - * - * @param source the source of the event - */ - public AbstractRequestEvent(Object source) { - super(source); - } - - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/CompositeEvent.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/CompositeEvent.java deleted file mode 100644 index ce058404da..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/CompositeEvent.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.core.component.event; - -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.event.Event; - -/** - * Implemented by runtime events associated with a composite, e.g. lifecycle events - * - * @version $$Rev$$ $$Date$$ - */ -public interface CompositeEvent extends Event { - - CompositeComponent getComposite(); - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/CompositeStart.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/CompositeStart.java deleted file mode 100644 index fba36feaf6..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/CompositeStart.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.core.component.event; - -import org.apache.tuscany.spi.component.CompositeComponent; - -/** - * Propagated when a composite starts - * - * @version $$Rev$$ $$Date$$ - */ -public class CompositeStart extends AbstractEvent implements CompositeEvent { - - private CompositeComponent component; - - /** - * Creates a composite stop event - * - * @param source the source of the event - * @param component the composite component associated the composite being stopped - */ - public CompositeStart(Object source, CompositeComponent component) { - super(source); - this.component = component; - } - - public CompositeComponent getComposite() { - return component; - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/CompositeStop.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/CompositeStop.java deleted file mode 100644 index 6b3e37f619..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/CompositeStop.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.core.component.event; - -import org.apache.tuscany.spi.component.CompositeComponent; - -/** - * Propagated when a composite stops - * - * @version $$Rev$$ $$Date$$ - */ -public class CompositeStop extends AbstractEvent implements CompositeEvent { - - private CompositeComponent component; - - /** - * Creates a composite stop event - * - * @param source the source of the event - * @param component the composite component associated the composite being stopped - */ - public CompositeStop(Object source, CompositeComponent component) { - super(source); - this.component = component; - } - - public CompositeComponent getComposite() { - return component; - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/ConversationEnd.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/ConversationEnd.java deleted file mode 100644 index 4a51d970c3..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/ConversationEnd.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.core.component.event; - -/** - * Propagated when a conversation session is expired - * - * @version $$Rev: 430937 $$ $$Date: 2006-08-11 21:17:56 -0400 (Fri, 11 Aug 2006) $$ - */ -public class ConversationEnd extends ConversationalEvent { - - public ConversationEnd(Object source, Object id) { - super(source, id); - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/ConversationStart.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/ConversationStart.java deleted file mode 100644 index 5725369bf6..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/ConversationStart.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.core.component.event; - -/** - * Propagated when a conversation session has started - * - * @version $$Rev: 430937 $$ $$Date: 2006-08-11 21:17:56 -0400 (Fri, 11 Aug 2006) $$ - */ -public class ConversationStart extends ConversationalEvent { - - public ConversationStart(Object source, Object id) { - super(source, id); - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/ConversationalEvent.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/ConversationalEvent.java deleted file mode 100644 index a75086e745..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/ConversationalEvent.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.core.component.event; - -/** - * A base implementation of conversational session events in the runtime - * - * @version $$Rev: 430937 $$ $$Date: 2006-08-11 21:17:56 -0400 (Fri, 11 Aug 2006) $$ - */ -public class ConversationalEvent extends AbstractEvent { - - private Object id; - - public ConversationalEvent(Object source, Object id) { - super(source); - assert id != null : "Conversation id was null"; - this.id = id; - } - - public Object getId() { - return id; - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpRequestEnded.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpRequestEnded.java deleted file mode 100644 index 01bd769031..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpRequestEnded.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.core.component.event; - -/** - * Propagated when an HTTP-based request has ended. - * - * @version $$Rev: 430937 $$ $$Date: 2006-08-11 21:17:56 -0400 (Fri, 11 Aug 2006) $$ - */ -public class HttpRequestEnded extends HttpSessionEvent { - - /** - * Creates a new event - * - * @param source the source of the event - * @param id the id of the HTTP session being ended - */ - public HttpRequestEnded(Object source, Object id) { - super(source, id); - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpRequestStart.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpRequestStart.java deleted file mode 100644 index 9d0ff80dd7..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpRequestStart.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.core.component.event; - -/** - * Propagated when an HTTP-based request has started - * - * @version $$Rev: 430937 $$ $$Date: 2006-08-11 21:17:56 -0400 (Fri, 11 Aug 2006) $$ - */ -public class HttpRequestStart extends HttpSessionEvent { - - /** - * Creates a new event - * - * @param source the source of the event - * @param id the id of the HTTP session being ended - */ - public HttpRequestStart(Object source, Object id) { - super(source, id); - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpSessionEnd.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpSessionEnd.java deleted file mode 100644 index 7f2bebe94a..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpSessionEnd.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.core.component.event; - -/** - * Propagated when an HTTP-based session is expired - * - * @version $$Rev$$ $$Date$$ - */ -public class HttpSessionEnd extends HttpSessionEvent { - - /** - * 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) { - super(source, id); - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpSessionEvent.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpSessionEvent.java deleted file mode 100644 index ed245d0930..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpSessionEvent.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.core.component.event; - -/** - * A base implementation of HTTP-based session events in the runtime - * - * @version $$Rev$$ $$Date$$ - */ -public abstract class HttpSessionEvent extends AbstractEvent { - - private Object id; - - public HttpSessionEvent(Object source, Object id) { - super(source); - assert id != null : "Session id was null"; - this.id = id; - } - - - public Object getSource() { - return source; - } - - public Object getId() { - return id; - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpSessionStart.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpSessionStart.java deleted file mode 100644 index 7f9c0fadea..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/HttpSessionStart.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.core.component.event; - -/** - * Propagated when an HTTP-based session has started - * - * @version $$Rev$$ $$Date$$ - */ -public class HttpSessionStart extends HttpSessionEvent { - - /** - * Creates a new event - * - * @param source the source of the event - * @param id the id of the HTTP session being ended - */ - public HttpSessionStart(Object source, Object id) { - super(source, id); - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/RequestEnd.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/RequestEnd.java deleted file mode 100644 index 25856e86f8..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/RequestEnd.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.core.component.event; - -/** - * Propagated when a request completes or is ended - * - * @version $$Rev$$ $$Date$$ - */ -public class RequestEnd extends AbstractRequestEvent { - - /** - * Creates a new event - * - * @param source the source of the event - */ - public RequestEnd(Object source) { - super(source); - } - - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/RequestEvent.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/RequestEvent.java deleted file mode 100644 index 9a6d767236..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/RequestEvent.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.core.component.event; - -/** - * Implemented by runtime events associated request - * - * @version $$Rev$$ $$Date$$ - */ -public interface RequestEvent { - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/RequestStart.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/RequestStart.java deleted file mode 100644 index 466f52551a..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/event/RequestStart.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.core.component.event; - -/** - * Propagated when a request is started in the runtime - * - * @version $$Rev$$ $$Date$$ - */ -public class RequestStart extends AbstractRequestEvent { - - /** - * Creates a new event - * - * @param source the source of the event - */ - public RequestStart(Object source) { - super(source); - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/AbstractScopeContainer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/AbstractScopeContainer.java deleted file mode 100644 index cde61eaa5a..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/AbstractScopeContainer.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.component.scope; - - -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArrayList; - -import org.apache.tuscany.spi.AbstractLifecycle; -import org.apache.tuscany.spi.component.AtomicComponent; -import org.apache.tuscany.spi.component.PersistenceException; -import org.apache.tuscany.spi.component.ScopeContainer; -import org.apache.tuscany.spi.component.ScopeContainerMonitor; -import org.apache.tuscany.spi.component.TargetNotFoundException; -import org.apache.tuscany.spi.component.TargetResolutionException; -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.event.Event; -import org.apache.tuscany.spi.event.EventFilter; -import org.apache.tuscany.spi.event.RuntimeEventListener; -import org.apache.tuscany.spi.event.TrueFilter; - -/** - * Implements functionality common to scope contexts. - * - * @version $Rev$ $Date$ - */ -public abstract class AbstractScopeContainer extends AbstractLifecycle implements ScopeContainer { - private static final EventFilter TRUE_FILTER = new TrueFilter(); - - protected WorkContext workContext; - protected ScopeContainerMonitor monitor; - private Map> listeners; - - public AbstractScopeContainer(WorkContext workContext, ScopeContainerMonitor monitor) { - this.workContext = workContext; - this.monitor = monitor; - } - - public void addListener(RuntimeEventListener listener) { - addListener(TRUE_FILTER, listener); - } - - public void removeListener(RuntimeEventListener listener) { - assert listener != 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; - 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; - for (Map.Entry> entry : getListeners().entrySet()) { - if (entry.getKey().match(event)) { - for (RuntimeEventListener listener : entry.getValue()) { - listener.onEvent(event); - } - } - } - } - - public Object getInstance(AtomicComponent component) throws TargetResolutionException { - InstanceWrapper ctx = getInstanceWrapper(component, true); - if (ctx != null) { - if (!ctx.isStarted()) { - ctx.start(); - } - return ctx.getInstance(); - } - return null; - } - - public Object getAssociatedInstance(AtomicComponent component) throws TargetResolutionException { - InstanceWrapper ctx = getInstanceWrapper(component, false); - if (ctx != null) { - if (!ctx.isStarted()) { - ctx.start(); - } - return ctx.getInstance(); - } - throw new TargetNotFoundException(component.getName()); - } - - public void persistNew(AtomicComponent component, String id, Object instance, long expiration) - throws PersistenceException { - throw new UnsupportedOperationException("Scope does not support persistence"); - - } - - public void persist(AtomicComponent component, String id, Object instance, long expiration) - throws PersistenceException { - throw new UnsupportedOperationException("Scope does not support persistence"); - } - - public void remove(AtomicComponent component) throws PersistenceException { - throw new UnsupportedOperationException("Scope does not support persistence"); - } - - protected Map> getListeners() { - if (listeners == null) { - listeners = new ConcurrentHashMap>(); - } - return listeners; - } - - protected void checkInit() { - if (getLifecycleState() != RUNNING) { - throw new IllegalStateException("Scope container not running [" + getLifecycleState() + "]"); - } - } - - protected WorkContext getWorkContext() { - return workContext; - } - - public String toString() { - return "In state [" + super.toString() + ']'; - } - - protected abstract InstanceWrapper getInstanceWrapper(AtomicComponent component, boolean create) - throws TargetResolutionException; -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/CompositeScopeContainer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/CompositeScopeContainer.java deleted file mode 100644 index 21ff792282..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/CompositeScopeContainer.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.core.component.scope; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.tuscany.spi.ObjectCreationException; -import org.apache.tuscany.spi.component.AtomicComponent; -import org.apache.tuscany.spi.component.ScopeContainerMonitor; -import org.apache.tuscany.spi.component.TargetDestructionException; -import org.apache.tuscany.spi.component.TargetInitializationException; -import org.apache.tuscany.spi.component.TargetResolutionException; -import org.apache.tuscany.spi.event.Event; -import org.apache.tuscany.spi.model.Scope; - -import org.apache.tuscany.core.component.event.CompositeStart; -import org.apache.tuscany.core.component.event.CompositeStop; - -/** - * A scope context which manages atomic component instances keyed by composite - * - * @version $Rev$ $Date$ - */ -public class CompositeScopeContainer extends AbstractScopeContainer { - private static final InstanceWrapper EMPTY = new EmptyWrapper(); - private static final ComponentInitComparator COMPARATOR = new ComponentInitComparator(); - - private final Map instanceWrappers; - // the queue of instanceWrappers to destroy, in the order that their instances were created - private final List destroyQueue; - - public CompositeScopeContainer(ScopeContainerMonitor monitor) { - super(null, monitor); - instanceWrappers = new ConcurrentHashMap(); - destroyQueue = new ArrayList(); - } - - public Scope getScope() { - return Scope.COMPOSITE; - } - - public void onEvent(Event event) { - checkInit(); - if (event instanceof CompositeStart) { - try { - eagerInitComponents(); - } catch (ObjectCreationException e) { - monitor.eagerInitializationError(e); - } catch (TargetResolutionException e) { - monitor.eagerInitializationError(e); - } - lifecycleState = RUNNING; - } else if (event instanceof CompositeStop) { - shutdownContexts(); - } - } - - 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() { - checkInit(); - instanceWrappers.clear(); - synchronized (destroyQueue) { - destroyQueue.clear(); - } - lifecycleState = STOPPED; - } - - /** - * Notifies instanceWrappers of a shutdown in reverse order to which they were started - */ - private void shutdownContexts() { - if (destroyQueue.size() == 0) { - return; - } - synchronized (destroyQueue) { - // shutdown destroyable instances in reverse instantiation order - ListIterator iter = destroyQueue.listIterator(destroyQueue.size()); - while (iter.hasPrevious()) { - try { - iter.previous().stop(); - } catch (TargetDestructionException e) { - monitor.destructionError(e); - } - } - destroyQueue.clear(); - } - } - - public void register(AtomicComponent component) { - checkInit(); - instanceWrappers.put(component, EMPTY); - } - - protected InstanceWrapper getInstanceWrapper(AtomicComponent component, boolean create) - throws TargetResolutionException { - checkInit(); - InstanceWrapper ctx = instanceWrappers.get(component); - assert ctx != null; - if (ctx == EMPTY && !create) { - return null; - } - if (ctx == EMPTY) { - ctx = new InstanceWrapperImpl(component, component.createInstance()); - ctx.start(); - instanceWrappers.put(component, ctx); - synchronized (destroyQueue) { - destroyQueue.add(ctx); - } - } - return ctx; - } - - private void eagerInitComponents() throws ObjectCreationException, TargetResolutionException { - List componentList = new ArrayList(instanceWrappers.keySet()); - Collections.sort(componentList, COMPARATOR); - // start each group - for (AtomicComponent component : componentList) { - if (component.getInitLevel() <= 0) { - // Don't eagerly init - continue; - } - // the instance could have been created from a depth-first traversal - InstanceWrapper ctx = instanceWrappers.get(component); - if (ctx == EMPTY) { - try { - ctx = new InstanceWrapperImpl(component, component.createInstance()); - } catch (ObjectCreationException e) { - e.addContextName(component.getName()); - throw e; - } - ctx.start(); - instanceWrappers.put(component, ctx); - destroyQueue.add(ctx); - } - } - } - - private static class ComponentInitComparator implements Comparator { - public int compare(AtomicComponent o1, AtomicComponent o2) { - return o1.getInitLevel() - o2.getInitLevel(); - } - } - - private static class EmptyWrapper implements InstanceWrapper { - public Object getInstance() { - return null; - } - - public boolean isStarted() { - return true; - } - - public void start() throws TargetInitializationException { - - } - - public void stop() throws TargetDestructionException { - - } - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/CompositeScopeObjectFactory.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/CompositeScopeObjectFactory.java deleted file mode 100644 index a761f05d4b..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/CompositeScopeObjectFactory.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.core.component.scope; - -import org.osoa.sca.annotations.EagerInit; - -import org.apache.tuscany.spi.ObjectCreationException; -import org.apache.tuscany.spi.ObjectFactory; -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.component.ScopeContainerMonitor; -import org.apache.tuscany.spi.component.ScopeRegistry; -import org.apache.tuscany.spi.model.Scope; - -import org.apache.tuscany.api.annotation.Monitor; - -/** - * Creates a new composite scope context - * - * @version $$Rev$$ $$Date$$ - */ -@EagerInit -public class CompositeScopeObjectFactory implements ObjectFactory { - private ScopeContainerMonitor monitor; - - public CompositeScopeObjectFactory(@Autowire ScopeRegistry registry, - @Monitor ScopeContainerMonitor monitor) { - registry.registerFactory(Scope.COMPOSITE, this); - this.monitor = monitor; - } - - public CompositeScopeContainer getInstance() throws ObjectCreationException { - return new CompositeScopeContainer(monitor); - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainer.java deleted file mode 100644 index 1a77f3ecb3..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/ConversationalScopeContainer.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.component.scope; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.tuscany.spi.component.AtomicComponent; -import org.apache.tuscany.spi.component.PersistenceException; -import org.apache.tuscany.spi.component.SCAObject; -import org.apache.tuscany.spi.component.ScopeContainer; -import org.apache.tuscany.spi.component.ScopeContainerMonitor; -import org.apache.tuscany.spi.component.TargetDestructionException; -import org.apache.tuscany.spi.component.TargetNotFoundException; -import org.apache.tuscany.spi.component.TargetResolutionException; -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.event.Event; -import org.apache.tuscany.spi.event.RuntimeEventListener; -import org.apache.tuscany.spi.model.Scope; -import org.apache.tuscany.spi.services.store.Store; -import org.apache.tuscany.spi.services.store.StoreExpirationEvent; -import org.apache.tuscany.spi.services.store.StoreReadException; -import org.apache.tuscany.spi.services.store.StoreWriteException; - -/** - * 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 Store nonDurableStore; - private Map components; - - public ConversationalScopeContainer(Store store, WorkContext workContext, final ScopeContainerMonitor monitor) { - super(workContext, monitor); - this.nonDurableStore = store; - if (store != null) { - store.addListener(new ExpirationListener(monitor)); - } - components = new ConcurrentHashMap(); - } - - public Scope getScope() { - return Scope.CONVERSATION; - } - - 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 register(AtomicComponent component) { - components.put(component, component); - component.addListener(this); - } - - @Override - public Object getInstance(AtomicComponent component) throws TargetResolutionException { - String conversationId = getConversationId(); - try { - workContext.setCurrentAtomicComponent(component); - Object instance = nonDurableStore.readRecord(component, conversationId); - if (instance != null) { - if (component.getMaxIdleTime() > 0) { - // update expiration - long expire = System.currentTimeMillis() + component.getMaxIdleTime(); - nonDurableStore.updateRecord(component, conversationId, instance, expire); - } - } else { - instance = component.createInstance(); - long expire = calculateExpiration(component); - nonDurableStore.insertRecord(component, conversationId, instance, expire); - component.init(instance); - } - return instance; - } 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); - } - } - - public Object getAssociatedInstance(AtomicComponent component) throws TargetResolutionException { - String conversationId = getConversationId(); - try { - workContext.setCurrentAtomicComponent(component); - Object instance = nonDurableStore.readRecord(component, conversationId); - if (instance != null) { - if (component.getMaxIdleTime() > 0) { - // update expiration - long expire = System.currentTimeMillis() + component.getMaxIdleTime(); - nonDurableStore.updateRecord(component, conversationId, instance, expire); - } - return instance; - } else { - throw new TargetNotFoundException(component.getName()); - } - } 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); - } - } - - public void persistNew(AtomicComponent 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(AtomicComponent 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(AtomicComponent component) throws PersistenceException { - String conversationId = getConversationId(); - try { - workContext.setCurrentAtomicComponent(component); - 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(AtomicComponent component, boolean create) { - throw new UnsupportedOperationException(); - } - - /** - * Returns the conversation id associated with the current invocation context - */ - private String getConversationId() { - String conversationId = (String) workContext.getIdentifier(Scope.CONVERSATION); - assert conversationId != null; - return conversationId; - } - - private long calculateExpiration(AtomicComponent 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 { - private final ScopeContainerMonitor monitor; - - public ExpirationListener(ScopeContainerMonitor monitor) { - this.monitor = monitor; - } - - public void onEvent(Event event) { - if (event instanceof StoreExpirationEvent) { - StoreExpirationEvent expiration = (StoreExpirationEvent) event; - SCAObject object = expiration.getOwner(); - assert object instanceof AtomicComponent; - AtomicComponent owner = (AtomicComponent) object; - try { - owner.destroy(expiration.getInstance()); - } catch (TargetDestructionException e) { - monitor.destructionError(e); - } - } - } - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/ConversationalScopeObjectFactory.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/ConversationalScopeObjectFactory.java deleted file mode 100644 index 32dfaed8d9..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/ConversationalScopeObjectFactory.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.core.component.scope; - -import org.osoa.sca.annotations.EagerInit; - -import org.apache.tuscany.spi.ObjectCreationException; -import org.apache.tuscany.spi.ObjectFactory; -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.component.ScopeContainerMonitor; -import org.apache.tuscany.spi.component.ScopeRegistry; -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.model.Scope; -import org.apache.tuscany.spi.services.store.Store; - -import org.apache.tuscany.api.annotation.Monitor; - -/** - * Creates a new Session Scope context - * - * @version $$Rev: 450456 $$ $$Date: 2006-09-27 10:28:36 -0400 (Wed, 27 Sep 2006) $$ - */ -@EagerInit -public class ConversationalScopeObjectFactory implements ObjectFactory { - private WorkContext context; - private Store store; - private ScopeContainerMonitor monitor; - - public ConversationalScopeObjectFactory(@Autowire ScopeRegistry registry, - @Autowire WorkContext context, - @Autowire Store store, - @Monitor ScopeContainerMonitor monitor) { - registry.registerFactory(Scope.CONVERSATION, this); - this.context = context; - this.store = store; - this.monitor = monitor; - } - - public ConversationalScopeContainer getInstance() throws ObjectCreationException { - return new ConversationalScopeContainer(store, context, monitor); - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/HttpSessionScopeContainer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/HttpSessionScopeContainer.java deleted file mode 100644 index 83c79b2367..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/HttpSessionScopeContainer.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.component.scope; - -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.tuscany.spi.component.AtomicComponent; -import org.apache.tuscany.spi.component.ScopeContainerMonitor; -import org.apache.tuscany.spi.component.TargetDestructionException; -import org.apache.tuscany.spi.component.TargetResolutionException; -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.event.Event; -import org.apache.tuscany.spi.model.Scope; - -import org.apache.tuscany.core.component.event.HttpSessionEnd; - -/** - * A scope context which manages atomic component instances keyed on HTTP session - * - * @version $Rev$ $Date$ - */ -public class HttpSessionScopeContainer extends AbstractScopeContainer { - private final Map> contexts; - private final Map> destroyQueues; - - public HttpSessionScopeContainer(WorkContext workContext, ScopeContainerMonitor monitor) { - super(workContext, monitor); - contexts = new ConcurrentHashMap>(); - destroyQueues = new ConcurrentHashMap>(); - } - - public Scope getScope() { - return Scope.SESSION; - } - - public void onEvent(Event event) { - checkInit(); - if (event instanceof HttpSessionEnd) { - Object key = ((HttpSessionEnd) event).getId(); - shutdownInstances(key); - workContext.clearIdentifier(key); - } - } - - 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; - } - - public void register(AtomicComponent component) { - contexts.put(component, new ConcurrentHashMap()); - component.addListener(this); - } - - protected InstanceWrapper getInstanceWrapper(AtomicComponent component, boolean create) - throws TargetResolutionException { - Object key = workContext.getIdentifier(Scope.SESSION); - assert key != null : "HTTP session key not bound in work context"; - return getInstance(component, key, create); - } - - private InstanceWrapper getInstance(AtomicComponent component, Object key, boolean create) - throws TargetResolutionException { - Map wrappers = contexts.get(component); - InstanceWrapper ctx = wrappers.get(key); - if (ctx == null && !create) { - return null; - } - if (ctx == null) { - ctx = new InstanceWrapperImpl(component, component.createInstance()); - ctx.start(); - wrappers.put(key, ctx); - List destroyQueue = destroyQueues.get(key); - if (destroyQueue == null) { - destroyQueue = new ArrayList(); - destroyQueues.put(key, destroyQueue); - } - synchronized (destroyQueue) { - destroyQueue.add(ctx); - } - } - return ctx; - - } - - private void shutdownInstances(Object key) { - List destroyQueue = destroyQueues.remove(key); - if (destroyQueue != null) { - for (Map map : contexts.values()) { - map.remove(key); - } - ListIterator iter = destroyQueue.listIterator(destroyQueue.size()); - synchronized (destroyQueue) { - while (iter.hasPrevious()) { - try { - iter.previous().stop(); - } catch (TargetDestructionException e) { - monitor.destructionError(e); - } - } - } - } - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/HttpSessionScopeObjectFactory.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/HttpSessionScopeObjectFactory.java deleted file mode 100644 index 14713f9144..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/HttpSessionScopeObjectFactory.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.core.component.scope; - -import org.osoa.sca.annotations.EagerInit; - -import org.apache.tuscany.spi.ObjectCreationException; -import org.apache.tuscany.spi.ObjectFactory; -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.component.ScopeContainerMonitor; -import org.apache.tuscany.spi.component.ScopeRegistry; -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.model.Scope; - -import org.apache.tuscany.api.annotation.Monitor; - -/** - * Creates a new HTTP session scope context - * - * @version $$Rev$$ $$Date$$ - */ -@EagerInit -public class HttpSessionScopeObjectFactory implements ObjectFactory { - private WorkContext context; - private ScopeContainerMonitor monitor; - - public HttpSessionScopeObjectFactory(@Autowire ScopeRegistry registry, - @Autowire WorkContext context, - @Monitor ScopeContainerMonitor monitor) { - registry.registerFactory(Scope.SESSION, this); - this.context = context; - this.monitor = monitor; - } - - public HttpSessionScopeContainer getInstance() throws ObjectCreationException { - return new HttpSessionScopeContainer(context, monitor); - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/InstanceWrapper.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/InstanceWrapper.java deleted file mode 100644 index 50f4a31128..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/InstanceWrapper.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.core.component.scope; - -import org.apache.tuscany.spi.component.TargetDestructionException; -import org.apache.tuscany.spi.component.TargetInitializationException; - -/** - * Provides lifecycle management for an implementation instance associated with an {@link - * org.apache.tuscany.spi.component.AtomicComponent} for use by the atomic component's associated {@link - * org.apache.tuscany.spi.component.ScopeContainer} - * - * @version $Rev$ $Date$ - */ -public interface InstanceWrapper { - - Object getInstance(); - - boolean isStarted(); - - void start() throws TargetInitializationException; - - void stop() throws TargetDestructionException; - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/InstanceWrapperImpl.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/InstanceWrapperImpl.java deleted file mode 100644 index c4648d1e7b..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/InstanceWrapperImpl.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.core.component.scope; - -import org.apache.tuscany.spi.component.AtomicComponent; -import org.apache.tuscany.spi.component.TargetDestructionException; -import org.apache.tuscany.spi.component.TargetInitializationException; - -/** - * Default implementation of an InstanceWrapper - * - * @version $$Rev$$ $$Date$$ - */ -public class InstanceWrapperImpl implements InstanceWrapper { - private Object instance; - private AtomicComponent component; - private boolean started; - - public InstanceWrapperImpl(AtomicComponent component, Object instance) { - assert component != null; - assert instance != null; - this.component = component; - this.instance = instance; - } - - public boolean isStarted() { - return started; - } - - public Object getInstance() { - if (!started) { - throw new IllegalStateException("Instance not started"); - } - return instance; - } - - public void start() throws TargetInitializationException { - component.init(instance); - started = true; - } - - public void stop() throws TargetDestructionException { - component.destroy(instance); - started = false; - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/RequestScopeContainer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/RequestScopeContainer.java deleted file mode 100644 index 22beaae740..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/RequestScopeContainer.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.component.scope; - -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.tuscany.spi.component.AtomicComponent; -import org.apache.tuscany.spi.component.ScopeContainerMonitor; -import org.apache.tuscany.spi.component.TargetDestructionException; -import org.apache.tuscany.spi.component.TargetResolutionException; -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.event.Event; -import org.apache.tuscany.spi.model.Scope; - -import org.apache.tuscany.core.component.event.RequestEnd; - -/** - * 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; - private final Map> destroyQueues; - - public RequestScopeContainer(WorkContext workContext, ScopeContainerMonitor monitor) { - super(workContext, monitor); - contexts = new ConcurrentHashMap>(); - destroyQueues = new ConcurrentHashMap>(); - } - - public Scope getScope() { - return Scope.REQUEST; - } - - 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; - } - - public void register(AtomicComponent component) { - contexts.put(component, new ConcurrentHashMap()); - } - - protected InstanceWrapper getInstanceWrapper(AtomicComponent component, boolean create) - throws TargetResolutionException { - Map instanceContextMap = contexts.get(component); - assert instanceContextMap != null : "Atomic component not registered"; - InstanceWrapper ctx = instanceContextMap.get(Thread.currentThread()); - if (ctx == null && !create) { - return null; - } - if (ctx == null) { - ctx = new InstanceWrapperImpl(component, component.createInstance()); - ctx.start(); - instanceContextMap.put(Thread.currentThread(), ctx); - List destroyQueue = destroyQueues.get(Thread.currentThread()); - if (destroyQueue == null) { - destroyQueue = new ArrayList(); - destroyQueues.put(Thread.currentThread(), destroyQueue); - } - synchronized (destroyQueue) { - destroyQueue.add(ctx); - } - } - return ctx; - } - - private void shutdownInstances(Thread key) { - List destroyQueue = destroyQueues.remove(key); - if (destroyQueue != null && destroyQueue.size() > 0) { - Thread thread = Thread.currentThread(); - for (Map map : contexts.values()) { - map.remove(thread); - } - ListIterator iter = destroyQueue.listIterator(destroyQueue.size()); - synchronized (destroyQueue) { - while (iter.hasPrevious()) { - try { - iter.previous().stop(); - } catch (TargetDestructionException e) { - monitor.destructionError(e); - } - } - } - } - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/RequestScopeObjectFactory.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/RequestScopeObjectFactory.java deleted file mode 100644 index 0377bcd548..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/RequestScopeObjectFactory.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.core.component.scope; - -import org.apache.tuscany.spi.ObjectCreationException; -import org.apache.tuscany.spi.ObjectFactory; -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.component.ScopeContainerMonitor; -import org.apache.tuscany.spi.component.WorkContext; - -import org.apache.tuscany.api.annotation.Monitor; - -/** - * Creates a new request scope context - * - * @version $$Rev$$ $$Date$$ - */ -public class RequestScopeObjectFactory implements ObjectFactory { - private WorkContext context; - private ScopeContainerMonitor monitor; - - - public RequestScopeObjectFactory(@Autowire WorkContext context, @Monitor ScopeContainerMonitor monitor) { - this.context = context; - this.monitor = monitor; - } - - public RequestScopeContainer getInstance() throws ObjectCreationException { - return new RequestScopeContainer(context, monitor); - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/ScopeRegistryImpl.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/ScopeRegistryImpl.java deleted file mode 100644 index da338dd0ef..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/ScopeRegistryImpl.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.core.component.scope; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import org.apache.tuscany.spi.ObjectFactory; -import org.apache.tuscany.spi.component.ScopeContainer; -import org.apache.tuscany.spi.component.ScopeRegistry; -import org.apache.tuscany.spi.model.Scope; - -/** - * The default implementation of a scope registry - * - * @version $Rev$ $Date$ - */ -public class ScopeRegistryImpl implements ScopeRegistry { - private final Map scopeCache = - new ConcurrentHashMap(); - private final Map> factoryCache = - new ConcurrentHashMap>(); - - public ScopeContainer getScopeContainer(Scope scope) { - assert Scope.COMPOSITE != scope; - ScopeContainer container = scopeCache.get(scope); - if (container == null) { - ObjectFactory factory = factoryCache.get(scope); - if (factory != null) { - container = factory.getInstance(); - container.start(); - scopeCache.put(scope, container); - } - } - return container; - } - - public void registerFactory(Scope scope, ObjectFactory factory) { - factoryCache.put(scope, factory); - } - - public void deregisterFactory(Scope scope) { - factoryCache.remove(scope); - } - - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/StatelessScopeContainer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/StatelessScopeContainer.java deleted file mode 100644 index cbd47b6cdd..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/StatelessScopeContainer.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.core.component.scope; - -import org.apache.tuscany.spi.component.AtomicComponent; -import org.apache.tuscany.spi.component.ScopeContainerMonitor; -import org.apache.tuscany.spi.component.TargetResolutionException; -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.event.Event; -import org.apache.tuscany.spi.model.Scope; - -/** - * A scope context which manages stateless atomic component instances in a non-pooled fashion - * - * @version $Rev$ $Date$ - */ -public class StatelessScopeContainer extends AbstractScopeContainer { - - public StatelessScopeContainer(WorkContext workContext, ScopeContainerMonitor monitor) { - super(workContext, monitor); - } - - public Scope getScope() { - return Scope.STATELESS; - } - - 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() { - if (lifecycleState != RUNNING) { - throw new IllegalStateException("Scope in wrong state [" + lifecycleState + "]"); - } - lifecycleState = STOPPED; - } - - public void onEvent(Event event) { - } - - public void register(AtomicComponent component) { - checkInit(); - } - - protected InstanceWrapper getInstanceWrapper(AtomicComponent component, boolean create) - throws TargetResolutionException { - // there never is a previously associated instance, return null - if (!create) { - return null; - } - InstanceWrapper ctx = new InstanceWrapperImpl(component, component.createInstance()); - ctx.start(); - return ctx; - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/StatelessScopeObjectFactory.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/StatelessScopeObjectFactory.java deleted file mode 100644 index 8e05510723..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/component/scope/StatelessScopeObjectFactory.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.core.component.scope; - -import org.osoa.sca.annotations.EagerInit; - -import org.apache.tuscany.spi.ObjectCreationException; -import org.apache.tuscany.spi.ObjectFactory; -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.component.ScopeContainerMonitor; -import org.apache.tuscany.spi.component.ScopeRegistry; -import org.apache.tuscany.spi.component.WorkContext; -import org.apache.tuscany.spi.model.Scope; - -import org.apache.tuscany.api.annotation.Monitor; - -/** - * Creates a new stateless scope context - * - * @version $$Rev$$ $$Date$$ - */ -@EagerInit -public class StatelessScopeObjectFactory implements ObjectFactory { - private WorkContext context; - private ScopeContainerMonitor monitor; - - public StatelessScopeObjectFactory(@Autowire ScopeRegistry registry, - @Autowire WorkContext context, - @Monitor ScopeContainerMonitor monitor) { - registry.registerFactory(Scope.STATELESS, this); - this.context = context; - this.monitor = monitor; - } - - public StatelessScopeContainer getInstance() throws ObjectCreationException { - return new StatelessScopeContainer(context, monitor); - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingInteceptor.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingInteceptor.java deleted file mode 100644 index aedd715fed..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingInteceptor.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.impl; - -import java.lang.reflect.InvocationTargetException; -import java.util.HashMap; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.databinding.DataBinding; -import org.apache.tuscany.spi.databinding.ExceptionHandler; -import org.apache.tuscany.spi.databinding.Mediator; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.idl.ServiceFaultException; -import org.apache.tuscany.spi.model.DataType; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.wire.Interceptor; -import org.apache.tuscany.spi.wire.Message; -import org.apache.tuscany.spi.wire.Wire; - -/** - * An interceptor to transform data accross databindings on the wire - * - * @version $Rev$ $Date$ - */ -public class DataBindingInteceptor implements Interceptor { - private Interceptor next; - - private CompositeComponent compositeComponent; - - private Operation sourceOperation; - - private Operation targetOperation; - - private Mediator mediator; - - public DataBindingInteceptor(Wire sourceWire, Operation sourceOperation, Operation targetOperation) { - super(); - // this.sourceWire = sourceWire; - this.sourceOperation = sourceOperation; - // this.targetWire = targetWire; - this.targetOperation = targetOperation; - this.compositeComponent = sourceWire.getContainer().getParent(); - } - - /** - * @see org.apache.tuscany.spi.wire.Interceptor#getNext() - */ - public Interceptor getNext() { - return next; - } - - /** - * @see org.apache.tuscany.spi.wire.Interceptor#invoke(org.apache.tuscany.spi.wire.Message) - */ - /* - * (non-Javadoc) - * - * @see org.apache.tuscany.spi.wire.Interceptor#invoke(org.apache.tuscany.spi.wire.Message) - */ - public Message invoke(Message msg) { - Object input = transform(msg.getBody(), sourceOperation.getInputType(), targetOperation.getInputType()); - 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 DataType(DataBinding.IDL_OUTPUT, Object.class, targetOperation.getOutputType()); - - targetType.setOperation(targetOperation.getOutputType().getOperation()); - DataType sourceType = - new DataType(DataBinding.IDL_OUTPUT, Object.class, sourceOperation.getOutputType()); - sourceType.setOperation(sourceOperation.getOutputType().getOperation()); - - 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 ServiceFaultException) { - if (((ServiceFaultException)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.setBodyWithFault(newResult); - } - } - - } else { - assert !(result instanceof Throwable) : "Expected messages that are not throwable " + result; - - Object newResult = transform(result, targetType, sourceType); - if (newResult != result) { - resultMsg.setBody(newResult); - } - } - - return resultMsg; - } - - private Object transform(Object source, DataType sourceType, DataType targetType) { - if (sourceType == targetType || (sourceType != null && sourceType.equals(targetType))) { - return source; - } - Map, Object> metadata = new HashMap, Object>(); - metadata.put(CompositeComponent.class, compositeComponent); - 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.getDataBindingRegistry().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, Object> metadata = new HashMap, Object>(); - metadata.put(CompositeComponent.class, compositeComponent); - - DataType> eSourceDataType = - new DataType>("idl:fault", sourceExType.getPhysical(), sourceType); - DataType> eTargetDataType = - new DataType>("idl:fault", targetExType.getPhysical(), targetType); - - return mediator.mediate(source, eSourceDataType, eTargetDataType, metadata); - } - - /** - * @see org.apache.tuscany.spi.wire.Interceptor#isOptimizable() - */ - public boolean isOptimizable() { - return false; - } - - /** - * @see org.apache.tuscany.spi.wire.Interceptor#setNext(org.apache.tuscany.spi.wire.Interceptor) - */ - public void setNext(Interceptor next) { - this.next = next; - } - - /** - * @param mediator the mediator to set - */ - public void setMediator(Mediator mediator) { - this.mediator = mediator; - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingJavaInterfaceProcessor.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingJavaInterfaceProcessor.java deleted file mode 100644 index 6e176cf0a6..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingJavaInterfaceProcessor.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.impl; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Method; -import java.lang.reflect.Type; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Arrays; -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import javax.xml.datatype.Duration; -import javax.xml.datatype.XMLGregorianCalendar; - -import org.apache.tuscany.api.annotation.DataType; -import org.apache.tuscany.api.annotation.IDLMapping; -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.databinding.DataBindingRegistry; -import org.apache.tuscany.spi.idl.InvalidServiceContractException; -import org.apache.tuscany.spi.idl.java.JavaInterfaceProcessorExtension; -import org.apache.tuscany.spi.idl.java.JavaServiceContract; -import org.apache.tuscany.spi.model.Operation; - -/** - * The databinding annotation processor for java interfaces - * - * @version $Rev$ $Date$ - */ -public class DataBindingJavaInterfaceProcessor extends JavaInterfaceProcessorExtension { - private static final Class[] SIMPLE_JAVA_TYPES = - {Byte.class, Character.class, Short.class, Integer.class, Long.class, Float.class, Double.class, Date.class, - Calendar.class, GregorianCalendar.class, Duration.class, XMLGregorianCalendar.class, BigInteger.class, - BigDecimal.class}; - - private static final Set SIMPLE_TYPE_SET = new HashSet(Arrays.asList(SIMPLE_JAVA_TYPES)); - - private DataBindingRegistry dataBindingRegistry; - - public DataBindingJavaInterfaceProcessor(@Autowire - DataBindingRegistry dataBindingRegistry) { - super(); - this.dataBindingRegistry = dataBindingRegistry; - } - - public void visitInterface(Class clazz, Class callbackClass, JavaServiceContract contract) - throws InvalidServiceContractException { - if (!contract.isRemotable()) { - return; - } - Map> operations = contract.getOperations(); - processInterface(clazz, contract, operations); - if (callbackClass != null) { - Map> callbackOperations = contract.getCallbackOperations(); - processInterface(callbackClass, contract, callbackOperations); - } - } - - private void processInterface(Class clazz, JavaServiceContract contract, - Map> operations) { - IDLMapping interfaceMapping = clazz.getAnnotation(IDLMapping.class); - DataType interfaceDataType = clazz.getAnnotation(DataType.class); - if (interfaceDataType != null) { - contract.setDataBinding(interfaceDataType.name()); - } - for (Method method : clazz.getMethods()) { - Operation operation = operations.get(method.getName()); - DataType operationDataType = method.getAnnotation(DataType.class); - if (operationDataType == null) { - operationDataType = interfaceDataType; - } - - if (operationDataType != null) { - operation.setDataBinding(operationDataType.name()); - // FIXME: [rfeng] Keep data context as metadata? - } - IDLMapping operationMapping = clazz.getAnnotation(IDLMapping.class); - if (operationMapping == null) { - operationMapping = interfaceMapping; - } - - if (operationMapping != null) { - operation.setDataBinding(operationMapping.dataBinding()); - operation.setWrapperStyle(operationMapping.wrapperStyle()); - } - // String dataBinding = operation.getDataBinding(); - - Annotation[] annotations = null; - if (operationDataType != null) { - annotations = new Annotation[] {operationDataType}; - } - // FIXME: We need a better way to identify simple java types - for (org.apache.tuscany.spi.model.DataType d : operation.getInputType().getLogical()) { - dataBindingRegistry.introspectType(d, annotations); - } - if (operation.getOutputType() != null) { - dataBindingRegistry.introspectType(operation.getOutputType(), annotations); - } - for (org.apache.tuscany.spi.model.DataType d : operation.getFaultTypes()) { - dataBindingRegistry.introspectType(d, annotations); - } - } - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingRegistryImpl.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingRegistryImpl.java deleted file mode 100644 index 8c7f7e28ad..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingRegistryImpl.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.core.databinding.impl; - -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.core.databinding.javabeans.JavaBeansDataBinding; -import org.apache.tuscany.spi.databinding.DataBinding; -import org.apache.tuscany.spi.databinding.DataBindingRegistry; -import org.apache.tuscany.spi.model.DataType; -import org.osoa.sca.annotations.EagerInit; - -/** - * The default implementation of a data binding registry - * - * @version $Rev$ $Date$ - */ -@EagerInit -public class DataBindingRegistryImpl implements DataBindingRegistry { - private final Map bindings = new HashMap(); - - public DataBinding getDataBinding(String id) { - if (id == null) { - return null; - } - return bindings.get(id.toLowerCase()); - } - - public void register(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 unregister(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? - Object physical = dataType.getPhysical(); - if (physical instanceof Class) { - 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 DataType(JavaBeansDataBinding.NAME, value.getClass(), value.getClass()); - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingWirePostProcessor.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingWirePostProcessor.java deleted file mode 100644 index e687a161eb..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataBindingWirePostProcessor.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.core.databinding.impl; - -import java.util.Map; -import java.util.Set; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.component.ReferenceBinding; -import org.apache.tuscany.spi.component.SCAObject; -import org.apache.tuscany.spi.databinding.Mediator; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.wire.InboundInvocationChain; -import org.apache.tuscany.spi.wire.InboundWire; -import org.apache.tuscany.spi.wire.Interceptor; -import org.apache.tuscany.spi.wire.OutboundInvocationChain; -import org.apache.tuscany.spi.wire.OutboundWire; -import org.apache.tuscany.spi.wire.WirePostProcessorExtension; -import org.osoa.sca.annotations.Constructor; - -/** - * 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 DataBindingWirePostProcessor extends WirePostProcessorExtension { - private Mediator mediator; - - @Constructor({"mediator"}) - public DataBindingWirePostProcessor(@Autowire Mediator mediator) { - super(); - this.mediator = mediator; - } - - public void process(OutboundWire source, InboundWire target) { - Map, OutboundInvocationChain> chains = source.getInvocationChains(); - for (Map.Entry, OutboundInvocationChain> entry : chains.entrySet()) { - Operation sourceOperation = entry.getKey(); - Operation targetOperation = - getTargetOperation(target.getInvocationChains().keySet(), sourceOperation.getName()); - String sourceDataBinding = sourceOperation.getDataBinding(); - String targetDataBinding = targetOperation.getDataBinding(); - if (sourceDataBinding == null && targetDataBinding == null) { - continue; - } - if (sourceDataBinding == null || targetDataBinding == null - || !sourceDataBinding.equals(targetDataBinding)) { - // Add the interceptor to the source side because multiple - // references can be wired - // to the same service - DataBindingInteceptor interceptor = - new DataBindingInteceptor(source, sourceOperation, targetOperation); - interceptor.setMediator(mediator); - entry.getValue().addInterceptor(0, interceptor); - } - } - - // Check if there's a callback - Map callbackOperations = source.getServiceContract().getCallbackOperations(); - if (callbackOperations == null || callbackOperations.isEmpty()) { - return; - } - Object targetAddress = source.getContainer().getName(); - Map, OutboundInvocationChain> callbackChains = - target.getSourceCallbackInvocationChains(targetAddress); - if (callbackChains == null) { - // callback chains could be null - return; - } - for (Map.Entry, OutboundInvocationChain> entry : callbackChains.entrySet()) { - Operation sourceOperation = entry.getKey(); - Operation targetOperation = - getTargetOperation(source.getTargetCallbackInvocationChains().keySet(), sourceOperation - .getName()); - String sourceDataBinding = sourceOperation.getDataBinding(); - String targetDataBinding = targetOperation.getDataBinding(); - if (sourceDataBinding == null && targetDataBinding == null) { - continue; - } - if (sourceDataBinding == null || targetDataBinding == null - || !sourceDataBinding.equals(targetDataBinding)) { - // Add the interceptor to the source side because multiple - // references can be wired - // to the same service - DataBindingInteceptor interceptor = - new DataBindingInteceptor(source, sourceOperation, targetOperation); - interceptor.setMediator(mediator); - entry.getValue().addInterceptor(0, interceptor); - } - } - } - - public void process(InboundWire source, OutboundWire target) { - SCAObject container = source.getContainer(); - // Either Service or Reference - boolean isReference = container instanceof ReferenceBinding; - - Map, InboundInvocationChain> chains = source.getInvocationChains(); - for (Map.Entry, InboundInvocationChain> entry : chains.entrySet()) { - Operation sourceOperation = entry.getKey(); - Operation targetOperation = - getTargetOperation(target.getInvocationChains().keySet(), sourceOperation.getName()); - String sourceDataBinding = sourceOperation.getDataBinding(); - String targetDataBinding = targetOperation.getDataBinding(); - if (sourceDataBinding == null && targetDataBinding == null) { - continue; - } - if (sourceDataBinding == null || targetDataBinding == null - || !sourceDataBinding.equals(targetDataBinding)) { - // Add the interceptor to the source side - DataBindingInteceptor interceptor = - new DataBindingInteceptor(source, sourceOperation, targetOperation); - interceptor.setMediator(mediator); - if (isReference) { - // FIXME: We need a better way to position the interceptors - target.getInvocationChains().get(targetOperation).addInterceptor(0, interceptor); - Interceptor tail = entry.getValue().getTailInterceptor(); - if (tail != null) { - // HACK to relink the bridging interceptor - tail.setNext(interceptor); - } - } else { - entry.getValue().addInterceptor(0, interceptor); - } - - } - } - } - - private Operation getTargetOperation(Set> operations, String operationName) { - for (Operation op : operations) { - if (op.getName().equals(operationName)) { - return op; - } - } - return null; - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataTypeLoader.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataTypeLoader.java deleted file mode 100644 index 10731f8c53..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DataTypeLoader.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.core.databinding.impl; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.component.CompositeComponent; -import org.apache.tuscany.spi.deployer.DeploymentContext; -import org.apache.tuscany.spi.extension.LoaderExtension; -import org.apache.tuscany.spi.loader.InvalidValueException; -import org.apache.tuscany.spi.loader.LoaderException; -import org.apache.tuscany.spi.loader.LoaderRegistry; -import org.apache.tuscany.spi.loader.LoaderUtil; -import org.apache.tuscany.spi.model.DataType; -import org.apache.tuscany.spi.model.ModelObject; - -import org.osoa.sca.annotations.Constructor; - -/** - * The StAX loader for data type - */ -public class DataTypeLoader extends LoaderExtension { - public static final QName DATA_BINDING = - new QName("http://tuscany.apache.org/xmlns/sca/databinding/1.0", "databinding"); - - @Constructor({"registry"}) - public DataTypeLoader(@Autowire LoaderRegistry registry) { - super(registry); - } - - @Override - public QName getXMLType() { - return DATA_BINDING; - } - - public DataType load(CompositeComponent parent, - ModelObject object, XMLStreamReader reader, - DeploymentContext deploymentContext) throws XMLStreamException, LoaderException { - assert DATA_BINDING.equals(reader.getName()); - String name = reader.getAttributeValue(null, "name"); - LoaderUtil.skipToEndElement(reader); - if (name == null) { - throw new InvalidValueException("The 'name' attrbiute is required"); - } - DataType dataType = new DataType(name, Object.class, Object.class); - return dataType; - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DirectedGraph.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/DirectedGraph.java deleted file mode 100755 index 02adf5860c..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/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.core.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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/Exception2ExceptionTransformer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/Exception2ExceptionTransformer.java deleted file mode 100644 index d1ef0cbd1a..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/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.impl; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.databinding.DataBinding; -import org.apache.tuscany.spi.databinding.ExceptionHandler; -import org.apache.tuscany.spi.databinding.Mediator; -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.apache.tuscany.spi.model.DataType; -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 TransformerExtension 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 - */ - @Autowire - public void setMediator(Mediator mediator) { - this.mediator = mediator; - } - - /** - * @see org.apache.tuscany.spi.databinding.extension.TransformerExtension#getSourceType() - */ - @Override - protected Class getSourceType() { - return Exception.class; - } - - /** - * @see org.apache.tuscany.spi.databinding.extension.TransformerExtension#getTargetType() - */ - @Override - protected Class getTargetType() { - return Exception.class; - } - - /** - * @see org.apache.tuscany.spi.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.getDataBindingRegistry().getDataBinding(targetFaultType.getDataBinding()); - if (targetDataBinding == null) { - return null; - } - ExceptionHandler targetHandler = targetDataBinding.getExceptionHandler(); - return targetHandler; - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/Group2GroupTransformer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/Group2GroupTransformer.java deleted file mode 100644 index c774336f4c..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/Group2GroupTransformer.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.core.databinding.impl; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.databinding.Mediator; -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.apache.tuscany.spi.model.DataType; -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 Group2GroupTransformer extends TransformerExtension implements - PullTransformer { - - protected Mediator mediator; - - /** - * @param wrapperHandler - */ - public Group2GroupTransformer() { - super(); - } - - /** - * @param mediator the mediator to set - */ - @Autowire - 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.spi.databinding.extension.TransformerExtension#getSourceType() - */ - @Override - protected Class getSourceType() { - return Object.class; - } - - /** - * @see org.apache.tuscany.spi.databinding.extension.TransformerExtension#getTargetType() - */ - @Override - protected Class getTargetType() { - return Object.class; - } - - /** - * @see org.apache.tuscany.spi.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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/GroupDataBinding.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/GroupDataBinding.java deleted file mode 100644 index 6f56fbc2d5..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/GroupDataBinding.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.core.databinding.impl; - -import java.lang.annotation.Annotation; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; - -import org.apache.tuscany.spi.databinding.extension.DataBindingExtension; -import org.apache.tuscany.spi.model.DataType; - -/** - * The base class for a special databinding which represents a group of other databindings - * - * @version $Rev$ $Date$ - */ -public abstract class GroupDataBinding extends DataBindingExtension { - 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/Input2InputTransformer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/Input2InputTransformer.java deleted file mode 100644 index 3f3f49f0b8..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/Input2InputTransformer.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.impl; - -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.databinding.DataBinding; -import org.apache.tuscany.spi.databinding.Mediator; -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.WrapperHandler; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.apache.tuscany.spi.idl.ElementInfo; -import org.apache.tuscany.spi.idl.XMLType; -import org.apache.tuscany.spi.model.DataType; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.model.WrapperInfo; -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 TransformerExtension 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 - */ - @Autowire - public void setMediator(Mediator mediator) { - this.mediator = mediator; - } - - /** - * @see org.apache.tuscany.spi.databinding.extension.TransformerExtension#getSourceType() - */ - @Override - protected Class getSourceType() { - return Object[].class; - } - - /** - * @see org.apache.tuscany.spi.databinding.extension.TransformerExtension#getTargetType() - */ - @Override - protected Class getTargetType() { - return Object[].class; - } - - /** - * @see org.apache.tuscany.spi.databinding.Transformer#getWeight() - */ - public int getWeight() { - return 10000; - } - - @SuppressWarnings("unchecked") - public Object[] transform(Object[] source, TransformationContext context) { - DataType>> sourceType = context.getSourceDataType(); - Operation sourceOp = (Operation)sourceType.getOperation(); - boolean sourceWrapped = sourceOp != null && sourceOp.isWrapperStyle(); - - WrapperHandler sourceWrapperHandler = null; - if (sourceWrapped) { - sourceWrapperHandler = getWapperHandler(sourceType.getOperation().getDataBinding(), true); - } - - DataType>> targetType = context.getTargetDataType(); - Operation targetOp = (Operation)targetType.getOperation(); - boolean targetWrapped = targetOp != null && targetOp.isWrapperStyle(); - WrapperHandler targetWrapperHandler = null; - if (targetWrapped) { - targetWrapperHandler = getWapperHandler(targetType.getOperation().getDataBinding(), 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 = getWapperHandler(targetType.getOperation().getDataBinding(), false); - if (targetWrapperHandler != null) { - ElementInfo wrapperElement = sourceOp.getWrapper().getInputWrapperElement(); - // Object targetWrapper = - // targetWrapperHandler.create(wrapperElement, context); - DataType targetWrapperType = - new DataType(targetType.getOperation().getDataBinding(), 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 getWapperHandler(String dataBindingId, boolean required) { - DataBinding dataBinding = mediator.getDataBindingRegistry().getDataBinding(dataBindingId); - WrapperHandler wrapperHandler = dataBinding == null ? null : dataBinding.getWrapperHandler(); - if (wrapperHandler == null && required) { - throw new TransformationException( - "No wrapper handler is provided for databinding: " + dataBindingId); - } - return wrapperHandler; - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/MediatorImpl.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/MediatorImpl.java deleted file mode 100644 index 2b6d871472..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/MediatorImpl.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.impl; - -import java.util.List; -import java.util.Map; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.databinding.DataBindingRegistry; -import org.apache.tuscany.spi.databinding.DataPipe; -import org.apache.tuscany.spi.databinding.Mediator; -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.PushTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.TransformerRegistry; -import org.apache.tuscany.spi.model.DataType; -import org.osoa.sca.annotations.Scope; - -/** - * Default Mediator implementation - */ -@Scope("COMPOSITE") -public class MediatorImpl implements Mediator { - - private DataBindingRegistry dataBindingRegistry; - - private TransformerRegistry transformerRegistry; - - @Autowire - public void setTransformerRegistry(TransformerRegistry transformerRegistry) { - this.transformerRegistry = transformerRegistry; - } - - /** - * @param dataBindingRegistry the dataBindingRegistry to set - */ - @Autowire - public void setDataBindingRegistry(DataBindingRegistry dataBindingRegistry) { - this.dataBindingRegistry = dataBindingRegistry; - } - - /** - * @see org.apache.tuscany.spi.databinding.Mediator#mediate(java.lang.Object, - * org.apache.tuscany.spi.model.DataType, - * org.apache.tuscany.spi.model.DataType, Map) - */ - @SuppressWarnings("unchecked") - public Object mediate(Object source, - DataType sourceDataType, - DataType targetDataType, - Map, Object> metadata) { - if (sourceDataType == null) { - sourceDataType = dataBindingRegistry.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, Object> metadata) { - DataType sourceType = - (index == 0) ? sourceDataType : new DataType(transformer.getSourceDataBinding(), - Object.class, null); - DataType targetType = - (index == size - 1) ? targetDataType : new DataType(transformer.getTargetDataBinding(), - Object.class, null); - 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, Object> metadata) { - if (source == null) { - // Shortcut for null value - return; - } - if (sourceDataType == null) { - sourceDataType = dataBindingRegistry.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 = transformerRegistry.getTransformerChain(sourceId, targetId); - if (path == null) { - TransformationException ex = new TransformationException("No path found for the transformation"); - ex.addContextName("Source: " + sourceId); - ex.addContextName("Target: " + targetId); - throw ex; - } - return path; - } - - /** - * @return the dataBindingRegistry - */ - public DataBindingRegistry getDataBindingRegistry() { - return dataBindingRegistry; - } - - /** - * @return the transformerRegistry - */ - public TransformerRegistry getTransformerRegistry() { - return transformerRegistry; - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/Output2OutputTransformer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/Output2OutputTransformer.java deleted file mode 100644 index ef5798511a..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/Output2OutputTransformer.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.impl; - -import java.util.List; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.databinding.DataBinding; -import org.apache.tuscany.spi.databinding.Mediator; -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.WrapperHandler; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.apache.tuscany.spi.idl.ElementInfo; -import org.apache.tuscany.spi.idl.XMLType; -import org.apache.tuscany.spi.model.DataType; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.model.WrapperInfo; -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 TransformerExtension implements - PullTransformer { - - protected Mediator mediator; - - /** - * @param wrapperHandler - */ - public Output2OutputTransformer() { - super(); - } - - /** - * @param mediator the mediator to set - */ - @Autowire - 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.spi.databinding.extension.TransformerExtension#getSourceType() - */ - @Override - protected Class getSourceType() { - return Object.class; - } - - /** - * @see org.apache.tuscany.spi.databinding.extension.TransformerExtension#getTargetType() - */ - @Override - protected Class getTargetType() { - return Object.class; - } - - /** - * @see org.apache.tuscany.spi.databinding.Transformer#getWeight() - */ - public int getWeight() { - return 10; - } - - private WrapperHandler getWapperHandler(Operation operation) { - String dataBindingId; - dataBindingId = operation.getDataBinding(); - DataBinding dataBinding = mediator.getDataBindingRegistry().getDataBinding(dataBindingId); - WrapperHandler wrapperHandler = dataBinding == null ? null : dataBinding.getWrapperHandler(); - if (wrapperHandler == null) { - throw new TransformationException( - "No wrapper handler is provided for databinding: " + dataBindingId); - } - return wrapperHandler; - } - - private WrapperHandler getWapperHandler(String dataBindingId) { - DataBinding dataBinding = mediator.getDataBindingRegistry().getDataBinding(dataBindingId); - return dataBinding == null ? null : dataBinding.getWrapperHandler(); - } - - @SuppressWarnings("unchecked") - public Object transform(Object response, TransformationContext context) { - try { - DataType sourceType = context.getSourceDataType(); - Operation sourceOp = (Operation)sourceType.getOperation(); - boolean sourceWrapped = sourceOp != null && sourceOp.isWrapperStyle(); - WrapperHandler sourceWrapperHandler = null; - if (sourceWrapped) { - sourceWrapperHandler = getWapperHandler(sourceOp); - } - - DataType targetType = context.getTargetDataType(); - Operation targetOp = (Operation)targetType.getOperation(); - boolean targetWrapped = targetOp != null && targetOp.isWrapperStyle(); - WrapperHandler targetWrapperHandler = null; - if (targetWrapped) { - targetWrapperHandler = getWapperHandler(targetOp); - } - - 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 = getWapperHandler(targetType.getLogical().getDataBinding()); - if (targetWrapperHandler != null) { - ElementInfo wrapperElement = sourceOp.getWrapper().getInputWrapperElement(); - // Object targetWrapper = - // targetWrapperHandler.create(wrapperElement, context); - DataType targetWrapperType = - new DataType(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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueInterceptor.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueInterceptor.java deleted file mode 100644 index c891ff7a61..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueInterceptor.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.impl; - -import java.util.IdentityHashMap; -import java.util.Map; - -import org.apache.tuscany.spi.databinding.DataBinding; -import org.apache.tuscany.spi.databinding.DataBindingRegistry; -import org.apache.tuscany.spi.model.DataType; -import org.apache.tuscany.spi.wire.Interceptor; -import org.apache.tuscany.spi.wire.Message; - -/** - * An interceptor to enforce pass-by-value semantics for remotable interfaces - * - * @version $Rev$ $Date$ - */ -public class PassByValueInterceptor implements Interceptor { - private DataBindingRegistry registry; - private DataBinding[] parameterDatabindings; - private DataBinding resultDataBinding; - - private Interceptor next; - - public PassByValueInterceptor(DataBindingRegistry registry) { - this.registry = registry; - } - - public Interceptor getNext() { - return next; - } - - public boolean isOptimizable() { - return false; - } - - public void setNext(Interceptor next) { - this.next = next; - } - - public Message invoke(Message msg) { - Object obj = msg.getBody(); - msg.setBody(copy((Object[])obj)); - Message result = getNext().invoke(msg); - - if (!result.isFault()) { - result.setBody(copy(result.getBody(), getResultDataBinding())); - } - return result; - } - - public Object[] copy(Object[] args) { - if (args == null) { - return null; - } - Object[] copiedArgs = new Object[args.length]; - Map map = new IdentityHashMap(); - for (int i = 0; i < args.length; i++) { - if (args[i] == null) { - copiedArgs[i] = null; - } else { - Object copiedArg = map.get(args[i]); - if (copiedArg != null) { - copiedArgs[i] = copiedArg; - } else { - DataBinding dataBinding = - (getParameterDatabindings() != null) ? getParameterDatabindings()[i] : null; - copiedArg = copy(args[i], dataBinding); - map.put(args[i], copiedArg); - copiedArgs[i] = copiedArg; - } - } - } - return copiedArgs; - } - - public Object copy(Object arg, DataBinding argDataBinding) { - if (arg == null) { - return null; - } - Object copiedArg; - if (argDataBinding != null) { - copiedArg = argDataBinding.copy(arg); - } else { - copiedArg = arg; - DataType dataType = registry.introspectType(arg); - if (dataType != null) { - DataBinding binding = registry.getDataBinding(dataType.getDataBinding()); - if (binding != null) { - copiedArg = binding.copy(arg); - } - } - // FIXME: What to do if it's not recognized? - } - return copiedArg; - } - - public DataBinding[] getParameterDatabindings() { - return parameterDatabindings; - } - - public void setParameterDatabindings(DataBinding[] dataBindings) { - this.parameterDatabindings = dataBindings; - } - - public DataBinding getResultDataBinding() { - return resultDataBinding; - } - - public void setResultDataBinding(DataBinding retDataBinding) { - this.resultDataBinding = retDataBinding; - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessor.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessor.java deleted file mode 100644 index a95b0ef073..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessor.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.impl; - -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.component.ReferenceBinding; -import org.apache.tuscany.spi.component.ServiceBinding; -import org.apache.tuscany.spi.databinding.DataBinding; -import org.apache.tuscany.spi.databinding.DataBindingRegistry; -import org.apache.tuscany.spi.extension.AtomicComponentExtension; -import org.apache.tuscany.spi.model.DataType; -import org.apache.tuscany.spi.model.Operation; -import org.apache.tuscany.spi.wire.InboundInvocationChain; -import org.apache.tuscany.spi.wire.InboundWire; -import org.apache.tuscany.spi.wire.OutboundWire; -import org.apache.tuscany.spi.wire.WirePostProcessorExtension; - -/** - * This processor is responsible for enforcing the pass-by-value semantics - * required of Remotable interfaces. This is done by adding a pass-by-value - * interceptor to the inbound invocation chain of a target if the target - * interface is Remotable. - * - * @version $Rev$ $Date$ - */ -public class PassByValueWirePostProcessor extends WirePostProcessorExtension { - - private DataBindingRegistry dataBindingRegistry; - - public PassByValueWirePostProcessor() { - super(); - } - - /** - * @param dataBindingRegistry the dataBindingRegistry to set - */ - @Autowire - public void setDataBindingRegistry(DataBindingRegistry dataBindingRegistry) { - this.dataBindingRegistry = dataBindingRegistry; - } - - public void process(OutboundWire source, InboundWire target) { - PassByValueInterceptor interceptor; - Operation targetOperation; - Operation sourceOperation; - DataBinding[] argsDataBindings; - DataBinding resultDataBinding; - - boolean implAllowsPBR = false; - boolean methodAllowsPBR = false; - - // if the source is a service binding or the target is a reference - // binding do no - // add interceptor since the bindings will ensure passbyvalue semantics - if (!(source.getContainer() instanceof ServiceBinding || target.getContainer() instanceof ReferenceBinding)) { - - if (target.getContainer() instanceof AtomicComponentExtension) { - implAllowsPBR = ((AtomicComponentExtension)target.getContainer()).isAllowsPassByReference(); - } - - Map, InboundInvocationChain> chains = target.getInvocationChains(); - for (Map.Entry, InboundInvocationChain> entry : chains.entrySet()) { - targetOperation = entry.getKey(); - methodAllowsPBR = false; - - if (target.getContainer() instanceof AtomicComponentExtension) { - methodAllowsPBR = - ((AtomicComponentExtension)target.getContainer()).getPassByReferenceMethods() - .contains(targetOperation.getName()); - } - - if (target.getServiceContract().isRemotable() && (!implAllowsPBR && !methodAllowsPBR)) { - sourceOperation = - getSourceOperation(source.getInvocationChains().keySet(), targetOperation.getName()); - - if (null != sourceOperation) { - argsDataBindings = getParameterDataBindings(sourceOperation); - resultDataBinding = getResultDataBinding(sourceOperation); - interceptor = new PassByValueInterceptor(dataBindingRegistry); - interceptor.setParameterDatabindings(argsDataBindings); - interceptor.setResultDataBinding(resultDataBinding); - source.getInvocationChains().get(sourceOperation).addInterceptor(0, interceptor); - /* - * tailInterceptor = - * source.getInvocationChains().get(sourceOperation).getTailInterceptor(); - * if (tailInterceptor != null) { - * tailInterceptor.setNext(passByValueInterceptor); } - */ - } - } - } - - // Check if there's a callback - Map callbackOperations = source.getServiceContract().getCallbackOperations(); - implAllowsPBR = false; - - if (callbackOperations != null && !callbackOperations.isEmpty()) { - if (source.getContainer() instanceof AtomicComponentExtension) { - implAllowsPBR = ((AtomicComponentExtension)source.getContainer()).isAllowsPassByReference(); - } - - Object targetAddress = source.getContainer().getName(); - Map, InboundInvocationChain> callbackChains = source.getTargetCallbackInvocationChains(); - for (Map.Entry, InboundInvocationChain> entry : callbackChains.entrySet()) { - targetOperation = entry.getKey(); - methodAllowsPBR = false; - - if (source.getContainer() instanceof AtomicComponentExtension) { - methodAllowsPBR = - ((AtomicComponentExtension)source.getContainer()).getPassByReferenceMethods() - .contains(targetOperation.getName()); - } - - if (source.getServiceContract().isRemotable() && (!implAllowsPBR && !methodAllowsPBR)) { - sourceOperation = - getSourceOperation(target.getSourceCallbackInvocationChains(targetAddress).keySet(), - targetOperation.getName()); - - argsDataBindings = getParameterDataBindings(targetOperation); - resultDataBinding = getResultDataBinding(targetOperation); - - interceptor = new PassByValueInterceptor(dataBindingRegistry); - interceptor.setParameterDatabindings(argsDataBindings); - interceptor.setResultDataBinding(resultDataBinding); - - entry.getValue().addInterceptor(0, interceptor); - /* - * tailInterceptor = - * target.getSourceCallbackInvocationChains(targetAddress).get(sourceOperation) - * .getTailInterceptor(); if (tailInterceptor != null) { - * tailInterceptor.setNext(passByValueInterceptor); } - */ - } - } - } - } - } - - public void process(InboundWire source, OutboundWire target) { - // to be done if required.. - } - - private Operation getSourceOperation(Set> operations, String operationName) { - for (Operation op : operations) { - if (op.getName().equals(operationName)) { - return op; - } - } - return null; - } - - @SuppressWarnings("unchecked") - private DataBinding[] getParameterDataBindings(Operation operation) { - List> argumentTypes = (List>)operation.getInputType().getLogical(); - DataBinding[] argDataBindings = new DataBinding[argumentTypes.size()]; - int count = 0; - for (DataType argType : argumentTypes) { - argDataBindings[count++] = dataBindingRegistry.getDataBinding(argType.getDataBinding()); - } - return argDataBindings; - } - - private DataBinding getResultDataBinding(Operation operation) { - DataType resultType = (DataType)operation.getOutputType(); - return dataBindingRegistry.getDataBinding(resultType.getDataBinding()); - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PipedTransformer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PipedTransformer.java deleted file mode 100755 index 388ea710a7..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/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.core.databinding.impl; - -import org.apache.tuscany.spi.databinding.DataPipe; -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.PushTransformer; -import org.apache.tuscany.spi.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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/SimpleDataBinding.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/SimpleDataBinding.java deleted file mode 100644 index b1550c9f0a..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/SimpleDataBinding.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.core.databinding.impl; - -import org.osoa.sca.annotations.Property; - -import org.apache.tuscany.spi.databinding.extension.DataBindingExtension; -import org.apache.tuscany.spi.loader.MissingResourceException; - -/** - * Simple databinding represented by a base java type. A SCDL property className is used to customize this component. - *

- * The following illustrates how a simple data binding can be registered as a SCA component. - *

- *

- * <component name="databinding.MyDataBinding">
- *   <system:implementation.java - * class="org.apache.tuscany.databinding.impl.SimpleDataBinding"/>
- *   <property name="className">my.Type</property>
- * </component> - *
- * - * @version $Rv$ $Date$ - */ -public class SimpleDataBinding extends DataBindingExtension { - - public SimpleDataBinding(@Property(name = "className")String className) throws MissingResourceException { - super(resolve(className)); - } - - private static Class resolve(String className) throws MissingResourceException { - ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); - try { - return Class.forName(className, false, classLoader); - } catch (ClassNotFoundException e) { - classLoader = SimpleDataBinding.class.getClassLoader(); - try { - return Class.forName(className, false, classLoader); - } catch (ClassNotFoundException e1) { - throw new MissingResourceException(className, e1); - } - } - } -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/TransformationContextImpl.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/TransformationContextImpl.java deleted file mode 100755 index 47f340097b..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/TransformationContextImpl.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.impl; - -import java.lang.ref.WeakReference; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.model.DataType; - -public class TransformationContextImpl implements TransformationContext { - private DataType sourceDataType; - - private DataType targetDataType; - - private final Map, Object> metadata = new HashMap, Object>(); - - private WeakReference classLoaderRef; - - public TransformationContextImpl() { - super(); - setClassLoader(Thread.currentThread().getContextClassLoader()); - } - - public TransformationContextImpl(DataType sourceDataType, - DataType targetDataType, - ClassLoader classLoader, - Map, Object> 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, Object> getMetadata() { - return metadata; - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/TransformerRegistryImpl.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/TransformerRegistryImpl.java deleted file mode 100755 index 6f5c6d0e73..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/TransformerRegistryImpl.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.core.databinding.impl; - -import java.util.ArrayList; -import java.util.List; - -import org.osoa.sca.annotations.EagerInit; - -import org.apache.tuscany.spi.annotation.Autowire; -import org.apache.tuscany.spi.databinding.DataBinding; -import org.apache.tuscany.spi.databinding.DataBindingRegistry; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.TransformerRegistry; - -/** - * @version $Rev$ $Date$ - */ -@EagerInit -public class TransformerRegistryImpl implements TransformerRegistry { - private DataBindingRegistry dataBindingRegistry; - - private final DirectedGraph graph = new DirectedGraph(); - - public void registerTransformer(String sourceType, String resultType, int weight, Transformer transformer) { - graph.addEdge(sourceType, resultType, transformer, weight); - } - - public void registerTransformer(Transformer transformer) { - graph.addEdge(transformer.getSourceDataBinding(), - transformer.getTargetDataBinding(), - transformer, - transformer.getWeight()); - } - - public boolean unregisterTransformer(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(); - } - - /** - * @param dataBindingRegistry the dataBindingRegistry to set - */ - @Autowire - public void setDataBindingRegistry(DataBindingRegistry dataBindingRegistry) { - this.dataBindingRegistry = dataBindingRegistry; - } - - /** - * Normalize the id to a name of a data binding as databindings may have aliases - * @param id - * @return - */ - private String normalize(String id) { - if (dataBindingRegistry != null) { - DataBinding dataBinding = dataBindingRegistry.getDataBinding(id); - return dataBinding == null ? id : dataBinding.getName(); - } else { - return id; - } - } - -} diff --git a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/DOMNode2JavaBeanTransformer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/DOMNode2JavaBeanTransformer.java deleted file mode 100644 index 80f9fa04da..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/DOMNode2JavaBeanTransformer.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.core.databinding.javabeans; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tuscany.spi.databinding.Transformer; -import org.osoa.sca.annotations.Service; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * Transformer to convert data from DOM Node to JavaBean - */ -@Service(Transformer.class) -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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/Java2XMLMapperException.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/Java2XMLMapperException.java deleted file mode 100644 index 3f88a4ee89..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/Java2XMLMapperException.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.core.databinding.javabeans; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.api.TuscanyRuntimeException; - -/** - * This exception is used to encapsulate and rethrow exceptions that arise out - * of converting JavaBean objects to XML - */ -public class Java2XMLMapperException extends TuscanyRuntimeException { - 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/JavaBean2DOMNodeTransformer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/JavaBean2DOMNodeTransformer.java deleted file mode 100644 index 5925e87b69..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/JavaBean2DOMNodeTransformer.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.core.databinding.javabeans; - -import javax.xml.namespace.QName; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.DOMHelper; -import org.osoa.sca.annotations.Service; -import org.w3c.dom.Document; -import org.w3c.dom.Node; - -/** - * Transformer to convert data from a JavaBean object to DOM Node - */ -@Service(Transformer.class) -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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/JavaBean2XMLStreamReader.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/JavaBean2XMLStreamReader.java deleted file mode 100644 index 770c8e7254..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/JavaBean2XMLStreamReader.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.core.databinding.javabeans; - -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.core.databinding.xml.BeanUtil; -import org.apache.tuscany.core.databinding.xml.XMLDocumentStreamReader; -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; - -@Service(Transformer.class) -public class JavaBean2XMLStreamReader extends TransformerExtension 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/JavaBean2XMLTransformer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/JavaBean2XMLTransformer.java deleted file mode 100644 index c0199eee95..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/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.core.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.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.SimpleTypeMapperExtension; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; - -/** - * Transformer to convert data from a JavaBean object to xml - */ -@Service(Transformer.class) -public abstract class JavaBean2XMLTransformer extends TransformerExtension 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 SimpleTypeMapperExtension mapper; - - public JavaBean2XMLTransformer() { - this.mapper = new SimpleTypeMapperExtension(); - } - - public T transform(Object source, TransformationContext context) { - QName rootElementName = (QName)context.getTargetDataType().getMetadata("RootElementName"); - if (rootElementName == null) { - 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/JavaBeansDataBinding.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/JavaBeansDataBinding.java deleted file mode 100644 index 58c3728202..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/JavaBeansDataBinding.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.core.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.spi.databinding.DataBinding; -import org.apache.tuscany.spi.databinding.extension.DataBindingExtension; -import org.osoa.sca.annotations.Service; - -/** - * DataBinding for JavaBeans - */ -@Service(DataBinding.class) -public class JavaBeansDataBinding extends DataBindingExtension { - /** - * 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/XML2JavaBeanTransformer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/XML2JavaBeanTransformer.java deleted file mode 100644 index 2013502851..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/XML2JavaBeanTransformer.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.core.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.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.SimpleTypeMapperExtension; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.apache.tuscany.spi.idl.ElementInfo; -import org.apache.tuscany.spi.idl.TypeInfo; -import org.apache.tuscany.spi.idl.XMLType; -import org.osoa.sca.annotations.Service; - -/** - * Transformer to convert data from XML to JavaBean - */ -@Service(Transformer.class) -public abstract class XML2JavaBeanTransformer extends TransformerExtension implements - PullTransformer { - - public static final String SET = "set"; - - protected SimpleTypeMapperExtension mapper; - - public XML2JavaBeanTransformer() { - this.mapper = new SimpleTypeMapperExtension(); - } - - @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 (SimpleTypeMapperExtension.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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/XML2JavaMapperException.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/XML2JavaMapperException.java deleted file mode 100644 index dfdd54084b..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/javabeans/XML2JavaMapperException.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.core.databinding.javabeans; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.api.TuscanyRuntimeException; - -/** - * This exception is used to encapsulate and rethrow exceptions that arise out - * of converting XML Data to Java Objects. - */ -public class XML2JavaMapperException extends TuscanyRuntimeException { - 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/BeanUtil.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/BeanUtil.java deleted file mode 100644 index 34e3e07843..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/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.core.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.spi.databinding.extension.SimpleTypeMapperExtension; -import org.apache.tuscany.spi.idl.TypeInfo; - -public final class BeanUtil { - private static final Object[] NULL = (Object[])null; - private static int nsCount = 1; - - private static final SimpleTypeMapperExtension MAPPER = new SimpleTypeMapperExtension(); - - 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/DOMDataBinding.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/DOMDataBinding.java deleted file mode 100644 index a3f13663bc..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/DOMDataBinding.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.core.databinding.xml; - - -import org.w3c.dom.Node; - -import org.apache.tuscany.spi.databinding.WrapperHandler; -import org.apache.tuscany.spi.databinding.extension.DataBindingExtension; - -/** - * DOM DataBinding - * - * @version $Rev$ $Date$ - */ -public class DOMDataBinding extends DataBindingExtension { - 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/DOMWrapperHandler.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/DOMWrapperHandler.java deleted file mode 100644 index 6aac20e98f..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/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.core.databinding.xml; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.WrapperHandler; -import org.apache.tuscany.spi.databinding.extension.DOMHelper; -import org.apache.tuscany.spi.idl.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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/DOMXMLStreamReader.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/DOMXMLStreamReader.java deleted file mode 100644 index 39adcf332d..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/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.core.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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/DelegatingNamespaceContext.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/DelegatingNamespaceContext.java deleted file mode 100644 index 1edc52c089..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/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.core.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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/InputSource2Node.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/InputSource2Node.java deleted file mode 100644 index e9757fa13c..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/InputSource2Node.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.core.databinding.xml; - -import javax.xml.transform.Source; -import javax.xml.transform.dom.DOMResult; -import javax.xml.transform.stream.StreamSource; - -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; -import org.w3c.dom.Node; -import org.xml.sax.InputSource; - -/** - * Push DOM InputSource to Node - */ -@Service(Transformer.class) -public class InputSource2Node extends TransformerExtension 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/InputSource2SAX.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/InputSource2SAX.java deleted file mode 100644 index be78a07ede..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/InputSource2SAX.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.core.databinding.xml; - -import org.apache.tuscany.spi.databinding.PushTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; -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 - */ -@Service(Transformer.class) -public class InputSource2SAX extends TransformerExtension 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/InputStream2Node.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/InputStream2Node.java deleted file mode 100644 index e103c82b33..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/InputStream2Node.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.core.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.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; -import org.w3c.dom.Node; -import org.xml.sax.InputSource; - -/** - * Push DOM InputSource to Node - */ -@Service(Transformer.class) -public class InputStream2Node extends TransformerExtension 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/InputStream2SAX.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/InputStream2SAX.java deleted file mode 100644 index d74863ea95..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/InputStream2SAX.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.core.databinding.xml; - -import java.io.InputStream; - -import org.apache.tuscany.spi.databinding.PushTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; -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 - */ -@Service(Transformer.class) -public class InputStream2SAX extends TransformerExtension 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/NameValueArrayStreamReader.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/NameValueArrayStreamReader.java deleted file mode 100644 index d10af29b35..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/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.core.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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/NameValuePairStreamReader.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/NameValuePairStreamReader.java deleted file mode 100644 index d9261b8b4f..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/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.core.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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/NamedProperty.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/NamedProperty.java deleted file mode 100644 index 0ce249e912..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/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.core.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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/NilElementStreamReader.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/NilElementStreamReader.java deleted file mode 100644 index 8a454c8342..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/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.core.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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Node2OutputStream.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Node2OutputStream.java deleted file mode 100644 index 34fbdf8c6f..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Node2OutputStream.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.core.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.spi.databinding.PushTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; -import org.w3c.dom.Node; - -/** - * Push DOM Node to OutputStream - */ -@Service(Transformer.class) -public class Node2OutputStream extends TransformerExtension 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Node2String.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Node2String.java deleted file mode 100755 index 92378e96a3..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Node2String.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.core.databinding.xml; - -import java.io.StringWriter; - -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; -import org.w3c.dom.Node; - -/** - * Transform DOM Node to XML String - */ -@Service(org.apache.tuscany.spi.databinding.Transformer.class) -public class Node2String extends TransformerExtension 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Node2Writer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Node2Writer.java deleted file mode 100644 index 96328fdd2f..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Node2Writer.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.core.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.spi.databinding.PushTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; -import org.w3c.dom.Node; - -/** - * Push DOM Node to Writer - */ -@Service(Transformer.class) -public class Node2Writer extends TransformerExtension 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Node2XMLStreamReader.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Node2XMLStreamReader.java deleted file mode 100644 index 0c75826ffa..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Node2XMLStreamReader.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.core.databinding.xml; - -import javax.xml.stream.XMLStreamReader; - -import org.apache.tuscany.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; -import org.w3c.dom.Node; - -/** - * Transform DOM Node to XML XMLStreamReader - */ -@Service(Transformer.class) -public class Node2XMLStreamReader extends TransformerExtension 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Reader2Node.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Reader2Node.java deleted file mode 100644 index 02de055c35..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Reader2Node.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.core.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.spi.databinding.PullTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; -import org.w3c.dom.Node; - -/** - * Push DOM Reader to Node - */ -@Service(Transformer.class) -public class Reader2Node extends TransformerExtension 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Reader2SAX.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Reader2SAX.java deleted file mode 100644 index 0a4504b3de..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Reader2SAX.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.core.databinding.xml; - -import java.io.Reader; - -import org.apache.tuscany.spi.databinding.PushTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; -import org.xml.sax.ContentHandler; -import org.xml.sax.InputSource; - -/** - * Transform XML string to SAX - */ -@Service(Transformer.class) -public class Reader2SAX extends TransformerExtension 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/SAX2DOM.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/SAX2DOM.java deleted file mode 100644 index 8f8f0f952e..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/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.core.databinding.xml; - -import java.util.ArrayList; -import java.util.List; -import java.util.Stack; - -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.tuscany.spi.databinding.extension.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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/SAX2DOMPipe.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/SAX2DOMPipe.java deleted file mode 100644 index 79118b4a2c..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/SAX2DOMPipe.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.core.databinding.xml; - -import javax.xml.parsers.ParserConfigurationException; - -import org.apache.tuscany.spi.databinding.DataPipe; -import org.apache.tuscany.spi.databinding.Transformer; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; -import org.w3c.dom.Node; -import org.xml.sax.ContentHandler; - -@Service(Transformer.class) -public class SAX2DOMPipe extends TransformerExtension 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Source2ResultTransformer.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Source2ResultTransformer.java deleted file mode 100755 index 7db14efb39..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/Source2ResultTransformer.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.core.databinding.xml; - -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.TransformerFactory; - -import org.apache.tuscany.spi.databinding.PushTransformer; -import org.apache.tuscany.spi.databinding.TransformationContext; -import org.apache.tuscany.spi.databinding.TransformationException; -import org.apache.tuscany.spi.databinding.extension.TransformerExtension; -import org.osoa.sca.annotations.Service; - -/** - * Transform TrAX Source to Result - */ -@Service(org.apache.tuscany.spi.databinding.Transformer.class) -public class Source2ResultTransformer extends TransformerExtension 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-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/StAX2SAXAdapter.java b/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/xml/StAX2SAXAdapter.java deleted file mode 100644 index 63fa53edb4..0000000000 --- a/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/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.core.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: - *