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 - 502 files changed, 55261 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 (limited to 'branches/sca-java-integration/sca/extensions') 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 - - - -- cgit v1.2.3