summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-07-21 07:03:47 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-07-21 07:03:47 +0000
commitab6904bc2f622129bc548391745b08eb0c219e57 (patch)
tree5c7599119182bfa8e65c0d6605e933396aedffd2 /java
parent8d70ef6d556ad29b93d5d40e91c4c9304638c9e9 (diff)
Fix svn:eol-style and svn:keywords properties for java/xml files
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@796166 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--java/sca/archetypes/contribution-jar/pom.xml100
-rw-r--r--java/sca/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype-metadata.xml70
-rw-r--r--java/sca/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype.xml58
-rw-r--r--java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml218
-rw-r--r--java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java72
-rw-r--r--java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldService.java56
-rw-r--r--java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml44
-rw-r--r--java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/helloworld.composite58
-rw-r--r--java/sca/archetypes/contribution-zip-discriptor/pom.xml66
-rw-r--r--java/sca/archetypes/contribution-zip-discriptor/src/main/resources/assemblies/tuscany-zip-contribution.xml80
-rw-r--r--java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java76
-rw-r--r--java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java50
-rw-r--r--java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite58
-rw-r--r--java/sca/archetypes/pom.xml102
-rw-r--r--java/sca/archetypes/quickstart-bpel/pom.xml100
-rw-r--r--java/sca/archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype-metadata.xml84
-rw-r--r--java/sca/archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype.xml64
-rw-r--r--java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/pom.xml362
-rw-r--r--java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/java/HelloworldService.java56
-rw-r--r--java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/resources/helloworld.wsdl162
-rw-r--r--java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite74
-rw-r--r--java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml82
-rw-r--r--java/sca/archetypes/quickstart-jsf/pom.xml100
-rw-r--r--java/sca/archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype-metadata.xml86
-rw-r--r--java/sca/archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype.xml74
-rw-r--r--java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/pom.xml308
-rw-r--r--java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/myfaces/HelloWorldController.java126
-rw-r--r--java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java56
-rw-r--r--java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java60
-rw-r--r--java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml104
-rw-r--r--java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite70
-rw-r--r--java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml460
-rw-r--r--java/sca/archetypes/quickstart-stripes/pom.xml100
-rw-r--r--java/sca/archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype-metadata.xml86
-rw-r--r--java/sca/archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype.xml74
-rw-r--r--java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/pom.xml248
-rw-r--r--java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java56
-rw-r--r--java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java62
-rw-r--r--java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/BaseActionBean.java72
-rw-r--r--java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/HomeActionBean.java96
-rw-r--r--java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/StripesResources.properties154
-rw-r--r--java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/log4j.properties102
-rw-r--r--java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite68
-rw-r--r--java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml136
-rw-r--r--java/sca/archetypes/quickstart/pom.xml100
-rw-r--r--java/sca/archetypes/quickstart/src/main/resources/META-INF/maven/archetype-metadata.xml82
-rw-r--r--java/sca/archetypes/quickstart/src/main/resources/META-INF/maven/archetype.xml60
-rw-r--r--java/sca/archetypes/quickstart/src/main/resources/archetype-resources/pom.xml284
-rw-r--r--java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java54
-rw-r--r--java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldService.java50
-rw-r--r--java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite68
-rw-r--r--java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml86
-rw-r--r--java/sca/distribution/all/pom.xml230
-rw-r--r--java/sca/distribution/all/src/main/assembly/bin.xml72
-rw-r--r--java/sca/distribution/all/src/main/assembly/src.xml90
-rw-r--r--java/sca/distribution/all/src/main/components/bin-common.xml86
-rw-r--r--java/sca/distribution/all/src/main/components/bin-launcher.xml82
-rw-r--r--java/sca/distribution/all/src/main/components/bin-modules.xml66
-rw-r--r--java/sca/distribution/all/src/main/components/bin-samples.xml160
-rw-r--r--java/sca/distribution/tomcat/pom.xml78
-rw-r--r--java/sca/distribution/tomcat/testing/download-tomcat/pom.xml126
-rw-r--r--java/sca/distribution/tomcat/testing/helloworld-client-webapp/pom.xml94
-rw-r--r--java/sca/distribution/tomcat/testing/helloworld-client-webapp/src/main/java/testing/HelloworldService.java54
-rw-r--r--java/sca/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.composite60
-rw-r--r--java/sca/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.xml62
-rw-r--r--java/sca/distribution/tomcat/testing/helloworld-service-contribution/pom.xml90
-rw-r--r--java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldImpl.java72
-rw-r--r--java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldService.java50
-rw-r--r--java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/META-INF/sca-contribution.xml44
-rw-r--r--java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/helloworld.composite56
-rw-r--r--java/sca/distribution/tomcat/testing/legal-checks/pom.xml84
-rw-r--r--java/sca/distribution/tomcat/testing/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java294
-rw-r--r--java/sca/distribution/tomcat/testing/pom.xml76
-rw-r--r--java/sca/distribution/tomcat/tomcat-hook/pom.xml140
-rw-r--r--java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyAnnotationsProcessor.java170
-rw-r--r--java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyLifecycleListener.java340
-rw-r--r--java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java370
-rw-r--r--java/sca/distribution/tomcat/tomcat-servlet/pom.xml126
-rw-r--r--java/sca/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/tomcat/foo/TuscanyTomcatNode.java148
-rw-r--r--java/sca/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/war/Installer.java636
-rw-r--r--java/sca/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/war/InstallerServlet.java140
-rw-r--r--java/sca/distribution/tomcat/tomcat-war/pom.xml172
-rw-r--r--java/sca/distribution/tomcat/tomcat-war/src/main/assembly/war.xml188
-rw-r--r--java/sca/distribution/tomcat/tomcat-war/src/main/webapp/WEB-INF/web.xml80
-rw-r--r--java/sca/features/all/pom.xml182
-rw-r--r--java/sca/features/api/pom.xml102
-rw-r--r--java/sca/features/core/pom.xml508
-rw-r--r--java/sca/features/ejava/pom.xml266
-rw-r--r--java/sca/features/process/pom.xml114
-rw-r--r--java/sca/features/webapp/pom.xml162
-rw-r--r--java/sca/features/webservice/pom.xml266
-rw-r--r--java/sca/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite76
-rw-r--r--java/sca/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite62
-rw-r--r--java/sca/itest/component-type/src/main/resources/Calculator.composite98
-rw-r--r--java/sca/itest/contribution-folder/pom.xml92
-rw-r--r--java/sca/itest/contribution-folder/src/test/java/calculator/CalculatorService.java62
-rw-r--r--java/sca/itest/contribution-folder/src/test/java/test/ContributionFolderTestCase.java110
-rw-r--r--java/sca/itest/contribution-folder/src/test/resources/repository/folderWithJars/Calculator.composite98
-rw-r--r--java/sca/itest/contribution-folder/src/test/resources/repository/folderWithJars/META-INF/sca-contribution.xml44
-rw-r--r--java/sca/itest/contribution-import-export/export-composite/pom.xml134
-rw-r--r--java/sca/itest/contribution-import-export/export-composite/src/main/java/hello/Hello.java60
-rw-r--r--java/sca/itest/contribution-import-export/export-composite/src/main/java/hello/HelloImpl.java66
-rw-r--r--java/sca/itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml48
-rw-r--r--java/sca/itest/contribution-import-export/export-composite/src/main/resources/hello.composite62
-rw-r--r--java/sca/itest/contribution-import-export/export-composite/src/test/java/org/apache/tuscany/sca/test/contribution/HelloTestCase.java182
-rw-r--r--java/sca/itest/contribution-import-export/export-java/pom.xml134
-rw-r--r--java/sca/itest/contribution-import-export/export-java/src/main/java/helloworld/HelloWorldService.java60
-rw-r--r--java/sca/itest/contribution-import-export/export-java/src/main/resources/META-INF/sca-contribution.xml46
-rw-r--r--java/sca/itest/contribution-import-export/export-wsdl/pom.xml62
-rw-r--r--java/sca/itest/contribution-import-export/export-wsdl/src/main/resources/META-INF/sca-contribution.xml46
-rw-r--r--java/sca/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl152
-rw-r--r--java/sca/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd68
-rw-r--r--java/sca/itest/contribution-import-export/import-composite/pom.xml146
-rw-r--r--java/sca/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldImpl.java76
-rw-r--r--java/sca/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldServer.java92
-rw-r--r--java/sca/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldService.java60
-rw-r--r--java/sca/itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml52
-rw-r--r--java/sca/itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl152
-rw-r--r--java/sca/itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd68
-rw-r--r--java/sca/itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite78
-rw-r--r--java/sca/itest/contribution-import-export/import-composite/src/test/java/org/apache/tuscany/test/contribution/HelloWorldServerTestCase.java252
-rw-r--r--java/sca/itest/contribution-import-export/import-java/pom.xml146
-rw-r--r--java/sca/itest/contribution-import-export/import-java/src/main/java/helloworld/HelloWorldImpl.java66
-rw-r--r--java/sca/itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite58
-rw-r--r--java/sca/itest/contribution-import-export/import-java/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java254
-rw-r--r--java/sca/itest/contribution-import-export/import-wsdl/pom.xml146
-rw-r--r--java/sca/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldImpl.java66
-rw-r--r--java/sca/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldServer.java92
-rw-r--r--java/sca/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldService.java60
-rw-r--r--java/sca/itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml48
-rw-r--r--java/sca/itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite66
-rw-r--r--java/sca/itest/contribution-import-export/import-wsdl/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java274
-rw-r--r--java/sca/itest/contribution-import-export/pom.xml112
-rw-r--r--java/sca/itest/contribution-zip/pom.xml90
-rw-r--r--java/sca/itest/contribution-zip/src/test/java/calculator/CalculatorService.java62
-rw-r--r--java/sca/itest/distribution/bin-distro-unzip/build.xml48
-rw-r--r--java/sca/itest/distribution/binding-ws-calculator/build.xml80
-rw-r--r--java/sca/itest/distribution/binding-ws-calculator/pom.xml164
-rw-r--r--java/sca/itest/distribution/calculator-rmi/build.xml102
-rw-r--r--java/sca/itest/distribution/calculator-rmi/pom.xml162
-rw-r--r--java/sca/itest/distribution/implementation-java-calculator/build.xml80
-rw-r--r--java/sca/itest/distribution/implementation-java-calculator/pom.xml164
-rw-r--r--java/sca/itest/distribution/legal-checks/pom.xml84
-rw-r--r--java/sca/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java324
-rw-r--r--java/sca/itest/distribution/pom.xml96
-rw-r--r--java/sca/itest/distribution/webapp-helloworld-bpel/pom.xml248
-rw-r--r--java/sca/itest/distribution/webapp-helloworld-bpel/src/test/java/itest/HelloworldTestCase.java102
-rw-r--r--java/sca/itest/distribution/webapp-helloworld-jsf/pom.xml260
-rw-r--r--java/sca/itest/distribution/webapp-helloworld-jsf/src/test/java/itest/HelloworldTestCaseFIXME.java142
-rw-r--r--java/sca/itest/distribution/webapp-helloworld-jsp/pom.xml376
-rw-r--r--java/sca/itest/distribution/webapp-helloworld-jsp/src/test/java/itest/HelloworldTestCase.java100
-rw-r--r--java/sca/itest/distribution/webapp-helloworld-stripes/pom.xml248
-rw-r--r--java/sca/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java106
-rw-r--r--java/sca/itest/distribution/webapp-helloworld/pom.xml242
-rw-r--r--java/sca/itest/implementation-spring/pom.xml160
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteImpl.java76
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteService.java60
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/calculator/AddService.java56
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/calculator/AddServiceImpl.java68
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/calculator/CalculatorService.java74
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/calculator/CalculatorServiceImpl.java158
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/calculator/DivideService.java56
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/calculator/DivideServiceImpl.java70
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/calculator/MultiplyService.java56
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/calculator/MultiplyServiceImpl.java70
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/calculator/SubtractService.java56
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/calculator/SubtractServiceImpl.java70
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/calculator/security/CalculatorCallbackHandler.java100
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/calculator/security/JaasLoginModule.java356
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/calculator/security/UserPrincipal.java132
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/context/access/SCAApplicationContextProvider.java74
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/helloworld/HelloWorld.java70
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/helloworld/HelloWorldImpl.java76
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/helloworld/HelloWorldProxy.java84
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/mock/TestBean.java62
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/mock/TestBeanImpl.java84
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/mock/TestHelloWorldBean.java78
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/mock/TestReference.java54
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/mock/TestReferenceBean.java114
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/mock/TestSCAPropertyBean.java110
-rw-r--r--java/sca/itest/implementation-spring/src/main/java/spring/annotations/CalculatorServiceImpl.java262
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/CalculatorService-context.xml78
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/SpringDelegationHelloWorld-context.xml76
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/SpringHelloWorld-context.xml60
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-access/CalculatorService-context.xml88
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/CalculatorService-context.xml78
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/SpringImport-context.xml56
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/SpringHelloWorld-context.xml60
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/StockQuoteService-context.xml70
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/beanRefContext.xml68
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/implementation-policies/CalculatorService-context.xml78
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringExplicitReference-context.xml66
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringImplicitReference-context.xml68
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringExplicitService-context.xml76
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringImplicitService-context.xml60
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/spring-annotation/CalculatorService-context.xml82
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/context/access/ContextAccess.composite98
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/context/imports/ContextImports.composite98
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/context/multiple/MultipleContext.composite70
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties34
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/implementation/policies/ImplementationPolicies.composite116
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/implementation/policies/definitions.xml78
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/location/folder/SpringFolderLocation.composite78
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/location/jar/SpringJarLocation.composite78
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite64
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite64
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/sca/references/SpringExplicitReference.composite64
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/sca/references/SpringImplicitReference.composite78
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/sca/services/SpringExplicitService.composite66
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/sca/services/SpringImplicitService.composite64
-rw-r--r--java/sca/itest/implementation-spring/src/main/resources/spring/annotations/Calculator.composite120
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/context/access/CalculatorClient.java118
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/context/access/ContextAccessTestCase.java64
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/context/imports/CalculatorClient.java102
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/context/imports/ContextImportsTestCase.java64
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/context/multiple/MultipleContextTestCase.java64
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/context/multiple/StockQuoteServer.java106
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/implementation/policies/CalculatorClient.java148
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.java70
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/location/folder/SpringFolderLocationTestCase.java82
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/location/jar/SpringJarLocationTestCase.java82
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java80
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java114
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.java68
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java82
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java62
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java64
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java72
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java80
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/sca/references/SpringExplicitReferenceTestCase.java82
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/sca/references/SpringImplicitReferenceTestCase.java88
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/sca/services/SpringExplicitServiceTestCase.java72
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/sca/services/SpringImplicitServiceTestCase.java68
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/spring/annotations/CalculatorClient.java122
-rw-r--r--java/sca/itest/implementation-spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.java64
-rw-r--r--java/sca/itest/interfaces/src/main/resources/InterfacesTest.composite78
-rw-r--r--java/sca/itest/nodes/helloworld-client/pom.xml88
-rw-r--r--java/sca/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java86
-rw-r--r--java/sca/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml44
-rw-r--r--java/sca/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite58
-rw-r--r--java/sca/itest/nodes/helloworld-iface/pom.xml78
-rw-r--r--java/sca/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java58
-rw-r--r--java/sca/itest/nodes/helloworld-service/pom.xml98
-rw-r--r--java/sca/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java56
-rw-r--r--java/sca/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml44
-rw-r--r--java/sca/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite56
-rw-r--r--java/sca/itest/nodes/one-node-test/pom.xml96
-rw-r--r--java/sca/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java174
-rw-r--r--java/sca/itest/nodes/pom.xml90
-rw-r--r--java/sca/itest/nodes/two-nodes-test/pom.xml116
-rw-r--r--java/sca/itest/nodes/two-nodes-test/src/test/java/itest/ClientNode.java184
-rw-r--r--java/sca/itest/nodes/two-nodes-test/src/test/java/itest/ServiceNode.java116
-rw-r--r--java/sca/itest/nodes/two-nodes-test/src/test/java/itest/TestCaseRunner.java584
-rw-r--r--java/sca/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java210
-rw-r--r--java/sca/itest/policies/pom.xml118
-rw-r--r--java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCard.java130
-rw-r--r--java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCardPayment.java74
-rw-r--r--java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Customer.java102
-rw-r--r--java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CustomerRegistry.java54
-rw-r--r--java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Payment.java60
-rw-r--r--java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CreditCardPaymentImpl.java80
-rw-r--r--java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CustomerRegistryImpl.java156
-rw-r--r--java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/PaymentImpl.java108
-rw-r--r--java/sca/itest/policies/src/main/resources/Customer.composite66
-rw-r--r--java/sca/itest/policies/src/main/resources/LoggingMessages.properties32
-rw-r--r--java/sca/itest/policies/src/main/resources/META-INF/definitions.xml66
-rw-r--r--java/sca/itest/policies/src/main/resources/META-INF/sca-contribution.xml44
-rw-r--r--java/sca/itest/policies/src/main/resources/Payment.composite96
-rw-r--r--java/sca/itest/policies/src/test/java/org/apache/tuscany/sca/itest/policies/PaymentTestCase.java138
-rw-r--r--java/sca/itest/properties/pom.xml212
-rw-r--r--java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java302
-rw-r--r--java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java270
-rw-r--r--java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java376
-rw-r--r--java/sca/itest/properties/src/main/resources/ConstructorPropertyInjection.composite76
-rw-r--r--java/sca/itest/properties/src/main/resources/Outer.composite86
-rw-r--r--java/sca/itest/properties/src/main/resources/customer.xsd60
-rw-r--r--java/sca/itest/properties/src/main/resources/mySimpleService.composite80
-rw-r--r--java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java338
-rw-r--r--java/sca/itest/references/src/main/resources/AutoWiredReferencesTest.composite120
-rw-r--r--java/sca/itest/references/src/main/resources/InnerReferencesTest.composite100
-rw-r--r--java/sca/itest/scaclient-api/src/main/resources/Helloworld.composite58
-rw-r--r--java/sca/itest/scopes/src/main/resources/scopes.composite66
-rw-r--r--java/sca/itest/services/src/main/resources/ServicesTest.composite138
-rw-r--r--java/sca/itest/wires/src/main/resources/WireTest.composite78
-rw-r--r--java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java246
-rw-r--r--java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/SCABindingProcessor.java262
-rw-r--r--java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/BuildPolicyTestCase.java2
-rw-r--r--java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteLocalCompositeTestCase.java200
-rw-r--r--java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolvePolicyTestCase.java2
-rw-r--r--java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestPolicyProcessor.java164
-rw-r--r--java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Multiplicity.composite64
-rw-r--r--java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/another_test_definitions.xml190
-rw-r--r--java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/local.composite54
-rw-r--r--java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/test_definitions.xml410
-rw-r--r--java/sca/modules/assembly-xsd/src/main/java/org/apache/tuscany/sca/assembly/xsd/Constants.java202
-rw-r--r--java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/oasis-200401-wss-wssecurity-secext-1.0.xsd390
-rw-r--r--java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/oasis-200401-wss-wssecurity-utility-1.0.xsd216
-rw-r--r--java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/ws-addr.xsd274
-rw-r--r--java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/ws-policy.xsd282
-rw-r--r--java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/xml.xsd234
-rw-r--r--java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/xmldsig-core-schema.xsd2
-rw-r--r--java/sca/modules/assembly-xsd/src/main/resources/sca-contribution-java-1.1-cd01.xsd66
-rw-r--r--java/sca/modules/assembly-xsd/src/main/resources/sca-implementation-spring-1.1.xsd44
-rw-r--r--java/sca/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1-implementation-osgi.xsd106
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DistributedSCABinding.java90
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DomainBuilder.java166
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceConfigurationBuilderImpl.java2
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationException.java76
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationUtil.java842
-rw-r--r--java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/DistributedSCABindingImpl.java152
-rw-r--r--java/sca/modules/binding-ejb-runtime/src/test/resources/account/account.composite74
-rw-r--r--java/sca/modules/binding-http-runtime/src/test/resources/testCache.composite66
-rw-r--r--java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java332
-rw-r--r--java/sca/modules/binding-jsonp-runtime/pom.xml170
-rw-r--r--java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPBindingProviderFactory.java118
-rw-r--r--java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java142
-rw-r--r--java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java226
-rw-r--r--java/sca/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java56
-rw-r--r--java/sca/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java56
-rw-r--r--java/sca/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java124
-rw-r--r--java/sca/modules/binding-jsonp-runtime/src/test/resources/helloworld.composite64
-rw-r--r--java/sca/modules/binding-jsonp/pom.xml82
-rw-r--r--java/sca/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBindingFactory.java62
-rw-r--r--java/sca/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/JSONPBindingFactoryImpl.java68
-rw-r--r--java/sca/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/JSONPBindingImpl.java134
-rw-r--r--java/sca/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RemoteBindingHelper.java86
-rw-r--r--java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java194
-rw-r--r--java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java170
-rw-r--r--java/sca/modules/binding-sca-runtime/src/test/resources/Calculator.composite118
-rw-r--r--java/sca/modules/binding-sca-runtime/src/test/resources/CalculatorServiceImpl.componentType64
-rw-r--r--java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java108
-rw-r--r--java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProcessor.java226
-rw-r--r--java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProviderFactory.java118
-rw-r--r--java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyInterceptor.java180
-rw-r--r--java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java142
-rw-r--r--java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyInterceptor.java196
-rw-r--r--java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java140
-rw-r--r--java/sca/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/definitions.xml108
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Account.java68
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/AccountService.java66
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/CustomerProfileData.java206
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCase.java128
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLImportTestCase.java208
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLIncludeTestCase.java208
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferClient.java72
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCaseOFF.java162
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java64
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java100
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCaseOFF.java140
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ClientPWCBHandler.java90
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/IntegrityPWCBHandler.java90
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ServerPWCBHandler.java90
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthenticationTestCaseFIXME.java48
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java84
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCaseOFF.java48
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCaseOFF.java140
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ClientPWCBHandler.java90
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/IntegrityPWCBHandler.java90
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ServerPWCBHandler.java90
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCaseOFF.java54
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java84
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCaseOFF.java54
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.composite94
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDL.composite106
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdata.xsd72
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdefs.xsd54
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerinfo.xsd62
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiService.composite106
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleService.composite102
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURI.composite100
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURI.composite102
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorld.composite96
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.composite86
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-porttype.wsdl118
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.composite84
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.composite92
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransfer.wsdl168
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite64
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/definitions.xml200
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties38
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/intent/definitions.xml62
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/definitions.xml404
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import-nested.wsdl140
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-import.composite62
-rw-r--r--java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-include.composite62
-rw-r--r--java/sca/modules/binding-ws-wsdlgen/pom.xml168
-rw-r--r--java/sca/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java2
-rw-r--r--java/sca/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java2
-rw-r--r--java/sca/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator-bad-wsdlElement.composite118
-rw-r--r--java/sca/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/PoliciedCalculator.composite120
-rw-r--r--java/sca/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleContributionScanner.java386
-rw-r--r--java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImportExportFactory.java84
-rw-r--r--java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceModelResolver.java318
-rw-r--r--java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoader.java772
-rw-r--r--java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportExportFactoryImpl.java82
-rw-r--r--java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtendedArtifactProcessor.java80
-rw-r--r--java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtendedURLArtifactProcessor.java60
-rw-r--r--java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLDocumentStreamReader.java2
-rw-r--r--java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultImportAllModelResolver.java160
-rw-r--r--java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ResourceReference.java206
-rw-r--r--java/sca/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceArtifactResolverTestCase.java150
-rw-r--r--java/sca/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoaderTestCase.java524
-rw-r--r--java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/PhasedInterceptor.java62
-rw-r--r--java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BasePolicyProvider.java338
-rw-r--r--java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointListener.java92
-rw-r--r--java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java96
-rw-r--r--java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/EndpointSerializer.java76
-rw-r--r--java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointSerializerImpl.java214
-rw-r--r--java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java200
-rw-r--r--java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java200
-rw-r--r--java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CachedProxy.java140
-rw-r--r--java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackReferenceObjectFactory.java98
-rw-r--r--java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkListener.java64
-rw-r--r--java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java124
-rw-r--r--java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Exception2OMElement.java190
-rw-r--r--java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Externalizable2OMElement.java154
-rw-r--r--java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Exception.java158
-rw-r--r--java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Externalizable.java138
-rw-r--r--java/sca/modules/databinding-axiom/src/test/resources/order.wsdl150
-rw-r--r--java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/externalizable/ExternalizableDataBinding.java78
-rw-r--r--java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/DOMNode2JavaBeanTransformer.java196
-rw-r--r--java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/Java2XMLMapperException.java138
-rw-r--r--java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2DOMNodeTransformer.java158
-rw-r--r--java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLTransformer.java524
-rw-r--r--java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java324
-rw-r--r--java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaExceptionDataBinding.java70
-rw-r--r--java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaBeanTransformer.java658
-rw-r--r--java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaMapperException.java152
-rw-r--r--java/sca/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/impl/order.wsdl150
-rw-r--r--java/sca/modules/definitions-xml/pom.xml130
-rw-r--r--java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefaultDefinitionsExtensionPoint.java242
-rw-r--r--java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsExtensionPoint.java128
-rw-r--r--java/sca/modules/definitions-xml/src/main/resources/META-INF/sca-policy-1.1-intents-definitions-cd02.xml484
-rw-r--r--java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/ReadDocumentTestCase.java452
-rw-r--r--java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/TestPolicyProcessor.java114
-rw-r--r--java/sca/modules/definitions-xml/src/test/resources/org/apache/tuscany/sca/definitions/test_definitions.xml410
-rw-r--r--java/sca/modules/definitions/pom.xml104
-rw-r--r--java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java166
-rw-r--r--java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilder.java68
-rw-r--r--java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderException.java86
-rw-r--r--java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsBuilderImpl.java614
-rw-r--r--java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java144
-rw-r--r--java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.java78
-rw-r--r--java/sca/modules/endpoint-tribes/pom.xml94
-rw-r--r--java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/MapStore.java166
-rw-r--r--java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java734
-rw-r--r--java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/OSGiExtensionPointRegistry.java250
-rw-r--r--java/sca/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHostTestCase.java2
-rw-r--r--java/sca/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/TestEquinoxHost.java2
-rw-r--r--java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/LifeCycleListener.java72
-rw-r--r--java/sca/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/DefaultUtilityExtensionPointTestCase.java222
-rw-r--r--java/sca/modules/host-rmi/pom.xml78
-rw-r--r--java/sca/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostException.java90
-rw-r--r--java/sca/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostRuntimeException.java92
-rw-r--r--java/sca/modules/host-rmi/src/test/java/org/apache/tuscany/sca/host/rmi/RMIHostImplTestCase.java180
-rw-r--r--java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/ServletHostHelper.java380
-rw-r--r--java/sca/modules/implementation-bpel-runtime/pom.xml916
-rw-r--r--java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/BPELODEDeployFile.java466
-rw-r--r--java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEEndpointReference.java192
-rw-r--r--java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEEprContext.java150
-rw-r--r--java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/ODEInvocationException.java66
-rw-r--r--java/sca/modules/implementation-bpel-runtime/src/test/resources/helloworld/greetings.wsdl174
-rw-r--r--java/sca/modules/implementation-bpel-runtime/src/test/resources/helloworld/helloworld.wsdl162
-rw-r--r--java/sca/modules/implementation-bpel/pom.xml152
-rw-r--r--java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImportElement.java130
-rw-r--r--java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkElement.java258
-rw-r--r--java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkTypeElement.java222
-rw-r--r--java/sca/modules/implementation-bpel/src/test/resources/helloworld/helloworld.wsdl162
-rw-r--r--java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ConversationIDObjectFactory.java84
-rw-r--r--java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java652
-rw-r--r--java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/NoConversationalContractException.java66
-rw-r--r--java/sca/modules/implementation-java/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions.xml198
-rw-r--r--java/sca/modules/implementation-java/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions_with_policysets.xml224
-rw-r--r--java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/BindingDescriptions.java68
-rw-r--r--java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/BindingDescriptionsImpl.java72
-rw-r--r--java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/introspection/ExportedServiceIntrospector.java896
-rw-r--r--java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/BindingDescriptionsProcessor.java234
-rw-r--r--java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/BluePrintComponentsProcessor.java292
-rw-r--r--java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiComponentProcessor.java350
-rw-r--r--java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/BluePrintComponentsProcessorTestCase.java178
-rw-r--r--java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiComponentProcessorTestCase.java172
-rw-r--r--java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/sca/bundle.componentType108
-rw-r--r--java/sca/modules/implementation-osgi/src/test/resources/osgitest.composite70
-rw-r--r--java/sca/modules/implementation-spring-sca/pom.xml140
-rw-r--r--java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/SCANamespaceHandlerResolver.java106
-rw-r--r--java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaNamespaceHandler.java76
-rw-r--r--java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaPropertyBeanDefinitionParser.java70
-rw-r--r--java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaReferenceBeanDefinitionParser.java72
-rw-r--r--java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaServiceBeanDefinitionParser.java72
-rw-r--r--java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentNameAnnotationProcessor.java300
-rw-r--r--java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentStub.java108
-rw-r--r--java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ConstructorAnnotationProcessor.java230
-rw-r--r--java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/InitDestroyAnnotationProcessor.java150
-rw-r--r--java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyAnnotationProcessor.java322
-rw-r--r--java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyValueStub.java110
-rw-r--r--java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ReferenceAnnotationProcessor.java328
-rw-r--r--java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SCAParentApplicationContext.java380
-rw-r--r--java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java336
-rw-r--r--java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringImplementationStub.java234
-rw-r--r--java/sca/modules/implementation-spring-sca/src/main/resources/org/springframework/sca/xml/spring-sca.xsd168
-rw-r--r--java/sca/modules/implementation-spring/pom.xml148
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringBeanElement.java152
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringConstructorArgElement.java156
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java440
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationConstants.java128
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringPropertyElement.java122
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAPropertyElement.java104
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAReferenceElement.java108
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAServiceElement.java128
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanIntrospector.java270
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanPojoProcessor.java1312
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java1562
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/ComponentTie.java82
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/PropertyValueTie.java106
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java260
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java170
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java154
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationTie.java286
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringInvocationException.java80
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringInvoker.java248
-rw-r--r--java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java466
-rw-r--r--java/sca/modules/implementation-spring/src/main/resources/impl-spring-validation-messages.properties44
-rw-r--r--java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java136
-rw-r--r--java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/jsp/ReferenceTEI.java90
-rw-r--r--java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/jsp/ReferenceTag.java188
-rw-r--r--java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/utils/ContextHelper.java266
-rw-r--r--java/sca/modules/implementation-web/pom.xml174
-rw-r--r--java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java84
-rw-r--r--java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementationFactory.java68
-rw-r--r--java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationFactoryImpl.java74
-rw-r--r--java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java330
-rw-r--r--java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java240
-rw-r--r--java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/ReadTestCase.java136
-rw-r--r--java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java132
-rw-r--r--java/sca/modules/implementation-web/src/test/resources/org/apache/tuscany/sca/implementation/web/xml/TestWeb.composite58
-rw-r--r--java/sca/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl282
-rw-r--r--java/sca/modules/interface-java-jaxws/src/test/resources/wsdl/StockExceptionTest.wsdl340
-rw-r--r--java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/BPELPartnerLinkTypeExt.java158
-rw-r--r--java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java284
-rw-r--r--java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java76
-rw-r--r--java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java466
-rw-r--r--java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java568
-rw-r--r--java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java2
-rw-r--r--java/sca/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties46
-rw-r--r--java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java166
-rw-r--r--java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java242
-rw-r--r--java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java172
-rw-r--r--java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java142
-rw-r--r--java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java130
-rw-r--r--java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java182
-rw-r--r--java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java134
-rw-r--r--java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java246
-rw-r--r--java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java176
-rw-r--r--java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java104
-rw-r--r--java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite110
-rw-r--r--java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType64
-rw-r--r--java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl52
-rw-r--r--java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl114
-rw-r--r--java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd272
-rw-r--r--java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl114
-rw-r--r--java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl90
-rw-r--r--java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd66
-rw-r--r--java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl126
-rw-r--r--java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl150
-rw-r--r--java/sca/modules/interface-wsdl/src/test/resources/policy/stockquote_policy.wsdl122
-rw-r--r--java/sca/modules/interface-wsdl/src/test/resources/wsdl/helloworld-interface.wsdl134
-rw-r--r--java/sca/modules/interface-wsdl/src/test/resources/wsdl/helloworld-service.wsdl98
-rw-r--r--java/sca/modules/interface-wsdl/src/test/resources/xsd/greeting.xsd56
-rw-r--r--java/sca/modules/interface-wsdl/src/test/resources/xsd/helloworld.xsd42
-rw-r--r--java/sca/modules/interface-wsdl/src/test/resources/xsd/name.xsd56
-rw-r--r--java/sca/modules/launcher/pom.xml70
-rw-r--r--java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java636
-rw-r--r--java/sca/modules/myfaces/pom.xml152
-rw-r--r--java/sca/modules/myfaces/src/main/java/org/apache/tuscany/sca/myfaces/TuscanyAnnotationLifecycleProvider.java138
-rw-r--r--java/sca/modules/myfaces/src/main/java/org/apache/tuscany/sca/myfaces/TuscanyAnnotationProcessor.java106
-rw-r--r--java/sca/modules/node-api/pom.xml82
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFinder.java116
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeMain2.java112
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/BindingConfiguration.java110
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java204
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/DefaultNodeConfigurationFactory.java92
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/DeploymentComposite.java128
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java186
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfigurationFactory.java100
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/BindingConfigurationImpl.java108
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/ContributionConfigurationImpl.java310
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/DeploymentCompositeImpl.java118
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationFactoryImpl.java126
-rw-r--r--java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationImpl.java352
-rw-r--r--java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/AbstractDiscoveryService.java688
-rw-r--r--java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/DiscoveredServiceNotificationImpl.java134
-rw-r--r--java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/DiscoveryActivator.java116
-rw-r--r--java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/DomainDiscoveryService.java244
-rw-r--r--java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/EndpointDescription.java138
-rw-r--r--java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/EndpointPublication.java126
-rw-r--r--java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/LocalDiscoveryService.java244
-rw-r--r--java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/ServiceEndpointDescriptionImpl.java270
-rw-r--r--java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeUtil.java2
-rw-r--r--java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/OSGiServiceExporter.java276
-rw-r--r--java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/DiscoveredServiceNotification.java214
-rw-r--r--java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/DiscoveredServiceTracker.java162
-rw-r--r--java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/Discovery.java132
-rw-r--r--java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/ServiceEndpointDescription.java256
-rw-r--r--java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/ServicePublication.java294
-rw-r--r--java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/bundle.componentType108
-rw-r--r--java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/calculator.composite106
-rw-r--r--java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/operations/bundle.componentType94
-rw-r--r--java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/operations/operations.composite86
-rw-r--r--java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/sca/META-INF/sca-contribution.xml48
-rw-r--r--java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/sca/OSGI-INF/sca/calculator.composite140
-rw-r--r--java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationATOMProcessor.java320
-rw-r--r--java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessor.java480
-rw-r--r--java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/XMLStreamSerializer.java574
-rw-r--r--java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/Contributions.java320
-rw-r--r--java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java2
-rw-r--r--java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/management/NodeManager.java130
-rw-r--r--java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/management/NodeManagerMBean.java60
-rw-r--r--java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessorTestCase.java166
-rw-r--r--java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeUtilTestCase.java76
-rw-r--r--java/sca/modules/node-impl/src/test/resources/HelloWorld.composite60
-rw-r--r--java/sca/modules/node-impl/src/test/resources/org/apache/tuscany/sca/node/configuration/node1.xml108
-rw-r--r--java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/ContributionLocationHelper.java2
-rw-r--r--java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/FrameworkLauncher.java252
-rw-r--r--java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher2.java434
-rw-r--r--java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherCommand.java114
-rw-r--r--java/sca/modules/node-launcher-equinox/src/test/resources/HelloWorld.composite68
-rw-r--r--java/sca/modules/policy-logging/pom.xml116
-rw-r--r--java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/Logging.java92
-rw-r--r--java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicy.java170
-rw-r--r--java/sca/modules/policy-logging/src/main/resources/org/apache/tuscany/sca/policy/logging/definitions.xml58
-rw-r--r--java/sca/modules/policy-logging/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml44
-rw-r--r--java/sca/modules/policy-security/pom.xml104
-rw-r--r--java/sca/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicy.java142
-rw-r--r--java/sca/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyHandler.java142
-rw-r--r--java/sca/modules/policy-xml/pom.xml116
-rw-r--r--java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyConstants.java148
-rw-r--r--java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java2
-rw-r--r--java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/TestPolicyProcessor.java164
-rw-r--r--java/sca/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/Calculator.composite98
-rw-r--r--java/sca/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml404
-rw-r--r--java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java76
-rw-r--r--java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java78
-rw-r--r--java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationException.java76
-rw-r--r--java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationUtils.java196
-rw-r--r--java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/InvalidServiceException.java120
-rw-r--r--java/sca/modules/sca-client-impl/pom.xml94
-rw-r--r--java/sca/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl.java118
-rw-r--r--java/sca/modules/stripes/pom.xml120
-rw-r--r--java/sca/modules/wicket/pom.xml130
-rw-r--r--java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/IContextLocator.java120
-rw-r--r--java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/TuscanyComponentInjector.java316
-rw-r--r--java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/TuscanyFieldValueFactory.java132
-rw-r--r--java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/TuscanyInjector.java76
-rw-r--r--java/sca/modules/xsd/pom.xml130
-rw-r--r--java/sca/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDefinition.java2
-rw-r--r--java/sca/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDefinitionImpl.java2
-rw-r--r--java/sca/otest/current/pom.xml288
-rw-r--r--java/sca/otest/current/tests/src/test/resources/oasis-sca-tests.properties34
-rw-r--r--java/sca/otest/fixed_version/pom.xml184
-rw-r--r--java/sca/samples/calculator-rmi-reference/build.xml168
-rw-r--r--java/sca/samples/calculator-rmi-reference/pom.xml164
-rw-r--r--java/sca/samples/calculator-rmi-reference/src/main/java/calculator/AddService.java56
-rw-r--r--java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorClient.java98
-rw-r--r--java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorService.java78
-rw-r--r--java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorServiceImpl.java136
-rw-r--r--java/sca/samples/calculator-rmi-reference/src/main/java/calculator/DivideService.java56
-rw-r--r--java/sca/samples/calculator-rmi-reference/src/main/java/calculator/MultiplyService.java56
-rw-r--r--java/sca/samples/calculator-rmi-reference/src/main/java/calculator/SubtractService.java56
-rw-r--r--java/sca/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIReferenceTestCase.java140
-rw-r--r--java/sca/samples/calculator-rmi-service/pom.xml134
-rw-r--r--java/sca/samples/calculator-rmi-service/src/main/java/calculator/AddService.java56
-rw-r--r--java/sca/samples/calculator-rmi-service/src/main/java/calculator/AddServiceImpl.java60
-rw-r--r--java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServer.java90
-rw-r--r--java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorService.java72
-rw-r--r--java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServiceImpl.java136
-rw-r--r--java/sca/samples/calculator-rmi-service/src/main/java/calculator/DivideService.java56
-rw-r--r--java/sca/samples/calculator-rmi-service/src/main/java/calculator/DivideServiceImpl.java60
-rw-r--r--java/sca/samples/calculator-rmi-service/src/main/java/calculator/MultiplyService.java56
-rw-r--r--java/sca/samples/calculator-rmi-service/src/main/java/calculator/MultiplyServiceImpl.java60
-rw-r--r--java/sca/samples/calculator-rmi-service/src/main/java/calculator/SubtractService.java56
-rw-r--r--java/sca/samples/calculator-rmi-service/src/main/java/calculator/SubtractServiceImpl.java60
-rw-r--r--java/sca/samples/calculator-rmi-service/src/main/resources/META-INF/sca-contribution.xml44
-rw-r--r--java/sca/samples/calculator-rmi-service/src/test/java/calculator/CalculatorRMIServerTestCase.java126
-rw-r--r--java/sca/samples/calculator/src/main/resources/META-INF/sca-contribution.xml44
-rw-r--r--java/sca/samples/dosgi-calculator-operations/OSGI-INF/add-component.xml50
-rw-r--r--java/sca/samples/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml78
-rw-r--r--java/sca/samples/dosgi-calculator-operations/OSGI-INF/divide-component.xml50
-rw-r--r--java/sca/samples/dosgi-calculator-operations/OSGI-INF/multiply-component.xml50
-rw-r--r--java/sca/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType94
-rw-r--r--java/sca/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite86
-rw-r--r--java/sca/samples/dosgi-calculator-operations/OSGI-INF/subtract-component.xml50
-rw-r--r--java/sca/samples/dosgi-calculator-operations/pom.xml268
-rw-r--r--java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java62
-rw-r--r--java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java62
-rw-r--r--java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java62
-rw-r--r--java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java62
-rw-r--r--java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java74
-rw-r--r--java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java74
-rw-r--r--java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java74
-rw-r--r--java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java176
-rw-r--r--java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java74
-rw-r--r--java/sca/samples/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml46
-rw-r--r--java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java210
-rw-r--r--java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java86
-rw-r--r--java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java208
-rw-r--r--java/sca/samples/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml84
-rw-r--r--java/sca/samples/dosgi-calculator/OSGI-INF/calculator-component.xml72
-rw-r--r--java/sca/samples/dosgi-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml132
-rw-r--r--java/sca/samples/dosgi-calculator/OSGI-INF/sca/bundle.componentType108
-rw-r--r--java/sca/samples/dosgi-calculator/OSGI-INF/sca/bundle.composite112
-rw-r--r--java/sca/samples/dosgi-calculator/pom.xml278
-rw-r--r--java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java72
-rw-r--r--java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java156
-rw-r--r--java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java228
-rw-r--r--java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java196
-rw-r--r--java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java62
-rw-r--r--java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java62
-rw-r--r--java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java62
-rw-r--r--java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java62
-rw-r--r--java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java186
-rw-r--r--java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java264
-rw-r--r--java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java74
-rw-r--r--java/sca/samples/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml48
-rw-r--r--java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java86
-rw-r--r--java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java288
-rw-r--r--java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java210
-rw-r--r--java/sca/samples/helloworld-bpel/src/main/java/helloworld/Hello.java58
-rw-r--r--java/sca/samples/helloworld-bpel/src/main/resources/META-INF/sca-contribution.xml44
-rw-r--r--java/sca/samples/webapps/helloworld-bpel/src/main/java/sample/HelloworldService.java56
-rw-r--r--java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.wsdl162
-rw-r--r--java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.composite74
-rw-r--r--java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.xml82
-rw-r--r--java/sca/samples/webapps/helloworld-jsf/pom.xml124
-rw-r--r--java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloWorldController.java112
-rw-r--r--java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldService.java50
-rw-r--r--java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldServiceImpl.java54
-rw-r--r--java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/faces-config.xml102
-rw-r--r--java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.composite68
-rw-r--r--java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.xml382
-rw-r--r--java/sca/samples/webapps/helloworld-jsp/pom.xml110
-rw-r--r--java/sca/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldService.java50
-rw-r--r--java/sca/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldServiceImpl.java56
-rw-r--r--java/sca/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.composite68
-rw-r--r--java/sca/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.xml82
-rw-r--r--java/sca/samples/webapps/helloworld-rest/pom.xml222
-rw-r--r--java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/ClientJavaTestService.java58
-rw-r--r--java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/ClientTestServiceWebapp.java216
-rw-r--r--java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldService.java26
-rw-r--r--java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldServiceImpl.java88
-rw-r--r--java/sca/samples/webapps/helloworld-rest/src/main/resources/rest.composite74
-rw-r--r--java/sca/samples/webapps/helloworld-rest/src/main/webapp/META-INF/sca-contribution.xml52
-rw-r--r--java/sca/samples/webapps/helloworld-rest/src/main/webapp/WEB-INF/web.xml70
-rw-r--r--java/sca/samples/webapps/helloworld-servlet/pom.xml108
-rw-r--r--java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldService.java50
-rw-r--r--java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServiceImpl.java54
-rw-r--r--java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServlet.java112
-rw-r--r--java/sca/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.composite68
-rw-r--r--java/sca/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.xml84
-rw-r--r--java/sca/samples/webapps/helloworld-stripes/pom.xml130
-rw-r--r--java/sca/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/BaseActionBean.java66
-rw-r--r--java/sca/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/HomeActionBean.java90
-rw-r--r--java/sca/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldService.java50
-rw-r--r--java/sca/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldServiceImpl.java56
-rw-r--r--java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.composite68
-rw-r--r--java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.xml122
-rw-r--r--java/sca/samples/webapps/helloworld-wicket/pom.xml152
-rw-r--r--java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/HelloworldService.java50
-rw-r--r--java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/HelloworldServiceImpl.java56
-rw-r--r--java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/HomePage.java130
-rw-r--r--java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/IMyService.java68
-rw-r--r--java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/MyService.java74
-rw-r--r--java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/WicketApplication.java92
-rw-r--r--java/sca/samples/webapps/helloworld-wicket/src/main/resources/log4j.properties58
-rw-r--r--java/sca/samples/webapps/helloworld-wicket/src/main/webapp/WEB-INF/web.composite68
-rw-r--r--java/sca/samples/webapps/helloworld-wicket/src/main/webapp/WEB-INF/web.xml100
-rw-r--r--java/sca/samples/webapps/helloworld/pom.xml110
-rw-r--r--java/sca/samples/webapps/helloworld/src/main/java/sample/HelloworldService.java50
-rw-r--r--java/sca/samples/webapps/helloworld/src/main/java/sample/HelloworldServiceImpl.java76
-rw-r--r--java/sca/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.composite58
-rw-r--r--java/sca/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.xml74
780 files changed, 54636 insertions, 54636 deletions
diff --git a/java/sca/archetypes/contribution-jar/pom.xml b/java/sca/archetypes/contribution-jar/pom.xml
index 6987e0ee86..3473186421 100644
--- a/java/sca/archetypes/contribution-jar/pom.xml
+++ b/java/sca/archetypes/contribution-jar/pom.xml
@@ -1,50 +1,50 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-contribution-jar</artifactId>
- <packaging>maven-archetype</packaging>
- <name>Create an SCA JAR contribution project</name>
-
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-3</version>
- </extension>
- </extensions>
- <plugins>
- <plugin>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-3</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-contribution-jar</artifactId>
+ <packaging>maven-archetype</packaging>
+ <name>Create an SCA JAR contribution project</name>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-3</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-3</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/java/sca/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype-metadata.xml b/java/sca/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype-metadata.xml
index 9f0334fd64..46c5cd6dca 100644
--- a/java/sca/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/java/sca/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -1,36 +1,36 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<archetype-descriptor name="myproject">
- <fileSets>
- <fileSet filtered="true" packaged="true" encoding="UTF-8">
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
- <fileSet filtered="true" encoding="UTF-8">
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.composite</include>
- </includes>
- </fileSet>
- </fileSets>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<archetype-descriptor name="myproject">
+ <fileSets>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.composite</include>
+ </includes>
+ </fileSet>
+ </fileSets>
</archetype-descriptor> \ No newline at end of file
diff --git a/java/sca/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype.xml b/java/sca/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype.xml
index 88100e8412..69c3fb5ac9 100644
--- a/java/sca/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype.xml
+++ b/java/sca/archetypes/contribution-jar/src/main/resources/META-INF/maven/archetype.xml
@@ -1,30 +1,30 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<archetype>
- <id>tuscany-contribution-jar</id>
- <sources>
- <source>src/main/java/HelloworldImpl.java</source>
- <source>src/main/java/HelloworldService.java</source>
- </sources>
- <resources>
- <resource>src/main/hello.composite</resource>
- <resource>src/main/webapp/META-INF/sca-contribution.xml</resource>
- </resources>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<archetype>
+ <id>tuscany-contribution-jar</id>
+ <sources>
+ <source>src/main/java/HelloworldImpl.java</source>
+ <source>src/main/java/HelloworldService.java</source>
+ </sources>
+ <resources>
+ <resource>src/main/hello.composite</resource>
+ <resource>src/main/webapp/META-INF/sca-contribution.xml</resource>
+ </resources>
</archetype> \ No newline at end of file
diff --git a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml
index 35b8618378..5ac5472493 100644
--- a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml
+++ b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/pom.xml
@@ -1,110 +1,110 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>${groupId}</groupId>
- <artifactId>${artifactId}</artifactId>
- <packaging>jar</packaging>
- <version>${version}</version>
- #literal()<!-- TODO project name -->
- <name>quickstart</name>
- <description></description>
-
- <dependencies>
- <!-- TUSCANY DEPENDENCIES -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>${tuscany.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- JUNIT DEPENDENCY FOR TESTING -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
- <build>
- <defaultGoal>install</defaultGoal>
- <finalName>${artifactId}</finalName>
- <resources>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <filtering>false</filtering>
- <directory>src/test/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <inherited>true</inherited>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <optimise>true</optimise>
- <debug>true</debug>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <configuration>
- <downloadSources>true</downloadSources>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-tuscany-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- <properties>
- <tuscany.version>2.0-SNAPSHOT</tuscany.version>
- </properties>
- #end
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <packaging>jar</packaging>
+ <version>${version}</version>
+ #literal()<!-- TODO project name -->
+ <name>quickstart</name>
+ <description></description>
+
+ <dependencies>
+ <!-- TUSCANY DEPENDENCIES -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- JUNIT DEPENDENCY FOR TESTING -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <finalName>${artifactId}</finalName>
+ <resources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <filtering>false</filtering>
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <inherited>true</inherited>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <optimise>true</optimise>
+ <debug>true</debug>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-tuscany-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ <tuscany.version>2.0-SNAPSHOT</tuscany.version>
+ </properties>
+ #end
</project> \ No newline at end of file
diff --git a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
index af90e4fe7f..26237c105c 100644
--- a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
+++ b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
@@ -1,36 +1,36 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package ${package};
-
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.EagerInit;
-
-@Scope("COMPOSITE") @EagerInit
-public class HelloworldImpl implements HelloworldService {
-
- public String sayHello(String name) {
- return "Hello " + name;
- }
-
- @Init
- public void init() {
- System.out.println(sayHello("world"));
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package};
+
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.EagerInit;
+
+@Scope("COMPOSITE") @EagerInit
+public class HelloworldImpl implements HelloworldService {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+ @Init
+ public void init() {
+ System.out.println(sayHello("world"));
+ }
+}
diff --git a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldService.java b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
index 3527edcd6f..d705564334 100644
--- a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
+++ b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package ${package};
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface HelloworldService {
-
- String sayHello(String name);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package};
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface HelloworldService {
+
+ String sayHello(String name);
+
+}
diff --git a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml
index cbfff9b246..8608a99897 100644
--- a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml
+++ b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/META-INF/sca-contribution.xml
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sample="http://${package}">
- <deployable composite="sample:${artifactId}"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sample="http://${package}">
+ <deployable composite="sample:${artifactId}"/>
</contribution> \ No newline at end of file
diff --git a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/helloworld.composite b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/helloworld.composite
index 29d1725fd4..c33da77c0d 100644
--- a/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/helloworld.composite
+++ b/java/sca/archetypes/contribution-jar/src/main/resources/archetype-resources/src/main/resources/helloworld.composite
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://${package}"
- name="${artifactId}">
-
- <component name="HelloworldComponent">
- <implementation.java class="${package}.HelloworldImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ targetNamespace="http://${package}"
+ name="${artifactId}">
+
+ <component name="HelloworldComponent">
+ <implementation.java class="${package}.HelloworldImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/archetypes/contribution-zip-discriptor/pom.xml b/java/sca/archetypes/contribution-zip-discriptor/pom.xml
index 2e39f23a9c..c3a1f9bb5f 100644
--- a/java/sca/archetypes/contribution-zip-discriptor/pom.xml
+++ b/java/sca/archetypes/contribution-zip-discriptor/pom.xml
@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-zip-contribution-descriptor</artifactId>
- <name>Tuscany SCA ZIP contribution Shared Assembly Descriptor</name>
-
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-zip-contribution-descriptor</artifactId>
+ <name>Tuscany SCA ZIP contribution Shared Assembly Descriptor</name>
+
+
+</project>
diff --git a/java/sca/archetypes/contribution-zip-discriptor/src/main/resources/assemblies/tuscany-zip-contribution.xml b/java/sca/archetypes/contribution-zip-discriptor/src/main/resources/assemblies/tuscany-zip-contribution.xml
index 5ab0cbad2a..a672d2920d 100644
--- a/java/sca/archetypes/contribution-zip-discriptor/src/main/resources/assemblies/tuscany-zip-contribution.xml
+++ b/java/sca/archetypes/contribution-zip-discriptor/src/main/resources/assemblies/tuscany-zip-contribution.xml
@@ -1,40 +1,40 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<assembly>
- <id>zip-contribution</id>
- <formats>
- <format>zip</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <dependencySets>
- <dependencySet>
- <unpack>false</unpack>
- <scope>runtime</scope>
- <outputDirectory>lib</outputDirectory>
- <useProjectArtifact>false</useProjectArtifact>
- </dependencySet>
- </dependencySets>
- <fileSets>
- <fileSet>
- <directory>${project.build.outputDirectory}</directory>
- <outputDirectory>/</outputDirectory>
- </fileSet>
- </fileSets>
-</assembly>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<assembly>
+ <id>zip-contribution</id>
+ <formats>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <dependencySets>
+ <dependencySet>
+ <unpack>false</unpack>
+ <scope>runtime</scope>
+ <outputDirectory>lib</outputDirectory>
+ <useProjectArtifact>false</useProjectArtifact>
+ </dependencySet>
+ </dependencySets>
+ <fileSets>
+ <fileSet>
+ <directory>${project.build.outputDirectory}</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
+ </fileSets>
+</assembly>
diff --git a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java
index 359f2c0a38..48b62dbb6f 100644
--- a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java
+++ b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddImpl.java
@@ -1,38 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package ${package};
-
-import org.apache.commons.math.util.MathUtils;
-
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.EagerInit;
-
-@Scope("COMPOSITE") @EagerInit
-public class AddImpl implements AddService {
-
- public int add(int x, int y) {
- return MathUtils.addAndCheck(x, y);
- }
-
- @Init
- public void init() {
- System.out.println("1 + 2 = " + add(1, 2));
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package};
+
+import org.apache.commons.math.util.MathUtils;
+
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.EagerInit;
+
+@Scope("COMPOSITE") @EagerInit
+public class AddImpl implements AddService {
+
+ public int add(int x, int y) {
+ return MathUtils.addAndCheck(x, y);
+ }
+
+ @Init
+ public void init() {
+ System.out.println("1 + 2 = " + add(1, 2));
+ }
+}
diff --git a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java
index 1081cb0b2e..4b25553893 100644
--- a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java
+++ b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/java/AddService.java
@@ -1,25 +1,25 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package ${package};
-
-public interface AddService {
-
- int add(int x, int y);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package};
+
+public interface AddService {
+
+ int add(int x, int y);
+
+}
diff --git a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite
index 83bc07435d..2a8b041849 100644
--- a/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite
+++ b/java/sca/archetypes/contribution-zip/src/main/resources/archetype-resources/src/main/resources/add.composite
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://${package}"
- name="${artifactId}">
-
- <component name="AddComponent">
- <implementation.java class="${package}.AddImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ targetNamespace="http://${package}"
+ name="${artifactId}">
+
+ <component name="AddComponent">
+ <implementation.java class="${package}.AddImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/archetypes/pom.xml b/java/sca/archetypes/pom.xml
index a79f5a98f1..9f3e35e2a3 100644
--- a/java/sca/archetypes/pom.xml
+++ b/java/sca/archetypes/pom.xml
@@ -1,51 +1,51 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-archetype</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Maven Archetypes</name>
-
- <profiles>
- <profile>
- <id>default</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
-
- <modules>
- <module>contribution-jar</module>
- <module>contribution-zip</module>
- <module>contribution-zip-discriptor</module>
- <module>quickstart</module>
- <module>quickstart-jsf</module>
- <module>quickstart-stripes</module>
- <module>quickstart-bpel</module>
- </modules>
- </profile>
- </profiles>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-archetype</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Maven Archetypes</name>
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+
+ <modules>
+ <module>contribution-jar</module>
+ <module>contribution-zip</module>
+ <module>contribution-zip-discriptor</module>
+ <module>quickstart</module>
+ <module>quickstart-jsf</module>
+ <module>quickstart-stripes</module>
+ <module>quickstart-bpel</module>
+ </modules>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/java/sca/archetypes/quickstart-bpel/pom.xml b/java/sca/archetypes/quickstart-bpel/pom.xml
index c49f589d11..c1248a0a9d 100644
--- a/java/sca/archetypes/quickstart-bpel/pom.xml
+++ b/java/sca/archetypes/quickstart-bpel/pom.xml
@@ -1,50 +1,50 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-quickstart-bpel</artifactId>
- <packaging>maven-archetype</packaging>
- <name>Create an SCA Webapp project using BPEL</name>
-
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-3</version>
- </extension>
- </extensions>
- <plugins>
- <plugin>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-3</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-quickstart-bpel</artifactId>
+ <packaging>maven-archetype</packaging>
+ <name>Create an SCA Webapp project using BPEL</name>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-3</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-3</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/java/sca/archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype-metadata.xml b/java/sca/archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype-metadata.xml
index 18352d9bef..47c2f5dc10 100644
--- a/java/sca/archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/java/sca/archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -1,43 +1,43 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<archetype-descriptor name="myproject">
- <fileSets>
- <fileSet filtered="true" packaged="true" encoding="UTF-8">
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
- <fileSet filtered="true" packaged="true" encoding="UTF-8">
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*</include>
- </includes>
- </fileSet>
- <fileSet filtered="true" encoding="UTF-8">
- <directory>src/main/webapp</directory>
- <includes>
- <include>**/*.jsp</include>
- <include>**/*.xml</include>
- <include>**/*.composite</include>
- </includes>
- </fileSet>
- </fileSets>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<archetype-descriptor name="myproject">
+ <fileSets>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/webapp</directory>
+ <includes>
+ <include>**/*.jsp</include>
+ <include>**/*.xml</include>
+ <include>**/*.composite</include>
+ </includes>
+ </fileSet>
+ </fileSets>
</archetype-descriptor> \ No newline at end of file
diff --git a/java/sca/archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype.xml b/java/sca/archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype.xml
index 1ed5562255..c466a1b3f5 100644
--- a/java/sca/archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype.xml
+++ b/java/sca/archetypes/quickstart-bpel/src/main/resources/META-INF/maven/archetype.xml
@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<archetype>
- <id>tuscany-quickstart</id>
- <sources>
- <source>src/main/java/HelloworldImpl.java</source>
- <source>src/main/java/HelloworldService.java</source>
- </sources>
- <resources>
- <source>src/main/resources/helloworld.bpel</source>
- <source>src/main/resources/helloworld.wsdl</source>
- <resource>src/main/webapp/hello.jsp</resource>
- <resource>src/main/webapp/WEB-INF/web.composite</resource>
- <resource>src/main/webapp/WEB-INF/web.xml</resource>
- </resources>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<archetype>
+ <id>tuscany-quickstart</id>
+ <sources>
+ <source>src/main/java/HelloworldImpl.java</source>
+ <source>src/main/java/HelloworldService.java</source>
+ </sources>
+ <resources>
+ <source>src/main/resources/helloworld.bpel</source>
+ <source>src/main/resources/helloworld.wsdl</source>
+ <resource>src/main/webapp/hello.jsp</resource>
+ <resource>src/main/webapp/WEB-INF/web.composite</resource>
+ <resource>src/main/webapp/WEB-INF/web.xml</resource>
+ </resources>
</archetype> \ No newline at end of file
diff --git a/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/pom.xml b/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/pom.xml
index cc8bc21909..f3e7e19e03 100644
--- a/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/pom.xml
+++ b/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/pom.xml
@@ -1,182 +1,182 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>${groupId}</groupId>
- <artifactId>${artifactId}</artifactId>
- <packaging>war</packaging>
- <version>${version}</version>
- #literal()<!-- TODO project name -->
- <name>quickstart</name>
- <description></description>
-
- <dependencies>
- <!-- TUSCANY DEPENDENCIES -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>${tuscany.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-runtime</artifactId>
- <version>${tuscany.version}</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-bpel-runtime</artifactId>
- <version>${tuscany.version}</version>
- <scope>runtime</scope>
- </dependency>
-
- <!-- JUNIT DEPENDENCY FOR TESTING -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- <!-- JETTY DEPENDENCIES FOR TESTING -->
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- <version>${jetty.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- <version>${jetty.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-management</artifactId>
- <version>${jetty.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- <build>
- <defaultGoal>install</defaultGoal>
- <finalName>${artifactId}</finalName>
- <resources>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <filtering>false</filtering>
- <directory>src/test/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>compile</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-dao-jpa-ojpa-derby</artifactId>
- <version>1.1.1</version>
- <type>zip</type>
- <overWrite>false</overWrite>
- <outputDirectory>${project.build.directory}/classes</outputDirectory>
- <includes>**/*</includes>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <inherited>true</inherited>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <optimise>true</optimise>
- <debug>true</debug>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>${jetty.version}</version>
- <configuration>
- <systemProperties>
- <systemProperty>
- <!-- this property is needed to avoid a problem in openjpa -->
- <name>openjpa.QueryCompilationCache</name>
- <value>false</value>
- </systemProperty>
- </systemProperties>
- <!-- need to override the src dir so src/main/resources are also included -->
- <webAppSourceDirectory>${basedir}/src/main</webAppSourceDirectory>
- <webXml>${basedir}/src/main/webapp/WEB-INF/web.xml</webXml>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <configuration>
- <downloadSources>true</downloadSources>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <properties>
- <tuscany.version>2.0-SNAPSHOT</tuscany.version>
- <jetty.version>6.1.18</jetty.version>
- </properties>
- #end
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <packaging>war</packaging>
+ <version>${version}</version>
+ #literal()<!-- TODO project name -->
+ <name>quickstart</name>
+ <description></description>
+
+ <dependencies>
+ <!-- TUSCANY DEPENDENCIES -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-bpel-runtime</artifactId>
+ <version>${tuscany.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- JUNIT DEPENDENCY FOR TESTING -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- JETTY DEPENDENCIES FOR TESTING -->
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>${jetty.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ <version>${jetty.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-management</artifactId>
+ <version>${jetty.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <finalName>${artifactId}</finalName>
+ <resources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <filtering>false</filtering>
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-dao-jpa-ojpa-derby</artifactId>
+ <version>1.1.1</version>
+ <type>zip</type>
+ <overWrite>false</overWrite>
+ <outputDirectory>${project.build.directory}/classes</outputDirectory>
+ <includes>**/*</includes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <inherited>true</inherited>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <optimise>true</optimise>
+ <debug>true</debug>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>${jetty.version}</version>
+ <configuration>
+ <systemProperties>
+ <systemProperty>
+ <!-- this property is needed to avoid a problem in openjpa -->
+ <name>openjpa.QueryCompilationCache</name>
+ <value>false</value>
+ </systemProperty>
+ </systemProperties>
+ <!-- need to override the src dir so src/main/resources are also included -->
+ <webAppSourceDirectory>${basedir}/src/main</webAppSourceDirectory>
+ <webXml>${basedir}/src/main/webapp/WEB-INF/web.xml</webXml>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ <tuscany.version>2.0-SNAPSHOT</tuscany.version>
+ <jetty.version>6.1.18</jetty.version>
+ </properties>
+ #end
</project> \ No newline at end of file
diff --git a/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/java/HelloworldService.java b/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
index 91e01f0648..a99cc7b032 100644
--- a/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
+++ b/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package ${package};
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface HelloworldService {
-
- String hello(String name);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package};
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface HelloworldService {
+
+ String hello(String name);
+
+}
diff --git a/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/resources/helloworld.wsdl b/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/resources/helloworld.wsdl
index 1cb338b283..46cf381577 100644
--- a/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/resources/helloworld.wsdl
+++ b/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/resources/helloworld.wsdl
@@ -1,82 +1,82 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-
-<wsdl:definitions
- targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
- xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
-
- <wsdl:types>
- <schema elementFormDefault="qualified"
- targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns="http://www.w3.org/2001/XMLSchema">
-
- <element name="hello">
- <complexType>
- <sequence>
- <element name="message" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
- </schema>
- </wsdl:types>
-
- <wsdl:message name="HelloMessage">
- <wsdl:part element="tns:hello" name="TestPart"/>
- </wsdl:message>
-
- <wsdl:portType name="HelloPortType">
- <wsdl:operation name="hello">
- <wsdl:input message="tns:HelloMessage" name="TestIn"/>
- <wsdl:output message="tns:HelloMessage" name="TestOut"/>
- </wsdl:operation>
- </wsdl:portType>
-
-
- <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="hello">
- <wsdlsoap:operation soapAction=""/>
- <wsdl:input name="TestIn">
- <wsdlsoap:body use="literal"/>
- </wsdl:input>
- <wsdl:output name="TestOut">
- <wsdlsoap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="HelloService">
- <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
- <soap:address location="http://localhost:8085/ode/processes/helloWorld"/>
- </wsdl:port>
- </wsdl:service>
-
- <plnk:partnerLinkType name="HelloPartnerLinkType">
- <plnk:role name="me" portType="tns:HelloPortType"/>
- <plnk:role name="you" portType="tns:HelloPortType"/>
- </plnk:partnerLinkType>
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<wsdl:definitions
+ targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+ xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified"
+ targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <element name="hello">
+ <complexType>
+ <sequence>
+ <element name="message" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="HelloMessage">
+ <wsdl:part element="tns:hello" name="TestPart"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloPortType">
+ <wsdl:operation name="hello">
+ <wsdl:input message="tns:HelloMessage" name="TestIn"/>
+ <wsdl:output message="tns:HelloMessage" name="TestOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+
+ <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="hello">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="TestIn">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="TestOut">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="HelloService">
+ <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
+ <soap:address location="http://localhost:8085/ode/processes/helloWorld"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="HelloPartnerLinkType">
+ <plnk:role name="me" portType="tns:HelloPortType"/>
+ <plnk:role name="you" portType="tns:HelloPortType"/>
+ </plnk:partnerLinkType>
</wsdl:definitions> \ No newline at end of file
diff --git a/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite b/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
index 3d3a101d93..c2aced55f0 100644
--- a/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
+++ b/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
@@ -1,37 +1,37 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:hns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
- targetNamespace="http://${package}"
- name="${artifactId}">
-
- <component name="WebComponent">
- <implementation.web web-uri=""/>
- <reference name="service" target="HelloworldComponent">
- <interface.java interface="${package}.HelloworldService"/>
- </reference>
- </component>
-
- <component name="HelloworldComponent">
- <implementation.bpel process="hns:HelloWorld"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ xmlns:hns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
+ targetNamespace="http://${package}"
+ name="${artifactId}">
+
+ <component name="WebComponent">
+ <implementation.web web-uri=""/>
+ <reference name="service" target="HelloworldComponent">
+ <interface.java interface="${package}.HelloworldService"/>
+ </reference>
+ </component>
+
+ <component name="HelloworldComponent">
+ <implementation.bpel process="hns:HelloWorld"/>
+ </component>
+
+</composite>
diff --git a/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
index f2bdfe3362..922d275b17 100644
--- a/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
+++ b/java/sca/archetypes/quickstart-bpel/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
@@ -1,41 +1,41 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<web-app version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
-
- <display-name>${artifactId}</display-name>
-
- <filter>
- <filter-name>tuscany.${artifactId}</filter-name>
- <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>tuscany.${artifactId}</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
- <welcome-file-list id="WelcomeFileList">
- <welcome-file>hello.jsp</welcome-file>
- </welcome-file-list>
-
-</web-app>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
+
+ <display-name>${artifactId}</display-name>
+
+ <filter>
+ <filter-name>tuscany.${artifactId}</filter-name>
+ <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>tuscany.${artifactId}</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>hello.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>
diff --git a/java/sca/archetypes/quickstart-jsf/pom.xml b/java/sca/archetypes/quickstart-jsf/pom.xml
index a6711957fa..ec26342ff9 100644
--- a/java/sca/archetypes/quickstart-jsf/pom.xml
+++ b/java/sca/archetypes/quickstart-jsf/pom.xml
@@ -1,50 +1,50 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-quickstart-jsf</artifactId>
- <packaging>maven-archetype</packaging>
- <name>Create a Tuscany SCA and JSF project</name>
-
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-4</version>
- </extension>
- </extensions>
- <plugins>
- <plugin>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-4</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-quickstart-jsf</artifactId>
+ <packaging>maven-archetype</packaging>
+ <name>Create a Tuscany SCA and JSF project</name>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-4</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-4</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/java/sca/archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype-metadata.xml b/java/sca/archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype-metadata.xml
index 01bb835c40..f15a12fb88 100644
--- a/java/sca/archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/java/sca/archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -1,44 +1,44 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<archetype-descriptor name="myproject">
- <fileSets>
- <fileSet filtered="true" packaged="true" encoding="UTF-8">
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
- <fileSet filtered="true" encoding="UTF-8">
- <directory>src/main/webapp</directory>
- <includes>
- <include>**/*.jsp</include>
- <include>**/*.xml</include>
- <include>**/*.html</include>
- <include>**/*.composite</include>
- </includes>
- </fileSet>
- <fileSet filtered="true" encoding="UTF-8">
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*.properties</include>
- </includes>
- </fileSet>
- </fileSets>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<archetype-descriptor name="myproject">
+ <fileSets>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/webapp</directory>
+ <includes>
+ <include>**/*.jsp</include>
+ <include>**/*.xml</include>
+ <include>**/*.html</include>
+ <include>**/*.composite</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*.properties</include>
+ </includes>
+ </fileSet>
+ </fileSets>
</archetype-descriptor> \ No newline at end of file
diff --git a/java/sca/archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype.xml b/java/sca/archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype.xml
index fcc5d91515..b5295d8a73 100644
--- a/java/sca/archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype.xml
+++ b/java/sca/archetypes/quickstart-jsf/src/main/resources/META-INF/maven/archetype.xml
@@ -1,38 +1,38 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<archetype>
- <id>quickstart-stripes</id>
- <sources>
- <source>src/main/java/sample/stripes/action/BaseActionBean.java</source>
- <source>src/main/java/sample/stripes/action/HomeActionBean.java</source>
- <source>src/main/java/sample/sca/HelloworldService.java</source>
- <source>src/main/java/sample/sca/HelloworldServiceImpl.java</source>
- </sources>
- <resources>
- <resource>src/main/resources/log4j.properties</resource>
- <resource>src/main/resources/StripesResources.properties</resource>
- <resource>src/main/webapp/index.html</resource>
- <resource>src/main/webapp/WEB-INF/jsp/home.jsp</resource>
- <resource>src/main/webapp/WEB-INF/jsp/layout.jsp</resource>
- <resource>src/main/webapp/WEB-INF/jsp/taglibs.jsp</resource>
- <resource>src/main/webapp/WEB-INF/web.composite</resource>
- <resource>src/main/webapp/WEB-INF/web.xml</resource>
- </resources>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<archetype>
+ <id>quickstart-stripes</id>
+ <sources>
+ <source>src/main/java/sample/stripes/action/BaseActionBean.java</source>
+ <source>src/main/java/sample/stripes/action/HomeActionBean.java</source>
+ <source>src/main/java/sample/sca/HelloworldService.java</source>
+ <source>src/main/java/sample/sca/HelloworldServiceImpl.java</source>
+ </sources>
+ <resources>
+ <resource>src/main/resources/log4j.properties</resource>
+ <resource>src/main/resources/StripesResources.properties</resource>
+ <resource>src/main/webapp/index.html</resource>
+ <resource>src/main/webapp/WEB-INF/jsp/home.jsp</resource>
+ <resource>src/main/webapp/WEB-INF/jsp/layout.jsp</resource>
+ <resource>src/main/webapp/WEB-INF/jsp/taglibs.jsp</resource>
+ <resource>src/main/webapp/WEB-INF/web.composite</resource>
+ <resource>src/main/webapp/WEB-INF/web.xml</resource>
+ </resources>
</archetype> \ No newline at end of file
diff --git a/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/pom.xml b/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/pom.xml
index 3c061fec03..f252e602ab 100644
--- a/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/pom.xml
+++ b/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/pom.xml
@@ -1,154 +1,154 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>${groupId}</groupId>
- <artifactId>${artifactId}</artifactId>
- <packaging>war</packaging>
- <version>${version}</version>
- #literal()<!-- TODO project name -->
- <name>quickstart-jsf</name>
- <description></description>
-
- <dependencies>
-
- <!-- Tuscany dependencies -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>${tuscany.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-myfaces</artifactId>
- <version>${tuscany.version}</version>
- </dependency>
-
- <!-- MyFaces JSF dependencies -->
- <dependency>
- <groupId>org.apache.myfaces.core</groupId>
- <artifactId>myfaces-api</artifactId>
- <version>1.2.2</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.myfaces.core</groupId>
- <artifactId>myfaces-impl</artifactId>
- <version>1.2.2</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.myfaces.tomahawk</groupId>
- <artifactId>tomahawk</artifactId>
- <version>1.1.6</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>jstl</groupId>
- <artifactId>jstl</artifactId>
- <version>1.2</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.0</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <defaultGoal>install</defaultGoal>
- <finalName>${artifactId}</finalName>
- <resources>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <filtering>false</filtering>
- <directory>src/test/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <inherited>true</inherited>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <optimise>true</optimise>
- <debug>true</debug>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>${jetty.version}</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <configuration>
- <downloadSources>true</downloadSources>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <properties>
- <tuscany.version>2.0-SNAPSHOT</tuscany.version>
- <myfaces.version>1.5</myfaces.version>
- <jetty.version>6.1.4</jetty.version>
- </properties>
- #end
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <packaging>war</packaging>
+ <version>${version}</version>
+ #literal()<!-- TODO project name -->
+ <name>quickstart-jsf</name>
+ <description></description>
+
+ <dependencies>
+
+ <!-- Tuscany dependencies -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-myfaces</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <!-- MyFaces JSF dependencies -->
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>1.2.2</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>1.2.2</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>tomahawk</artifactId>
+ <version>1.1.6</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>jstl</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.0</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <finalName>${artifactId}</finalName>
+ <resources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <filtering>false</filtering>
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <inherited>true</inherited>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <optimise>true</optimise>
+ <debug>true</debug>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>${jetty.version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ <tuscany.version>2.0-SNAPSHOT</tuscany.version>
+ <myfaces.version>1.5</myfaces.version>
+ <jetty.version>6.1.4</jetty.version>
+ </properties>
+ #end
+
+</project>
diff --git a/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/myfaces/HelloWorldController.java b/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/myfaces/HelloWorldController.java
index cea27930f7..e38c84feda 100644
--- a/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/myfaces/HelloWorldController.java
+++ b/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/myfaces/HelloWorldController.java
@@ -1,64 +1,64 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
-*/
-package ${package}.myfaces;
-
-import org.oasisopen.sca.annotation.Reference;
-
-import ${package}.sca.HelloworldService;
-
-/**
- * A typical simple backing bean, that is backed to <code>helloworld.jsp</code>
- *
- */
-public class HelloWorldController {
-
- //properties
- private String name;
-
- @Reference
- private HelloworldService service;
-
- /**
- * default empty constructor
- */
- public HelloWorldController(){
- }
-
- //-------------------getter & setter
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Method that is backed to a submit button of a form.
- */
- public String send(){
-
- // invoke the SCA reference
- name = service.sayHello(name);
-
- return "success";
- }
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+package ${package}.myfaces;
+
+import org.oasisopen.sca.annotation.Reference;
+
+import ${package}.sca.HelloworldService;
+
+/**
+ * A typical simple backing bean, that is backed to <code>helloworld.jsp</code>
+ *
+ */
+public class HelloWorldController {
+
+ //properties
+ private String name;
+
+ @Reference
+ private HelloworldService service;
+
+ /**
+ * default empty constructor
+ */
+ public HelloWorldController(){
+ }
+
+ //-------------------getter & setter
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Method that is backed to a submit button of a form.
+ */
+ public String send(){
+
+ // invoke the SCA reference
+ name = service.sayHello(name);
+
+ return "success";
+ }
} \ No newline at end of file
diff --git a/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java b/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java
index fb7a3ecdcf..d6cb7bbcf2 100644
--- a/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java
+++ b/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java
@@ -1,28 +1,28 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package ${package}.sca;
-
-public interface HelloworldService {
-
- String sayHello(String name);
-
-}
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package}.sca;
+
+public interface HelloworldService {
+
+ String sayHello(String name);
+
+}
diff --git a/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java b/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java
index c4c97dd933..ec9bfd7221 100644
--- a/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java
+++ b/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java
@@ -1,30 +1,30 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package ${package}.sca;
-
-public class HelloworldServiceImpl implements HelloworldService {
-
- public String sayHello(String name) {
- return "Hello " + name;
- }
-
-}
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package}.sca;
+
+public class HelloworldServiceImpl implements HelloworldService {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml b/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml
index 50753bc0ba..3b732de8af 100644
--- a/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml
+++ b/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml
@@ -1,53 +1,53 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<faces-config version="1.2"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xi="http://www.w3.org/2001/XInclude"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
-
- <!-- managed beans of the simple hello world app -->
- <managed-bean>
- <managed-bean-name>helloWorld</managed-bean-name>
- <managed-bean-class>${package}.myfaces.HelloWorldController</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- </managed-bean>
-
- <!-- navigation rules for helloWorld.jsp -->
- <navigation-rule>
- <from-view-id>/helloWorld.jsp</from-view-id>
- <navigation-case>
- <from-outcome>success</from-outcome>
- <to-view-id>/page2.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
-
- <!-- navigation rules for page2.jsp -->
- <navigation-rule>
- <from-view-id>/page2.jsp</from-view-id>
- <navigation-case>
- <from-outcome>back</from-outcome>
- <to-view-id>/helloWorld.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<faces-config version="1.2"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <!-- managed beans of the simple hello world app -->
+ <managed-bean>
+ <managed-bean-name>helloWorld</managed-bean-name>
+ <managed-bean-class>${package}.myfaces.HelloWorldController</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+
+ <!-- navigation rules for helloWorld.jsp -->
+ <navigation-rule>
+ <from-view-id>/helloWorld.jsp</from-view-id>
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/page2.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- navigation rules for page2.jsp -->
+ <navigation-rule>
+ <from-view-id>/page2.jsp</from-view-id>
+ <navigation-case>
+ <from-outcome>back</from-outcome>
+ <to-view-id>/helloWorld.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
</faces-config> \ No newline at end of file
diff --git a/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite b/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
index 18245e9a3f..eb86cee711 100644
--- a/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
+++ b/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
@@ -1,35 +1,35 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://${package}"
- name="${artifactId}">
-
- <component name="${artifactId}WebComponent">
- <implementation.web web-uri=""/>
- <reference name="service" target="HelloworldComponent"/>
- </component>
-
- <component name="HelloworldComponent">
- <implementation.java class="${package}.sca.HelloworldServiceImpl"/>
- </component>
-
-</composite>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ targetNamespace="http://${package}"
+ name="${artifactId}">
+
+ <component name="${artifactId}WebComponent">
+ <implementation.web web-uri=""/>
+ <reference name="service" target="HelloworldComponent"/>
+ </component>
+
+ <component name="HelloworldComponent">
+ <implementation.java class="${package}.sca.HelloworldServiceImpl"/>
+ </component>
+
+</composite>
+
diff --git a/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
index 3e853708d2..48b73fe68a 100644
--- a/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
+++ b/java/sca/archetypes/quickstart-jsf/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
@@ -1,230 +1,230 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
- version="2.4">
-
- <display-name>${artifactId}</display-name>
-
- <!-- The only web.xml change to the MyFaces Helloworld sample is to add
- the Tuscany listener and annotation processor context parameter -->
- <listener>
- <listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class>
- </listener>
- <context-param>
- <param-name>org.apache.myfaces.config.annotation.LifecycleProvider</param-name>
- <param-value>org.apache.tuscany.sca.myfaces.TuscanyAnnotationLifecycleProvider</param-value>
- </context-param>
-
- <!--optional: context-param>
- <description>Comma separated list of URIs of (additional) faces config files.
- (e.g. /WEB-INF/my-config.xml)
- See JSF 1.0 PRD2, 10.3.2
- Attention: You do not need to put /WEB-INF/faces-config.xml in here.
- </description>
- <param-name>javax.faces.CONFIG_FILES</param-name>
- <param-value>/WEB-INF/examples-config.xml</param-value>
- </context-param-->
- <context-param>
- <description>State saving method: "client" or "server" (= default)
- See JSF Specification 2.5.3</description>
- <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
- <param-value>client</param-value>
- </context-param>
- <context-param>
- <description>Only applicable if state saving method is "server" (= default).
- Defines the amount (default = 20) of the latest views are stored in session.</description>
- <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
- <param-value>20</param-value>
- </context-param>
- <context-param>
- <description>Only applicable if state saving method is "server" (= default).
- If true (default) the state will be serialized to a byte stream before it
- is written to the session.
- If false the state will not be serialized to a byte stream.</description>
- <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <description>Only applicable if state saving method is "server" (= default) and if
- org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (= default)
- If true (default) the serialized state will be compressed before it
- is written to the session. If false the state will not be compressed.</description>
- <param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <description>This parameter tells MyFaces if javascript code should be allowed in the
- rendered HTML output.
- If javascript is allowed, command_link anchors will have javascript code
- that submits the corresponding form.
- If javascript is not allowed, the state saving info and nested parameters
- will be added as url parameters.
- Default: "true"</description>
- <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
- <param-value>false</param-value>
- </context-param>
- <context-param>
- <description>If true, rendered HTML code will be formatted, so that it is "human readable".
- i.e. additional line separators and whitespace will be written, that do not
- influence the HTML code.
- Default: "true"</description>
- <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <description>If true, a javascript function will be rendered that is able to restore the
- former vertical scroll on every request. Convenient feature if you have pages
- with long lists and you do not want the browser page to always jump to the top
- if you trigger a link or button action that stays on the same page.
- Default: "false"</description>
- <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
- <param-value>true</param-value>
- </context-param>
-
- <context-param>
- <description>Used for encrypting view state. Only relevant for client side
- state saving. See MyFaces wiki/web site documentation for instructions
- on how to configure an application for diffenent encryption strengths.
- </description>
- <param-name>org.apache.myfaces.SECRET</param-name>
- <param-value>NzY1NDMyMTA=</param-value>
- </context-param>
-
- <context-param>
- <description>
- Validate managed beans, navigation rules and ensure that forms are not nested.
- </description>
- <param-name>org.apache.myfaces.VALIDATE</param-name>
- <param-value>true</param-value>
- </context-param>
-
- <context-param>
- <description>
- Treat readonly same as if disabled attribute was set for select elements.
- </description>
- <param-name>org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS</param-name>
- <param-value>true</param-value>
- </context-param>
-
- <context-param>
- <description>
- Use the defined class as the class which will be called when a resource is added to the
- ExtensionFilter handling. Using StreamingAddResource here helps with performance. If you want to add
- custom components and want to use the ExtensionFilter, you need to provide your custom implementation here.
- </description>
- <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
- <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
- </context-param>
-
- <context-param>
- <description>
- Virtual path in the URL which triggers loading of resources for the MyFaces extended components
- in the ExtensionFilter.
- </description>
- <param-name>org.apache.myfaces.RESOURCE_VIRTUAL_PATH</param-name>
- <param-value>/faces/myFacesExtensionResource</param-value>
- </context-param>
-
- <context-param>
- <description>
- Check if the extensions-filter has been properly configured.
- </description>
- <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
- <param-value>true</param-value>
- </context-param>
-
- <context-param>
- <description>
- Define partial state saving as true/false.
- </description>
- <param-name>javax.faces.PARTIAL_STATE_SAVING_METHOD</param-name>
- <param-value>false</param-value>
- </context-param>
-
- <!-- Extensions Filter -->
- <filter>
- <filter-name>extensionsFilter</filter-name>
- <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
- <init-param>
- <description>Set the size limit for uploaded files.
- Format: 10 - 10 bytes
- 10k - 10 KB
- 10m - 10 MB
- 1g - 1 GB</description>
- <param-name>uploadMaxFileSize</param-name>
- <param-value>100m</param-value>
- </init-param>
- <init-param>
- <description>Set the threshold size - files
- below this limit are stored in memory, files above
- this limit are stored on disk.
-
- Format: 10 - 10 bytes
- 10k - 10 KB
- 10m - 10 MB
- 1g - 1 GB</description>
- <param-name>uploadThresholdSize</param-name>
- <param-value>100k</param-value>
- </init-param>
- </filter>
-
- <filter-mapping>
- <filter-name>extensionsFilter</filter-name>
- <url-pattern>*.jsf</url-pattern>
- </filter-mapping>
- <filter-mapping>
- <filter-name>extensionsFilter</filter-name>
- <url-pattern>/faces/*</url-pattern>
- </filter-mapping>
-
- <!-- Listener, to allow Jetty serving MyFaces apps -->
- <listener>
- <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
- </listener>
-
- <!-- Faces Servlet -->
- <servlet>
- <servlet-name>Faces Servlet</servlet-name>
- <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
-
- <!-- Faces Servlet Mapping -->
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>*.jsf</url-pattern>
- </servlet-mapping>
-
- <!-- Welcome files -->
- <welcome-file-list>
- <welcome-file>index.jsp</welcome-file>
- <welcome-file>index.html</welcome-file>
- </welcome-file-list>
-
-</web-app>
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <display-name>${artifactId}</display-name>
+
+ <!-- The only web.xml change to the MyFaces Helloworld sample is to add
+ the Tuscany listener and annotation processor context parameter -->
+ <listener>
+ <listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class>
+ </listener>
+ <context-param>
+ <param-name>org.apache.myfaces.config.annotation.LifecycleProvider</param-name>
+ <param-value>org.apache.tuscany.sca.myfaces.TuscanyAnnotationLifecycleProvider</param-value>
+ </context-param>
+
+ <!--optional: context-param>
+ <description>Comma separated list of URIs of (additional) faces config files.
+ (e.g. /WEB-INF/my-config.xml)
+ See JSF 1.0 PRD2, 10.3.2
+ Attention: You do not need to put /WEB-INF/faces-config.xml in here.
+ </description>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/examples-config.xml</param-value>
+ </context-param-->
+ <context-param>
+ <description>State saving method: "client" or "server" (= default)
+ See JSF Specification 2.5.3</description>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>client</param-value>
+ </context-param>
+ <context-param>
+ <description>Only applicable if state saving method is "server" (= default).
+ Defines the amount (default = 20) of the latest views are stored in session.</description>
+ <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
+ <param-value>20</param-value>
+ </context-param>
+ <context-param>
+ <description>Only applicable if state saving method is "server" (= default).
+ If true (default) the state will be serialized to a byte stream before it
+ is written to the session.
+ If false the state will not be serialized to a byte stream.</description>
+ <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <description>Only applicable if state saving method is "server" (= default) and if
+ org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (= default)
+ If true (default) the serialized state will be compressed before it
+ is written to the session. If false the state will not be compressed.</description>
+ <param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <description>This parameter tells MyFaces if javascript code should be allowed in the
+ rendered HTML output.
+ If javascript is allowed, command_link anchors will have javascript code
+ that submits the corresponding form.
+ If javascript is not allowed, the state saving info and nested parameters
+ will be added as url parameters.
+ Default: "true"</description>
+ <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <description>If true, rendered HTML code will be formatted, so that it is "human readable".
+ i.e. additional line separators and whitespace will be written, that do not
+ influence the HTML code.
+ Default: "true"</description>
+ <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <description>If true, a javascript function will be rendered that is able to restore the
+ former vertical scroll on every request. Convenient feature if you have pages
+ with long lists and you do not want the browser page to always jump to the top
+ if you trigger a link or button action that stays on the same page.
+ Default: "false"</description>
+ <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>Used for encrypting view state. Only relevant for client side
+ state saving. See MyFaces wiki/web site documentation for instructions
+ on how to configure an application for diffenent encryption strengths.
+ </description>
+ <param-name>org.apache.myfaces.SECRET</param-name>
+ <param-value>NzY1NDMyMTA=</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Validate managed beans, navigation rules and ensure that forms are not nested.
+ </description>
+ <param-name>org.apache.myfaces.VALIDATE</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Treat readonly same as if disabled attribute was set for select elements.
+ </description>
+ <param-name>org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Use the defined class as the class which will be called when a resource is added to the
+ ExtensionFilter handling. Using StreamingAddResource here helps with performance. If you want to add
+ custom components and want to use the ExtensionFilter, you need to provide your custom implementation here.
+ </description>
+ <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
+ <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Virtual path in the URL which triggers loading of resources for the MyFaces extended components
+ in the ExtensionFilter.
+ </description>
+ <param-name>org.apache.myfaces.RESOURCE_VIRTUAL_PATH</param-name>
+ <param-value>/faces/myFacesExtensionResource</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Check if the extensions-filter has been properly configured.
+ </description>
+ <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Define partial state saving as true/false.
+ </description>
+ <param-name>javax.faces.PARTIAL_STATE_SAVING_METHOD</param-name>
+ <param-value>false</param-value>
+ </context-param>
+
+ <!-- Extensions Filter -->
+ <filter>
+ <filter-name>extensionsFilter</filter-name>
+ <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
+ <init-param>
+ <description>Set the size limit for uploaded files.
+ Format: 10 - 10 bytes
+ 10k - 10 KB
+ 10m - 10 MB
+ 1g - 1 GB</description>
+ <param-name>uploadMaxFileSize</param-name>
+ <param-value>100m</param-value>
+ </init-param>
+ <init-param>
+ <description>Set the threshold size - files
+ below this limit are stored in memory, files above
+ this limit are stored on disk.
+
+ Format: 10 - 10 bytes
+ 10k - 10 KB
+ 10m - 10 MB
+ 1g - 1 GB</description>
+ <param-name>uploadThresholdSize</param-name>
+ <param-value>100k</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>extensionsFilter</filter-name>
+ <url-pattern>*.jsf</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>extensionsFilter</filter-name>
+ <url-pattern>/faces/*</url-pattern>
+ </filter-mapping>
+
+ <!-- Listener, to allow Jetty serving MyFaces apps -->
+ <listener>
+ <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
+ </listener>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- Faces Servlet Mapping -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+ <!-- Welcome files -->
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+</web-app>
diff --git a/java/sca/archetypes/quickstart-stripes/pom.xml b/java/sca/archetypes/quickstart-stripes/pom.xml
index a9d1ba7431..af6ae0be3c 100644
--- a/java/sca/archetypes/quickstart-stripes/pom.xml
+++ b/java/sca/archetypes/quickstart-stripes/pom.xml
@@ -1,50 +1,50 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-quickstart-stripes</artifactId>
- <packaging>maven-archetype</packaging>
- <name>Create a simple Apache Tuscany SCA webapp project using the Stripes Web Framework</name>
-
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-4</version>
- </extension>
- </extensions>
- <plugins>
- <plugin>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-4</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-quickstart-stripes</artifactId>
+ <packaging>maven-archetype</packaging>
+ <name>Create a simple Apache Tuscany SCA webapp project using the Stripes Web Framework</name>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-4</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-4</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/java/sca/archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype-metadata.xml b/java/sca/archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype-metadata.xml
index 01bb835c40..f15a12fb88 100644
--- a/java/sca/archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/java/sca/archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -1,44 +1,44 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<archetype-descriptor name="myproject">
- <fileSets>
- <fileSet filtered="true" packaged="true" encoding="UTF-8">
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
- <fileSet filtered="true" encoding="UTF-8">
- <directory>src/main/webapp</directory>
- <includes>
- <include>**/*.jsp</include>
- <include>**/*.xml</include>
- <include>**/*.html</include>
- <include>**/*.composite</include>
- </includes>
- </fileSet>
- <fileSet filtered="true" encoding="UTF-8">
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*.properties</include>
- </includes>
- </fileSet>
- </fileSets>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<archetype-descriptor name="myproject">
+ <fileSets>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/webapp</directory>
+ <includes>
+ <include>**/*.jsp</include>
+ <include>**/*.xml</include>
+ <include>**/*.html</include>
+ <include>**/*.composite</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*.properties</include>
+ </includes>
+ </fileSet>
+ </fileSets>
</archetype-descriptor> \ No newline at end of file
diff --git a/java/sca/archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype.xml b/java/sca/archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype.xml
index fcc5d91515..b5295d8a73 100644
--- a/java/sca/archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype.xml
+++ b/java/sca/archetypes/quickstart-stripes/src/main/resources/META-INF/maven/archetype.xml
@@ -1,38 +1,38 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<archetype>
- <id>quickstart-stripes</id>
- <sources>
- <source>src/main/java/sample/stripes/action/BaseActionBean.java</source>
- <source>src/main/java/sample/stripes/action/HomeActionBean.java</source>
- <source>src/main/java/sample/sca/HelloworldService.java</source>
- <source>src/main/java/sample/sca/HelloworldServiceImpl.java</source>
- </sources>
- <resources>
- <resource>src/main/resources/log4j.properties</resource>
- <resource>src/main/resources/StripesResources.properties</resource>
- <resource>src/main/webapp/index.html</resource>
- <resource>src/main/webapp/WEB-INF/jsp/home.jsp</resource>
- <resource>src/main/webapp/WEB-INF/jsp/layout.jsp</resource>
- <resource>src/main/webapp/WEB-INF/jsp/taglibs.jsp</resource>
- <resource>src/main/webapp/WEB-INF/web.composite</resource>
- <resource>src/main/webapp/WEB-INF/web.xml</resource>
- </resources>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<archetype>
+ <id>quickstart-stripes</id>
+ <sources>
+ <source>src/main/java/sample/stripes/action/BaseActionBean.java</source>
+ <source>src/main/java/sample/stripes/action/HomeActionBean.java</source>
+ <source>src/main/java/sample/sca/HelloworldService.java</source>
+ <source>src/main/java/sample/sca/HelloworldServiceImpl.java</source>
+ </sources>
+ <resources>
+ <resource>src/main/resources/log4j.properties</resource>
+ <resource>src/main/resources/StripesResources.properties</resource>
+ <resource>src/main/webapp/index.html</resource>
+ <resource>src/main/webapp/WEB-INF/jsp/home.jsp</resource>
+ <resource>src/main/webapp/WEB-INF/jsp/layout.jsp</resource>
+ <resource>src/main/webapp/WEB-INF/jsp/taglibs.jsp</resource>
+ <resource>src/main/webapp/WEB-INF/web.composite</resource>
+ <resource>src/main/webapp/WEB-INF/web.xml</resource>
+ </resources>
</archetype> \ No newline at end of file
diff --git a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/pom.xml b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/pom.xml
index 068d0627e7..7586f8aabc 100644
--- a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/pom.xml
+++ b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/pom.xml
@@ -1,124 +1,124 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>${groupId}</groupId>
- <artifactId>${artifactId}</artifactId>
- <packaging>war</packaging>
- <version>${version}</version>
- #literal()<!-- TODO project name -->
- <name>quickstart-stripes</name>
- <description></description>
-
- <dependencies>
-
- <!-- Tuscany dependencies -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>${tuscany.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-stripes</artifactId>
- <version>${tuscany.version}</version>
- </dependency>
-
- <!-- Stripes Framework dependencies -->
- <dependency>
- <groupId>net.sourceforge.stripes</groupId>
- <artifactId>stripes</artifactId>
- <version>${stripes.version}</version>
- </dependency>
- <dependency>
- <groupId>taglibs</groupId>
- <artifactId>standard</artifactId>
- <version>1.1.2</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <defaultGoal>install</defaultGoal>
- <finalName>${artifactId}</finalName>
- <resources>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <filtering>false</filtering>
- <directory>src/test/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <inherited>true</inherited>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <optimise>true</optimise>
- <debug>true</debug>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>${jetty.version}</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <configuration>
- <downloadSources>true</downloadSources>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <properties>
- <tuscany.version>2.0-SNAPSHOT</tuscany.version>
- <stripes.version>1.5</stripes.version>
- <jetty.version>6.1.4</jetty.version>
- </properties>
- #end
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <packaging>war</packaging>
+ <version>${version}</version>
+ #literal()<!-- TODO project name -->
+ <name>quickstart-stripes</name>
+ <description></description>
+
+ <dependencies>
+
+ <!-- Tuscany dependencies -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-stripes</artifactId>
+ <version>${tuscany.version}</version>
+ </dependency>
+
+ <!-- Stripes Framework dependencies -->
+ <dependency>
+ <groupId>net.sourceforge.stripes</groupId>
+ <artifactId>stripes</artifactId>
+ <version>${stripes.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>taglibs</groupId>
+ <artifactId>standard</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <finalName>${artifactId}</finalName>
+ <resources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <filtering>false</filtering>
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <inherited>true</inherited>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <optimise>true</optimise>
+ <debug>true</debug>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>${jetty.version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ <tuscany.version>2.0-SNAPSHOT</tuscany.version>
+ <stripes.version>1.5</stripes.version>
+ <jetty.version>6.1.4</jetty.version>
+ </properties>
+ #end
+
+</project>
diff --git a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java
index fb7a3ecdcf..d6cb7bbcf2 100644
--- a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java
+++ b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldService.java
@@ -1,28 +1,28 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package ${package}.sca;
-
-public interface HelloworldService {
-
- String sayHello(String name);
-
-}
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package}.sca;
+
+public interface HelloworldService {
+
+ String sayHello(String name);
+
+}
diff --git a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java
index 030cea25b5..390b424d24 100644
--- a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java
+++ b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/sca/HelloworldServiceImpl.java
@@ -1,31 +1,31 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package ${package}.sca;
-
-
-public class HelloworldServiceImpl implements HelloworldService {
-
- public String sayHello(String name) {
- return "Hello " + name;
- }
-
-}
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package}.sca;
+
+
+public class HelloworldServiceImpl implements HelloworldService {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/BaseActionBean.java b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/BaseActionBean.java
index a17b4ab268..5bfa1c5d32 100644
--- a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/BaseActionBean.java
+++ b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/BaseActionBean.java
@@ -1,36 +1,36 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package ${package}.stripes.action;
-
-import net.sourceforge.stripes.action.ActionBean;
-import net.sourceforge.stripes.action.ActionBeanContext;
-
-public class BaseActionBean implements ActionBean {
- private ActionBeanContext context;
-
- public ActionBeanContext getContext() {
- return context;
- }
- public void setContext(ActionBeanContext context) {
- this.context = context;
- }
-}
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package}.stripes.action;
+
+import net.sourceforge.stripes.action.ActionBean;
+import net.sourceforge.stripes.action.ActionBeanContext;
+
+public class BaseActionBean implements ActionBean {
+ private ActionBeanContext context;
+
+ public ActionBeanContext getContext() {
+ return context;
+ }
+ public void setContext(ActionBeanContext context) {
+ this.context = context;
+ }
+}
diff --git a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/HomeActionBean.java b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/HomeActionBean.java
index 89d897f879..05fd743841 100644
--- a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/HomeActionBean.java
+++ b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/java/stripes/action/HomeActionBean.java
@@ -1,48 +1,48 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package ${package}.stripes.action;
-
-import net.sourceforge.stripes.action.DefaultHandler;
-import net.sourceforge.stripes.action.ForwardResolution;
-import net.sourceforge.stripes.action.Resolution;
-import net.sourceforge.stripes.action.UrlBinding;
-
-import org.oasisopen.sca.annotation.Reference;
-
-import ${package}.sca.HelloworldService;
-
-@UrlBinding("/Home.htm")
-public class HomeActionBean extends BaseActionBean {
-
- @Reference
- HelloworldService service;
-
- @DefaultHandler
- public Resolution view() {
- return new ForwardResolution("/WEB-INF/jsp/home.jsp");
- }
-
- public String getHello() {
- return service.sayHello("world");
- }
-
-}
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package}.stripes.action;
+
+import net.sourceforge.stripes.action.DefaultHandler;
+import net.sourceforge.stripes.action.ForwardResolution;
+import net.sourceforge.stripes.action.Resolution;
+import net.sourceforge.stripes.action.UrlBinding;
+
+import org.oasisopen.sca.annotation.Reference;
+
+import ${package}.sca.HelloworldService;
+
+@UrlBinding("/Home.htm")
+public class HomeActionBean extends BaseActionBean {
+
+ @Reference
+ HelloworldService service;
+
+ @DefaultHandler
+ public Resolution view() {
+ return new ForwardResolution("/WEB-INF/jsp/home.jsp");
+ }
+
+ public String getHello() {
+ return service.sayHello("world");
+ }
+
+}
diff --git a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/StripesResources.properties b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/StripesResources.properties
index 81a01a547e..6567f21ce1 100644
--- a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/StripesResources.properties
+++ b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/StripesResources.properties
@@ -1,77 +1,77 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-
-${symbol_pound} Resource strings used by the <stripes:errors> tag when there are no nested tags
-stripes.errors.header=<div style="color:${symbol_pound}b72222; font-weight: bold">Please fix the following errors:</div><ol>
-stripes.errors.beforeError=<li style="color: ${symbol_pound}b72222;">
-stripes.errors.afterError=</li>
-stripes.errors.footer=</ol>
-
-${symbol_pound} Resource strings used by the <stripes:errors> tag when displaying errors for a
-${symbol_pound} specific field (e.g. <stripes:errors field="password"/>). If not supplied the
-${symbol_pound} values above will be used instead.
-stripes.fieldErrors.header=
-stripes.fieldErrors.beforeError=<span style="color: ${symbol_pound}b72222;">
-stripes.fieldErrors.afterError=</span><br />
-stripes.fieldErrors.footer=
-
-${symbol_pound} Resource strings used by the stripes:messages tag
-stripes.messages.header=<ul class="messages">
-stripes.messages.beforeMessage=<li>
-stripes.messages.afterMessage=</li>
-stripes.messages.footer=</ul>
-
-${symbol_pound} Validation error messages produced by Stripes' built-in converter classes. These
-${symbol_pound} are default error messages and can be overridden on per-field and per-form levels.
-${symbol_pound} Using the 'invalidNumber' error for a field 'age' of a form posting to
-${symbol_pound} '/user/Profile.action', the keys looked for (in order) would be:
-${symbol_pound} 1: /user/Profile.action.age.invalidNumber
-${symbol_pound} 2: /user/Profile.action.age.errorMessage
-${symbol_pound} 3: age.errorMessage
-${symbol_pound} 4: /user/Profile.action.invalidNumber
-${symbol_pound} 5: converter.number.invalidNumber
-converter.number.invalidNumber=The value ({1}) entered in field {0} must be a valid number
-converter.byte.outOfRange=The value ({1}) entered in field {0} was out of the range {2} to {3}
-converter.short.outOfRange=The value ({1}) entered in field {0} was out of the range {2} to {3}
-converter.integer.outOfRange=The value ({1}) entered in field {0} was out of the range {2} to {3}
-converter.float.outOfRange=The value ({1}) entered in field {0} was out of the range {2} to {3}
-converter.enum.notAnEnumeratedValue=The value "{1}" is not a valid value for field {0}
-converter.date.invalidDate=The value ({1}) entered in field {0} must be a valid date
-converter.email.invalidEmail=The value ({1}) entered is not a valid email address
-converter.creditCard.invalidCreditCard=The value ({1}) entered is not a valid credit card number
-
-${symbol_pound} Validation error messages produced by Stripes' annotation based validations. These
-${symbol_pound} are default error messages and can be overridden on per-field and per-form levels.
-${symbol_pound} Using the 'valueNotPresent' required field error for a field 'username' of a form
-${symbol_pound} posting to '/user/Register.action', the keys looked for (in order) would be:
-${symbol_pound} 1: /user/Register.action.username.valueNotPresent
-${symbol_pound} 2: /user/Register.action.username.errorMessage
-${symbol_pound} 3: username.errorMessage
-${symbol_pound} 4: /user/Register.action.valueNotPresent
-${symbol_pound} 5: validation.required.valueNotPresent
-validation.required.valueNotPresent={0} is a required field
-validation.minlength.valueTooShort={0} must be at least {2} characters long
-validation.maxlength.valueTooLong={0} must be no more than {2} characters long
-validation.minvalue.valueBelowMinimum=The minimum allowed value for {0} is {2}
-validation.maxvalue.valueAboveMaximum=The maximum allowed value for {0} is {2}
-validation.mask.valueDoesNotMatch=<em>{1}</em> is not a valid {0}
-validation.expression.valueFailedExpression=The value supplied ({1}) for field {0} is invalid
-validation.file.postBodyTooBig=Total upload size of {3} KB exceeds the maximum size of {2} KB
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+
+${symbol_pound} Resource strings used by the <stripes:errors> tag when there are no nested tags
+stripes.errors.header=<div style="color:${symbol_pound}b72222; font-weight: bold">Please fix the following errors:</div><ol>
+stripes.errors.beforeError=<li style="color: ${symbol_pound}b72222;">
+stripes.errors.afterError=</li>
+stripes.errors.footer=</ol>
+
+${symbol_pound} Resource strings used by the <stripes:errors> tag when displaying errors for a
+${symbol_pound} specific field (e.g. <stripes:errors field="password"/>). If not supplied the
+${symbol_pound} values above will be used instead.
+stripes.fieldErrors.header=
+stripes.fieldErrors.beforeError=<span style="color: ${symbol_pound}b72222;">
+stripes.fieldErrors.afterError=</span><br />
+stripes.fieldErrors.footer=
+
+${symbol_pound} Resource strings used by the stripes:messages tag
+stripes.messages.header=<ul class="messages">
+stripes.messages.beforeMessage=<li>
+stripes.messages.afterMessage=</li>
+stripes.messages.footer=</ul>
+
+${symbol_pound} Validation error messages produced by Stripes' built-in converter classes. These
+${symbol_pound} are default error messages and can be overridden on per-field and per-form levels.
+${symbol_pound} Using the 'invalidNumber' error for a field 'age' of a form posting to
+${symbol_pound} '/user/Profile.action', the keys looked for (in order) would be:
+${symbol_pound} 1: /user/Profile.action.age.invalidNumber
+${symbol_pound} 2: /user/Profile.action.age.errorMessage
+${symbol_pound} 3: age.errorMessage
+${symbol_pound} 4: /user/Profile.action.invalidNumber
+${symbol_pound} 5: converter.number.invalidNumber
+converter.number.invalidNumber=The value ({1}) entered in field {0} must be a valid number
+converter.byte.outOfRange=The value ({1}) entered in field {0} was out of the range {2} to {3}
+converter.short.outOfRange=The value ({1}) entered in field {0} was out of the range {2} to {3}
+converter.integer.outOfRange=The value ({1}) entered in field {0} was out of the range {2} to {3}
+converter.float.outOfRange=The value ({1}) entered in field {0} was out of the range {2} to {3}
+converter.enum.notAnEnumeratedValue=The value "{1}" is not a valid value for field {0}
+converter.date.invalidDate=The value ({1}) entered in field {0} must be a valid date
+converter.email.invalidEmail=The value ({1}) entered is not a valid email address
+converter.creditCard.invalidCreditCard=The value ({1}) entered is not a valid credit card number
+
+${symbol_pound} Validation error messages produced by Stripes' annotation based validations. These
+${symbol_pound} are default error messages and can be overridden on per-field and per-form levels.
+${symbol_pound} Using the 'valueNotPresent' required field error for a field 'username' of a form
+${symbol_pound} posting to '/user/Register.action', the keys looked for (in order) would be:
+${symbol_pound} 1: /user/Register.action.username.valueNotPresent
+${symbol_pound} 2: /user/Register.action.username.errorMessage
+${symbol_pound} 3: username.errorMessage
+${symbol_pound} 4: /user/Register.action.valueNotPresent
+${symbol_pound} 5: validation.required.valueNotPresent
+validation.required.valueNotPresent={0} is a required field
+validation.minlength.valueTooShort={0} must be at least {2} characters long
+validation.maxlength.valueTooLong={0} must be no more than {2} characters long
+validation.minvalue.valueBelowMinimum=The minimum allowed value for {0} is {2}
+validation.maxvalue.valueAboveMaximum=The maximum allowed value for {0} is {2}
+validation.mask.valueDoesNotMatch=<em>{1}</em> is not a valid {0}
+validation.expression.valueFailedExpression=The value supplied ({1}) for field {0} is invalid
+validation.file.postBodyTooBig=Total upload size of {3} KB exceeds the maximum size of {2} KB
diff --git a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/log4j.properties b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/log4j.properties
index d9ed00c533..e2fd1997c8 100644
--- a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/log4j.properties
+++ b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/resources/log4j.properties
@@ -1,51 +1,51 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-${symbol_pound} log4j.properties
-
-${symbol_pound} Set up a logger to the console
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %-5p %c %x - %m%n
-
-${symbol_pound} Use this to only see log messages beyond a certain threshold in the console
-${symbol_pound}log4j.appender.stdout.Threshold=WARN
-
-${symbol_pound} Set up a logger to a log file
-log4j.appender.logfile=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
-log4j.appender.logfile.layout.ConversionPattern=[%d{HH:mm:ss}] %-5p %c %x - %m%n
-log4j.appender.logfile.File=${symbol_dollar}{user.home}/stripesquick.log
-log4j.appender.logfile.DatePattern='.'yyyy-MM-dd
-
-${symbol_pound} Use this to only see log messages beyond a certain threshold in the log file
-${symbol_pound}log4j.appender.logfile.Threshold=WARN
-
-${symbol_pound} Logger settings
-log4j.rootLogger=INFO, stdout, logfile
-
-${symbol_pound} Valid levels are TRACE, DEBUG, INFO, WARN, ERROR, FATAL
-${symbol_pound} Change to TRACE or DEBUG to see more log messages
-log4j.logger.net.sourceforge.stripes=WARN
-log4j.logger.org.stripesbook.quickstart=INFO
-log4j.logger.org.mortbay.log=INFO
-log4j.logger.org=WARN
-log4j.logger.com=WARN
-log4j.logger.net=WARN
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+${symbol_pound} log4j.properties
+
+${symbol_pound} Set up a logger to the console
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %-5p %c %x - %m%n
+
+${symbol_pound} Use this to only see log messages beyond a certain threshold in the console
+${symbol_pound}log4j.appender.stdout.Threshold=WARN
+
+${symbol_pound} Set up a logger to a log file
+log4j.appender.logfile=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
+log4j.appender.logfile.layout.ConversionPattern=[%d{HH:mm:ss}] %-5p %c %x - %m%n
+log4j.appender.logfile.File=${symbol_dollar}{user.home}/stripesquick.log
+log4j.appender.logfile.DatePattern='.'yyyy-MM-dd
+
+${symbol_pound} Use this to only see log messages beyond a certain threshold in the log file
+${symbol_pound}log4j.appender.logfile.Threshold=WARN
+
+${symbol_pound} Logger settings
+log4j.rootLogger=INFO, stdout, logfile
+
+${symbol_pound} Valid levels are TRACE, DEBUG, INFO, WARN, ERROR, FATAL
+${symbol_pound} Change to TRACE or DEBUG to see more log messages
+log4j.logger.net.sourceforge.stripes=WARN
+log4j.logger.org.stripesbook.quickstart=INFO
+log4j.logger.org.mortbay.log=INFO
+log4j.logger.org=WARN
+log4j.logger.com=WARN
+log4j.logger.net=WARN
diff --git a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
index 686de0740e..4ffadbe621 100644
--- a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
+++ b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://${package}"
- name="${artifactId}">
-
- <component name="${artifactId}WebComponent">
- <implementation.web web-uri=""/>
- <reference name="service" target="HelloworldComponent"/>
- </component>
-
- <component name="HelloworldComponent">
- <implementation.java class="${package}.sca.HelloworldServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ targetNamespace="http://${package}"
+ name="${artifactId}">
+
+ <component name="${artifactId}WebComponent">
+ <implementation.web web-uri=""/>
+ <reference name="service" target="HelloworldComponent"/>
+ </component>
+
+ <component name="HelloworldComponent">
+ <implementation.java class="${package}.sca.HelloworldServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
index c24be378f8..d73e7311d6 100644
--- a/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
+++ b/java/sca/archetypes/quickstart-stripes/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
@@ -1,68 +1,68 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
- <display-name>${artifactId}</display-name>
-
- <listener>
- <listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class>
- </listener>
-
- <filter>
- <filter-name>StripesFilter</filter-name>
- <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
- <init-param>
- <param-name>ActionResolver.Packages</param-name>
- <param-value>${package}.stripes.action</param-value>
- </init-param>
- <init-param>
- <param-name>Extension.Packages</param-name>
- <param-value>org.apache.tuscany.sca.stripes</param-value>
- </init-param>
- </filter>
-
- <servlet>
- <servlet-name>DispatcherServlet</servlet-name>
- <servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
-
- <filter-mapping>
- <filter-name>StripesFilter</filter-name>
- <servlet-name>DispatcherServlet</servlet-name>
- <dispatcher>REQUEST</dispatcher>
- <dispatcher>FORWARD</dispatcher>
- </filter-mapping>
-
- <servlet-mapping>
- <servlet-name>DispatcherServlet</servlet-name>
- <url-pattern>*.htm</url-pattern>
- </servlet-mapping>
-
- <welcome-file-list>
- <welcome-file>index.html</welcome-file>
- </welcome-file-list>
-
-</web-app>
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <display-name>${artifactId}</display-name>
+
+ <listener>
+ <listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>StripesFilter</filter-name>
+ <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
+ <init-param>
+ <param-name>ActionResolver.Packages</param-name>
+ <param-value>${package}.stripes.action</param-value>
+ </init-param>
+ <init-param>
+ <param-name>Extension.Packages</param-name>
+ <param-value>org.apache.tuscany.sca.stripes</param-value>
+ </init-param>
+ </filter>
+
+ <servlet>
+ <servlet-name>DispatcherServlet</servlet-name>
+ <servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <filter-mapping>
+ <filter-name>StripesFilter</filter-name>
+ <servlet-name>DispatcherServlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ </filter-mapping>
+
+ <servlet-mapping>
+ <servlet-name>DispatcherServlet</servlet-name>
+ <url-pattern>*.htm</url-pattern>
+ </servlet-mapping>
+
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+</web-app>
diff --git a/java/sca/archetypes/quickstart/pom.xml b/java/sca/archetypes/quickstart/pom.xml
index 859fa5b0ae..583acbb297 100644
--- a/java/sca/archetypes/quickstart/pom.xml
+++ b/java/sca/archetypes/quickstart/pom.xml
@@ -1,50 +1,50 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-quickstart</artifactId>
- <packaging>maven-archetype</packaging>
- <name>Create a simple Apache Tuscany SCA webapp project</name>
-
- <build>
- <extensions>
- <extension>
- <groupId>org.apache.maven.archetype</groupId>
- <artifactId>archetype-packaging</artifactId>
- <version>2.0-alpha-4</version>
- </extension>
- </extensions>
- <plugins>
- <plugin>
- <artifactId>maven-archetype-plugin</artifactId>
- <version>2.0-alpha-4</version>
- <extensions>true</extensions>
- </plugin>
- </plugins>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-quickstart</artifactId>
+ <packaging>maven-archetype</packaging>
+ <name>Create a simple Apache Tuscany SCA webapp project</name>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.0-alpha-4</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.0-alpha-4</version>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/java/sca/archetypes/quickstart/src/main/resources/META-INF/maven/archetype-metadata.xml b/java/sca/archetypes/quickstart/src/main/resources/META-INF/maven/archetype-metadata.xml
index 450e33afd5..c132fa0364 100644
--- a/java/sca/archetypes/quickstart/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/java/sca/archetypes/quickstart/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -1,42 +1,42 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<archetype-descriptor name="myproject">
- <requiredProperties>
- <requiredProperty key="includeTuscanyRuntime">
- <defaultValue>Y</defaultValue>
- </requiredProperty>
- </requiredProperties>
- <fileSets>
- <fileSet filtered="true" packaged="true" encoding="UTF-8">
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
- <fileSet filtered="true" encoding="UTF-8">
- <directory>src/main/webapp</directory>
- <includes>
- <include>**/*.jsp</include>
- <include>**/*.xml</include>
- <include>**/*.composite</include>
- </includes>
- </fileSet>
- </fileSets>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<archetype-descriptor name="myproject">
+ <requiredProperties>
+ <requiredProperty key="includeTuscanyRuntime">
+ <defaultValue>Y</defaultValue>
+ </requiredProperty>
+ </requiredProperties>
+ <fileSets>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/webapp</directory>
+ <includes>
+ <include>**/*.jsp</include>
+ <include>**/*.xml</include>
+ <include>**/*.composite</include>
+ </includes>
+ </fileSet>
+ </fileSets>
</archetype-descriptor> \ No newline at end of file
diff --git a/java/sca/archetypes/quickstart/src/main/resources/META-INF/maven/archetype.xml b/java/sca/archetypes/quickstart/src/main/resources/META-INF/maven/archetype.xml
index 1bf4353502..7794570626 100644
--- a/java/sca/archetypes/quickstart/src/main/resources/META-INF/maven/archetype.xml
+++ b/java/sca/archetypes/quickstart/src/main/resources/META-INF/maven/archetype.xml
@@ -1,31 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<archetype>
- <id>tuscany-quickstart</id>
- <sources>
- <source>src/main/java/HelloworldImpl.java</source>
- <source>src/main/java/HelloworldService.java</source>
- </sources>
- <resources>
- <resource>src/main/webapp/hello.jsp</resource>
- <resource>src/main/webapp/WEB-INF/web.composite</resource>
- <resource>src/main/webapp/WEB-INF/web.xml</resource>
- </resources>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<archetype>
+ <id>tuscany-quickstart</id>
+ <sources>
+ <source>src/main/java/HelloworldImpl.java</source>
+ <source>src/main/java/HelloworldService.java</source>
+ </sources>
+ <resources>
+ <resource>src/main/webapp/hello.jsp</resource>
+ <resource>src/main/webapp/WEB-INF/web.composite</resource>
+ <resource>src/main/webapp/WEB-INF/web.xml</resource>
+ </resources>
</archetype> \ No newline at end of file
diff --git a/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/pom.xml b/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/pom.xml
index 8345739dfa..1c863a830e 100644
--- a/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/pom.xml
+++ b/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/pom.xml
@@ -1,143 +1,143 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>${groupId}</groupId>
- <artifactId>${artifactId}</artifactId>
- <packaging>war</packaging>
- <version>${version}</version>
- <name>quickstart</name>
-
- <dependencies>
- <!-- TUSCANY DEPENDENCIES -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>${tuscany.version}</version>
-#if(${includeTuscanyRuntime} == "Y")
- <scope>compile</scope>
-#else
- <scope>provided</scope>
-#end
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-runtime</artifactId>
- <version>${tuscany.version}</version>
-#if( $includeTuscanyRuntime == "Y")
- <scope>runtime</scope>
-#else
- <scope>provided</scope>
-#end
- </dependency>
-
- <!-- JUNIT DEPENDENCY FOR TESTING -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- <!-- JETTY DEPENDENCIES FOR TESTING -->
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- <version>${jetty.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- <version>${jetty.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-management</artifactId>
- <version>${jetty.version}</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- <build>
- <defaultGoal>install</defaultGoal>
- <finalName>${artifactId}</finalName>
- <resources>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <filtering>false</filtering>
- <directory>src/test/java</directory>
- <includes>
- <include>**</include>
- </includes>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </testResource>
- </testResources>
- <plugins>
- <plugin>
- <inherited>true</inherited>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <optimise>true</optimise>
- <debug>true</debug>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>${jetty.version}</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <configuration>
- <downloadSources>true</downloadSources>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <properties>
- <tuscany.version>2.0-SNAPSHOT</tuscany.version>
- <jetty.version>6.1.18</jetty.version>
- </properties>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <packaging>war</packaging>
+ <version>${version}</version>
+ <name>quickstart</name>
+
+ <dependencies>
+ <!-- TUSCANY DEPENDENCIES -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>${tuscany.version}</version>
+#if(${includeTuscanyRuntime} == "Y")
+ <scope>compile</scope>
+#else
+ <scope>provided</scope>
+#end
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-runtime</artifactId>
+ <version>${tuscany.version}</version>
+#if( $includeTuscanyRuntime == "Y")
+ <scope>runtime</scope>
+#else
+ <scope>provided</scope>
+#end
+ </dependency>
+
+ <!-- JUNIT DEPENDENCY FOR TESTING -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- JETTY DEPENDENCIES FOR TESTING -->
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>${jetty.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ <version>${jetty.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-management</artifactId>
+ <version>${jetty.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <finalName>${artifactId}</finalName>
+ <resources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <filtering>false</filtering>
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>**/*.java</exclude>
+ </excludes>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <inherited>true</inherited>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <optimise>true</optimise>
+ <debug>true</debug>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>${jetty.version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <properties>
+ <tuscany.version>2.0-SNAPSHOT</tuscany.version>
+ <jetty.version>6.1.18</jetty.version>
+ </properties>
</project> \ No newline at end of file
diff --git a/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java b/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
index 2491816adc..df80303778 100644
--- a/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
+++ b/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldImpl.java
@@ -1,27 +1,27 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package ${package};
-
-public class HelloworldImpl implements HelloworldService {
-
- public String sayHello(String name) {
- return "Hello " + name;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package};
+
+public class HelloworldImpl implements HelloworldService {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldService.java b/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
index 352c165731..47501efb9a 100644
--- a/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
+++ b/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/java/HelloworldService.java
@@ -1,25 +1,25 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package ${package};
-
-public interface HelloworldService {
-
- String sayHello(String name);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package ${package};
+
+public interface HelloworldService {
+
+ String sayHello(String name);
+
+}
diff --git a/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite b/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
index 84d8ebb86f..9df4cd915e 100644
--- a/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
+++ b/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.composite
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://${package}"
- name="${artifactId}">
-
- <component name="${artifactId}WebComponent">
- <implementation.web web-uri=""/>
- <reference name="service" target="HelloworldComponent"/>
- </component>
-
- <component name="HelloworldComponent">
- <implementation.java class="${package}.HelloworldImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ targetNamespace="http://${package}"
+ name="${artifactId}">
+
+ <component name="${artifactId}WebComponent">
+ <implementation.web web-uri=""/>
+ <reference name="service" target="HelloworldComponent"/>
+ </component>
+
+ <component name="HelloworldComponent">
+ <implementation.java class="${package}.HelloworldImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
index 25d8d8184d..a7c7d2251e 100644
--- a/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
+++ b/java/sca/archetypes/quickstart/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
@@ -1,43 +1,43 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<web-app version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
-
- <display-name>${artifactId}</display-name>
-
-#if($includeTuscanyRuntime == "Y")
- <filter>
- <filter-name>tuscany.${artifactId}</filter-name>
- <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>tuscany.${artifactId}</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
-#end
- <welcome-file-list id="WelcomeFileList">
- <welcome-file>hello.jsp</welcome-file>
- </welcome-file-list>
-
-</web-app>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
+
+ <display-name>${artifactId}</display-name>
+
+#if($includeTuscanyRuntime == "Y")
+ <filter>
+ <filter-name>tuscany.${artifactId}</filter-name>
+ <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>tuscany.${artifactId}</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+#end
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>hello.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>
diff --git a/java/sca/distribution/all/pom.xml b/java/sca/distribution/all/pom.xml
index ef7ab6d0a8..4b489dd4ef 100644
--- a/java/sca/distribution/all/pom.xml
+++ b/java/sca/distribution/all/pom.xml
@@ -1,115 +1,115 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-distribution-all</artifactId>
- <name>Apache Tuscany SCA All-in-one Distribution</name>
- <packaging>pom</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-all</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>1.0.3-SNAPSHOT</version>
- <executions>
- <execution>
- <id>distribution-modules</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>generate-modules</goal>
- </goals>
- <configuration>
- <targetDirectory>target/modules</targetDirectory>
- <useDistributionName>false</useDistributionName>
- <generateManifestJar>true</generateManifestJar>
- <artifactManifests>
- <artifactManifest>
- <groupId>org.apache.ws.commons.axiom</groupId>
- <artifactId>axiom-api</artifactId>
- <version>1.2.7</version>
- <manifestFile>${basedir}/manifests/axiom-api-1.2.7.MF</manifestFile>
- </artifactManifest>
- <artifactManifest>
- <groupId>org.apache.woden</groupId>
- <artifactId>woden-impl-dom</artifactId>
- <version>1.0M8</version>
- <manifestFile>${basedir}/manifests/woden-impl-dom-1.0M8.MF</manifestFile>
- </artifactManifest>
- <artifactManifest>
- <groupId>org.apache.axis2</groupId>
- <artifactId>*</artifactId>
- <version>*</version>
- </artifactManifest>
- </artifactManifests>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.eclipse</groupId>
- <artifactId>osgi</artifactId>
- <version>3.3.0-v20070530</version>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>distribution-package</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/bin.xml</descriptor>
- <descriptor>src/main/assembly/src.xml</descriptor>
- </descriptors>
- <tarLongFileMode>gnu</tarLongFileMode>
- <finalName>apache-tuscany-sca-all-${version}</finalName>
- <appendAssemblyId>true</appendAssemblyId>
- <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-distribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-distribution-all</artifactId>
+ <name>Apache Tuscany SCA All-in-one Distribution</name>
+ <packaging>pom</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-all</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>1.0.3-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>distribution-modules</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>generate-modules</goal>
+ </goals>
+ <configuration>
+ <targetDirectory>target/modules</targetDirectory>
+ <useDistributionName>false</useDistributionName>
+ <generateManifestJar>true</generateManifestJar>
+ <artifactManifests>
+ <artifactManifest>
+ <groupId>org.apache.ws.commons.axiom</groupId>
+ <artifactId>axiom-api</artifactId>
+ <version>1.2.7</version>
+ <manifestFile>${basedir}/manifests/axiom-api-1.2.7.MF</manifestFile>
+ </artifactManifest>
+ <artifactManifest>
+ <groupId>org.apache.woden</groupId>
+ <artifactId>woden-impl-dom</artifactId>
+ <version>1.0M8</version>
+ <manifestFile>${basedir}/manifests/woden-impl-dom-1.0M8.MF</manifestFile>
+ </artifactManifest>
+ <artifactManifest>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>*</artifactId>
+ <version>*</version>
+ </artifactManifest>
+ </artifactManifests>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>osgi</artifactId>
+ <version>3.3.0-v20070530</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>distribution-package</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/bin.xml</descriptor>
+ <descriptor>src/main/assembly/src.xml</descriptor>
+ </descriptors>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ <finalName>apache-tuscany-sca-all-${version}</finalName>
+ <appendAssemblyId>true</appendAssemblyId>
+ <ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/java/sca/distribution/all/src/main/assembly/bin.xml b/java/sca/distribution/all/src/main/assembly/bin.xml
index fa3a5632ef..51033a5e1d 100644
--- a/java/sca/distribution/all/src/main/assembly/bin.xml
+++ b/java/sca/distribution/all/src/main/assembly/bin.xml
@@ -1,36 +1,36 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<assembly>
- <!-- id typically identifies the "type" (src vs bin etc) of the assembly -->
- <id></id>
- <includeBaseDirectory>true</includeBaseDirectory>
- <baseDirectory>tuscany-sca-${version}</baseDirectory>
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
-
- <componentDescriptors>
- <componentDescriptor>src/main/components/bin-common.xml</componentDescriptor>
- <componentDescriptor>src/main/components/bin-modules.xml</componentDescriptor>
- <componentDescriptor>src/main/components/bin-samples.xml</componentDescriptor>
- <componentDescriptor>src/main/components/bin-launcher.xml</componentDescriptor>
- </componentDescriptors>
-</assembly>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<assembly>
+ <!-- id typically identifies the "type" (src vs bin etc) of the assembly -->
+ <id></id>
+ <includeBaseDirectory>true</includeBaseDirectory>
+ <baseDirectory>tuscany-sca-${version}</baseDirectory>
+ <formats>
+ <format>tar.gz</format>
+ <format>zip</format>
+ </formats>
+
+ <componentDescriptors>
+ <componentDescriptor>src/main/components/bin-common.xml</componentDescriptor>
+ <componentDescriptor>src/main/components/bin-modules.xml</componentDescriptor>
+ <componentDescriptor>src/main/components/bin-samples.xml</componentDescriptor>
+ <componentDescriptor>src/main/components/bin-launcher.xml</componentDescriptor>
+ </componentDescriptors>
+</assembly>
diff --git a/java/sca/distribution/all/src/main/assembly/src.xml b/java/sca/distribution/all/src/main/assembly/src.xml
index a3df72925a..0bb6503560 100644
--- a/java/sca/distribution/all/src/main/assembly/src.xml
+++ b/java/sca/distribution/all/src/main/assembly/src.xml
@@ -1,45 +1,45 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<assembly>
- <!-- id typically identifies the "type" (src vs bin etc) of the assembly -->
- <id>src</id>
- <includeBaseDirectory>true</includeBaseDirectory>
- <baseDirectory>tuscany-sca-${version}-src</baseDirectory>
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
-
- <fileSets>
- <fileSet>
- <directory>../..</directory>
- <outputDirectory></outputDirectory>
- <excludes>
- <exclude>**/.*</exclude>
- <exclude>**/.*/**</exclude>
- <exclude>**/*.log</exclude>
- <exclude>**/target</exclude>
- <exclude>**/target/**/*</exclude>
- <exclude>**/maven-eclipse.xml</exclude>
- </excludes>
- </fileSet>
- </fileSets>
-
-</assembly>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<assembly>
+ <!-- id typically identifies the "type" (src vs bin etc) of the assembly -->
+ <id>src</id>
+ <includeBaseDirectory>true</includeBaseDirectory>
+ <baseDirectory>tuscany-sca-${version}-src</baseDirectory>
+ <formats>
+ <format>tar.gz</format>
+ <format>zip</format>
+ </formats>
+
+ <fileSets>
+ <fileSet>
+ <directory>../..</directory>
+ <outputDirectory></outputDirectory>
+ <excludes>
+ <exclude>**/.*</exclude>
+ <exclude>**/.*/**</exclude>
+ <exclude>**/*.log</exclude>
+ <exclude>**/target</exclude>
+ <exclude>**/target/**/*</exclude>
+ <exclude>**/maven-eclipse.xml</exclude>
+ </excludes>
+ </fileSet>
+ </fileSets>
+
+</assembly>
diff --git a/java/sca/distribution/all/src/main/components/bin-common.xml b/java/sca/distribution/all/src/main/components/bin-common.xml
index 983b6addff..b5b7111096 100644
--- a/java/sca/distribution/all/src/main/components/bin-common.xml
+++ b/java/sca/distribution/all/src/main/components/bin-common.xml
@@ -1,43 +1,43 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<component>
- <fileSets>
-
- <!-- Add the text files to the top-level directroy -->
- <fileSet>
- <directory>../..</directory>
- <outputDirectory></outputDirectory>
- <includes>
- <include>CHANGES</include>
- <include>README</include>
- <include>RELEASE_NOTES</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>src/main/release/bin</directory>
- <outputDirectory></outputDirectory>
- <includes>
- <include>INSTALL</include>
- <include>LICENSE</include>
- <include>NOTICE</include>
- </includes>
- </fileSet>
- </fileSets>
-
-</component>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<component>
+ <fileSets>
+
+ <!-- Add the text files to the top-level directroy -->
+ <fileSet>
+ <directory>../..</directory>
+ <outputDirectory></outputDirectory>
+ <includes>
+ <include>CHANGES</include>
+ <include>README</include>
+ <include>RELEASE_NOTES</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>src/main/release/bin</directory>
+ <outputDirectory></outputDirectory>
+ <includes>
+ <include>INSTALL</include>
+ <include>LICENSE</include>
+ <include>NOTICE</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+
+</component>
diff --git a/java/sca/distribution/all/src/main/components/bin-launcher.xml b/java/sca/distribution/all/src/main/components/bin-launcher.xml
index ae7aba79ca..018e041d38 100644
--- a/java/sca/distribution/all/src/main/components/bin-launcher.xml
+++ b/java/sca/distribution/all/src/main/components/bin-launcher.xml
@@ -1,41 +1,41 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<component>
- <fileSets>
- <fileSet>
- <directory>src/main/release/launcher</directory>
- <outputDirectory>bin</outputDirectory>
- <includes>
- </includes>
- </fileSet>
- </fileSets>
-
- <dependencySets>
- <dependencySet>
- <outputDirectory>bin</outputDirectory>
- <unpack>false</unpack>
- <includes>
- <include>org.apache.tuscany.sca:tuscany-launcher</include>
- </includes>
- <outputFileNameMapping>launcher.jar</outputFileNameMapping>
- </dependencySet>
-
- </dependencySets>
-
-</component>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<component>
+ <fileSets>
+ <fileSet>
+ <directory>src/main/release/launcher</directory>
+ <outputDirectory>bin</outputDirectory>
+ <includes>
+ </includes>
+ </fileSet>
+ </fileSets>
+
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>bin</outputDirectory>
+ <unpack>false</unpack>
+ <includes>
+ <include>org.apache.tuscany.sca:tuscany-launcher</include>
+ </includes>
+ <outputFileNameMapping>launcher.jar</outputFileNameMapping>
+ </dependencySet>
+
+ </dependencySets>
+
+</component>
diff --git a/java/sca/distribution/all/src/main/components/bin-modules.xml b/java/sca/distribution/all/src/main/components/bin-modules.xml
index 69ec47740a..89de329d86 100644
--- a/java/sca/distribution/all/src/main/components/bin-modules.xml
+++ b/java/sca/distribution/all/src/main/components/bin-modules.xml
@@ -1,33 +1,33 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<component>
- <fileSets>
-
- <fileSet>
- <directory>target</directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>modules/**/*</include>
- <include>features/**/*</include>
- </includes>
- </fileSet>
-
- </fileSets>
-
-</component>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<component>
+ <fileSets>
+
+ <fileSet>
+ <directory>target</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>modules/**/*</include>
+ <include>features/**/*</include>
+ </includes>
+ </fileSet>
+
+ </fileSets>
+
+</component>
diff --git a/java/sca/distribution/all/src/main/components/bin-samples.xml b/java/sca/distribution/all/src/main/components/bin-samples.xml
index 1cdfb142ec..ebbc5c748f 100644
--- a/java/sca/distribution/all/src/main/components/bin-samples.xml
+++ b/java/sca/distribution/all/src/main/components/bin-samples.xml
@@ -1,80 +1,80 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<component>
- <fileSets>
- <!-- Add top level samples files -->
- <fileSet>
- <directory>../../samples</directory>
- <outputDirectory>samples</outputDirectory>
- <includes>
- <include>README</include>
- <include>logging.properties</include>
- <include>build-common.xml</include>
- <include>binding-ws-calculator/**/*</include>
- <include>calculator/**/*</include>
- <include>calculator-equinox/**/*</include>
- <include>calculator-osgi/**/*</include>
- <include>calculator-rmi-reference/**/*</include>
- <include>calculator-rmi-service/**/*</include>
- <include>implementation-java-calculator/**/*</include>
- <include>dosgi-calculator/**/*</include>
- <include>dosgi-calculator-operations/**/*</include>
- <include>webapps/helloworld/**/*</include>
- <include>webapps/helloworld-bpel/**/*</include>
- <include>webapps/helloworld-jsf/**/*</include>
- <include>webapps/helloworld-jsp/**/*</include>
- <include>webapps/helloworld-stripes/**/*</include>
- </includes>
- <excludes>
- <!-- General file/folders to exclude -->
- <exclude>**/.*</exclude>
- <exclude>**/.*/**</exclude>
- <exclude>**/*.log</exclude>
- <exclude>**/*.svg</exclude>
- <exclude>**/maven-eclipse.xml</exclude>
-
- <!-- Sample specific files/folders to exclude -->
- <exclude>pom.xml</exclude>
- <!-- exclude>**/target</exclude -->
- <!-- exclude>**/target/**/*</exclude -->
- <exclude>*/target/mvn-eclipse-cache.properties</exclude>
- <exclude>*/target/pom-transformed.xml</exclude>
- <exclude>*/target/classes</exclude>
- <exclude>*/target/classes/**/*</exclude>
- <exclude>*/target/dependency-maven-plugin-markers</exclude>
- <exclude>*/target/dependency-maven-plugin-markers/**/*</exclude>
- <exclude>*/target/.felix</exclude>
- <exclude>*/target/.felix/**/*</exclude>
- <exclude>*/target/maven-archiver</exclude>
- <exclude>*/target/maven-archiver/**/*</exclude>
- <exclude>*/target/test-classes</exclude>
- <exclude>*/target/test-classes/**/*</exclude>
- <exclude>*/target/surefire-reports</exclude>
- <exclude>*/target/surefire-reports/**/*</exclude>
- <exclude>*/target/surefire-osgi-reports</exclude>
- <exclude>*/target/surefire-osgi-reports/**/*</exclude>
- <exclude>webapps/helloworld/target/**/*</exclude>
- <exclude>webapps/helloworld-bpel/target/**/*</exclude>
- <exclude>webapps/helloworld-jsf/target/**/*</exclude>
- <exclude>webapps/helloworld-jsp/target/**/*</exclude>
- <exclude>webapps/helloworld-stripes/target/**/*</exclude>
- </excludes>
- </fileSet>
- </fileSets>
-</component>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<component>
+ <fileSets>
+ <!-- Add top level samples files -->
+ <fileSet>
+ <directory>../../samples</directory>
+ <outputDirectory>samples</outputDirectory>
+ <includes>
+ <include>README</include>
+ <include>logging.properties</include>
+ <include>build-common.xml</include>
+ <include>binding-ws-calculator/**/*</include>
+ <include>calculator/**/*</include>
+ <include>calculator-equinox/**/*</include>
+ <include>calculator-osgi/**/*</include>
+ <include>calculator-rmi-reference/**/*</include>
+ <include>calculator-rmi-service/**/*</include>
+ <include>implementation-java-calculator/**/*</include>
+ <include>dosgi-calculator/**/*</include>
+ <include>dosgi-calculator-operations/**/*</include>
+ <include>webapps/helloworld/**/*</include>
+ <include>webapps/helloworld-bpel/**/*</include>
+ <include>webapps/helloworld-jsf/**/*</include>
+ <include>webapps/helloworld-jsp/**/*</include>
+ <include>webapps/helloworld-stripes/**/*</include>
+ </includes>
+ <excludes>
+ <!-- General file/folders to exclude -->
+ <exclude>**/.*</exclude>
+ <exclude>**/.*/**</exclude>
+ <exclude>**/*.log</exclude>
+ <exclude>**/*.svg</exclude>
+ <exclude>**/maven-eclipse.xml</exclude>
+
+ <!-- Sample specific files/folders to exclude -->
+ <exclude>pom.xml</exclude>
+ <!-- exclude>**/target</exclude -->
+ <!-- exclude>**/target/**/*</exclude -->
+ <exclude>*/target/mvn-eclipse-cache.properties</exclude>
+ <exclude>*/target/pom-transformed.xml</exclude>
+ <exclude>*/target/classes</exclude>
+ <exclude>*/target/classes/**/*</exclude>
+ <exclude>*/target/dependency-maven-plugin-markers</exclude>
+ <exclude>*/target/dependency-maven-plugin-markers/**/*</exclude>
+ <exclude>*/target/.felix</exclude>
+ <exclude>*/target/.felix/**/*</exclude>
+ <exclude>*/target/maven-archiver</exclude>
+ <exclude>*/target/maven-archiver/**/*</exclude>
+ <exclude>*/target/test-classes</exclude>
+ <exclude>*/target/test-classes/**/*</exclude>
+ <exclude>*/target/surefire-reports</exclude>
+ <exclude>*/target/surefire-reports/**/*</exclude>
+ <exclude>*/target/surefire-osgi-reports</exclude>
+ <exclude>*/target/surefire-osgi-reports/**/*</exclude>
+ <exclude>webapps/helloworld/target/**/*</exclude>
+ <exclude>webapps/helloworld-bpel/target/**/*</exclude>
+ <exclude>webapps/helloworld-jsf/target/**/*</exclude>
+ <exclude>webapps/helloworld-jsp/target/**/*</exclude>
+ <exclude>webapps/helloworld-stripes/target/**/*</exclude>
+ </excludes>
+ </fileSet>
+ </fileSets>
+</component>
diff --git a/java/sca/distribution/tomcat/pom.xml b/java/sca/distribution/tomcat/pom.xml
index 3a0c9dc36f..b06a0aea79 100644
--- a/java/sca/distribution/tomcat/pom.xml
+++ b/java/sca/distribution/tomcat/pom.xml
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <relativePath>../pom.xml</relativePath>
- <version>2.0-SNAPSHOT</version>
- </parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-tomcat</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Distribution Tomcat</name>
-
- <modules>
- <module>tomcat-hook</module>
- <module>tomcat-servlet</module>
- <module>tomcat-war</module>
- </modules>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <relativePath>../pom.xml</relativePath>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-distribution-tomcat</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Distribution Tomcat</name>
+
+ <modules>
+ <module>tomcat-hook</module>
+ <module>tomcat-servlet</module>
+ <module>tomcat-war</module>
+ </modules>
+
+</project>
diff --git a/java/sca/distribution/tomcat/testing/download-tomcat/pom.xml b/java/sca/distribution/tomcat/testing/download-tomcat/pom.xml
index 827877bc1a..c4ca568746 100644
--- a/java/sca/distribution/tomcat/testing/download-tomcat/pom.xml
+++ b/java/sca/distribution/tomcat/testing/download-tomcat/pom.xml
@@ -1,63 +1,63 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-tomcat-testing</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>download-tomcat</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Tomcat Integration Testing Download Tomcat</name>
-
- <properties>
- <tomcat.version>6.0.18</tomcat.version>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>wagon-maven-plugin</artifactId>
- <version>1.0-beta-1</version>
- <executions>
- <execution>
- <id>download-tomcat</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>download-single</goal>
- </goals>
- <configuration>
- <!-- Note: the url should be "archive.apache.org" but that is truncating the file at 4808k,
- no idea why but it sounds like an infra problem - https://issues.apache.org/jira/browse/INFRA-1910 -->
- <url>http://www.eu.apache.org</url>
- <fromFile>dist/tomcat/tomcat-6/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.zip</fromFile>
- <toDir>download</toDir>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-distribution-tomcat-testing</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>download-tomcat</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Tomcat Integration Testing Download Tomcat</name>
+
+ <properties>
+ <tomcat.version>6.0.18</tomcat.version>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>wagon-maven-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ <executions>
+ <execution>
+ <id>download-tomcat</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>download-single</goal>
+ </goals>
+ <configuration>
+ <!-- Note: the url should be "archive.apache.org" but that is truncating the file at 4808k,
+ no idea why but it sounds like an infra problem - https://issues.apache.org/jira/browse/INFRA-1910 -->
+ <url>http://www.eu.apache.org</url>
+ <fromFile>dist/tomcat/tomcat-6/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.zip</fromFile>
+ <toDir>download</toDir>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/java/sca/distribution/tomcat/testing/helloworld-client-webapp/pom.xml b/java/sca/distribution/tomcat/testing/helloworld-client-webapp/pom.xml
index f5057b08f7..27816ddb00 100644
--- a/java/sca/distribution/tomcat/testing/helloworld-client-webapp/pom.xml
+++ b/java/sca/distribution/tomcat/testing/helloworld-client-webapp/pom.xml
@@ -1,47 +1,47 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-tomcat-testing</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>helloworld-client-webapp</artifactId>
- <packaging>war</packaging>
- <name>Apache Tuscany SCA Tomcat Integration Testing Helloworld Client Webapp</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-
-</project>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-distribution-tomcat-testing</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>helloworld-client-webapp</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA Tomcat Integration Testing Helloworld Client Webapp</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
+
diff --git a/java/sca/distribution/tomcat/testing/helloworld-client-webapp/src/main/java/testing/HelloworldService.java b/java/sca/distribution/tomcat/testing/helloworld-client-webapp/src/main/java/testing/HelloworldService.java
index 5815274774..8c67e05aa7 100644
--- a/java/sca/distribution/tomcat/testing/helloworld-client-webapp/src/main/java/testing/HelloworldService.java
+++ b/java/sca/distribution/tomcat/testing/helloworld-client-webapp/src/main/java/testing/HelloworldService.java
@@ -1,27 +1,27 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package testing;
-
-// TODO: should the webapp need to include the service interface?
-
-public interface HelloworldService {
-
- String sayHello(String name);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package testing;
+
+// TODO: should the webapp need to include the service interface?
+
+public interface HelloworldService {
+
+ String sayHello(String name);
+
+}
diff --git a/java/sca/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.composite b/java/sca/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.composite
index f8c7f026b2..c03a70c58a 100644
--- a/java/sca/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.composite
+++ b/java/sca/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.composite
@@ -1,30 +1,30 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://testing"
- name="jsp-client-webapp">
-
- <!-- TODO: should the component name be unique in the domain? i guess so -->
- <component name="WebComponent">
- <implementation.web web-uri=""/>
- <reference name="service" target="HelloworldComponent"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://testing"
+ name="jsp-client-webapp">
+
+ <!-- TODO: should the component name be unique in the domain? i guess so -->
+ <component name="WebComponent">
+ <implementation.web web-uri=""/>
+ <reference name="service" target="HelloworldComponent"/>
+ </component>
+
+</composite>
diff --git a/java/sca/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.xml b/java/sca/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.xml
index f2e3441d5e..411d8a3146 100644
--- a/java/sca/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.xml
+++ b/java/sca/distribution/tomcat/testing/helloworld-client-webapp/src/main/webapp/WEB-INF/web.xml
@@ -1,31 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<web-app version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
-
- <display-name>jsp-client-webapp</display-name>
-
- <welcome-file-list id="WelcomeFileList">
- <welcome-file>hello.jsp</welcome-file>
- </welcome-file-list>
-
-</web-app>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
+
+ <display-name>jsp-client-webapp</display-name>
+
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>hello.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>
diff --git a/java/sca/distribution/tomcat/testing/helloworld-service-contribution/pom.xml b/java/sca/distribution/tomcat/testing/helloworld-service-contribution/pom.xml
index 21f5fecfd7..3b43a4fa59 100644
--- a/java/sca/distribution/tomcat/testing/helloworld-service-contribution/pom.xml
+++ b/java/sca/distribution/tomcat/testing/helloworld-service-contribution/pom.xml
@@ -1,45 +1,45 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-tomcat-testing</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>helloworld-service-contribution</artifactId>
- <name>Apache Tuscany SCA Tomcat Integration Testing Helloworld Service Contribution</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-distribution-tomcat-testing</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>helloworld-service-contribution</artifactId>
+ <name>Apache Tuscany SCA Tomcat Integration Testing Helloworld Service Contribution</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
diff --git a/java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldImpl.java b/java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldImpl.java
index f59c31f481..c9c6ff66d6 100644
--- a/java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldImpl.java
+++ b/java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldImpl.java
@@ -1,36 +1,36 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package testing;
-
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.EagerInit;
-
-@Scope("COMPOSITE") @EagerInit
-public class HelloworldImpl implements HelloworldService {
-
- public String sayHello(String name) {
- return "Hello " + name;
- }
-
- @Init
- public void init() {
- System.out.println("HelloworldImpl eager init: " + sayHello("world"));
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package testing;
+
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.EagerInit;
+
+@Scope("COMPOSITE") @EagerInit
+public class HelloworldImpl implements HelloworldService {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+ @Init
+ public void init() {
+ System.out.println("HelloworldImpl eager init: " + sayHello("world"));
+ }
+}
diff --git a/java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldService.java b/java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldService.java
index be529d36e7..65e95f275c 100644
--- a/java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldService.java
+++ b/java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/java/testing/HelloworldService.java
@@ -1,25 +1,25 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package testing;
-
-public interface HelloworldService {
-
- String sayHello(String name);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package testing;
+
+public interface HelloworldService {
+
+ String sayHello(String name);
+
+}
diff --git a/java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/META-INF/sca-contribution.xml b/java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/META-INF/sca-contribution.xml
index f39e321376..9bdfd4e58b 100644
--- a/java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/META-INF/sca-contribution.xml
+++ b/java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/META-INF/sca-contribution.xml
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:testing="http://org.apache.tuscany.tomcat.testing">
- <deployable composite="testing:helloworld-service-contribution"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:testing="http://org.apache.tuscany.tomcat.testing">
+ <deployable composite="testing:helloworld-service-contribution"/>
</contribution> \ No newline at end of file
diff --git a/java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/helloworld.composite b/java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/helloworld.composite
index 5b4279d9cc..2d6ce9419b 100644
--- a/java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/helloworld.composite
+++ b/java/sca/distribution/tomcat/testing/helloworld-service-contribution/src/main/resources/helloworld.composite
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://org.apache.tuscany.tomcat.testing"
- name="helloworld-service-contribution">
-
- <component name="HelloworldComponent">
- <implementation.java class="testing.HelloworldImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://org.apache.tuscany.tomcat.testing"
+ name="helloworld-service-contribution">
+
+ <component name="HelloworldComponent">
+ <implementation.java class="testing.HelloworldImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/distribution/tomcat/testing/legal-checks/pom.xml b/java/sca/distribution/tomcat/testing/legal-checks/pom.xml
index 077561a7f9..ce9acd6902 100644
--- a/java/sca/distribution/tomcat/testing/legal-checks/pom.xml
+++ b/java/sca/distribution/tomcat/testing/legal-checks/pom.xml
@@ -1,42 +1,42 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-distribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>war-legal-checks</artifactId>
- <name>Apache Tuscany SCA WAR Distribution Legal Checks</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-bin-distro-unzip</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
- <build>
- </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>war-legal-checks</artifactId>
+ <name>Apache Tuscany SCA WAR Distribution Legal Checks</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+</project>
diff --git a/java/sca/distribution/tomcat/testing/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java b/java/sca/distribution/tomcat/testing/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java
index f574188532..05f16f603d 100644
--- a/java/sca/distribution/tomcat/testing/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java
+++ b/java/sca/distribution/tomcat/testing/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java
@@ -1,147 +1,147 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package itest;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.junit.Test;
-
-/**
- * Checks that all jar files included in the distribution are mentioned in the LICENSE file
- * and that all jars mentioned in the LICENSE are in the distribution.
- */
-public class JarsInLICENSETestCase {
-
- @Test
- public void testJars() throws Exception {
- File distroRoot = getUnzipedDistroRoot();
-
- File licenseFile = new File(distroRoot, "LICENSE");
- if (!licenseFile.exists()) {
- throw new IllegalStateException("can't find LICENSE file at: " + licenseFile.getAbsoluteFile().toString());
- }
-
- File libDirectory = distroRoot;
- if (!libDirectory.exists()) {
- throw new IllegalStateException("can't find modules folder at: " + libDirectory.getAbsoluteFile().toString());
- }
-
- List<String> jars = getJarsInDistro(libDirectory);
-
- List<String> bad2 = getLICENSEJarsNotInDistro(licenseFile, jars);
- if (bad2.size() > 0) {
- System.err.println("Jars in LICENSE but not in Distribution: " + bad2);
- }
-
- List<String> bad1 = getJarsNotInLICENSE(jars, licenseFile);
- if (bad1.size() > 0) {
- System.err.println("Jars in distribution but not in LICENSE: " + bad1);
- }
-
- if (bad1.size() > 0 || bad2.size() > 0) {
- throw new IllegalStateException("LICENSE problems, check log");
- }
- }
-
- private List<String> getLICENSEJarsNotInDistro(File licenseFile, List<String> jars) throws IOException {
- List<String> badJars = new ArrayList<String>();
- BufferedReader reader = new BufferedReader(new FileReader(licenseFile));
- String line = null;
- while ((line = reader.readLine()) != null) {
- line = line.trim();
- if (line.contains(".jar")) {
- StringTokenizer st = new StringTokenizer(line);
- while (st.hasMoreTokens()) {
- String s = st.nextToken();
- if (s.contains(".jar")) {
- if (s.startsWith("(")) {
- s = s.substring(1);
- }
- if (s.endsWith(",") || s.endsWith(":")) {
- s = s.substring(0, s.length()-1);
- }
- if (s.endsWith(")")) {
- s = s.substring(0, s.length()-1);
- }
- if (!jars.contains(s) && !s.startsWith("tuscany-")) {
- badJars.add(s);
- }
- }
- }
- }
- }
- return badJars;
- }
-
- private List<String> getJarsNotInLICENSE(List<String> jars, File licenseFile) throws IOException {
- List<String> badJars = new ArrayList<String>();
- String licenseText = readLICENSE(licenseFile);
- for (String jar : jars) {
- if (!licenseText.contains(jar)) {
- if (jar.startsWith("tuscany-")) {
- // ignore tuscany jars as they're not mentioned in the LICENSE file
- } else {
- badJars.add(jar);
- }
- }
- }
- return badJars;
- }
-
- private List<String> getJarsInDistro(File directory) {
- List<String> jars = new ArrayList<String>();
- for (String fn : directory.list()){
- if (fn.endsWith(".jar")) {
- jars.add(fn);
- } else {
- File f = new File(directory, fn);
- if (f.isDirectory()) {
- jars.addAll(getJarsInDistro(f));
- }
- }
- }
- return jars;
- }
-
- private File getUnzipedDistroRoot() {
- return new File("../../tomcat-war/target/tuscany.dir");
- }
-
- private static String readLICENSE(File licenseFile) throws java.io.IOException {
- StringBuffer fileData = new StringBuffer();
- BufferedReader reader = new BufferedReader(new FileReader(licenseFile));
- char[] buf = new char[1024];
- int numRead = 0;
- while ((numRead = reader.read(buf)) != -1) {
- String readData = String.valueOf(buf, 0, numRead);
- fileData.append(readData);
- buf = new char[1024];
- }
- reader.close();
- return fileData.toString();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package itest;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.junit.Test;
+
+/**
+ * Checks that all jar files included in the distribution are mentioned in the LICENSE file
+ * and that all jars mentioned in the LICENSE are in the distribution.
+ */
+public class JarsInLICENSETestCase {
+
+ @Test
+ public void testJars() throws Exception {
+ File distroRoot = getUnzipedDistroRoot();
+
+ File licenseFile = new File(distroRoot, "LICENSE");
+ if (!licenseFile.exists()) {
+ throw new IllegalStateException("can't find LICENSE file at: " + licenseFile.getAbsoluteFile().toString());
+ }
+
+ File libDirectory = distroRoot;
+ if (!libDirectory.exists()) {
+ throw new IllegalStateException("can't find modules folder at: " + libDirectory.getAbsoluteFile().toString());
+ }
+
+ List<String> jars = getJarsInDistro(libDirectory);
+
+ List<String> bad2 = getLICENSEJarsNotInDistro(licenseFile, jars);
+ if (bad2.size() > 0) {
+ System.err.println("Jars in LICENSE but not in Distribution: " + bad2);
+ }
+
+ List<String> bad1 = getJarsNotInLICENSE(jars, licenseFile);
+ if (bad1.size() > 0) {
+ System.err.println("Jars in distribution but not in LICENSE: " + bad1);
+ }
+
+ if (bad1.size() > 0 || bad2.size() > 0) {
+ throw new IllegalStateException("LICENSE problems, check log");
+ }
+ }
+
+ private List<String> getLICENSEJarsNotInDistro(File licenseFile, List<String> jars) throws IOException {
+ List<String> badJars = new ArrayList<String>();
+ BufferedReader reader = new BufferedReader(new FileReader(licenseFile));
+ String line = null;
+ while ((line = reader.readLine()) != null) {
+ line = line.trim();
+ if (line.contains(".jar")) {
+ StringTokenizer st = new StringTokenizer(line);
+ while (st.hasMoreTokens()) {
+ String s = st.nextToken();
+ if (s.contains(".jar")) {
+ if (s.startsWith("(")) {
+ s = s.substring(1);
+ }
+ if (s.endsWith(",") || s.endsWith(":")) {
+ s = s.substring(0, s.length()-1);
+ }
+ if (s.endsWith(")")) {
+ s = s.substring(0, s.length()-1);
+ }
+ if (!jars.contains(s) && !s.startsWith("tuscany-")) {
+ badJars.add(s);
+ }
+ }
+ }
+ }
+ }
+ return badJars;
+ }
+
+ private List<String> getJarsNotInLICENSE(List<String> jars, File licenseFile) throws IOException {
+ List<String> badJars = new ArrayList<String>();
+ String licenseText = readLICENSE(licenseFile);
+ for (String jar : jars) {
+ if (!licenseText.contains(jar)) {
+ if (jar.startsWith("tuscany-")) {
+ // ignore tuscany jars as they're not mentioned in the LICENSE file
+ } else {
+ badJars.add(jar);
+ }
+ }
+ }
+ return badJars;
+ }
+
+ private List<String> getJarsInDistro(File directory) {
+ List<String> jars = new ArrayList<String>();
+ for (String fn : directory.list()){
+ if (fn.endsWith(".jar")) {
+ jars.add(fn);
+ } else {
+ File f = new File(directory, fn);
+ if (f.isDirectory()) {
+ jars.addAll(getJarsInDistro(f));
+ }
+ }
+ }
+ return jars;
+ }
+
+ private File getUnzipedDistroRoot() {
+ return new File("../../tomcat-war/target/tuscany.dir");
+ }
+
+ private static String readLICENSE(File licenseFile) throws java.io.IOException {
+ StringBuffer fileData = new StringBuffer();
+ BufferedReader reader = new BufferedReader(new FileReader(licenseFile));
+ char[] buf = new char[1024];
+ int numRead = 0;
+ while ((numRead = reader.read(buf)) != -1) {
+ String readData = String.valueOf(buf, 0, numRead);
+ fileData.append(readData);
+ buf = new char[1024];
+ }
+ reader.close();
+ return fileData.toString();
+ }
+
+}
diff --git a/java/sca/distribution/tomcat/testing/pom.xml b/java/sca/distribution/tomcat/testing/pom.xml
index c2e4ac197f..732e7c292d 100644
--- a/java/sca/distribution/tomcat/testing/pom.xml
+++ b/java/sca/distribution/tomcat/testing/pom.xml
@@ -1,38 +1,38 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-tomcat</artifactId>
- <relativePath>../pom.xml</relativePath>
- <version>2.0-SNAPSHOT</version>
- </parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution-tomcat-testing</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Distribution Tomcat Testing</name>
-
- <modules>
- <module>helloworld-service-contribution</module>
- <module>helloworld-client-webapp</module>
- </modules>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-distribution-tomcat</artifactId>
+ <relativePath>../pom.xml</relativePath>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-distribution-tomcat-testing</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Distribution Tomcat Testing</name>
+
+ <modules>
+ <module>helloworld-service-contribution</module>
+ <module>helloworld-client-webapp</module>
+ </modules>
+
+</project>
diff --git a/java/sca/distribution/tomcat/tomcat-hook/pom.xml b/java/sca/distribution/tomcat/tomcat-hook/pom.xml
index 6bb5adad0f..8b792960ad 100644
--- a/java/sca/distribution/tomcat/tomcat-hook/pom.xml
+++ b/java/sca/distribution/tomcat/tomcat-hook/pom.xml
@@ -1,70 +1,70 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-tomcat-hook</artifactId>
- <name>Apache Tuscany SCA Tomcat Hook</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>catalina</artifactId>
- <version>6.0.18</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- </exclusions>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>coyote</artifactId>
- <version>6.0.18</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.swizzle</groupId>
- <artifactId>swizzle-stream</artifactId>
- <version>1.0.2</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-tomcat-hook</artifactId>
+ <name>Apache Tuscany SCA Tomcat Hook</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>catalina</artifactId>
+ <version>6.0.18</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>coyote</artifactId>
+ <version>6.0.18</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.swizzle</groupId>
+ <artifactId>swizzle-stream</artifactId>
+ <version>1.0.2</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyAnnotationsProcessor.java b/java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyAnnotationsProcessor.java
index 8dfd8175e4..54947d6492 100644
--- a/java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyAnnotationsProcessor.java
+++ b/java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyAnnotationsProcessor.java
@@ -1,85 +1,85 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.tomcat;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import javax.naming.NamingException;
-import javax.servlet.ServletContext;
-
-import org.apache.AnnotationProcessor;
-import org.apache.catalina.util.DefaultAnnotationProcessor;
-
-public class TuscanyAnnotationsProcessor implements AnnotationProcessor {
-
- private TuscanyStandardContext tuscanyStandardContext;
- private AnnotationProcessor tomcatAnnotationProcessor;
- private Method tuscanyInjectMethod;
-
- public TuscanyAnnotationsProcessor(TuscanyStandardContext tuscanyStandardContext, javax.naming.Context context) {
- this.tuscanyStandardContext = tuscanyStandardContext;
- this.tomcatAnnotationProcessor = new DefaultAnnotationProcessor(context);
- initInjectMethod(tuscanyStandardContext);
- }
-
- private void initInjectMethod(TuscanyStandardContext tuscanyStandardContext) {
-
- // this needs to use reflection as the tuscany-hook module can't have any
- // dependencies on the tuscany runtime modules as they're not
- // in the server classpath
- // TODO: is there a nicer way ?
-
- ClassLoader cl = tuscanyStandardContext.getParentClassLoader();
- try {
- Class<?> c = Class.forName("org.apache.tuscany.sca.implementation.web.runtime.utils.ContextHelper", true, cl);
- if (c != null) {
- this.tuscanyInjectMethod = c.getMethod("inject", new Class[]{Object.class, ServletContext.class});
- }
- } catch (Exception e){
- // ignore
- }
- }
-
- public void postConstruct(Object instance) throws IllegalAccessException, InvocationTargetException {
- tomcatAnnotationProcessor.postConstruct(instance);
- }
-
- public void preDestroy(Object instance) throws IllegalAccessException, InvocationTargetException {
- tomcatAnnotationProcessor.preDestroy(instance);
- }
-
- public void processAnnotations(Object instance) throws IllegalAccessException, InvocationTargetException, NamingException {
- if (tuscanyInjectMethod != null) {
- ServletContext sc = tuscanyStandardContext.getServletContext();
- if (sc != null) {
- Object rc = sc.getAttribute("org.apache.tuscany.sca.implementation.web.RuntimeComponent");
- if (rc != null) {
- try {
- tuscanyInjectMethod.invoke(null, instance, sc);
- } catch (Exception e) {
- throw new InvocationTargetException(e);
- }
- }
- }
- }
- tomcatAnnotationProcessor.processAnnotations(instance);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.tomcat;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import javax.naming.NamingException;
+import javax.servlet.ServletContext;
+
+import org.apache.AnnotationProcessor;
+import org.apache.catalina.util.DefaultAnnotationProcessor;
+
+public class TuscanyAnnotationsProcessor implements AnnotationProcessor {
+
+ private TuscanyStandardContext tuscanyStandardContext;
+ private AnnotationProcessor tomcatAnnotationProcessor;
+ private Method tuscanyInjectMethod;
+
+ public TuscanyAnnotationsProcessor(TuscanyStandardContext tuscanyStandardContext, javax.naming.Context context) {
+ this.tuscanyStandardContext = tuscanyStandardContext;
+ this.tomcatAnnotationProcessor = new DefaultAnnotationProcessor(context);
+ initInjectMethod(tuscanyStandardContext);
+ }
+
+ private void initInjectMethod(TuscanyStandardContext tuscanyStandardContext) {
+
+ // this needs to use reflection as the tuscany-hook module can't have any
+ // dependencies on the tuscany runtime modules as they're not
+ // in the server classpath
+ // TODO: is there a nicer way ?
+
+ ClassLoader cl = tuscanyStandardContext.getParentClassLoader();
+ try {
+ Class<?> c = Class.forName("org.apache.tuscany.sca.implementation.web.runtime.utils.ContextHelper", true, cl);
+ if (c != null) {
+ this.tuscanyInjectMethod = c.getMethod("inject", new Class[]{Object.class, ServletContext.class});
+ }
+ } catch (Exception e){
+ // ignore
+ }
+ }
+
+ public void postConstruct(Object instance) throws IllegalAccessException, InvocationTargetException {
+ tomcatAnnotationProcessor.postConstruct(instance);
+ }
+
+ public void preDestroy(Object instance) throws IllegalAccessException, InvocationTargetException {
+ tomcatAnnotationProcessor.preDestroy(instance);
+ }
+
+ public void processAnnotations(Object instance) throws IllegalAccessException, InvocationTargetException, NamingException {
+ if (tuscanyInjectMethod != null) {
+ ServletContext sc = tuscanyStandardContext.getServletContext();
+ if (sc != null) {
+ Object rc = sc.getAttribute("org.apache.tuscany.sca.implementation.web.RuntimeComponent");
+ if (rc != null) {
+ try {
+ tuscanyInjectMethod.invoke(null, instance, sc);
+ } catch (Exception e) {
+ throw new InvocationTargetException(e);
+ }
+ }
+ }
+ }
+ tomcatAnnotationProcessor.processAnnotations(instance);
+ }
+}
diff --git a/java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyLifecycleListener.java b/java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyLifecycleListener.java
index ab96376020..75f925fec5 100644
--- a/java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyLifecycleListener.java
+++ b/java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyLifecycleListener.java
@@ -1,170 +1,170 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.tomcat;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Properties;
-import java.util.logging.Logger;
-
-import org.apache.catalina.Container;
-import org.apache.catalina.LifecycleEvent;
-import org.apache.catalina.LifecycleListener;
-import org.apache.catalina.ServerFactory;
-import org.apache.catalina.Service;
-import org.apache.catalina.connector.Connector;
-import org.apache.catalina.core.StandardEngine;
-import org.apache.catalina.core.StandardHost;
-import org.apache.catalina.core.StandardServer;
-import org.apache.catalina.core.StandardService;
-import org.apache.catalina.startup.HostConfig;
-
-/**
- * A Tomcat LifecycleListener that initilizes the Tuscany Tomcat integration.
- * It sets a System property with the location of the Tuscany runtime .war
- * and configures each Tomcat Connector to use the TuscanyStandardContext.
- *
- * To configure Tomcat to use this add the following to the Tomcat conf/server.xml
- * <Listener className="org.apache.tuscany.sca.tomcat.TuscanyLifecycleListener"/>
- */
-public class TuscanyLifecycleListener implements LifecycleListener {
- private static final Logger log = Logger.getLogger(TuscanyLifecycleListener.class.getName());
-
- public static final String TUSCANY_WAR_PROP = "org.apache.tuscany.sca.tomcat.war";
-
- private static boolean running;
-
- public static boolean isRunning() {
- return running;
- }
-
- static final String TUSCANY_SHARED_PROP = "org.apache.tuscany.sca.tomcat.shared";
-
- public TuscanyLifecycleListener() {
- running = true;
- log.info("Apache Tuscany initilizing");
- }
-
- public void lifecycleEvent(LifecycleEvent event) {
- if ("init".equals(event.getType()) && (event.getSource() instanceof StandardServer)) {
- File webappDir = findTuscanyWar();
- if (webappDir == null) {
- log.severe("Tuscany disabled as Tuscany webapp not found");
- } else {
- System.setProperty(TUSCANY_WAR_PROP, webappDir.getAbsolutePath());
- System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled", "false");
- File propFile = new File(webappDir, "tuscany.properties");
- if (propFile.isFile()) {
- try {
- FileInputStream is = new FileInputStream(propFile);
- Properties props = new Properties();
- props.load(is);
- is.close();
- System.setProperty(TUSCANY_SHARED_PROP, props.getProperty("singleton", "false"));
- } catch (IOException e) {
- // Ignore
- }
- }
- log.info("Using Tuscany webapp: " + webappDir.getAbsolutePath());
- StandardServer server = (StandardServer)event.getSource();
- StandardService catalina = (StandardService)server.findService("Catalina");
- for (Connector connector : catalina.findConnectors()) {
- for (Container container : connector.getContainer().findChildren()) {
- if (container instanceof StandardHost) {
- for (LifecycleListener listener : ((StandardHost)container).findLifecycleListeners()) {
- if (listener instanceof HostConfig) {
- ((HostConfig)listener)
- .setContextClass("org.apache.tuscany.sca.tomcat.TuscanyStandardContext");
- log.info("Tuscany enabled on connector: " + container.getName()
- + ":"
- + connector.getPort());
- }
- }
- }
- }
- }
- }
- }
- }
-
- private static File findTuscanyWar() {
-
- // in Tomcat 5.5 the Tuscany war is in the server/webapps director
- String catalinaBase = System.getProperty("catalina.base");
- File serverWebapps = new File(catalinaBase, "server/webapps");
- File tuscanyWar = findTuscanyWar(serverWebapps);
- if (tuscanyWar != null) {
- return tuscanyWar;
- }
-
- // in Tomcat 6 the Tuscany war is normally in webapps, but we just scan all hosts directories
- for (Service service : ServerFactory.getServer().findServices()) {
- Container container = service.getContainer();
- if (container instanceof StandardEngine) {
- StandardEngine engine = (StandardEngine)container;
- for (Container child : engine.findChildren()) {
- if (child instanceof StandardHost) {
- StandardHost host = (StandardHost)child;
- String appBase = host.getAppBase();
-
- // determine the host dir (normally webapps)
- File hostDir = new File(appBase);
- if (!hostDir.isAbsolute()) {
- hostDir = new File(catalinaBase, appBase);
- }
-
- tuscanyWar = findTuscanyWar(hostDir);
- if (tuscanyWar != null) {
- return tuscanyWar;
- }
- }
- }
- }
- }
- return null;
- }
-
- private static File findTuscanyWar(File hostDir) {
- if (!hostDir.isDirectory()) {
- return null;
- }
-
- // iterate over the contexts
- for (File contextDir : hostDir.listFiles()) {
- // does this war have a web-inf lib dir
- File hookLib = new File(contextDir, "tomcat-lib");
- if (!hookLib.isDirectory()) {
- continue;
- }
- // iterate over the libs looking for the tuscany-tomcat-*.jar
- for (File file : hookLib.listFiles()) {
- if (file.getName().startsWith("tuscany-tomcat-hook-") && file.getName().endsWith(".jar")) {
- // this should be in the Tuscany war...
- // make sure it has a runtime directory
- if (new File(contextDir, "tuscany-lib").isDirectory()) {
- return contextDir;
- }
- }
- }
- }
- return null;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.tomcat;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Properties;
+import java.util.logging.Logger;
+
+import org.apache.catalina.Container;
+import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.ServerFactory;
+import org.apache.catalina.Service;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.core.StandardEngine;
+import org.apache.catalina.core.StandardHost;
+import org.apache.catalina.core.StandardServer;
+import org.apache.catalina.core.StandardService;
+import org.apache.catalina.startup.HostConfig;
+
+/**
+ * A Tomcat LifecycleListener that initilizes the Tuscany Tomcat integration.
+ * It sets a System property with the location of the Tuscany runtime .war
+ * and configures each Tomcat Connector to use the TuscanyStandardContext.
+ *
+ * To configure Tomcat to use this add the following to the Tomcat conf/server.xml
+ * <Listener className="org.apache.tuscany.sca.tomcat.TuscanyLifecycleListener"/>
+ */
+public class TuscanyLifecycleListener implements LifecycleListener {
+ private static final Logger log = Logger.getLogger(TuscanyLifecycleListener.class.getName());
+
+ public static final String TUSCANY_WAR_PROP = "org.apache.tuscany.sca.tomcat.war";
+
+ private static boolean running;
+
+ public static boolean isRunning() {
+ return running;
+ }
+
+ static final String TUSCANY_SHARED_PROP = "org.apache.tuscany.sca.tomcat.shared";
+
+ public TuscanyLifecycleListener() {
+ running = true;
+ log.info("Apache Tuscany initilizing");
+ }
+
+ public void lifecycleEvent(LifecycleEvent event) {
+ if ("init".equals(event.getType()) && (event.getSource() instanceof StandardServer)) {
+ File webappDir = findTuscanyWar();
+ if (webappDir == null) {
+ log.severe("Tuscany disabled as Tuscany webapp not found");
+ } else {
+ System.setProperty(TUSCANY_WAR_PROP, webappDir.getAbsolutePath());
+ System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled", "false");
+ File propFile = new File(webappDir, "tuscany.properties");
+ if (propFile.isFile()) {
+ try {
+ FileInputStream is = new FileInputStream(propFile);
+ Properties props = new Properties();
+ props.load(is);
+ is.close();
+ System.setProperty(TUSCANY_SHARED_PROP, props.getProperty("singleton", "false"));
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
+ log.info("Using Tuscany webapp: " + webappDir.getAbsolutePath());
+ StandardServer server = (StandardServer)event.getSource();
+ StandardService catalina = (StandardService)server.findService("Catalina");
+ for (Connector connector : catalina.findConnectors()) {
+ for (Container container : connector.getContainer().findChildren()) {
+ if (container instanceof StandardHost) {
+ for (LifecycleListener listener : ((StandardHost)container).findLifecycleListeners()) {
+ if (listener instanceof HostConfig) {
+ ((HostConfig)listener)
+ .setContextClass("org.apache.tuscany.sca.tomcat.TuscanyStandardContext");
+ log.info("Tuscany enabled on connector: " + container.getName()
+ + ":"
+ + connector.getPort());
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private static File findTuscanyWar() {
+
+ // in Tomcat 5.5 the Tuscany war is in the server/webapps director
+ String catalinaBase = System.getProperty("catalina.base");
+ File serverWebapps = new File(catalinaBase, "server/webapps");
+ File tuscanyWar = findTuscanyWar(serverWebapps);
+ if (tuscanyWar != null) {
+ return tuscanyWar;
+ }
+
+ // in Tomcat 6 the Tuscany war is normally in webapps, but we just scan all hosts directories
+ for (Service service : ServerFactory.getServer().findServices()) {
+ Container container = service.getContainer();
+ if (container instanceof StandardEngine) {
+ StandardEngine engine = (StandardEngine)container;
+ for (Container child : engine.findChildren()) {
+ if (child instanceof StandardHost) {
+ StandardHost host = (StandardHost)child;
+ String appBase = host.getAppBase();
+
+ // determine the host dir (normally webapps)
+ File hostDir = new File(appBase);
+ if (!hostDir.isAbsolute()) {
+ hostDir = new File(catalinaBase, appBase);
+ }
+
+ tuscanyWar = findTuscanyWar(hostDir);
+ if (tuscanyWar != null) {
+ return tuscanyWar;
+ }
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private static File findTuscanyWar(File hostDir) {
+ if (!hostDir.isDirectory()) {
+ return null;
+ }
+
+ // iterate over the contexts
+ for (File contextDir : hostDir.listFiles()) {
+ // does this war have a web-inf lib dir
+ File hookLib = new File(contextDir, "tomcat-lib");
+ if (!hookLib.isDirectory()) {
+ continue;
+ }
+ // iterate over the libs looking for the tuscany-tomcat-*.jar
+ for (File file : hookLib.listFiles()) {
+ if (file.getName().startsWith("tuscany-tomcat-hook-") && file.getName().endsWith(".jar")) {
+ // this should be in the Tuscany war...
+ // make sure it has a runtime directory
+ if (new File(contextDir, "tuscany-lib").isDirectory()) {
+ return contextDir;
+ }
+ }
+ }
+ }
+ return null;
+ }
+}
diff --git a/java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java b/java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java
index 94b7152610..5e9b5d90e5 100644
--- a/java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java
+++ b/java/sca/distribution/tomcat/tomcat-hook/src/main/java/org/apache/tuscany/sca/tomcat/TuscanyStandardContext.java
@@ -1,185 +1,185 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.tomcat;
-
-import java.io.File;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.logging.Logger;
-
-import javax.naming.NameClassPair;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-
-import org.apache.catalina.Loader;
-import org.apache.catalina.core.StandardContext;
-import org.apache.catalina.deploy.FilterDef;
-
-/**
- * A Tuscany StandardContext to initilize SCA applications.
- * There is a StandardContext instance for each webapp and its
- * called to handle all start/stop/etc requests. This intercepts
- * the start and inserts any required Tuscany configuration.
- */
-public class TuscanyStandardContext extends StandardContext {
- private static final long serialVersionUID = 1L;
- private static final Logger log = Logger.getLogger(TuscanyStandardContext.class.getName());
-
- protected static final String TUSCANY_FILTER_NAME = "TuscanyFilter";
- protected static final String TUSCANY_SERVLET_FILTER = "org.apache.tuscany.sca.host.webapp.TuscanyServletFilter";
- protected static final String TUSCANY_CONTEXT_LISTENER = "org.apache.tuscany.sca.host.webapp.TuscanyContextListener";
- protected static final String TUSCANY_MANAGER_LISTENER = "org.apache.tuscany.sca.tomcat.foo.TuscanyTomcatNode";
-
- private boolean isSCAApp;
-
- // TODO: this gives an instance per webapp, work out how to have only one per server
- private static URLClassLoader tuscanyClassLoader;
-
- /**
- * Overrides the getLoader method in the Tomcat StandardContext as its a convenient
- * point to insert the Tuscany initilization. This gets called the first time during
- * StandardContext.start after the webapp resources have been created so this can
- * use getResources() to look for the SCA web.composite or sca-contribution.xml files,
- * but its still early enough in start to insert the required Tuscany config.
- */
- @Override
- public Loader getLoader() {
- if (loader != null) {
- return loader;
- }
-
- ClassLoader parent = getParentClassLoader();
- if (isSCAApp = isSCAApplication() || isTuscanyManager()) {
- String sharedProp = System.getProperty(TuscanyLifecycleListener.TUSCANY_SHARED_PROP, "false");
- boolean shared = "true".equalsIgnoreCase(sharedProp);
- if (!shared) {
- setParentClassLoader(copy(getTuscanyClassloader(parent)));
- } else {
- // The default parent classloader is the one for the webapp
- setParentClassLoader(getTuscanyClassloader(parent));
- }
- }
-
- return super.getLoader();
- }
-
- @Override
- public boolean listenerStart() {
- if (isTuscanyManager()) {
- // this isn't great having the manager app config scattered about different modules
- // but is temp until this is all tidied up in a refactor after the basics are working
- addApplicationListener(TUSCANY_MANAGER_LISTENER);
- } else if (isSCAApp) {
- enableTuscany();
- }
- return super.listenerStart();
- }
-
- private void enableTuscany() {
-
- for (String listener : findApplicationListeners()) {
- if (TUSCANY_CONTEXT_LISTENER.equals(listener)) {
- // The web application already has the context listener configured
- return;
- }
- }
-
- for (FilterDef filterDef : findFilterDefs()) {
- if (TUSCANY_SERVLET_FILTER.equals(filterDef.getFilterClass())) {
- // The web application already has the filter configured
- return;
- }
- }
-
- addApplicationListener(TUSCANY_CONTEXT_LISTENER);
-
- FilterDef filterDef = new FilterDef();
- filterDef.setFilterName(TUSCANY_FILTER_NAME);
- filterDef.setFilterClass(TUSCANY_SERVLET_FILTER);
- addFilterDef(filterDef);
-
- if (isUseNaming() && getNamingContextListener() != null) {
- setAnnotationProcessor(new TuscanyAnnotationsProcessor(this, getNamingContextListener().getEnvContext()));
- } else {
- setAnnotationProcessor(new TuscanyAnnotationsProcessor(this, null));
- }
-
- log.info("Tuscany SCA is enabled for: " + this.getName());
- }
-
- private boolean isSCAApplication() {
- Object o = null;
- try {
- o = getResources().lookup("WEB-INF/web.composite");
- } catch (NamingException e) {
- }
- if (o == null) {
- try {
- o = getResources().lookup("META-INF/sca-contribution.xml");
- } catch (NamingException e) {
- }
- }
- if (o == null) {
- return false;
- }
-
- // Try to see if the Tuscany jars are packaged in the webapp
- NamingEnumeration<NameClassPair> enumeration;
- try {
- enumeration = getResources().list("WEB-INF/lib");
- while (enumeration.hasMoreElements()) {
- String jar = enumeration.nextElement().getName();
- if (jar.startsWith("tuscany-")) {
- // Do not alter is
- log.info("Tuscany SCA ignoring webapp with embedded Tuscany runtime: " + this.getName());
- return false;
- }
- }
- } catch (NamingException e) {
- }
- return true;
- }
-
- private boolean isTuscanyManager() {
- return "/tuscany".equals(getName());
- }
-
- private static URLClassLoader copy(URLClassLoader classLoader) {
- return new URLClassLoader(classLoader.getURLs(), classLoader.getParent());
- }
-
- private synchronized URLClassLoader getTuscanyClassloader(ClassLoader parent) {
- if (tuscanyClassLoader == null) {
- File tuscanyWar = new File(System.getProperty(TuscanyLifecycleListener.TUSCANY_WAR_PROP));
- File[] runtimeJars = new File(tuscanyWar, "tuscany-lib").listFiles();
- try {
- URL[] jarURLs = new URL[runtimeJars.length];
- for (int i = 0; i < jarURLs.length; i++) {
- jarURLs[i] = runtimeJars[i].toURI().toURL();
- }
- tuscanyClassLoader = new URLClassLoader(jarURLs, parent);
- return tuscanyClassLoader;
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- return tuscanyClassLoader;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.tomcat;
+
+import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.logging.Logger;
+
+import javax.naming.NameClassPair;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+
+import org.apache.catalina.Loader;
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.deploy.FilterDef;
+
+/**
+ * A Tuscany StandardContext to initilize SCA applications.
+ * There is a StandardContext instance for each webapp and its
+ * called to handle all start/stop/etc requests. This intercepts
+ * the start and inserts any required Tuscany configuration.
+ */
+public class TuscanyStandardContext extends StandardContext {
+ private static final long serialVersionUID = 1L;
+ private static final Logger log = Logger.getLogger(TuscanyStandardContext.class.getName());
+
+ protected static final String TUSCANY_FILTER_NAME = "TuscanyFilter";
+ protected static final String TUSCANY_SERVLET_FILTER = "org.apache.tuscany.sca.host.webapp.TuscanyServletFilter";
+ protected static final String TUSCANY_CONTEXT_LISTENER = "org.apache.tuscany.sca.host.webapp.TuscanyContextListener";
+ protected static final String TUSCANY_MANAGER_LISTENER = "org.apache.tuscany.sca.tomcat.foo.TuscanyTomcatNode";
+
+ private boolean isSCAApp;
+
+ // TODO: this gives an instance per webapp, work out how to have only one per server
+ private static URLClassLoader tuscanyClassLoader;
+
+ /**
+ * Overrides the getLoader method in the Tomcat StandardContext as its a convenient
+ * point to insert the Tuscany initilization. This gets called the first time during
+ * StandardContext.start after the webapp resources have been created so this can
+ * use getResources() to look for the SCA web.composite or sca-contribution.xml files,
+ * but its still early enough in start to insert the required Tuscany config.
+ */
+ @Override
+ public Loader getLoader() {
+ if (loader != null) {
+ return loader;
+ }
+
+ ClassLoader parent = getParentClassLoader();
+ if (isSCAApp = isSCAApplication() || isTuscanyManager()) {
+ String sharedProp = System.getProperty(TuscanyLifecycleListener.TUSCANY_SHARED_PROP, "false");
+ boolean shared = "true".equalsIgnoreCase(sharedProp);
+ if (!shared) {
+ setParentClassLoader(copy(getTuscanyClassloader(parent)));
+ } else {
+ // The default parent classloader is the one for the webapp
+ setParentClassLoader(getTuscanyClassloader(parent));
+ }
+ }
+
+ return super.getLoader();
+ }
+
+ @Override
+ public boolean listenerStart() {
+ if (isTuscanyManager()) {
+ // this isn't great having the manager app config scattered about different modules
+ // but is temp until this is all tidied up in a refactor after the basics are working
+ addApplicationListener(TUSCANY_MANAGER_LISTENER);
+ } else if (isSCAApp) {
+ enableTuscany();
+ }
+ return super.listenerStart();
+ }
+
+ private void enableTuscany() {
+
+ for (String listener : findApplicationListeners()) {
+ if (TUSCANY_CONTEXT_LISTENER.equals(listener)) {
+ // The web application already has the context listener configured
+ return;
+ }
+ }
+
+ for (FilterDef filterDef : findFilterDefs()) {
+ if (TUSCANY_SERVLET_FILTER.equals(filterDef.getFilterClass())) {
+ // The web application already has the filter configured
+ return;
+ }
+ }
+
+ addApplicationListener(TUSCANY_CONTEXT_LISTENER);
+
+ FilterDef filterDef = new FilterDef();
+ filterDef.setFilterName(TUSCANY_FILTER_NAME);
+ filterDef.setFilterClass(TUSCANY_SERVLET_FILTER);
+ addFilterDef(filterDef);
+
+ if (isUseNaming() && getNamingContextListener() != null) {
+ setAnnotationProcessor(new TuscanyAnnotationsProcessor(this, getNamingContextListener().getEnvContext()));
+ } else {
+ setAnnotationProcessor(new TuscanyAnnotationsProcessor(this, null));
+ }
+
+ log.info("Tuscany SCA is enabled for: " + this.getName());
+ }
+
+ private boolean isSCAApplication() {
+ Object o = null;
+ try {
+ o = getResources().lookup("WEB-INF/web.composite");
+ } catch (NamingException e) {
+ }
+ if (o == null) {
+ try {
+ o = getResources().lookup("META-INF/sca-contribution.xml");
+ } catch (NamingException e) {
+ }
+ }
+ if (o == null) {
+ return false;
+ }
+
+ // Try to see if the Tuscany jars are packaged in the webapp
+ NamingEnumeration<NameClassPair> enumeration;
+ try {
+ enumeration = getResources().list("WEB-INF/lib");
+ while (enumeration.hasMoreElements()) {
+ String jar = enumeration.nextElement().getName();
+ if (jar.startsWith("tuscany-")) {
+ // Do not alter is
+ log.info("Tuscany SCA ignoring webapp with embedded Tuscany runtime: " + this.getName());
+ return false;
+ }
+ }
+ } catch (NamingException e) {
+ }
+ return true;
+ }
+
+ private boolean isTuscanyManager() {
+ return "/tuscany".equals(getName());
+ }
+
+ private static URLClassLoader copy(URLClassLoader classLoader) {
+ return new URLClassLoader(classLoader.getURLs(), classLoader.getParent());
+ }
+
+ private synchronized URLClassLoader getTuscanyClassloader(ClassLoader parent) {
+ if (tuscanyClassLoader == null) {
+ File tuscanyWar = new File(System.getProperty(TuscanyLifecycleListener.TUSCANY_WAR_PROP));
+ File[] runtimeJars = new File(tuscanyWar, "tuscany-lib").listFiles();
+ try {
+ URL[] jarURLs = new URL[runtimeJars.length];
+ for (int i = 0; i < jarURLs.length; i++) {
+ jarURLs[i] = runtimeJars[i].toURI().toURL();
+ }
+ tuscanyClassLoader = new URLClassLoader(jarURLs, parent);
+ return tuscanyClassLoader;
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ return tuscanyClassLoader;
+ }
+}
diff --git a/java/sca/distribution/tomcat/tomcat-servlet/pom.xml b/java/sca/distribution/tomcat/tomcat-servlet/pom.xml
index 19c9381f83..83b68dad0c 100644
--- a/java/sca/distribution/tomcat/tomcat-servlet/pom.xml
+++ b/java/sca/distribution/tomcat/tomcat-servlet/pom.xml
@@ -1,63 +1,63 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-tomcat-servlet</artifactId>
- <name>Apache Tuscany SCA Tomcat Integration Servlet</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-tomcat-hook</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.swizzle</groupId>
- <artifactId>swizzle-stream</artifactId>
- <version>1.0.2</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-tomcat-servlet</artifactId>
+ <name>Apache Tuscany SCA Tomcat Integration Servlet</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-tomcat-hook</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.swizzle</groupId>
+ <artifactId>swizzle-stream</artifactId>
+ <version>1.0.2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/java/sca/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/tomcat/foo/TuscanyTomcatNode.java b/java/sca/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/tomcat/foo/TuscanyTomcatNode.java
index 69b0c77b72..972aafd8b6 100644
--- a/java/sca/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/tomcat/foo/TuscanyTomcatNode.java
+++ b/java/sca/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/tomcat/foo/TuscanyTomcatNode.java
@@ -1,74 +1,74 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.tomcat.foo;
-
-import java.io.File;
-import java.net.MalformedURLException;
-
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.apache.tuscany.sca.war.Installer;
-
-public class TuscanyTomcatNode implements ServletContextListener {
-
- protected Node tomcatNode;
-
- public void contextInitialized(ServletContextEvent arg0) {
- if (!Installer.isTuscanyHookRunning()) {
- return;
- }
-
- // TODO: this relys on the location of webapp folder, find way to get actual catalina base
- File tomcatBase = new File(arg0.getServletContext().getRealPath("/")).getParentFile().getParentFile();
-
- File contributionDir = new File(tomcatBase, "sca-contributions");
- if (!contributionDir.exists()) {
- return;
- }
- File[] contributionFiles = contributionDir.listFiles();
- if (contributionFiles.length < 1) {
- return;
- }
-
- Contribution[] nodeContributions = new Contribution[contributionFiles.length];
- for (int i = 0; i<contributionFiles.length; i++) {
- try {
- nodeContributions[i] =
- new Contribution(contributionFiles[i].getName(), contributionFiles[i].toURI().toURL().toString());
- } catch (MalformedURLException e) {
- e.printStackTrace();
- }
- }
-
- tomcatNode = NodeFactory.newInstance().createNode(nodeContributions);
- tomcatNode.start();
- }
-
- public void contextDestroyed(ServletContextEvent arg0) {
- if (tomcatNode != null) {
- tomcatNode.stop();
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.tomcat.foo;
+
+import java.io.File;
+import java.net.MalformedURLException;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.war.Installer;
+
+public class TuscanyTomcatNode implements ServletContextListener {
+
+ protected Node tomcatNode;
+
+ public void contextInitialized(ServletContextEvent arg0) {
+ if (!Installer.isTuscanyHookRunning()) {
+ return;
+ }
+
+ // TODO: this relys on the location of webapp folder, find way to get actual catalina base
+ File tomcatBase = new File(arg0.getServletContext().getRealPath("/")).getParentFile().getParentFile();
+
+ File contributionDir = new File(tomcatBase, "sca-contributions");
+ if (!contributionDir.exists()) {
+ return;
+ }
+ File[] contributionFiles = contributionDir.listFiles();
+ if (contributionFiles.length < 1) {
+ return;
+ }
+
+ Contribution[] nodeContributions = new Contribution[contributionFiles.length];
+ for (int i = 0; i<contributionFiles.length; i++) {
+ try {
+ nodeContributions[i] =
+ new Contribution(contributionFiles[i].getName(), contributionFiles[i].toURI().toURL().toString());
+ } catch (MalformedURLException e) {
+ e.printStackTrace();
+ }
+ }
+
+ tomcatNode = NodeFactory.newInstance().createNode(nodeContributions);
+ tomcatNode.start();
+ }
+
+ public void contextDestroyed(ServletContextEvent arg0) {
+ if (tomcatNode != null) {
+ tomcatNode.stop();
+ }
+ }
+
+}
diff --git a/java/sca/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/war/Installer.java b/java/sca/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/war/Installer.java
index 9ad06832e5..2251a2e833 100644
--- a/java/sca/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/war/Installer.java
+++ b/java/sca/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/war/Installer.java
@@ -1,318 +1,318 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.war;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.Closeable;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.util.Properties;
-
-import org.apache.tuscany.sca.tomcat.TuscanyLifecycleListener;
-import org.codehaus.swizzle.stream.DelimitedTokenReplacementInputStream;
-import org.codehaus.swizzle.stream.StringTokenHandler;
-
-public class Installer {
-
- private static boolean restartRequired;
- private static boolean tuscanyHookRunning;
- static {
- try {
- tuscanyHookRunning = TuscanyLifecycleListener.isRunning();
- } catch (Throwable e) {
- tuscanyHookRunning = false;
- }
- }
-
- public static boolean isTuscanyHookRunning() {
- return tuscanyHookRunning;
- }
-
- public static boolean isRestartRequired() {
- return restartRequired;
- }
-
- private File tuscanyWAR;
- private File catalinaBase;
- private String status = "";
-
- public Installer(File tuscanyWAR, File catalinaBase) {
- this.tuscanyWAR = tuscanyWAR;
- this.catalinaBase = catalinaBase;
- }
-
- public static boolean isInstalled() {
- return false;
- }
-
- public String getStatus() {
- return status;
- }
-
- public boolean install(boolean singleton) {
- try {
-
- doInstall(singleton);
- status = "Install successful, Tomcat restart required.";
- restartRequired = true;
- return true;
-
- } catch (Throwable e) {
- status = "Exception during install\n";
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- PrintWriter pw = new PrintWriter(os);
- e.printStackTrace(pw);
- pw.close();
- status += new String(os.toByteArray());
- return false;
- }
- }
-
- public boolean uninstall() {
- try {
-
- doUnintsall();
- status =
- "Tuscany removed from server.xml, please restart Tomcat and manually remove Tuscany jars from Tomcat lib";
- restartRequired = true;
- return true;
-
- } catch (Throwable e) {
- status = "Exception during install";
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- PrintWriter pw = new PrintWriter(os);
- e.printStackTrace(pw);
- status += "/n" + new String(os.toByteArray());
- return false;
- }
- }
-
- private void doUnintsall() {
- File serverXml = new File(catalinaBase, "/conf/server.xml");
- if (!(serverXml.exists())) {
- throw new IllegalStateException("conf/server.xml not found: " + serverXml.getAbsolutePath());
- }
- removeServerXml(serverXml);
- File propFile = new File(tuscanyWAR, "tuscany.properties");
- if (propFile.isFile()) {
- propFile.delete();
- }
-
- }
-
- private boolean doInstall(boolean singleton) {
- // First verify all the file locations are as expected
- if (!tuscanyWAR.exists()) {
- throw new IllegalStateException("Tuscany war missing: " + tuscanyWAR.getAbsolutePath());
- }
- if (!catalinaBase.exists()) {
- throw new IllegalStateException("Catalina base does not exist: " + catalinaBase.getAbsolutePath());
- }
- File serverLib = new File(catalinaBase, "/lib");
- if (!(serverLib.exists())) {
- // try Tomcat 5 server/lib
- if (new File(catalinaBase, "/server").exists()) {
- serverLib = new File(new File(catalinaBase, "/server"), "/lib");
- }
- }
- if (!(serverLib.exists())) {
- throw new IllegalStateException("Tomcat lib not found: " + serverLib.getAbsolutePath());
- }
- File serverXml = new File(catalinaBase, "/conf/server.xml");
- if (!(serverXml.exists())) {
- throw new IllegalStateException("conf/server.xml not found: " + serverXml.getAbsolutePath());
- }
-
- File tuscanyTomcatJar = findTuscanyTomcatJar(tuscanyWAR);
- if (tuscanyTomcatJar == null || !tuscanyTomcatJar.exists()) {
- throw new IllegalStateException("Can't find tuscany-tomcat-*.jar in: " + tuscanyWAR.getAbsolutePath());
- }
-
- // Copy tuscany-tomcat jar from the tuscany webapp web-inf/lib to Tomcat server/lib
- copyFile(tuscanyTomcatJar, new File(serverLib, tuscanyTomcatJar.getName()));
-
- if (singleton) {
- try {
- // Write out a property file
- File propFile = new File(tuscanyWAR, "tuscany.properties");
- FileOutputStream os = new FileOutputStream(propFile);
- Properties props = new Properties();
- props.put("singleton", "true");
- props.store(os, "Apache Tuscany properties for Tomcat");
- os.close();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- // Add Tuscany LifecycleListener to Tomcat server.xml
- updateServerXml(serverXml);
-
- return true;
- }
-
- private File findTuscanyTomcatJar(File tuscanyWAR) {
- File lib = new File(tuscanyWAR, "/tomcat-lib");
- for (File f : lib.listFiles()) {
- if (f.getName().startsWith("tuscany-tomcat-hook-") && f.getName().endsWith(".jar")) {
- return f;
- }
- }
- return null;
- }
-
- static final String tuscanyListener =
- "\r\n" + " <!-- Tuscany plugin for Tomcat -->\r\n"
- + "<Listener className=\"org.apache.tuscany.sca.tomcat.TuscanyLifecycleListener\" />";
-
- private void updateServerXml(File serverXmlFile) {
- String serverXML = readAll(serverXmlFile);
- if (!serverXML.contains(tuscanyListener)) {
- String newServerXml = replace(serverXML, "<Server", "<Server", ">", ">" + tuscanyListener);
- backup(serverXmlFile);
- writeAll(serverXmlFile, newServerXml);
- }
-
- }
-
- private void removeServerXml(File serverXmlFile) {
- String serverXML = readAll(serverXmlFile);
- if (serverXML.contains(tuscanyListener)) {
- String newServerXml = replace(serverXML, "<Server", "<Server", ">" + tuscanyListener, ">");
- writeAll(serverXmlFile, newServerXml);
- }
-
- }
-
- private String replace(String inputText, String begin, String newBegin, String end, String newEnd) {
- BeginEndTokenHandler tokenHandler = new BeginEndTokenHandler(newBegin, newEnd);
-
- ByteArrayInputStream in = new ByteArrayInputStream(inputText.getBytes());
-
- InputStream replacementStream = new DelimitedTokenReplacementInputStream(in, begin, end, tokenHandler, true);
- String newServerXml = readAll(replacementStream);
- close(replacementStream);
- return newServerXml;
- }
-
- private boolean backup(File source) {
- File backupFile = new File(source.getParent(), source.getName() + ".b4Tuscany");
- if (!backupFile.exists()) {
- copyFile(source, backupFile);
- }
- return true;
- }
-
- private String readAll(File file) {
- FileInputStream in = null;
- try {
- in = new FileInputStream(file);
- String text = readAll(in);
- return text;
- } catch (Exception e) {
- return null;
- } finally {
- close(in);
- }
- }
-
- private String readAll(InputStream in) {
- try {
- // SwizzleStream block read methods are broken so read byte at a time
- StringBuilder sb = new StringBuilder();
- int i = in.read();
- while (i != -1) {
- sb.append((char)i);
- i = in.read();
- }
- return sb.toString();
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
- }
-
- private void copyFile(File source, File destination) {
- InputStream in = null;
- OutputStream out = null;
- try {
- in = new FileInputStream(source);
- out = new FileOutputStream(destination);
- writeAll(in, out);
- } catch (IOException e) {
- throw new IllegalStateException(e);
- } finally {
- close(in);
- close(out);
- }
- }
-
- private boolean writeAll(File file, String text) {
- FileOutputStream fileOutputStream = null;
- try {
- fileOutputStream = new FileOutputStream(file);
- writeAll(new ByteArrayInputStream(text.getBytes()), fileOutputStream);
- return true;
- } catch (Exception e) {
- return false;
- } finally {
- close(fileOutputStream);
- }
- }
-
- private void writeAll(InputStream in, OutputStream out) throws IOException {
- byte[] buffer = new byte[4096];
- int count;
- while ((count = in.read(buffer)) > 0) {
- out.write(buffer, 0, count);
- }
- out.flush();
- }
-
- private void close(Closeable thing) {
- if (thing != null) {
- try {
- thing.close();
- } catch (Exception ignored) {
- }
- }
- }
-
- private class BeginEndTokenHandler extends StringTokenHandler {
- private final String begin;
- private final String end;
-
- public BeginEndTokenHandler(String begin, String end) {
- this.begin = begin;
- this.end = end;
- }
-
- public String handleToken(String token) throws IOException {
- String result = begin + token + end;
- return result;
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.war;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.Properties;
+
+import org.apache.tuscany.sca.tomcat.TuscanyLifecycleListener;
+import org.codehaus.swizzle.stream.DelimitedTokenReplacementInputStream;
+import org.codehaus.swizzle.stream.StringTokenHandler;
+
+public class Installer {
+
+ private static boolean restartRequired;
+ private static boolean tuscanyHookRunning;
+ static {
+ try {
+ tuscanyHookRunning = TuscanyLifecycleListener.isRunning();
+ } catch (Throwable e) {
+ tuscanyHookRunning = false;
+ }
+ }
+
+ public static boolean isTuscanyHookRunning() {
+ return tuscanyHookRunning;
+ }
+
+ public static boolean isRestartRequired() {
+ return restartRequired;
+ }
+
+ private File tuscanyWAR;
+ private File catalinaBase;
+ private String status = "";
+
+ public Installer(File tuscanyWAR, File catalinaBase) {
+ this.tuscanyWAR = tuscanyWAR;
+ this.catalinaBase = catalinaBase;
+ }
+
+ public static boolean isInstalled() {
+ return false;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public boolean install(boolean singleton) {
+ try {
+
+ doInstall(singleton);
+ status = "Install successful, Tomcat restart required.";
+ restartRequired = true;
+ return true;
+
+ } catch (Throwable e) {
+ status = "Exception during install\n";
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ PrintWriter pw = new PrintWriter(os);
+ e.printStackTrace(pw);
+ pw.close();
+ status += new String(os.toByteArray());
+ return false;
+ }
+ }
+
+ public boolean uninstall() {
+ try {
+
+ doUnintsall();
+ status =
+ "Tuscany removed from server.xml, please restart Tomcat and manually remove Tuscany jars from Tomcat lib";
+ restartRequired = true;
+ return true;
+
+ } catch (Throwable e) {
+ status = "Exception during install";
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ PrintWriter pw = new PrintWriter(os);
+ e.printStackTrace(pw);
+ status += "/n" + new String(os.toByteArray());
+ return false;
+ }
+ }
+
+ private void doUnintsall() {
+ File serverXml = new File(catalinaBase, "/conf/server.xml");
+ if (!(serverXml.exists())) {
+ throw new IllegalStateException("conf/server.xml not found: " + serverXml.getAbsolutePath());
+ }
+ removeServerXml(serverXml);
+ File propFile = new File(tuscanyWAR, "tuscany.properties");
+ if (propFile.isFile()) {
+ propFile.delete();
+ }
+
+ }
+
+ private boolean doInstall(boolean singleton) {
+ // First verify all the file locations are as expected
+ if (!tuscanyWAR.exists()) {
+ throw new IllegalStateException("Tuscany war missing: " + tuscanyWAR.getAbsolutePath());
+ }
+ if (!catalinaBase.exists()) {
+ throw new IllegalStateException("Catalina base does not exist: " + catalinaBase.getAbsolutePath());
+ }
+ File serverLib = new File(catalinaBase, "/lib");
+ if (!(serverLib.exists())) {
+ // try Tomcat 5 server/lib
+ if (new File(catalinaBase, "/server").exists()) {
+ serverLib = new File(new File(catalinaBase, "/server"), "/lib");
+ }
+ }
+ if (!(serverLib.exists())) {
+ throw new IllegalStateException("Tomcat lib not found: " + serverLib.getAbsolutePath());
+ }
+ File serverXml = new File(catalinaBase, "/conf/server.xml");
+ if (!(serverXml.exists())) {
+ throw new IllegalStateException("conf/server.xml not found: " + serverXml.getAbsolutePath());
+ }
+
+ File tuscanyTomcatJar = findTuscanyTomcatJar(tuscanyWAR);
+ if (tuscanyTomcatJar == null || !tuscanyTomcatJar.exists()) {
+ throw new IllegalStateException("Can't find tuscany-tomcat-*.jar in: " + tuscanyWAR.getAbsolutePath());
+ }
+
+ // Copy tuscany-tomcat jar from the tuscany webapp web-inf/lib to Tomcat server/lib
+ copyFile(tuscanyTomcatJar, new File(serverLib, tuscanyTomcatJar.getName()));
+
+ if (singleton) {
+ try {
+ // Write out a property file
+ File propFile = new File(tuscanyWAR, "tuscany.properties");
+ FileOutputStream os = new FileOutputStream(propFile);
+ Properties props = new Properties();
+ props.put("singleton", "true");
+ props.store(os, "Apache Tuscany properties for Tomcat");
+ os.close();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ // Add Tuscany LifecycleListener to Tomcat server.xml
+ updateServerXml(serverXml);
+
+ return true;
+ }
+
+ private File findTuscanyTomcatJar(File tuscanyWAR) {
+ File lib = new File(tuscanyWAR, "/tomcat-lib");
+ for (File f : lib.listFiles()) {
+ if (f.getName().startsWith("tuscany-tomcat-hook-") && f.getName().endsWith(".jar")) {
+ return f;
+ }
+ }
+ return null;
+ }
+
+ static final String tuscanyListener =
+ "\r\n" + " <!-- Tuscany plugin for Tomcat -->\r\n"
+ + "<Listener className=\"org.apache.tuscany.sca.tomcat.TuscanyLifecycleListener\" />";
+
+ private void updateServerXml(File serverXmlFile) {
+ String serverXML = readAll(serverXmlFile);
+ if (!serverXML.contains(tuscanyListener)) {
+ String newServerXml = replace(serverXML, "<Server", "<Server", ">", ">" + tuscanyListener);
+ backup(serverXmlFile);
+ writeAll(serverXmlFile, newServerXml);
+ }
+
+ }
+
+ private void removeServerXml(File serverXmlFile) {
+ String serverXML = readAll(serverXmlFile);
+ if (serverXML.contains(tuscanyListener)) {
+ String newServerXml = replace(serverXML, "<Server", "<Server", ">" + tuscanyListener, ">");
+ writeAll(serverXmlFile, newServerXml);
+ }
+
+ }
+
+ private String replace(String inputText, String begin, String newBegin, String end, String newEnd) {
+ BeginEndTokenHandler tokenHandler = new BeginEndTokenHandler(newBegin, newEnd);
+
+ ByteArrayInputStream in = new ByteArrayInputStream(inputText.getBytes());
+
+ InputStream replacementStream = new DelimitedTokenReplacementInputStream(in, begin, end, tokenHandler, true);
+ String newServerXml = readAll(replacementStream);
+ close(replacementStream);
+ return newServerXml;
+ }
+
+ private boolean backup(File source) {
+ File backupFile = new File(source.getParent(), source.getName() + ".b4Tuscany");
+ if (!backupFile.exists()) {
+ copyFile(source, backupFile);
+ }
+ return true;
+ }
+
+ private String readAll(File file) {
+ FileInputStream in = null;
+ try {
+ in = new FileInputStream(file);
+ String text = readAll(in);
+ return text;
+ } catch (Exception e) {
+ return null;
+ } finally {
+ close(in);
+ }
+ }
+
+ private String readAll(InputStream in) {
+ try {
+ // SwizzleStream block read methods are broken so read byte at a time
+ StringBuilder sb = new StringBuilder();
+ int i = in.read();
+ while (i != -1) {
+ sb.append((char)i);
+ i = in.read();
+ }
+ return sb.toString();
+ } catch (IOException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ private void copyFile(File source, File destination) {
+ InputStream in = null;
+ OutputStream out = null;
+ try {
+ in = new FileInputStream(source);
+ out = new FileOutputStream(destination);
+ writeAll(in, out);
+ } catch (IOException e) {
+ throw new IllegalStateException(e);
+ } finally {
+ close(in);
+ close(out);
+ }
+ }
+
+ private boolean writeAll(File file, String text) {
+ FileOutputStream fileOutputStream = null;
+ try {
+ fileOutputStream = new FileOutputStream(file);
+ writeAll(new ByteArrayInputStream(text.getBytes()), fileOutputStream);
+ return true;
+ } catch (Exception e) {
+ return false;
+ } finally {
+ close(fileOutputStream);
+ }
+ }
+
+ private void writeAll(InputStream in, OutputStream out) throws IOException {
+ byte[] buffer = new byte[4096];
+ int count;
+ while ((count = in.read(buffer)) > 0) {
+ out.write(buffer, 0, count);
+ }
+ out.flush();
+ }
+
+ private void close(Closeable thing) {
+ if (thing != null) {
+ try {
+ thing.close();
+ } catch (Exception ignored) {
+ }
+ }
+ }
+
+ private class BeginEndTokenHandler extends StringTokenHandler {
+ private final String begin;
+ private final String end;
+
+ public BeginEndTokenHandler(String begin, String end) {
+ this.begin = begin;
+ this.end = end;
+ }
+
+ public String handleToken(String token) throws IOException {
+ String result = begin + token + end;
+ return result;
+ }
+ }
+
+}
diff --git a/java/sca/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/war/InstallerServlet.java b/java/sca/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/war/InstallerServlet.java
index 5447bab83d..a7e5c7e3d7 100644
--- a/java/sca/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/war/InstallerServlet.java
+++ b/java/sca/distribution/tomcat/tomcat-servlet/src/main/java/org/apache/tuscany/sca/war/InstallerServlet.java
@@ -1,70 +1,70 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.war;
-
-import java.io.File;
-import java.io.IOException;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-public class InstallerServlet extends HttpServlet {
- private static final long serialVersionUID = 1L;
- private transient ServletConfig servletConfig;
- private transient Installer installer;
-
- public void init(ServletConfig servletConfig) throws ServletException {
- this.servletConfig = servletConfig;
- String path = servletConfig.getServletContext().getRealPath("/");
- File tuscanyWarDir = null;
- if (path != null) {
- tuscanyWarDir = new File(path);
- }
- File tomcatBase = new File(System.getProperty("catalina.base"));
- installer = new Installer(tuscanyWarDir, tomcatBase);
- }
-
- protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {
- doIt(httpServletRequest, httpServletResponse);
- }
-
- protected void doPost(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {
- doIt(httpServletRequest, httpServletResponse);
- }
-
- protected void doIt(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
-
- if ("Install".equalsIgnoreCase(req.getParameter("action"))) {
- String singleton = req.getParameter("singleton");
- installer.install(singleton!=null && singleton.equalsIgnoreCase("true"));
- } else if ("Uninstall".equalsIgnoreCase(req.getParameter("action"))) {
- installer.uninstall();
- }
-
- req.setAttribute("installer", installer);
- RequestDispatcher rd = servletConfig.getServletContext().getRequestDispatcher("/installer.jsp");
- rd.forward(req,res);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.war;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class InstallerServlet extends HttpServlet {
+ private static final long serialVersionUID = 1L;
+ private transient ServletConfig servletConfig;
+ private transient Installer installer;
+
+ public void init(ServletConfig servletConfig) throws ServletException {
+ this.servletConfig = servletConfig;
+ String path = servletConfig.getServletContext().getRealPath("/");
+ File tuscanyWarDir = null;
+ if (path != null) {
+ tuscanyWarDir = new File(path);
+ }
+ File tomcatBase = new File(System.getProperty("catalina.base"));
+ installer = new Installer(tuscanyWarDir, tomcatBase);
+ }
+
+ protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {
+ doIt(httpServletRequest, httpServletResponse);
+ }
+
+ protected void doPost(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {
+ doIt(httpServletRequest, httpServletResponse);
+ }
+
+ protected void doIt(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
+
+ if ("Install".equalsIgnoreCase(req.getParameter("action"))) {
+ String singleton = req.getParameter("singleton");
+ installer.install(singleton!=null && singleton.equalsIgnoreCase("true"));
+ } else if ("Uninstall".equalsIgnoreCase(req.getParameter("action"))) {
+ installer.uninstall();
+ }
+
+ req.setAttribute("installer", installer);
+ RequestDispatcher rd = servletConfig.getServletContext().getRequestDispatcher("/installer.jsp");
+ rd.forward(req,res);
+ }
+
+}
diff --git a/java/sca/distribution/tomcat/tomcat-war/pom.xml b/java/sca/distribution/tomcat/tomcat-war/pom.xml
index 973e80d67b..fa768b7f54 100644
--- a/java/sca/distribution/tomcat/tomcat-war/pom.xml
+++ b/java/sca/distribution/tomcat/tomcat-war/pom.xml
@@ -1,86 +1,86 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-distribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-war</artifactId>
- <name>Apache Tuscany SCA Tomcat Deep Integration WAR</name>
- <packaging>pom</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.codehaus.swizzle</groupId>
- <artifactId>swizzle-stream</artifactId>
- <version>1.0.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-tomcat-servlet</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-tomcat-hook</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>tuscany</finalName>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>war</id>
- <phase>package</phase>
- <goals>
- <goal>attached</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <appendAssemblyId>false</appendAssemblyId>
- <descriptors>
- <descriptor>src/main/assembly/war.xml</descriptor>
- </descriptors>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-distribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-war</artifactId>
+ <name>Apache Tuscany SCA Tomcat Deep Integration WAR</name>
+ <packaging>pom</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.swizzle</groupId>
+ <artifactId>swizzle-stream</artifactId>
+ <version>1.0.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-tomcat-servlet</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-tomcat-hook</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>tuscany</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>war</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>src/main/assembly/war.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/java/sca/distribution/tomcat/tomcat-war/src/main/assembly/war.xml b/java/sca/distribution/tomcat/tomcat-war/src/main/assembly/war.xml
index 67f976459e..695acee3f0 100644
--- a/java/sca/distribution/tomcat/tomcat-war/src/main/assembly/war.xml
+++ b/java/sca/distribution/tomcat/tomcat-war/src/main/assembly/war.xml
@@ -1,94 +1,94 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<assembly>
- <id>war</id>
- <formats>
- <format>war</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>${basedir}</directory>
- <includes>
- <include>README.txt</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>${basedir}/target/classes</directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>README.txt</include>
- <include>NOTICE.txt</include>
- <include>LICENSE.txt</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>${basedir}/src/main/webapp</directory>
- <outputDirectory>/</outputDirectory>
- </fileSet>
- <fileSet>
- <directory>${basedir}/target/classes</directory>
- <outputDirectory>/</outputDirectory>
- <excludes>
- <exclude>org/**</exclude>
- <exclude>META-INF/LICENSE</exclude>
- <exclude>META-INF/NOTICE</exclude>
- </excludes>
- </fileSet>
- <fileSet>
- <directory>${basedir}/target/classes</directory>
- <outputDirectory>WEB-INF/classes</outputDirectory>
- </fileSet>
- <fileSet>
- <directory>${basedir}/target</directory>
- <outputDirectory>lib</outputDirectory>
- <includes>
- <include>tuscany-host*.jar</include>
- </includes>
- </fileSet>
- </fileSets>
- <dependencySets>
- <dependencySet>
- <outputDirectory>tuscany-lib</outputDirectory>
- <scope>runtime</scope>
- <excludes>
- <exclude>org.apache.tomcat:catalina</exclude>
- <exclude>org.apache.tomcat:annotations-api</exclude>
- <exclude>org.apache.tomcat:juli</exclude>
- <exclude>org.apache.tomcat:servlet-api</exclude>
- </excludes>
- </dependencySet>
- <dependencySet>
- <outputDirectory>tomcat-lib</outputDirectory>
- <scope>runtime</scope>
- <includes>
- <include>org.apache.tuscany.sca:tuscany-tomcat-hook</include>
- </includes>
- </dependencySet>
- <dependencySet>
- <outputDirectory>WEB-INF/lib</outputDirectory>
- <scope>runtime</scope>
- <includes>
- <include>org.apache.tuscany.sca:tuscany-tomcat-servlet</include>
- <include>org.codehaus.swizzle:swizzle-stream</include>
- </includes>
- </dependencySet>
- </dependencySets>
-</assembly>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<assembly>
+ <id>war</id>
+ <formats>
+ <format>war</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>${basedir}</directory>
+ <includes>
+ <include>README.txt</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>${basedir}/target/classes</directory>
+ <outputDirectory>/</outputDirectory>
+ <includes>
+ <include>README.txt</include>
+ <include>NOTICE.txt</include>
+ <include>LICENSE.txt</include>
+ </includes>
+ </fileSet>
+ <fileSet>
+ <directory>${basedir}/src/main/webapp</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>${basedir}/target/classes</directory>
+ <outputDirectory>/</outputDirectory>
+ <excludes>
+ <exclude>org/**</exclude>
+ <exclude>META-INF/LICENSE</exclude>
+ <exclude>META-INF/NOTICE</exclude>
+ </excludes>
+ </fileSet>
+ <fileSet>
+ <directory>${basedir}/target/classes</directory>
+ <outputDirectory>WEB-INF/classes</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>${basedir}/target</directory>
+ <outputDirectory>lib</outputDirectory>
+ <includes>
+ <include>tuscany-host*.jar</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>tuscany-lib</outputDirectory>
+ <scope>runtime</scope>
+ <excludes>
+ <exclude>org.apache.tomcat:catalina</exclude>
+ <exclude>org.apache.tomcat:annotations-api</exclude>
+ <exclude>org.apache.tomcat:juli</exclude>
+ <exclude>org.apache.tomcat:servlet-api</exclude>
+ </excludes>
+ </dependencySet>
+ <dependencySet>
+ <outputDirectory>tomcat-lib</outputDirectory>
+ <scope>runtime</scope>
+ <includes>
+ <include>org.apache.tuscany.sca:tuscany-tomcat-hook</include>
+ </includes>
+ </dependencySet>
+ <dependencySet>
+ <outputDirectory>WEB-INF/lib</outputDirectory>
+ <scope>runtime</scope>
+ <includes>
+ <include>org.apache.tuscany.sca:tuscany-tomcat-servlet</include>
+ <include>org.codehaus.swizzle:swizzle-stream</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
+
diff --git a/java/sca/distribution/tomcat/tomcat-war/src/main/webapp/WEB-INF/web.xml b/java/sca/distribution/tomcat/tomcat-war/src/main/webapp/WEB-INF/web.xml
index f416c92c26..e6c3d23e9e 100644
--- a/java/sca/distribution/tomcat/tomcat-war/src/main/webapp/WEB-INF/web.xml
+++ b/java/sca/distribution/tomcat/tomcat-war/src/main/webapp/WEB-INF/web.xml
@@ -1,40 +1,40 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<!DOCTYPE web-app
- PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- "http://java.sun.com/dtd/web-app_2_3.dtd">
-
-<web-app>
-
- <display-name>Tuscany Installer Application</display-name>
-
- <servlet>
- <servlet-name>InstallerServlet</servlet-name>
- <servlet-class>org.apache.tuscany.sca.war.InstallerServlet</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>InstallerServlet</servlet-name>
- <url-pattern>/installer</url-pattern>
- </servlet-mapping>
-
- <welcome-file-list id="WelcomeFileList">
- <welcome-file>installer.jsp</welcome-file>
- </welcome-file-list>
-
-</web-app>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+
+ <display-name>Tuscany Installer Application</display-name>
+
+ <servlet>
+ <servlet-name>InstallerServlet</servlet-name>
+ <servlet-class>org.apache.tuscany.sca.war.InstallerServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>InstallerServlet</servlet-name>
+ <url-pattern>/installer</url-pattern>
+ </servlet-mapping>
+
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>installer.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>
diff --git a/java/sca/features/all/pom.xml b/java/sca/features/all/pom.xml
index c390551e4a..482e44a785 100644
--- a/java/sca/features/all/pom.xml
+++ b/java/sca/features/all/pom.xml
@@ -1,91 +1,91 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-feature-all</artifactId>
- <name>Apache Tuscany SCA All-in-one Feature</name>
- <packaging>pom</packaging>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-api</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-webservice</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-ejava</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-webapp</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-process</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-launcher</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint-tribes</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-feature-all</artifactId>
+ <name>Apache Tuscany SCA All-in-one Feature</name>
+ <packaging>pom</packaging>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-api</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-core</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-webservice</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-ejava</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-webapp</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-process</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-launcher</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-endpoint-tribes</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/java/sca/features/api/pom.xml b/java/sca/features/api/pom.xml
index a52d0f2f2d..1ae6db2cf1 100644
--- a/java/sca/features/api/pom.xml
+++ b/java/sca/features/api/pom.xml
@@ -1,51 +1,51 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-feature-api</artifactId>
- <name>Apache Tuscany SCA API Feature</name>
- <packaging>pom</packaging>
-
- <dependencies>
-
- <!-- SCA API -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Node API -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-feature-api</artifactId>
+ <name>Apache Tuscany SCA API Feature</name>
+ <packaging>pom</packaging>
+
+ <dependencies>
+
+ <!-- SCA API -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Node API -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/java/sca/features/core/pom.xml b/java/sca/features/core/pom.xml
index dca27e0b23..a0e44668f4 100644
--- a/java/sca/features/core/pom.xml
+++ b/java/sca/features/core/pom.xml
@@ -1,254 +1,254 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-feature-core</artifactId>
- <name>Apache Tuscany SCA Core Feature</name>
- <packaging>pom</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-api</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- SCA API -->
-<!--
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
--->
-
- <!-- Assembly model -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xsd</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Bindings -->
- <!--dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-corba-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency-->
-
- <!-- Contribution model -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Core runtime -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-databinding</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Databindings -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Data API -->
- <!--dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-data-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency-->
-
- <!-- Policy definitions -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-definitions-xml</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Domain support -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-endpoint</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Core Extensibility -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility-equinox</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Hosts -->
- <!--dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-corba-jse</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency-->
- <!-- host-http is required by tuscany-implementation-node-runtime -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Implementation types -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Interface models -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-jaxws</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Node runtime -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-client-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!--
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-webapp</artifactId>
- <version>2.0-SNAPSHOT</version>
- <type>war</type>
- </dependency>
- -->
-
- <!-- Monitoring -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-monitor</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Policy models -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-security</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <!--dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-security-jsr250</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency-->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-xml</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- XMLSchema support -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-feature-core</artifactId>
+ <name>Apache Tuscany SCA Core Feature</name>
+ <packaging>pom</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-api</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- SCA API -->
+<!--
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+-->
+
+ <!-- Assembly model -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xml</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xsd</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Bindings -->
+ <!--dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-corba-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency-->
+
+ <!-- Contribution model -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Core runtime -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-databinding</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-spi</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Databindings -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-jaxb</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Data API -->
+ <!--dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-data-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency-->
+
+ <!-- Policy definitions -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-definitions-xml</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Domain support -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-endpoint</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Core Extensibility -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-extensibility</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-extensibility-equinox</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Hosts -->
+ <!--dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-corba-jse</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency-->
+ <!-- host-http is required by tuscany-implementation-node-runtime -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-http</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Implementation types -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Interface models -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-java</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-java-jaxws</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-wsdl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Node runtime -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-client-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher-equinox</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!--
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher-webapp</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>war</type>
+ </dependency>
+ -->
+
+ <!-- Monitoring -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-monitor</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Policy models -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy-security</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <!--dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy-security-jsr250</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency-->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy-xml</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- XMLSchema support -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-xsd</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/java/sca/features/ejava/pom.xml b/java/sca/features/ejava/pom.xml
index 5d3bfa4e27..714901543d 100644
--- a/java/sca/features/ejava/pom.xml
+++ b/java/sca/features/ejava/pom.xml
@@ -1,133 +1,133 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-feature-ejava</artifactId>
- <name>Apache Tuscany SCA Enterprise Java Feature</name>
- <packaging>pom</packaging>
-
- <dependencies>
-
- <!-- Core distribution -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Bindings -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rmi-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-<!--
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ejb-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jms-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
--->
-
- <!-- Hosts -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-rmi</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-<!--
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-corba-jee</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
--->
-
- <!-- Implementations -->
-<!--
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-ejb</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
--->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-spring</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-spring-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- OSGi RFC 119 -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-osgi-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-osgi</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl-osgi</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.osgi</groupId>
- <artifactId>services</artifactId>
- <version>3.1.200-v20071203</version>
- </dependency>
-
-
- <!-- Policies -->
-<!--
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-transaction</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
--->
- </dependencies>
-
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-feature-ejava</artifactId>
+ <name>Apache Tuscany SCA Enterprise Java Feature</name>
+ <packaging>pom</packaging>
+
+ <dependencies>
+
+ <!-- Core distribution -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-core</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Bindings -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+<!--
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ejb-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jms-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+-->
+
+ <!-- Hosts -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-rmi</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+<!--
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-corba-jee</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+-->
+
+ <!-- Implementations -->
+<!--
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-ejb</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+-->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- OSGi RFC 119 -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-osgi-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution-osgi</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl-osgi</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.osgi</groupId>
+ <artifactId>services</artifactId>
+ <version>3.1.200-v20071203</version>
+ </dependency>
+
+
+ <!-- Policies -->
+<!--
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy-transaction</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+-->
+ </dependencies>
+
+
+</project>
diff --git a/java/sca/features/process/pom.xml b/java/sca/features/process/pom.xml
index 1ee4a0fe6f..644f55de85 100644
--- a/java/sca/features/process/pom.xml
+++ b/java/sca/features/process/pom.xml
@@ -1,57 +1,57 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-feature-process</artifactId>
- <name>Apache Tuscany SCA Process Feature</name>
- <packaging>pom</packaging>
-
- <dependencies>
-
- <!-- Core distribution -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- ODE BPEL -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-bpel</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-bpel-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-feature-process</artifactId>
+ <name>Apache Tuscany SCA Process Feature</name>
+ <packaging>pom</packaging>
+
+ <dependencies>
+
+ <!-- Core distribution -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-core</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- ODE BPEL -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-bpel</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-bpel-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/java/sca/features/webapp/pom.xml b/java/sca/features/webapp/pom.xml
index e7d75322d5..a28577743c 100644
--- a/java/sca/features/webapp/pom.xml
+++ b/java/sca/features/webapp/pom.xml
@@ -1,81 +1,81 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-feature-webapp</artifactId>
- <name>Apache Tuscany SCA WebApp Feature</name>
- <packaging>pom</packaging>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <version>2.0-SNAPSHOT</version>
- <type>pom</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Explicitly list the servlet/jsp apis as "provided" dependencies are not transitive -->
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jsp_2.1_spec</artifactId>
- <version>1.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-el_1.0_spec</artifactId>
- <version>1.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-stripes</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-myfaces</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-feature-webapp</artifactId>
+ <name>Apache Tuscany SCA WebApp Feature</name>
+ <packaging>pom</packaging>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-core</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Explicitly list the servlet/jsp apis as "provided" dependencies are not transitive -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jsp_2.1_spec</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-el_1.0_spec</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-stripes</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-myfaces</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/java/sca/features/webservice/pom.xml b/java/sca/features/webservice/pom.xml
index 6744c62759..777a9390a3 100644
--- a/java/sca/features/webservice/pom.xml
+++ b/java/sca/features/webservice/pom.xml
@@ -1,133 +1,133 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-feature-webservice</artifactId>
- <name>Apache Tuscany SCA Web Service Feature</name>
- <packaging>pom</packaging>
-
- <dependencies>
-
- <!-- Core distribution -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Bindings -->
- <!--dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-sca-axis2</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency-->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-SNAPSHOT</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.ant</groupId>
- <artifactId>ant-nodeps</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.axis2</groupId>
- <artifactId>addressing</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-xmlbeans</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.axis2</groupId>
- <artifactId>axis2-adb-codegen</artifactId>
- </exclusion>
- <exclusion>
- <groupId>bouncycastle</groupId>
- <artifactId>bcprov-jdk15</artifactId>
- </exclusion>
- <exclusion>
- <groupId>opensaml</groupId>
- <artifactId>opensaml</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-xml</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Databindings -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-axiom</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb-axiom</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <!--dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-sdo</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-sdo-axiom</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency-->
-
- <!-- Hosts -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Policy models -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-xml-ws</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-feature-webservice</artifactId>
+ <name>Apache Tuscany SCA Web Service Feature</name>
+ <packaging>pom</packaging>
+
+ <dependencies>
+
+ <!-- Core distribution -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-core</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Bindings -->
+ <!--dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-sca-axis2</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency-->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-nodeps</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>addressing</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-xmlbeans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.axis2</groupId>
+ <artifactId>axis2-adb-codegen</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>bouncycastle</groupId>
+ <artifactId>bcprov-jdk15</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>opensaml</groupId>
+ <artifactId>opensaml</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-xml</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Databindings -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-axiom</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-jaxb-axiom</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <!--dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-sdo</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-sdo-axiom</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency-->
+
+ <!-- Hosts -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Policy models -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy-xml-ws</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/java/sca/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite b/java/sca/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite
index ddf25b2578..3d0b37eeae 100644
--- a/java/sca/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite
+++ b/java/sca/itest/callback-multiple-wires/src/main/resources/CallbackMultiWireTest.composite
@@ -1,38 +1,38 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://callback"
- name="CallbackMultiWireTest">
-
- <component name="MyClientComponent1">
- <implementation.java class="org.apache.tuscany.sca.test.callback.MyClientImpl1"/>
- <reference name="myService" target="MyServiceComponent"/>
- </component>
-
- <component name="MyClientComponent2">
- <implementation.java class="org.apache.tuscany.sca.test.callback.MyClientImpl2"/>
- <reference name="myService" target="MyServiceComponent"/>
- </component>
-
- <component name="MyServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.test.callback.MyServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://callback"
+ name="CallbackMultiWireTest">
+
+ <component name="MyClientComponent1">
+ <implementation.java class="org.apache.tuscany.sca.test.callback.MyClientImpl1"/>
+ <reference name="myService" target="MyServiceComponent"/>
+ </component>
+
+ <component name="MyClientComponent2">
+ <implementation.java class="org.apache.tuscany.sca.test.callback.MyClientImpl2"/>
+ <reference name="myService" target="MyServiceComponent"/>
+ </component>
+
+ <component name="MyServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.test.callback.MyServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite b/java/sca/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite
index a6e2c35761..f803fb2ec9 100644
--- a/java/sca/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite
+++ b/java/sca/itest/callback-separatethread/src/main/resources/CallBackSeparateThreadTest.composite
@@ -1,31 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://callback" name="CallBackSeparateThreadTest">
-
- <component name="CallBackSeparateThreadClient">
- <implementation.java class="org.apache.tuscany.sca.itest.CallBackSeparateThreadClientImpl"/>
- <reference name="aCallBackService" target="EventProcessorService"/>
- </component>
-
- <component name="EventProcessorService">
- <implementation.java class="org.apache.tuscany.sca.itest.EventProcessorServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://callback" name="CallBackSeparateThreadTest">
+
+ <component name="CallBackSeparateThreadClient">
+ <implementation.java class="org.apache.tuscany.sca.itest.CallBackSeparateThreadClientImpl"/>
+ <reference name="aCallBackService" target="EventProcessorService"/>
+ </component>
+
+ <component name="EventProcessorService">
+ <implementation.java class="org.apache.tuscany.sca.itest.EventProcessorServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/component-type/src/main/resources/Calculator.composite b/java/sca/itest/component-type/src/main/resources/Calculator.composite
index 1245792edb..ecee33e072 100644
--- a/java/sca/itest/component-type/src/main/resources/Calculator.composite
+++ b/java/sca/itest/component-type/src/main/resources/Calculator.composite
@@ -1,49 +1,49 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://sample"
- xmlns:sample="http://sample"
- name="Calculator">
-
- <component name="CalculatorServiceComponent">
- <implementation.java class="calculator.CalculatorServiceImpl"/>
- <reference name="addService" target="AddServiceComponent/AddService"/>
- <reference name="subtractService" target="SubtractServiceComponent/SubtractService"/>
- <reference name="multiplyService" target="MultiplyServiceComponent/MultiplyService"/>
- <reference name="divideService" target="DivideServiceComponent/DivideService"/>
- </component>
-
- <component name="AddServiceComponent">
- <implementation.java class="calculator.AddServiceImpl"/>
- </component>
-
- <component name="SubtractServiceComponent">
- <implementation.java class="calculator.SubtractServiceImpl"/>
- </component>
-
- <component name="MultiplyServiceComponent">
- <implementation.java class="calculator.MultiplyServiceImpl"/>
- </component>
-
- <component name="DivideServiceComponent">
- <implementation.java class="calculator.DivideServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Calculator">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <reference name="addService" target="AddServiceComponent/AddService"/>
+ <reference name="subtractService" target="SubtractServiceComponent/SubtractService"/>
+ <reference name="multiplyService" target="MultiplyServiceComponent/MultiplyService"/>
+ <reference name="divideService" target="DivideServiceComponent/DivideService"/>
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/contribution-folder/pom.xml b/java/sca/itest/contribution-folder/pom.xml
index e18e5a92ed..35e7bb03ae 100644
--- a/java/sca/itest/contribution-folder/pom.xml
+++ b/java/sca/itest/contribution-folder/pom.xml
@@ -1,46 +1,46 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-contribution-folder</artifactId>
- <name>Apache Tuscany SCA iTest Contribution Folder</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-folder</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution Folder</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/java/sca/itest/contribution-folder/src/test/java/calculator/CalculatorService.java b/java/sca/itest/contribution-folder/src/test/java/calculator/CalculatorService.java
index a318cf50d9..b4c677b371 100644
--- a/java/sca/itest/contribution-folder/src/test/java/calculator/CalculatorService.java
+++ b/java/sca/itest/contribution-folder/src/test/java/calculator/CalculatorService.java
@@ -1,31 +1,31 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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 subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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 subtract(double n1, double n2);
+
+ double multiply(double n1, double n2);
+
+ double divide(double n1, double n2);
+
+}
diff --git a/java/sca/itest/contribution-folder/src/test/java/test/ContributionFolderTestCase.java b/java/sca/itest/contribution-folder/src/test/java/test/ContributionFolderTestCase.java
index 0c8f84d7cc..ef2a43c766 100644
--- a/java/sca/itest/contribution-folder/src/test/java/test/ContributionFolderTestCase.java
+++ b/java/sca/itest/contribution-folder/src/test/java/test/ContributionFolderTestCase.java
@@ -1,55 +1,55 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package test;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-import calculator.CalculatorService;
-
-/**
- * Test SCADomain.newInstance and invocation of a service.
- *
- * @version $Rev: 608205 $ $Date: 2008-01-02 20:29:05 +0000 (Wed, 02 Jan 2008) $
- */
-public class ContributionFolderTestCase extends TestCase {
-
- private Node node;
-
- @Override
- protected void setUp() throws Exception {
- node = NodeFactory.newInstance().createNode(new Contribution("foo", "src/test/resources/repository"));
- node.start();
- }
-
- public void testInvoke() throws Exception {
- CalculatorService service = node.getService(CalculatorService.class, "CalculatorServiceComponent");
- assertEquals(3.0, service.add(1, 2));
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package test;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+import calculator.CalculatorService;
+
+/**
+ * Test SCADomain.newInstance and invocation of a service.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ContributionFolderTestCase extends TestCase {
+
+ private Node node;
+
+ @Override
+ protected void setUp() throws Exception {
+ node = NodeFactory.newInstance().createNode(new Contribution("foo", "src/test/resources/repository"));
+ node.start();
+ }
+
+ public void testInvoke() throws Exception {
+ CalculatorService service = node.getService(CalculatorService.class, "CalculatorServiceComponent");
+ assertEquals(3.0, service.add(1, 2));
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+}
diff --git a/java/sca/itest/contribution-folder/src/test/resources/repository/folderWithJars/Calculator.composite b/java/sca/itest/contribution-folder/src/test/resources/repository/folderWithJars/Calculator.composite
index e11d44fe58..f67b212d99 100644
--- a/java/sca/itest/contribution-folder/src/test/resources/repository/folderWithJars/Calculator.composite
+++ b/java/sca/itest/contribution-folder/src/test/resources/repository/folderWithJars/Calculator.composite
@@ -1,49 +1,49 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://sample"
- xmlns:sample="http://sample"
- name="Calculator">
-
- <component name="CalculatorServiceComponent">
- <implementation.java class="calculator.CalculatorServiceImpl"/>
- <reference name="addService" target="AddServiceComponent" />
- <reference name="subtractService" target="SubtractServiceComponent" />
- <reference name="multiplyService" target="MultiplyServiceComponent" />
- <reference name="divideService" target="DivideServiceComponent" />
- </component>
-
- <component name="AddServiceComponent">
- <implementation.java class="calculator.AddServiceImpl"/>
- </component>
-
- <component name="SubtractServiceComponent">
- <implementation.java class="calculator.SubtractServiceImpl"/>
- </component>
-
- <component name="MultiplyServiceComponent">
- <implementation.java class="calculator.MultiplyServiceImpl"/>
- </component>
-
- <component name="DivideServiceComponent">
- <implementation.java class="calculator.DivideServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Calculator">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/contribution-folder/src/test/resources/repository/folderWithJars/META-INF/sca-contribution.xml b/java/sca/itest/contribution-folder/src/test/resources/repository/folderWithJars/META-INF/sca-contribution.xml
index 10140b7bc1..27a1ee74e4 100644
--- a/java/sca/itest/contribution-folder/src/test/resources/repository/folderWithJars/META-INF/sca-contribution.xml
+++ b/java/sca/itest/contribution-folder/src/test/resources/repository/folderWithJars/META-INF/sca-contribution.xml
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sample="http://sample">
- <deployable composite="sample:Calculator"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:Calculator"/>
</contribution> \ No newline at end of file
diff --git a/java/sca/itest/contribution-import-export/export-composite/pom.xml b/java/sca/itest/contribution-import-export/export-composite/pom.xml
index 38e37a7080..1ab420e93c 100644
--- a/java/sca/itest/contribution-import-export/export-composite/pom.xml
+++ b/java/sca/itest/contribution-import-export/export-composite/pom.xml
@@ -1,67 +1,67 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>1.6-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-contribution-export-composite</artifactId>
- <name>Apache Tuscany SCA iTest Contribution Export</name>
-
-<dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.6-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-tomcat</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-export-composite</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution Export</name>
+
+<dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/java/sca/itest/contribution-import-export/export-composite/src/main/java/hello/Hello.java b/java/sca/itest/contribution-import-export/export-composite/src/main/java/hello/Hello.java
index e65422136f..669821261c 100644
--- a/java/sca/itest/contribution-import-export/export-composite/src/main/java/hello/Hello.java
+++ b/java/sca/itest/contribution-import-export/export-composite/src/main/java/hello/Hello.java
@@ -1,30 +1,30 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package hello;
-
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * This is the business interface of the Hello service.
- */
-@Remotable
-public interface Hello {
-
- public String getGreetings(String name);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package hello;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * This is the business interface of the Hello service.
+ */
+@Remotable
+public interface Hello {
+
+ public String getGreetings(String name);
+}
diff --git a/java/sca/itest/contribution-import-export/export-composite/src/main/java/hello/HelloImpl.java b/java/sca/itest/contribution-import-export/export-composite/src/main/java/hello/HelloImpl.java
index 5369c18497..ff9f6e75f3 100644
--- a/java/sca/itest/contribution-import-export/export-composite/src/main/java/hello/HelloImpl.java
+++ b/java/sca/itest/contribution-import-export/export-composite/src/main/java/hello/HelloImpl.java
@@ -1,33 +1,33 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package hello;
-
-import org.osoa.sca.annotations.Service;
-
-/**
- * This class implements the HelloWorld service.
- */
-@Service(Hello.class)
-public class HelloImpl implements Hello {
-
- public String getGreetings(String name) {
- return "Hello " + name;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package hello;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the HelloWorld service.
+ */
+@Service(Hello.class)
+public class HelloImpl implements Hello {
+
+ public String getGreetings(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/java/sca/itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml b/java/sca/itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml
index 3c14560a56..bea6f39932 100644
--- a/java/sca/itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml
+++ b/java/sca/itest/contribution-import-export/export-composite/src/main/resources/META-INF/sca-contribution.xml
@@ -1,25 +1,25 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://hello"
- xmlns:hello="http://hello">
- <deployable composite="hello:hello"/>
- <export namespace="http://hello"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://hello"
+ xmlns:hello="http://hello">
+ <deployable composite="hello:hello"/>
+ <export namespace="http://hello"/>
</contribution> \ No newline at end of file
diff --git a/java/sca/itest/contribution-import-export/export-composite/src/main/resources/hello.composite b/java/sca/itest/contribution-import-export/export-composite/src/main/resources/hello.composite
index 636b7111d9..aeeab337fa 100644
--- a/java/sca/itest/contribution-import-export/export-composite/src/main/resources/hello.composite
+++ b/java/sca/itest/contribution-import-export/export-composite/src/main/resources/hello.composite
@@ -1,31 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://hello"
- xmlns:hello="http://hello"
- name="hello">
-
- <service name="HelloService" promote="HelloServiceComponent"/>
-
- <component name="HelloServiceComponent">
- <implementation.java class="hello.HelloImpl" />
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://hello"
+ xmlns:hello="http://hello"
+ name="hello">
+
+ <service name="HelloService" promote="HelloServiceComponent"/>
+
+ <component name="HelloServiceComponent">
+ <implementation.java class="hello.HelloImpl" />
+ </component>
+
+</composite>
diff --git a/java/sca/itest/contribution-import-export/export-composite/src/test/java/org/apache/tuscany/sca/test/contribution/HelloTestCase.java b/java/sca/itest/contribution-import-export/export-composite/src/test/java/org/apache/tuscany/sca/test/contribution/HelloTestCase.java
index 72b77564d2..44614f243a 100644
--- a/java/sca/itest/contribution-import-export/export-composite/src/test/java/org/apache/tuscany/sca/test/contribution/HelloTestCase.java
+++ b/java/sca/itest/contribution-import-export/export-composite/src/test/java/org/apache/tuscany/sca/test/contribution/HelloTestCase.java
@@ -1,91 +1,91 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test.contribution;
-
-import hello.Hello;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.service.ContributionService;
-import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
-
-/**
- * Tests that the helloworld server is available
- */
-public class HelloTestCase extends TestCase {
- private ClassLoader cl;
- private EmbeddedSCADomain domain;
-
- @Override
- protected void setUp() throws Exception {
- // Create a test embedded SCA domain
- cl = getClass().getClassLoader();
- domain = new EmbeddedSCADomain(cl, "http://localhost");
-
- // Start the domain
- domain.start();
-
- // Contribute the SCA contribution
- ContributionService contributionService = domain.getContributionService();
-
- URL helloURL = getContributionURL(Hello.class);
-
- // File helloContrib = new File("./target/classes/");
- // URL helloURL = helloContrib.toURL();
- Contribution consumerContribution =
- contributionService.contribute("http://import-export/hello", helloURL, false);
- Composite consumerComposite = consumerContribution.getDeployables().get(0);
- domain.getDomainComposite().getIncludes().add(consumerComposite);
- domain.buildComposite(consumerComposite);
-
- // Start Components from my composite
- domain.getCompositeActivator().activate(consumerComposite);
- domain.getCompositeActivator().start(consumerComposite);
- }
-
- private URL getContributionURL(Class<?> cls) throws MalformedURLException {
- String flag = "/" + cls.getName().replace('.', '/') + ".class";
- URL url = cls.getResource(flag);
- String root = url.toExternalForm();
- root = root.substring(0, root.length() - flag.length() + 1);
- if (root.startsWith("jar:") && root.endsWith("!/")) {
- root = root.substring(4, root.length() - 2);
- }
- url = new URL(root);
- return url;
- }
-
- public void testHello() throws IOException {
- Hello hello = domain.getService(Hello.class, "HelloServiceComponent");
- assertNotNull(hello);
- assertEquals(hello.getGreetings("lresende"), "Hello lresende");
- }
-
- @Override
- public void tearDown() throws Exception {
- domain.close();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.test.contribution;
+
+import hello.Hello;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.service.ContributionService;
+import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
+
+/**
+ * Tests that the helloworld server is available
+ */
+public class HelloTestCase extends TestCase {
+ private ClassLoader cl;
+ private EmbeddedSCADomain domain;
+
+ @Override
+ protected void setUp() throws Exception {
+ // Create a test embedded SCA domain
+ cl = getClass().getClassLoader();
+ domain = new EmbeddedSCADomain(cl, "http://localhost");
+
+ // Start the domain
+ domain.start();
+
+ // Contribute the SCA contribution
+ ContributionService contributionService = domain.getContributionService();
+
+ URL helloURL = getContributionURL(Hello.class);
+
+ // File helloContrib = new File("./target/classes/");
+ // URL helloURL = helloContrib.toURL();
+ Contribution consumerContribution =
+ contributionService.contribute("http://import-export/hello", helloURL, false);
+ Composite consumerComposite = consumerContribution.getDeployables().get(0);
+ domain.getDomainComposite().getIncludes().add(consumerComposite);
+ domain.buildComposite(consumerComposite);
+
+ // Start Components from my composite
+ domain.getCompositeActivator().activate(consumerComposite);
+ domain.getCompositeActivator().start(consumerComposite);
+ }
+
+ private URL getContributionURL(Class<?> cls) throws MalformedURLException {
+ String flag = "/" + cls.getName().replace('.', '/') + ".class";
+ URL url = cls.getResource(flag);
+ String root = url.toExternalForm();
+ root = root.substring(0, root.length() - flag.length() + 1);
+ if (root.startsWith("jar:") && root.endsWith("!/")) {
+ root = root.substring(4, root.length() - 2);
+ }
+ url = new URL(root);
+ return url;
+ }
+
+ public void testHello() throws IOException {
+ Hello hello = domain.getService(Hello.class, "HelloServiceComponent");
+ assertNotNull(hello);
+ assertEquals(hello.getGreetings("lresende"), "Hello lresende");
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ domain.close();
+ }
+
+}
diff --git a/java/sca/itest/contribution-import-export/export-java/pom.xml b/java/sca/itest/contribution-import-export/export-java/pom.xml
index 4f361a12f5..cca05b9bb9 100644
--- a/java/sca/itest/contribution-import-export/export-java/pom.xml
+++ b/java/sca/itest/contribution-import-export/export-java/pom.xml
@@ -1,67 +1,67 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>1.6-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-contribution-export-java</artifactId>
- <name>Apache Tuscany SCA iTest Contribution Java Export</name>
-
-<dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.6-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-tomcat</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-export-java</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution Java Export</name>
+
+<dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/java/sca/itest/contribution-import-export/export-java/src/main/java/helloworld/HelloWorldService.java b/java/sca/itest/contribution-import-export/export-java/src/main/java/helloworld/HelloWorldService.java
index 74d22ed830..268d90e910 100644
--- a/java/sca/itest/contribution-import-export/export-java/src/main/java/helloworld/HelloWorldService.java
+++ b/java/sca/itest/contribution-import-export/export-java/src/main/java/helloworld/HelloWorldService.java
@@ -1,30 +1,30 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package helloworld;
-
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * This is the business interface of the HelloWorld greetings service.
- */
-@Remotable
-public interface HelloWorldService {
-
- public String getGreetings(String name);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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;
+
+/**
+ * This is the business interface of the HelloWorld greetings service.
+ */
+@Remotable
+public interface HelloWorldService {
+
+ public String getGreetings(String name);
+}
diff --git a/java/sca/itest/contribution-import-export/export-java/src/main/resources/META-INF/sca-contribution.xml b/java/sca/itest/contribution-import-export/export-java/src/main/resources/META-INF/sca-contribution.xml
index dc33dfa560..7e11adcec7 100644
--- a/java/sca/itest/contribution-import-export/export-java/src/main/resources/META-INF/sca-contribution.xml
+++ b/java/sca/itest/contribution-import-export/export-java/src/main/resources/META-INF/sca-contribution.xml
@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://helloworld"
- xmlns:helloworld="http://helloworld">
- <export.java package="helloworld"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://helloworld"
+ xmlns:helloworld="http://helloworld">
+ <export.java package="helloworld"/>
</contribution> \ No newline at end of file
diff --git a/java/sca/itest/contribution-import-export/export-wsdl/pom.xml b/java/sca/itest/contribution-import-export/export-wsdl/pom.xml
index 9f81cd92ca..7c504aee50 100644
--- a/java/sca/itest/contribution-import-export/export-wsdl/pom.xml
+++ b/java/sca/itest/contribution-import-export/export-wsdl/pom.xml
@@ -1,31 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>1.6-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-contribution-export-wsdl</artifactId>
- <name>Apache Tuscany SCA iTest Contribution WSDL Export</name>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-export-wsdl</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution WSDL Export</name>
+
+</project>
diff --git a/java/sca/itest/contribution-import-export/export-wsdl/src/main/resources/META-INF/sca-contribution.xml b/java/sca/itest/contribution-import-export/export-wsdl/src/main/resources/META-INF/sca-contribution.xml
index b7394ec14b..8254b667f2 100644
--- a/java/sca/itest/contribution-import-export/export-wsdl/src/main/resources/META-INF/sca-contribution.xml
+++ b/java/sca/itest/contribution-import-export/export-wsdl/src/main/resources/META-INF/sca-contribution.xml
@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://helloworld"
- xmlns:helloworld="http://helloworld">
- <export namespace="http://helloworld"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://helloworld"
+ xmlns:helloworld="http://helloworld">
+ <export namespace="http://helloworld"/>
</contribution> \ No newline at end of file
diff --git a/java/sca/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl b/java/sca/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl
index 9b31363e1a..0172fb2c7c 100644
--- a/java/sca/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl
+++ b/java/sca/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.wsdl
@@ -1,76 +1,76 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<wsdl:definitions targetNamespace="http://helloworld"
- xmlns:tns="http://helloworld"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- name="helloworld">
-
- <wsdl:types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:tns2="http://helloworld2"
- targetNamespace="http://helloworld"
- elementFormDefault="qualified">
-
- <xsd:import namespace="http://helloworld2" schemaLocation="helloworld.xsd" />
-
- <element name="getGreetings" type="tns2:getGreetingsType"/>
- <element name="getGreetingsResponse" type="tns2:getGreetingsResponseType"/>
-
- </schema>
- </wsdl:types>
-
- <wsdl:message name="getGreetingsRequest">
- <wsdl:part element="tns:getGreetings" name="parameters"/>
- </wsdl:message>
-
- <wsdl:message name="getGreetingsResponse">
- <wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
- </wsdl:message>
-
- <wsdl:portType name="HelloWorld">
- <wsdl:operation name="getGreetings">
- <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
- <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
- </wsdl:operation>
- </wsdl:portType>
-
- <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="getGreetings">
- <wsdlsoap:operation soapAction=""/>
- <wsdl:input name="getGreetingsRequest">
- <wsdlsoap:body use="literal"/>
- </wsdl:input>
- <wsdl:output name="getGreetingsResponse">
- <wsdlsoap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="HelloWorldService">
- <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
- <wsdlsoap:address location="http://localhost:8085/HelloWorldServiceComponent"/>
- </wsdl:port>
- </wsdl:service>
-
-</wsdl:definitions>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<wsdl:definitions targetNamespace="http://helloworld"
+ xmlns:tns="http://helloworld"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ name="helloworld">
+
+ <wsdl:types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns2="http://helloworld2"
+ targetNamespace="http://helloworld"
+ elementFormDefault="qualified">
+
+ <xsd:import namespace="http://helloworld2" schemaLocation="helloworld.xsd" />
+
+ <element name="getGreetings" type="tns2:getGreetingsType"/>
+ <element name="getGreetingsResponse" type="tns2:getGreetingsResponseType"/>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetingsRequest">
+ <wsdl:part element="tns:getGreetings" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:message name="getGreetingsResponse">
+ <wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloWorld">
+ <wsdl:operation name="getGreetings">
+ <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
+ <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="getGreetings">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="getGreetingsRequest">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="getGreetingsResponse">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="HelloWorldService">
+ <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
+ <wsdlsoap:address location="http://localhost:8085/HelloWorldServiceComponent"/>
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
diff --git a/java/sca/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd b/java/sca/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd
index d3c83b08c6..d49e2ead99 100644
--- a/java/sca/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd
+++ b/java/sca/itest/contribution-import-export/export-wsdl/src/main/resources/helloworld.xsd
@@ -1,35 +1,35 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<schema targetNamespace="http://helloworld2"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ns="http://helloworld2">
-
- <complexType name="getGreetingsType">
- <sequence>
- <element name="name" type="string"/>
- </sequence>
- </complexType>
-
- <complexType name="getGreetingsResponseType">
- <sequence>
- <element name="getGreetingsReturn" type="string"/>
- </sequence>
- </complexType>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<schema targetNamespace="http://helloworld2"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns="http://helloworld2">
+
+ <complexType name="getGreetingsType">
+ <sequence>
+ <element name="name" type="string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="getGreetingsResponseType">
+ <sequence>
+ <element name="getGreetingsReturn" type="string"/>
+ </sequence>
+ </complexType>
</schema> \ No newline at end of file
diff --git a/java/sca/itest/contribution-import-export/import-composite/pom.xml b/java/sca/itest/contribution-import-export/import-composite/pom.xml
index d13f2e2a87..40dab26baa 100644
--- a/java/sca/itest/contribution-import-export/import-composite/pom.xml
+++ b/java/sca/itest/contribution-import-export/import-composite/pom.xml
@@ -1,73 +1,73 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>1.6-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-contribution-import-composite</artifactId>
- <name>Apache Tuscany SCA iTest Contribution Import</name>
-
-<dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-contribution-export-composite</artifactId>
- <version>1.6-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.6-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-tomcat</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-import-composite</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution Import</name>
+
+<dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-contribution-export-composite</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/java/sca/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldImpl.java b/java/sca/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldImpl.java
index 966f56d7d5..c062afaed0 100644
--- a/java/sca/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldImpl.java
+++ b/java/sca/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldImpl.java
@@ -1,38 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package helloworld;
-
-import hello.Hello;
-
-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
- protected Hello helloServiceRef;
-
- public String getGreetings(String name) {
- return helloServiceRef.getGreetings(name);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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 hello.Hello;
+
+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
+ protected Hello helloServiceRef;
+
+ public String getGreetings(String name) {
+ return helloServiceRef.getGreetings(name);
+ }
+
+}
diff --git a/java/sca/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldServer.java b/java/sca/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldServer.java
index 3d43290380..e03ed4dc25 100644
--- a/java/sca/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldServer.java
+++ b/java/sca/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldServer.java
@@ -1,46 +1,46 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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 org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * This server program shows how to create an SCA runtime, and start it which
- * activates the helloworld Web service endpoint.
- */
-public class HelloWorldServer {
-
- public static void main(String[] args) {
-
- SCADomain scaDomain = SCADomain.newInstance("helloworldws.composite");
-
- try {
- System.out.println("HelloWorld server started (press enter to shutdown)");
- System.in.read();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- scaDomain.close();
- System.out.println("HelloWorld server stopped");
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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 org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * This server program shows how to create an SCA runtime, and start it which
+ * activates the helloworld Web service endpoint.
+ */
+public class HelloWorldServer {
+
+ public static void main(String[] args) {
+
+ SCADomain scaDomain = SCADomain.newInstance("helloworldws.composite");
+
+ try {
+ System.out.println("HelloWorld server started (press enter to shutdown)");
+ System.in.read();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ scaDomain.close();
+ System.out.println("HelloWorld server stopped");
+ }
+
+}
diff --git a/java/sca/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldService.java b/java/sca/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldService.java
index 74d22ed830..268d90e910 100644
--- a/java/sca/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldService.java
+++ b/java/sca/itest/contribution-import-export/import-composite/src/main/java/helloworld/HelloWorldService.java
@@ -1,30 +1,30 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package helloworld;
-
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * This is the business interface of the HelloWorld greetings service.
- */
-@Remotable
-public interface HelloWorldService {
-
- public String getGreetings(String name);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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;
+
+/**
+ * This is the business interface of the HelloWorld greetings service.
+ */
+@Remotable
+public interface HelloWorldService {
+
+ public String getGreetings(String name);
+}
diff --git a/java/sca/itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml b/java/sca/itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml
index 9f3f5be452..130aa91093 100644
--- a/java/sca/itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml
+++ b/java/sca/itest/contribution-import-export/import-composite/src/main/resources/META-INF/sca-contribution.xml
@@ -1,27 +1,27 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://helloworld"
- xmlns:helloworld="http://helloworld"
- xmlns:hello="http://hello">
- <deployable composite="helloworld:helloworldws"/>
- <import namespace="http://hello"/>
- <!-- import namespace="http://hello" location="http://import-export/contrib-composite"/ -->
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://helloworld"
+ xmlns:helloworld="http://helloworld"
+ xmlns:hello="http://hello">
+ <deployable composite="helloworld:helloworldws"/>
+ <import namespace="http://hello"/>
+ <!-- import namespace="http://hello" location="http://import-export/contrib-composite"/ -->
</contribution> \ No newline at end of file
diff --git a/java/sca/itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl b/java/sca/itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl
index 9b31363e1a..0172fb2c7c 100644
--- a/java/sca/itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl
+++ b/java/sca/itest/contribution-import-export/import-composite/src/main/resources/helloworld.wsdl
@@ -1,76 +1,76 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<wsdl:definitions targetNamespace="http://helloworld"
- xmlns:tns="http://helloworld"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- name="helloworld">
-
- <wsdl:types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:tns2="http://helloworld2"
- targetNamespace="http://helloworld"
- elementFormDefault="qualified">
-
- <xsd:import namespace="http://helloworld2" schemaLocation="helloworld.xsd" />
-
- <element name="getGreetings" type="tns2:getGreetingsType"/>
- <element name="getGreetingsResponse" type="tns2:getGreetingsResponseType"/>
-
- </schema>
- </wsdl:types>
-
- <wsdl:message name="getGreetingsRequest">
- <wsdl:part element="tns:getGreetings" name="parameters"/>
- </wsdl:message>
-
- <wsdl:message name="getGreetingsResponse">
- <wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
- </wsdl:message>
-
- <wsdl:portType name="HelloWorld">
- <wsdl:operation name="getGreetings">
- <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
- <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
- </wsdl:operation>
- </wsdl:portType>
-
- <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="getGreetings">
- <wsdlsoap:operation soapAction=""/>
- <wsdl:input name="getGreetingsRequest">
- <wsdlsoap:body use="literal"/>
- </wsdl:input>
- <wsdl:output name="getGreetingsResponse">
- <wsdlsoap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="HelloWorldService">
- <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
- <wsdlsoap:address location="http://localhost:8085/HelloWorldServiceComponent"/>
- </wsdl:port>
- </wsdl:service>
-
-</wsdl:definitions>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<wsdl:definitions targetNamespace="http://helloworld"
+ xmlns:tns="http://helloworld"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ name="helloworld">
+
+ <wsdl:types>
+ <schema xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns2="http://helloworld2"
+ targetNamespace="http://helloworld"
+ elementFormDefault="qualified">
+
+ <xsd:import namespace="http://helloworld2" schemaLocation="helloworld.xsd" />
+
+ <element name="getGreetings" type="tns2:getGreetingsType"/>
+ <element name="getGreetingsResponse" type="tns2:getGreetingsResponseType"/>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetingsRequest">
+ <wsdl:part element="tns:getGreetings" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:message name="getGreetingsResponse">
+ <wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloWorld">
+ <wsdl:operation name="getGreetings">
+ <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
+ <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="getGreetings">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="getGreetingsRequest">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="getGreetingsResponse">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="HelloWorldService">
+ <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
+ <wsdlsoap:address location="http://localhost:8085/HelloWorldServiceComponent"/>
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
diff --git a/java/sca/itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd b/java/sca/itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd
index d3c83b08c6..d49e2ead99 100644
--- a/java/sca/itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd
+++ b/java/sca/itest/contribution-import-export/import-composite/src/main/resources/helloworld.xsd
@@ -1,35 +1,35 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<schema targetNamespace="http://helloworld2"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ns="http://helloworld2">
-
- <complexType name="getGreetingsType">
- <sequence>
- <element name="name" type="string"/>
- </sequence>
- </complexType>
-
- <complexType name="getGreetingsResponseType">
- <sequence>
- <element name="getGreetingsReturn" type="string"/>
- </sequence>
- </complexType>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<schema targetNamespace="http://helloworld2"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ns="http://helloworld2">
+
+ <complexType name="getGreetingsType">
+ <sequence>
+ <element name="name" type="string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="getGreetingsResponseType">
+ <sequence>
+ <element name="getGreetingsReturn" type="string"/>
+ </sequence>
+ </complexType>
</schema> \ No newline at end of file
diff --git a/java/sca/itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite b/java/sca/itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite
index e2f852ff7e..44ceba1240 100644
--- a/java/sca/itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite
+++ b/java/sca/itest/contribution-import-export/import-composite/src/main/resources/helloworldws.composite
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://helloworld"
- xmlns:helloworld="http://helloworld"
- xmlns:hello="http://hello"
- name="helloworldws">
-
- <component name="SourceHelloServiceComponent">
- <implementation.composite name="hello:hello"/>
- </component>
-
- <component name="HelloWorldServiceComponent">
- <service name="HelloWorldService">
- <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
- <binding.ws uri="http://localhost:8085/HelloWorldService"/>
- </service>
- <implementation.java class="helloworld.HelloWorldImpl" />
- <reference name="helloServiceRef" target="SourceHelloServiceComponent/HelloService"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://helloworld"
+ xmlns:helloworld="http://helloworld"
+ xmlns:hello="http://hello"
+ name="helloworldws">
+
+ <component name="SourceHelloServiceComponent">
+ <implementation.composite name="hello:hello"/>
+ </component>
+
+ <component name="HelloWorldServiceComponent">
+ <service name="HelloWorldService">
+ <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
+ <binding.ws uri="http://localhost:8085/HelloWorldService"/>
+ </service>
+ <implementation.java class="helloworld.HelloWorldImpl" />
+ <reference name="helloServiceRef" target="SourceHelloServiceComponent/HelloService"/>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/contribution-import-export/import-composite/src/test/java/org/apache/tuscany/test/contribution/HelloWorldServerTestCase.java b/java/sca/itest/contribution-import-export/import-composite/src/test/java/org/apache/tuscany/test/contribution/HelloWorldServerTestCase.java
index 1176a89143..3cc6784eca 100644
--- a/java/sca/itest/contribution-import-export/import-composite/src/test/java/org/apache/tuscany/test/contribution/HelloWorldServerTestCase.java
+++ b/java/sca/itest/contribution-import-export/import-composite/src/test/java/org/apache/tuscany/test/contribution/HelloWorldServerTestCase.java
@@ -1,126 +1,126 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.test.contribution;
-
-import hello.Hello;
-import helloworld.HelloWorldService;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.Socket;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.service.ContributionService;
-import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
-
-/**
- * Tests that the helloworld server is available
- */
-public class HelloWorldServerTestCase extends TestCase {
- private ClassLoader cl;
- private EmbeddedSCADomain domain;
- private Contribution helloWorldContribution;
- private Contribution compositeContribution;
-
- @Override
- protected void setUp() throws Exception {
- //Create a test embedded SCA domain
- cl = getClass().getClassLoader();
- domain = new EmbeddedSCADomain(cl, "http://localhost");
-
- //Start the domain
- domain.start();
-
- // Contribute the SCA contribution
- ContributionService contributionService = domain.getContributionService();
-
- // File compositeContribLocation = new File("../export-composite/target/classes");
- // URL compositeContribURL = compositeContribLocation.toURL();
- URL compositeContribURL = getContributionURL(Hello.class);
- compositeContribution =
- contributionService.contribute("http://import-export/export-composite", compositeContribURL, false);
- for (Composite deployable : compositeContribution.getDeployables()) {
- domain.getDomainComposite().getIncludes().add(deployable);
- domain.buildComposite(deployable);
- }
-
-// File helloWorldContribLocation = new File("./target/classes/");
-// URL helloWorldContribURL = helloWorldContribLocation.toURL();
- URL helloWorldContribURL = getContributionURL(HelloWorldService.class);
- helloWorldContribution =
- contributionService.contribute("http://import-export/helloworld", helloWorldContribURL, false);
- for (Composite deployable : helloWorldContribution.getDeployables()) {
- domain.getDomainComposite().getIncludes().add(deployable);
- domain.buildComposite(deployable);
- }
-
- // Start Components from my composite
- for (Composite deployable : helloWorldContribution.getDeployables()) {
- domain.getCompositeActivator().activate(deployable);
- domain.getCompositeActivator().start(deployable);
- }
- }
-
- private URL getContributionURL(Class<?> cls) throws MalformedURLException {
- String flag = "/" + cls.getName().replace('.', '/') + ".class";
- URL url = cls.getResource(flag);
- String root = url.toExternalForm();
- root = root.substring(0, root.length() - flag.length() + 1);
- if (root.startsWith("jar:") && root.endsWith("!/")) {
- root = root.substring(4, root.length() - 2);
- }
- url = new URL(root);
- return url;
- }
-
- public void testPing() throws IOException {
- new Socket("127.0.0.1", 8085);
- }
-
- public void testServiceCall() throws IOException {
- HelloWorldService helloWorldService =
- domain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService");
- assertNotNull(helloWorldService);
-
- assertEquals("Hello Smith", helloWorldService.getGreetings("Smith"));
- }
-
- @Override
- public void tearDown() throws Exception {
- ContributionService contributionService = domain.getContributionService();
-
- // Remove the contribution from the in-memory repository
- contributionService.remove("http://import-export/helloworld");
- contributionService.remove("http://import-export/export-composite");
-
- //Stop Components from my composite
- for (Composite deployable : helloWorldContribution.getDeployables()) {
- domain.getCompositeActivator().stop(deployable);
- domain.getCompositeActivator().deactivate(deployable);
- }
-
- domain.stop();
- domain.close();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.test.contribution;
+
+import hello.Hello;
+import helloworld.HelloWorldService;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.Socket;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.service.ContributionService;
+import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
+
+/**
+ * Tests that the helloworld server is available
+ */
+public class HelloWorldServerTestCase extends TestCase {
+ private ClassLoader cl;
+ private EmbeddedSCADomain domain;
+ private Contribution helloWorldContribution;
+ private Contribution compositeContribution;
+
+ @Override
+ protected void setUp() throws Exception {
+ //Create a test embedded SCA domain
+ cl = getClass().getClassLoader();
+ domain = new EmbeddedSCADomain(cl, "http://localhost");
+
+ //Start the domain
+ domain.start();
+
+ // Contribute the SCA contribution
+ ContributionService contributionService = domain.getContributionService();
+
+ // File compositeContribLocation = new File("../export-composite/target/classes");
+ // URL compositeContribURL = compositeContribLocation.toURL();
+ URL compositeContribURL = getContributionURL(Hello.class);
+ compositeContribution =
+ contributionService.contribute("http://import-export/export-composite", compositeContribURL, false);
+ for (Composite deployable : compositeContribution.getDeployables()) {
+ domain.getDomainComposite().getIncludes().add(deployable);
+ domain.buildComposite(deployable);
+ }
+
+// File helloWorldContribLocation = new File("./target/classes/");
+// URL helloWorldContribURL = helloWorldContribLocation.toURL();
+ URL helloWorldContribURL = getContributionURL(HelloWorldService.class);
+ helloWorldContribution =
+ contributionService.contribute("http://import-export/helloworld", helloWorldContribURL, false);
+ for (Composite deployable : helloWorldContribution.getDeployables()) {
+ domain.getDomainComposite().getIncludes().add(deployable);
+ domain.buildComposite(deployable);
+ }
+
+ // Start Components from my composite
+ for (Composite deployable : helloWorldContribution.getDeployables()) {
+ domain.getCompositeActivator().activate(deployable);
+ domain.getCompositeActivator().start(deployable);
+ }
+ }
+
+ private URL getContributionURL(Class<?> cls) throws MalformedURLException {
+ String flag = "/" + cls.getName().replace('.', '/') + ".class";
+ URL url = cls.getResource(flag);
+ String root = url.toExternalForm();
+ root = root.substring(0, root.length() - flag.length() + 1);
+ if (root.startsWith("jar:") && root.endsWith("!/")) {
+ root = root.substring(4, root.length() - 2);
+ }
+ url = new URL(root);
+ return url;
+ }
+
+ public void testPing() throws IOException {
+ new Socket("127.0.0.1", 8085);
+ }
+
+ public void testServiceCall() throws IOException {
+ HelloWorldService helloWorldService =
+ domain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService");
+ assertNotNull(helloWorldService);
+
+ assertEquals("Hello Smith", helloWorldService.getGreetings("Smith"));
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ ContributionService contributionService = domain.getContributionService();
+
+ // Remove the contribution from the in-memory repository
+ contributionService.remove("http://import-export/helloworld");
+ contributionService.remove("http://import-export/export-composite");
+
+ //Stop Components from my composite
+ for (Composite deployable : helloWorldContribution.getDeployables()) {
+ domain.getCompositeActivator().stop(deployable);
+ domain.getCompositeActivator().deactivate(deployable);
+ }
+
+ domain.stop();
+ domain.close();
+ }
+
+}
diff --git a/java/sca/itest/contribution-import-export/import-java/pom.xml b/java/sca/itest/contribution-import-export/import-java/pom.xml
index f05c62f8ca..91eb35d6c1 100644
--- a/java/sca/itest/contribution-import-export/import-java/pom.xml
+++ b/java/sca/itest/contribution-import-export/import-java/pom.xml
@@ -1,73 +1,73 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>1.6-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-contribution-import-java</artifactId>
- <name>Apache Tuscany SCA iTest Contribution Java Import</name>
-
-<dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-contribution-export-java</artifactId>
- <version>1.6-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.6-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-tomcat</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-import-java</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution Java Import</name>
+
+<dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-contribution-export-java</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/java/sca/itest/contribution-import-export/import-java/src/main/java/helloworld/HelloWorldImpl.java b/java/sca/itest/contribution-import-export/import-java/src/main/java/helloworld/HelloWorldImpl.java
index 4cdcc1fd0b..0de3c70303 100644
--- a/java/sca/itest/contribution-import-export/import-java/src/main/java/helloworld/HelloWorldImpl.java
+++ b/java/sca/itest/contribution-import-export/import-java/src/main/java/helloworld/HelloWorldImpl.java
@@ -1,33 +1,33 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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/java/sca/itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite b/java/sca/itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite
index 9b650e4acc..a53117e72f 100644
--- a/java/sca/itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite
+++ b/java/sca/itest/contribution-import-export/import-java/src/main/resources/helloworldws.composite
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://helloworld"
- xmlns:helloworld="http://helloworld"
- name="helloworldws">
-
- <component name="HelloWorldServiceComponent">
- <implementation.java class="helloworld.HelloWorldImpl" />
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://helloworld"
+ xmlns:helloworld="http://helloworld"
+ name="helloworldws">
+
+ <component name="HelloWorldServiceComponent">
+ <implementation.java class="helloworld.HelloWorldImpl" />
+ </component>
+
+</composite>
diff --git a/java/sca/itest/contribution-import-export/import-java/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java b/java/sca/itest/contribution-import-export/import-java/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java
index 431988cc04..9bc94525e0 100644
--- a/java/sca/itest/contribution-import-export/import-java/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java
+++ b/java/sca/itest/contribution-import-export/import-java/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java
@@ -1,127 +1,127 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test.contribution;
-
-import helloworld.HelloWorldImpl;
-import helloworld.HelloWorldService;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.service.ContributionService;
-import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
-
-/**
- * Tests that the helloworld server is available
- */
-public class HelloWorldServerTestCase extends TestCase {
- private ClassLoader cl;
- private EmbeddedSCADomain domain;
- private Contribution helloWorldContribution;
- private Contribution javaContribution;
-
- @Override
- protected void setUp() throws Exception {
- //Create a test embedded SCA domain
- cl = getClass().getClassLoader();
- domain = new EmbeddedSCADomain(cl, "http://localhost");
-
- //Start the domain
- domain.start();
-
- // Contribute the SCA contribution
- ContributionService contributionService = domain.getContributionService();
-
- //File javaContribLocation = new File("../export-java/target/classes");
- //URL javaContribURL = javaContribLocation.toURL();
- URL javaContribURL = getContributionURL(HelloWorldService.class);
- javaContribution = contributionService.contribute("http://import-export/export-java", javaContribURL, false);
- for (Composite deployable : javaContribution.getDeployables()) {
- domain.getDomainComposite().getIncludes().add(deployable);
- domain.buildComposite(deployable);
- }
-
- //File helloWorldContribLocation = new File("./target/classes/");
- //URL helloWorldContribURL = helloWorldContribLocation.toURL();
- URL helloWorldContribURL = getContributionURL(HelloWorldImpl.class);
- helloWorldContribution = contributionService.contribute("http://import-export/helloworld", helloWorldContribURL, false);
- for (Composite deployable : helloWorldContribution.getDeployables()) {
- domain.getDomainComposite().getIncludes().add(deployable);
- domain.buildComposite(deployable);
- }
-
- // Start Components from my composite
- for (Composite deployable : helloWorldContribution.getDeployables()) {
- domain.getCompositeActivator().activate(deployable);
- domain.getCompositeActivator().start(deployable);
- }
- }
-
- private URL getContributionURL(Class<?> cls) throws MalformedURLException {
- String flag = "/" + cls.getName().replace('.', '/') + ".class";
- URL url = cls.getResource(flag);
- String root = url.toExternalForm();
- root = root.substring(0, root.length() - flag.length() + 1);
- if (root.startsWith("jar:") && root.endsWith("!/")) {
- root = root.substring(4, root.length() - 2);
- }
- url = new URL(root);
- return url;
- }
-
- public void testPing() throws IOException {
- HelloWorldService helloWorldService =
- domain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService");
- assertNotNull(helloWorldService);
- assertEquals("Hello test", helloWorldService.getGreetings("test"));
- }
-
- public void testServiceCall() throws IOException {
- HelloWorldService helloWorldService =
- domain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService");
- assertNotNull(helloWorldService);
-
- assertEquals("Hello Smith", helloWorldService.getGreetings("Smith"));
- }
-
- @Override
- public void tearDown() throws Exception {
- ContributionService contributionService = domain.getContributionService();
-
- // Remove the contribution from the in-memory repository
- contributionService.remove("http://import-export/helloworld");
- contributionService.remove("http://import-export/export-java");
-
- // Stop Components from my composite
- for (Composite deployable : helloWorldContribution.getDeployables()) {
- domain.getCompositeActivator().stop(deployable);
- domain.getCompositeActivator().deactivate(deployable);
- }
-
- domain.stop();
-
- domain.close();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.test.contribution;
+
+import helloworld.HelloWorldImpl;
+import helloworld.HelloWorldService;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.service.ContributionService;
+import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
+
+/**
+ * Tests that the helloworld server is available
+ */
+public class HelloWorldServerTestCase extends TestCase {
+ private ClassLoader cl;
+ private EmbeddedSCADomain domain;
+ private Contribution helloWorldContribution;
+ private Contribution javaContribution;
+
+ @Override
+ protected void setUp() throws Exception {
+ //Create a test embedded SCA domain
+ cl = getClass().getClassLoader();
+ domain = new EmbeddedSCADomain(cl, "http://localhost");
+
+ //Start the domain
+ domain.start();
+
+ // Contribute the SCA contribution
+ ContributionService contributionService = domain.getContributionService();
+
+ //File javaContribLocation = new File("../export-java/target/classes");
+ //URL javaContribURL = javaContribLocation.toURL();
+ URL javaContribURL = getContributionURL(HelloWorldService.class);
+ javaContribution = contributionService.contribute("http://import-export/export-java", javaContribURL, false);
+ for (Composite deployable : javaContribution.getDeployables()) {
+ domain.getDomainComposite().getIncludes().add(deployable);
+ domain.buildComposite(deployable);
+ }
+
+ //File helloWorldContribLocation = new File("./target/classes/");
+ //URL helloWorldContribURL = helloWorldContribLocation.toURL();
+ URL helloWorldContribURL = getContributionURL(HelloWorldImpl.class);
+ helloWorldContribution = contributionService.contribute("http://import-export/helloworld", helloWorldContribURL, false);
+ for (Composite deployable : helloWorldContribution.getDeployables()) {
+ domain.getDomainComposite().getIncludes().add(deployable);
+ domain.buildComposite(deployable);
+ }
+
+ // Start Components from my composite
+ for (Composite deployable : helloWorldContribution.getDeployables()) {
+ domain.getCompositeActivator().activate(deployable);
+ domain.getCompositeActivator().start(deployable);
+ }
+ }
+
+ private URL getContributionURL(Class<?> cls) throws MalformedURLException {
+ String flag = "/" + cls.getName().replace('.', '/') + ".class";
+ URL url = cls.getResource(flag);
+ String root = url.toExternalForm();
+ root = root.substring(0, root.length() - flag.length() + 1);
+ if (root.startsWith("jar:") && root.endsWith("!/")) {
+ root = root.substring(4, root.length() - 2);
+ }
+ url = new URL(root);
+ return url;
+ }
+
+ public void testPing() throws IOException {
+ HelloWorldService helloWorldService =
+ domain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService");
+ assertNotNull(helloWorldService);
+ assertEquals("Hello test", helloWorldService.getGreetings("test"));
+ }
+
+ public void testServiceCall() throws IOException {
+ HelloWorldService helloWorldService =
+ domain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService");
+ assertNotNull(helloWorldService);
+
+ assertEquals("Hello Smith", helloWorldService.getGreetings("Smith"));
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ ContributionService contributionService = domain.getContributionService();
+
+ // Remove the contribution from the in-memory repository
+ contributionService.remove("http://import-export/helloworld");
+ contributionService.remove("http://import-export/export-java");
+
+ // Stop Components from my composite
+ for (Composite deployable : helloWorldContribution.getDeployables()) {
+ domain.getCompositeActivator().stop(deployable);
+ domain.getCompositeActivator().deactivate(deployable);
+ }
+
+ domain.stop();
+
+ domain.close();
+ }
+
+}
diff --git a/java/sca/itest/contribution-import-export/import-wsdl/pom.xml b/java/sca/itest/contribution-import-export/import-wsdl/pom.xml
index 59bee4125e..3d8b5e85c3 100644
--- a/java/sca/itest/contribution-import-export/import-wsdl/pom.xml
+++ b/java/sca/itest/contribution-import-export/import-wsdl/pom.xml
@@ -1,73 +1,73 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>1.6-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-contribution-import-wsdl</artifactId>
- <name>Apache Tuscany SCA iTest Contribution WSDL Import</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-contribution-export-wsdl</artifactId>
- <version>1.6-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.6-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-tomcat</artifactId>
- <version>1.6-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-import-wsdl</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution WSDL Import</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-contribution-export-wsdl</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-tomcat</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/java/sca/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldImpl.java b/java/sca/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldImpl.java
index 4cdcc1fd0b..0de3c70303 100644
--- a/java/sca/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldImpl.java
+++ b/java/sca/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldImpl.java
@@ -1,33 +1,33 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package 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;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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/java/sca/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldServer.java b/java/sca/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldServer.java
index 3d43290380..e03ed4dc25 100644
--- a/java/sca/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldServer.java
+++ b/java/sca/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldServer.java
@@ -1,46 +1,46 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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 org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- * This server program shows how to create an SCA runtime, and start it which
- * activates the helloworld Web service endpoint.
- */
-public class HelloWorldServer {
-
- public static void main(String[] args) {
-
- SCADomain scaDomain = SCADomain.newInstance("helloworldws.composite");
-
- try {
- System.out.println("HelloWorld server started (press enter to shutdown)");
- System.in.read();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- scaDomain.close();
- System.out.println("HelloWorld server stopped");
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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 org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ * This server program shows how to create an SCA runtime, and start it which
+ * activates the helloworld Web service endpoint.
+ */
+public class HelloWorldServer {
+
+ public static void main(String[] args) {
+
+ SCADomain scaDomain = SCADomain.newInstance("helloworldws.composite");
+
+ try {
+ System.out.println("HelloWorld server started (press enter to shutdown)");
+ System.in.read();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ scaDomain.close();
+ System.out.println("HelloWorld server stopped");
+ }
+
+}
diff --git a/java/sca/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldService.java b/java/sca/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldService.java
index 74d22ed830..268d90e910 100644
--- a/java/sca/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldService.java
+++ b/java/sca/itest/contribution-import-export/import-wsdl/src/main/java/helloworld/HelloWorldService.java
@@ -1,30 +1,30 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package helloworld;
-
-import org.osoa.sca.annotations.Remotable;
-
-/**
- * This is the business interface of the HelloWorld greetings service.
- */
-@Remotable
-public interface HelloWorldService {
-
- public String getGreetings(String name);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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;
+
+/**
+ * This is the business interface of the HelloWorld greetings service.
+ */
+@Remotable
+public interface HelloWorldService {
+
+ public String getGreetings(String name);
+}
diff --git a/java/sca/itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml b/java/sca/itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml
index d46fe0b57c..a47b9a71e9 100644
--- a/java/sca/itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml
+++ b/java/sca/itest/contribution-import-export/import-wsdl/src/main/resources/META-INF/sca-contribution.xml
@@ -1,25 +1,25 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://helloworld"
- xmlns:helloworld="http://helloworld">
- <deployable composite="helloworld:helloworldws"/>
- <import namespace="http://helloworld" location="http://import-export/export-wsdl"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://helloworld"
+ xmlns:helloworld="http://helloworld">
+ <deployable composite="helloworld:helloworldws"/>
+ <import namespace="http://helloworld" location="http://import-export/export-wsdl"/>
</contribution> \ No newline at end of file
diff --git a/java/sca/itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite b/java/sca/itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite
index 5008a2ea5b..76ccf71fb8 100644
--- a/java/sca/itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite
+++ b/java/sca/itest/contribution-import-export/import-wsdl/src/main/resources/helloworldws.composite
@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://helloworld"
- xmlns:hw="http://helloworld"
- name="helloworldws">
-
- <component name="HelloWorldServiceComponent">
- <service name="HelloWorldService">
- <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
- <binding.ws uri="http://localhost:8085/HelloWorldService"/>
- </service>
- <implementation.java class="helloworld.HelloWorldImpl" />
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://helloworld"
+ xmlns:hw="http://helloworld"
+ name="helloworldws">
+
+ <component name="HelloWorldServiceComponent">
+ <service name="HelloWorldService">
+ <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
+ <binding.ws uri="http://localhost:8085/HelloWorldService"/>
+ </service>
+ <implementation.java class="helloworld.HelloWorldImpl" />
+ </component>
+
+</composite>
diff --git a/java/sca/itest/contribution-import-export/import-wsdl/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java b/java/sca/itest/contribution-import-export/import-wsdl/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java
index 5c40606e50..66227eacaa 100644
--- a/java/sca/itest/contribution-import-export/import-wsdl/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java
+++ b/java/sca/itest/contribution-import-export/import-wsdl/src/test/java/org/apache/tuscany/sca/test/contribution/HelloWorldServerTestCase.java
@@ -1,137 +1,137 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.test.contribution;
-
-import helloworld.HelloWorldService;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.Socket;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.service.ContributionService;
-import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
-
-/**
- * Tests that the helloworld server is available
- */
-public class HelloWorldServerTestCase extends TestCase {
- private ClassLoader cl;
- private EmbeddedSCADomain domain;
- private Contribution wsdlContribution;
- private Contribution consumerContribution;
-
- @Override
- protected void setUp() throws Exception {
- // Create a test embedded SCA domain
- cl = getClass().getClassLoader();
- domain = new EmbeddedSCADomain(cl, "http://localhost");
-
- //Start the domain
- domain.start();
-
- // Contribute the SCA contribution
- ContributionService contributionService = domain.getContributionService();
-
- // File wsdlContribLocation = new File("../export-wsdl/target/classes");
- // URL wsdlContribURL = wsdlContribLocation.toURL();
- URL wsdlContribURL = getContributionURL(getClass().getClassLoader(), "helloworld.wsdl");
- wsdlContribution = contributionService.contribute("http://import-export/export-wsdl", wsdlContribURL, false);
- for (Composite deployable : wsdlContribution.getDeployables()) {
- domain.getDomainComposite().getIncludes().add(deployable);
- domain.buildComposite(deployable);
- }
-
- // File helloWorldContribLocation = new File("./target/classes/");
- // URL helloWorldContribURL = helloWorldContribLocation.toURL();
- URL helloWorldContribURL = getContributionURL(HelloWorldService.class);
- consumerContribution =
- contributionService.contribute("http://import-export/helloworld", helloWorldContribURL, false);
- for (Composite deployable : consumerContribution.getDeployables()) {
- domain.getDomainComposite().getIncludes().add(deployable);
- domain.buildComposite(deployable);
- }
-
- // Start Components from my composite
- for (Composite deployable : consumerContribution.getDeployables()) {
- domain.getCompositeActivator().activate(deployable);
- domain.getCompositeActivator().start(deployable);
- }
- }
-
- public void testPing() throws IOException {
- new Socket("127.0.0.1", 8085);
- }
-
- private URL getContributionURL(Class<?> cls) throws MalformedURLException {
- String flag = "/" + cls.getName().replace('.', '/') + ".class";
- URL url = cls.getResource(flag);
- String root = url.toExternalForm();
- root = root.substring(0, root.length() - flag.length() + 1);
- if (root.startsWith("jar:") && root.endsWith("!/")) {
- root = root.substring(4, root.length() - 2);
- }
- url = new URL(root);
- return url;
- }
-
- private URL getContributionURL(ClassLoader cl, String flag) throws MalformedURLException {
- URL url = cl.getResource(flag);
- String root = url.toExternalForm();
- root = root.substring(0, root.length() - flag.length());
- if (root.startsWith("jar:") && root.endsWith("!/")) {
- root = root.substring(4, root.length() - 2);
- }
- url = new URL(root);
- // System.out.println(url);
- return url;
- }
-
- public void testServiceCall() throws IOException {
- HelloWorldService helloWorldService =
- domain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService");
- assertNotNull(helloWorldService);
-
- assertEquals("Hello Smith", helloWorldService.getGreetings("Smith"));
- }
-
- @Override
- public void tearDown() throws Exception {
- ContributionService contributionService = domain.getContributionService();
-
- // Remove the contribution from the in-memory repository
- contributionService.remove("http://import-export/helloworld");
- contributionService.remove("http://import-export/export-wsdl");
-
- // Stop Components from my composite
- for (Composite deployable : consumerContribution.getDeployables()) {
- domain.getCompositeActivator().stop(deployable);
- domain.getCompositeActivator().deactivate(deployable);
- }
-
- domain.stop();
-
- domain.close();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.test.contribution;
+
+import helloworld.HelloWorldService;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.Socket;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.service.ContributionService;
+import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
+
+/**
+ * Tests that the helloworld server is available
+ */
+public class HelloWorldServerTestCase extends TestCase {
+ private ClassLoader cl;
+ private EmbeddedSCADomain domain;
+ private Contribution wsdlContribution;
+ private Contribution consumerContribution;
+
+ @Override
+ protected void setUp() throws Exception {
+ // Create a test embedded SCA domain
+ cl = getClass().getClassLoader();
+ domain = new EmbeddedSCADomain(cl, "http://localhost");
+
+ //Start the domain
+ domain.start();
+
+ // Contribute the SCA contribution
+ ContributionService contributionService = domain.getContributionService();
+
+ // File wsdlContribLocation = new File("../export-wsdl/target/classes");
+ // URL wsdlContribURL = wsdlContribLocation.toURL();
+ URL wsdlContribURL = getContributionURL(getClass().getClassLoader(), "helloworld.wsdl");
+ wsdlContribution = contributionService.contribute("http://import-export/export-wsdl", wsdlContribURL, false);
+ for (Composite deployable : wsdlContribution.getDeployables()) {
+ domain.getDomainComposite().getIncludes().add(deployable);
+ domain.buildComposite(deployable);
+ }
+
+ // File helloWorldContribLocation = new File("./target/classes/");
+ // URL helloWorldContribURL = helloWorldContribLocation.toURL();
+ URL helloWorldContribURL = getContributionURL(HelloWorldService.class);
+ consumerContribution =
+ contributionService.contribute("http://import-export/helloworld", helloWorldContribURL, false);
+ for (Composite deployable : consumerContribution.getDeployables()) {
+ domain.getDomainComposite().getIncludes().add(deployable);
+ domain.buildComposite(deployable);
+ }
+
+ // Start Components from my composite
+ for (Composite deployable : consumerContribution.getDeployables()) {
+ domain.getCompositeActivator().activate(deployable);
+ domain.getCompositeActivator().start(deployable);
+ }
+ }
+
+ public void testPing() throws IOException {
+ new Socket("127.0.0.1", 8085);
+ }
+
+ private URL getContributionURL(Class<?> cls) throws MalformedURLException {
+ String flag = "/" + cls.getName().replace('.', '/') + ".class";
+ URL url = cls.getResource(flag);
+ String root = url.toExternalForm();
+ root = root.substring(0, root.length() - flag.length() + 1);
+ if (root.startsWith("jar:") && root.endsWith("!/")) {
+ root = root.substring(4, root.length() - 2);
+ }
+ url = new URL(root);
+ return url;
+ }
+
+ private URL getContributionURL(ClassLoader cl, String flag) throws MalformedURLException {
+ URL url = cl.getResource(flag);
+ String root = url.toExternalForm();
+ root = root.substring(0, root.length() - flag.length());
+ if (root.startsWith("jar:") && root.endsWith("!/")) {
+ root = root.substring(4, root.length() - 2);
+ }
+ url = new URL(root);
+ // System.out.println(url);
+ return url;
+ }
+
+ public void testServiceCall() throws IOException {
+ HelloWorldService helloWorldService =
+ domain.getService(HelloWorldService.class, "HelloWorldServiceComponent/HelloWorldService");
+ assertNotNull(helloWorldService);
+
+ assertEquals("Hello Smith", helloWorldService.getGreetings("Smith"));
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ ContributionService contributionService = domain.getContributionService();
+
+ // Remove the contribution from the in-memory repository
+ contributionService.remove("http://import-export/helloworld");
+ contributionService.remove("http://import-export/export-wsdl");
+
+ // Stop Components from my composite
+ for (Composite deployable : consumerContribution.getDeployables()) {
+ domain.getCompositeActivator().stop(deployable);
+ domain.getCompositeActivator().deactivate(deployable);
+ }
+
+ domain.stop();
+
+ domain.close();
+ }
+
+}
diff --git a/java/sca/itest/contribution-import-export/pom.xml b/java/sca/itest/contribution-import-export/pom.xml
index ff6a4bbf12..e64ff002e1 100644
--- a/java/sca/itest/contribution-import-export/pom.xml
+++ b/java/sca/itest/contribution-import-export/pom.xml
@@ -1,56 +1,56 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>1.6-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-contribution-import-export</artifactId>
- <packaging>pom</packaging>
- <name>Apache Tuscany SCA Contribution Import/Export Integration Tests</name>
-
- <modules>
- <module>export-composite</module>
- <module>export-java</module>
- <module>export-resource</module>
- <module>export-wsdl</module>
- <module>import-composite</module>
- <module>import-java</module>
- <module>import-resource</module>
- <module>import-wsdl</module>
- </modules>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-embedded</artifactId>
- <version>1.6-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution-impl</artifactId>
- <version>1.6-SNAPSHOT</version>
- </dependency>
- </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-import-export</artifactId>
+ <packaging>pom</packaging>
+ <name>Apache Tuscany SCA Contribution Import/Export Integration Tests</name>
+
+ <modules>
+ <module>export-composite</module>
+ <module>export-java</module>
+ <module>export-resource</module>
+ <module>export-wsdl</module>
+ <module>import-composite</module>
+ <module>import-java</module>
+ <module>import-resource</module>
+ <module>import-wsdl</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-embedded</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution-impl</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/java/sca/itest/contribution-zip/pom.xml b/java/sca/itest/contribution-zip/pom.xml
index cc8dbea42a..ecffbc155a 100644
--- a/java/sca/itest/contribution-zip/pom.xml
+++ b/java/sca/itest/contribution-zip/pom.xml
@@ -1,45 +1,45 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-contribution-zip</artifactId>
- <name>Apache Tuscany SCA iTest Contribution ZIP</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-contribution-zip</artifactId>
+ <name>Apache Tuscany SCA iTest Contribution ZIP</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/java/sca/itest/contribution-zip/src/test/java/calculator/CalculatorService.java b/java/sca/itest/contribution-zip/src/test/java/calculator/CalculatorService.java
index a318cf50d9..b4c677b371 100644
--- a/java/sca/itest/contribution-zip/src/test/java/calculator/CalculatorService.java
+++ b/java/sca/itest/contribution-zip/src/test/java/calculator/CalculatorService.java
@@ -1,31 +1,31 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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 subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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 subtract(double n1, double n2);
+
+ double multiply(double n1, double n2);
+
+ double divide(double n1, double n2);
+
+}
diff --git a/java/sca/itest/distribution/bin-distro-unzip/build.xml b/java/sca/itest/distribution/bin-distro-unzip/build.xml
index 7542fc23dd..68e15d4a8b 100644
--- a/java/sca/itest/distribution/bin-distro-unzip/build.xml
+++ b/java/sca/itest/distribution/bin-distro-unzip/build.xml
@@ -1,24 +1,24 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project name="itest-unzip" default="unzip">
- <target name="unzip">
- <unzip src="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.zip"
- dest="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-dir"/>
- </target>
-</project>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project name="itest-unzip" default="unzip">
+ <target name="unzip">
+ <unzip src="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}.zip"
+ dest="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-dir"/>
+ </target>
+</project>
diff --git a/java/sca/itest/distribution/binding-ws-calculator/build.xml b/java/sca/itest/distribution/binding-ws-calculator/build.xml
index f222a3ac0c..ed22bce2dc 100644
--- a/java/sca/itest/distribution/binding-ws-calculator/build.xml
+++ b/java/sca/itest/distribution/binding-ws-calculator/build.xml
@@ -1,40 +1,40 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project name="itest-samples" default="run">
-
- <echo>${java.home}</echo>
- <!--
- compile and run each sample as though the user were running
- samples from the binary distribution. Here we use ant targets
- in the first instance but for some tests we may want to run
- jars directly or fire up webapp containers and deploy wars. In other cases
- we may need to run two samples together to provide reference and
- service sides of the sample.
- -->
-
- <property name="distro.root" value="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-dir/tuscany-sca-${tuscany.version}" />
-
- <target name="run">
-
- <ant antfile="build.xml"
- dir="${distro.root}/samples/binding-ws-calculator"/>
-
- </target>
-
-</project>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project name="itest-samples" default="run">
+
+ <echo>${java.home}</echo>
+ <!--
+ compile and run each sample as though the user were running
+ samples from the binary distribution. Here we use ant targets
+ in the first instance but for some tests we may want to run
+ jars directly or fire up webapp containers and deploy wars. In other cases
+ we may need to run two samples together to provide reference and
+ service sides of the sample.
+ -->
+
+ <property name="distro.root" value="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-dir/tuscany-sca-${tuscany.version}" />
+
+ <target name="run">
+
+ <ant antfile="build.xml"
+ dir="${distro.root}/samples/binding-ws-calculator"/>
+
+ </target>
+
+</project>
diff --git a/java/sca/itest/distribution/binding-ws-calculator/pom.xml b/java/sca/itest/distribution/binding-ws-calculator/pom.xml
index f3946564e5..26d18d0b4a 100644
--- a/java/sca/itest/distribution/binding-ws-calculator/pom.xml
+++ b/java/sca/itest/distribution/binding-ws-calculator/pom.xml
@@ -1,82 +1,82 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-distribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-distribution-binding-ws-calculator</artifactId>
- <name>Apache Tuscany SCA iTest Distribution binding-ws-calculator</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-bin-distro-unzip</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.3</version>
-
- <dependencies>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-trax</artifactId>
- <version>1.6.5</version>
- </dependency>
- <!-- this JDk dependency is a workaround for Maven bug - http://jira.codehaus.org/browse/MNG-1323 -->
- <dependency>
- <groupId>sun.jdk</groupId>
- <artifactId>tools</artifactId>
- <version>1.6</version>
- <scope>system</scope>
- <systemPath>${java.home}/../lib/tools.jar</systemPath>
- </dependency>
- </dependencies>
-
- <executions>
- <execution>
- <id>run-samples</id>
- <phase>verify</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <property name="java.home" value="${java.home}"/>
- <property name="tuscany.version" value="${version}" />
- <ant antfile="./build.xml" target="run"/>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-binding-ws-calculator</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution binding-ws-calculator</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.3</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-trax</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ <!-- this JDk dependency is a workaround for Maven bug - http://jira.codehaus.org/browse/MNG-1323 -->
+ <dependency>
+ <groupId>sun.jdk</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.6</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+ </dependencies>
+
+ <executions>
+ <execution>
+ <id>run-samples</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="java.home" value="${java.home}"/>
+ <property name="tuscany.version" value="${version}" />
+ <ant antfile="./build.xml" target="run"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/java/sca/itest/distribution/calculator-rmi/build.xml b/java/sca/itest/distribution/calculator-rmi/build.xml
index ac3bcf05d3..d122c58045 100644
--- a/java/sca/itest/distribution/calculator-rmi/build.xml
+++ b/java/sca/itest/distribution/calculator-rmi/build.xml
@@ -1,51 +1,51 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project name="itest-samples" default="run">
-
- <!--
- compile and run each sample as though the user were running
- samples from the binary distribution. Here we use ant targets
- in the first instance but for some tests we may want to run
- jars directly or fire up webapp containers and deploy wars. In other cases
- we may need to run two samples together to provide reference and
- service sides of the sample.
- -->
-
- <property name="distro.root" value="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-dir/tuscany-sca-${tuscany.version}" />
-
- <target name="run">
-
- <parallel>
-
- <daemons>
- <ant antfile="build.xml"
- dir="${distro.root}/samples/calculator-rmi-service"/>
- </daemons>
-
- <sequential>
- <sleep seconds="4"/>
- <ant antfile="build.xml"
- dir="${distro.root}/samples/calculator-rmi-reference"/>
- </sequential>
-
- </parallel>
-
- </target>
-
-</project>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project name="itest-samples" default="run">
+
+ <!--
+ compile and run each sample as though the user were running
+ samples from the binary distribution. Here we use ant targets
+ in the first instance but for some tests we may want to run
+ jars directly or fire up webapp containers and deploy wars. In other cases
+ we may need to run two samples together to provide reference and
+ service sides of the sample.
+ -->
+
+ <property name="distro.root" value="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-dir/tuscany-sca-${tuscany.version}" />
+
+ <target name="run">
+
+ <parallel>
+
+ <daemons>
+ <ant antfile="build.xml"
+ dir="${distro.root}/samples/calculator-rmi-service"/>
+ </daemons>
+
+ <sequential>
+ <sleep seconds="4"/>
+ <ant antfile="build.xml"
+ dir="${distro.root}/samples/calculator-rmi-reference"/>
+ </sequential>
+
+ </parallel>
+
+ </target>
+
+</project>
diff --git a/java/sca/itest/distribution/calculator-rmi/pom.xml b/java/sca/itest/distribution/calculator-rmi/pom.xml
index 391cc466a9..f002994692 100644
--- a/java/sca/itest/distribution/calculator-rmi/pom.xml
+++ b/java/sca/itest/distribution/calculator-rmi/pom.xml
@@ -1,81 +1,81 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-distribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-distribution-calculator-rmi</artifactId>
- <name>Apache Tuscany SCA iTest Distribution calculator-rmi</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-bin-distro-unzip</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.3</version>
-
- <dependencies>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-trax</artifactId>
- <version>1.6.5</version>
- </dependency>
- <!-- this JDk dependency is a workaround for Maven bug - http://jira.codehaus.org/browse/MNG-1323 -->
- <dependency>
- <groupId>sun.jdk</groupId>
- <artifactId>tools</artifactId>
- <version>1.6</version>
- <scope>system</scope>
- <systemPath>${java.home}/../lib/tools.jar</systemPath>
- </dependency>
- </dependencies>
-
- <executions>
- <execution>
- <id>run-samples</id>
- <phase>verify</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <property name="tuscany.version" value="${version}" />
- <ant antfile="./build.xml" target="run"/>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-calculator-rmi</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution calculator-rmi</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.3</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-trax</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ <!-- this JDk dependency is a workaround for Maven bug - http://jira.codehaus.org/browse/MNG-1323 -->
+ <dependency>
+ <groupId>sun.jdk</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.6</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+ </dependencies>
+
+ <executions>
+ <execution>
+ <id>run-samples</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="tuscany.version" value="${version}" />
+ <ant antfile="./build.xml" target="run"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/java/sca/itest/distribution/implementation-java-calculator/build.xml b/java/sca/itest/distribution/implementation-java-calculator/build.xml
index 3ac1900c3f..106fee758c 100644
--- a/java/sca/itest/distribution/implementation-java-calculator/build.xml
+++ b/java/sca/itest/distribution/implementation-java-calculator/build.xml
@@ -1,40 +1,40 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project name="itest-samples" default="run">
-
- <echo>${java.home}</echo>
- <!--
- compile and run each sample as though the user were running
- samples from the binary distribution. Here we use ant targets
- in the first instance but for some tests we may want to run
- jars directly or fire up webapp containers and deploy wars. In other cases
- we may need to run two samples together to provide reference and
- service sides of the sample.
- -->
-
- <property name="distro.root" value="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-dir/tuscany-sca-${tuscany.version}" />
-
- <target name="run">
-
- <ant antfile="build.xml"
- dir="${distro.root}/samples/implementation-java-calculator"/>
-
- </target>
-
-</project>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project name="itest-samples" default="run">
+
+ <echo>${java.home}</echo>
+ <!--
+ compile and run each sample as though the user were running
+ samples from the binary distribution. Here we use ant targets
+ in the first instance but for some tests we may want to run
+ jars directly or fire up webapp containers and deploy wars. In other cases
+ we may need to run two samples together to provide reference and
+ service sides of the sample.
+ -->
+
+ <property name="distro.root" value="../../../distribution/all/target/apache-tuscany-sca-all-${tuscany.version}-dir/tuscany-sca-${tuscany.version}" />
+
+ <target name="run">
+
+ <ant antfile="build.xml"
+ dir="${distro.root}/samples/implementation-java-calculator"/>
+
+ </target>
+
+</project>
diff --git a/java/sca/itest/distribution/implementation-java-calculator/pom.xml b/java/sca/itest/distribution/implementation-java-calculator/pom.xml
index 2a42fefaf4..584b7ca5e9 100644
--- a/java/sca/itest/distribution/implementation-java-calculator/pom.xml
+++ b/java/sca/itest/distribution/implementation-java-calculator/pom.xml
@@ -1,82 +1,82 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-distribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-distribution-implementation-java-calculator</artifactId>
- <name>Apache Tuscany SCA iTest Distribution implementation-java-calculator</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-bin-distro-unzip</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.3</version>
-
- <dependencies>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-trax</artifactId>
- <version>1.6.5</version>
- </dependency>
- <!-- this JDk dependency is a workaround for Maven bug - http://jira.codehaus.org/browse/MNG-1323 -->
- <dependency>
- <groupId>sun.jdk</groupId>
- <artifactId>tools</artifactId>
- <version>1.6</version>
- <scope>system</scope>
- <systemPath>${java.home}/../lib/tools.jar</systemPath>
- </dependency>
- </dependencies>
-
- <executions>
- <execution>
- <id>run-samples</id>
- <phase>verify</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <tasks>
- <property name="tuscany.version" value="${version}" />
- <property name="java.home" value="${java.home}"/>
- <ant antfile="./build.xml" target="run"/>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-implementation-java-calculator</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution implementation-java-calculator</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.3</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant-trax</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ <!-- this JDk dependency is a workaround for Maven bug - http://jira.codehaus.org/browse/MNG-1323 -->
+ <dependency>
+ <groupId>sun.jdk</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.6</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+ </dependencies>
+
+ <executions>
+ <execution>
+ <id>run-samples</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <property name="tuscany.version" value="${version}" />
+ <property name="java.home" value="${java.home}"/>
+ <ant antfile="./build.xml" target="run"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/java/sca/itest/distribution/legal-checks/pom.xml b/java/sca/itest/distribution/legal-checks/pom.xml
index 757248217e..c5f118458f 100644
--- a/java/sca/itest/distribution/legal-checks/pom.xml
+++ b/java/sca/itest/distribution/legal-checks/pom.xml
@@ -1,42 +1,42 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-distribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-distribution-legal-checks</artifactId>
- <name>Apache Tuscany SCA iTest Distribution Legal Checks</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-bin-distro-unzip</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
- <build>
- </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-legal-checks</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution Legal Checks</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ </build>
+</project>
diff --git a/java/sca/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java b/java/sca/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java
index d788d684b7..2cbbe57125 100644
--- a/java/sca/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java
+++ b/java/sca/itest/distribution/legal-checks/src/test/java/itest/JarsInLICENSETestCase.java
@@ -1,162 +1,162 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package itest;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.junit.Test;
-
-/**
- * Checks that all jar files included in the distribution are mentioned in the LICENSE file
- * and that all jars mentioned in the LICENSE are in the distribution.
- */
-public class JarsInLICENSETestCase {
-
- @Test
- public void testJars() throws Exception {
- File distroRoot = getUnzipedDistroRoot();
-
- File licenseFile = new File(distroRoot, "LICENSE");
- if (!licenseFile.exists()) {
- throw new IllegalStateException("can't find LICENSE file at: " + licenseFile.getAbsoluteFile().toString());
- }
-
- File libDirectory = new File(distroRoot, "modules");
- if (!libDirectory.exists()) {
- throw new IllegalStateException("can't find modules folder at: " + libDirectory.getAbsoluteFile().toString());
- }
-
- List<String> jars = getJarsInDistro(libDirectory);
-
- List<String> bad2 = getLICENSEJarsNotInDistro(licenseFile, jars);
- if (bad2.size() > 0) {
- System.err.println("Jars in LICENSE but not in Distribution: " + bad2);
- }
-
- List<String> bad1 = getJarsNotInLICENSE(jars, licenseFile);
- if (bad1.size() > 0) {
- System.err.println("Jars in distribution but not in LICENSE: " + bad1);
- }
-
- if (bad1.size() > 0 || bad2.size() > 0) {
- throw new IllegalStateException("LICENSE problems, check log");
- }
- }
-
- private List<String> getLICENSEJarsNotInDistro(File licenseFile, List<String> jars) throws IOException {
- List<String> badJars = new ArrayList<String>();
- BufferedReader reader = new BufferedReader(new FileReader(licenseFile));
- String line = null;
- while ((line = reader.readLine()) != null) {
- line = line.trim();
- if (line.contains(".jar")) {
- StringTokenizer st = new StringTokenizer(line);
- while (st.hasMoreTokens()) {
- String s = st.nextToken();
- if (s.contains(".jar")) {
- if (s.startsWith("(")) {
- s = s.substring(1);
- }
- if (s.endsWith(",") || s.endsWith(":")) {
- s = s.substring(0, s.length()-1);
- }
- if (s.endsWith(")")) {
- s = s.substring(0, s.length()-1);
- }
- if (!jars.contains(s) && !s.startsWith("tuscany-")) {
- badJars.add(s);
- }
- }
- }
- }
- }
- return badJars;
- }
-
- private List<String> getJarsNotInLICENSE(List<String> jars, File licenseFile) throws IOException {
- List<String> badJars = new ArrayList<String>();
- String licenseText = readLICENSE(licenseFile);
- for (String jar : jars) {
- if (!licenseText.contains(jar)) {
- if (jar.startsWith("tuscany-")) {
- // ignore tuscany jars as they're not mentioned in the LICENSE file
- } else {
- badJars.add(jar);
- }
- }
- }
- return badJars;
- }
-
- private List<String> getJarsInDistro(File directory) {
- List<String> jars = new ArrayList<String>();
- for (String fn : directory.list()){
- if (fn.endsWith(".jar")) {
- jars.add(fn);
- } else {
- File f = new File(directory, fn);
- if (f.isDirectory()) {
- jars.addAll(getJarsInDistro(f));
- }
- }
- }
- return jars;
- }
-
- private File getUnzipedDistroRoot() {
- File distroTarget = new File("../../../distribution/all/target");
- File root = null;
- for (String f : distroTarget.list()) {
- if (f.endsWith("-dir")) {
- root = new File(distroTarget, f);
- break;
- }
- }
- if (root == null) {
- throw new IllegalStateException("can't find distro root");
- }
- if (root.list().length != 1) {
- throw new IllegalStateException("expecting one directory in distro root");
- }
- root = new File(root, root.list()[0]);
- return root;
- }
-
- private static String readLICENSE(File licenseFile) throws java.io.IOException {
- StringBuffer fileData = new StringBuffer();
- BufferedReader reader = new BufferedReader(new FileReader(licenseFile));
- char[] buf = new char[1024];
- int numRead = 0;
- while ((numRead = reader.read(buf)) != -1) {
- String readData = String.valueOf(buf, 0, numRead);
- fileData.append(readData);
- buf = new char[1024];
- }
- reader.close();
- return fileData.toString();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package itest;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.junit.Test;
+
+/**
+ * Checks that all jar files included in the distribution are mentioned in the LICENSE file
+ * and that all jars mentioned in the LICENSE are in the distribution.
+ */
+public class JarsInLICENSETestCase {
+
+ @Test
+ public void testJars() throws Exception {
+ File distroRoot = getUnzipedDistroRoot();
+
+ File licenseFile = new File(distroRoot, "LICENSE");
+ if (!licenseFile.exists()) {
+ throw new IllegalStateException("can't find LICENSE file at: " + licenseFile.getAbsoluteFile().toString());
+ }
+
+ File libDirectory = new File(distroRoot, "modules");
+ if (!libDirectory.exists()) {
+ throw new IllegalStateException("can't find modules folder at: " + libDirectory.getAbsoluteFile().toString());
+ }
+
+ List<String> jars = getJarsInDistro(libDirectory);
+
+ List<String> bad2 = getLICENSEJarsNotInDistro(licenseFile, jars);
+ if (bad2.size() > 0) {
+ System.err.println("Jars in LICENSE but not in Distribution: " + bad2);
+ }
+
+ List<String> bad1 = getJarsNotInLICENSE(jars, licenseFile);
+ if (bad1.size() > 0) {
+ System.err.println("Jars in distribution but not in LICENSE: " + bad1);
+ }
+
+ if (bad1.size() > 0 || bad2.size() > 0) {
+ throw new IllegalStateException("LICENSE problems, check log");
+ }
+ }
+
+ private List<String> getLICENSEJarsNotInDistro(File licenseFile, List<String> jars) throws IOException {
+ List<String> badJars = new ArrayList<String>();
+ BufferedReader reader = new BufferedReader(new FileReader(licenseFile));
+ String line = null;
+ while ((line = reader.readLine()) != null) {
+ line = line.trim();
+ if (line.contains(".jar")) {
+ StringTokenizer st = new StringTokenizer(line);
+ while (st.hasMoreTokens()) {
+ String s = st.nextToken();
+ if (s.contains(".jar")) {
+ if (s.startsWith("(")) {
+ s = s.substring(1);
+ }
+ if (s.endsWith(",") || s.endsWith(":")) {
+ s = s.substring(0, s.length()-1);
+ }
+ if (s.endsWith(")")) {
+ s = s.substring(0, s.length()-1);
+ }
+ if (!jars.contains(s) && !s.startsWith("tuscany-")) {
+ badJars.add(s);
+ }
+ }
+ }
+ }
+ }
+ return badJars;
+ }
+
+ private List<String> getJarsNotInLICENSE(List<String> jars, File licenseFile) throws IOException {
+ List<String> badJars = new ArrayList<String>();
+ String licenseText = readLICENSE(licenseFile);
+ for (String jar : jars) {
+ if (!licenseText.contains(jar)) {
+ if (jar.startsWith("tuscany-")) {
+ // ignore tuscany jars as they're not mentioned in the LICENSE file
+ } else {
+ badJars.add(jar);
+ }
+ }
+ }
+ return badJars;
+ }
+
+ private List<String> getJarsInDistro(File directory) {
+ List<String> jars = new ArrayList<String>();
+ for (String fn : directory.list()){
+ if (fn.endsWith(".jar")) {
+ jars.add(fn);
+ } else {
+ File f = new File(directory, fn);
+ if (f.isDirectory()) {
+ jars.addAll(getJarsInDistro(f));
+ }
+ }
+ }
+ return jars;
+ }
+
+ private File getUnzipedDistroRoot() {
+ File distroTarget = new File("../../../distribution/all/target");
+ File root = null;
+ for (String f : distroTarget.list()) {
+ if (f.endsWith("-dir")) {
+ root = new File(distroTarget, f);
+ break;
+ }
+ }
+ if (root == null) {
+ throw new IllegalStateException("can't find distro root");
+ }
+ if (root.list().length != 1) {
+ throw new IllegalStateException("expecting one directory in distro root");
+ }
+ root = new File(root, root.list()[0]);
+ return root;
+ }
+
+ private static String readLICENSE(File licenseFile) throws java.io.IOException {
+ StringBuffer fileData = new StringBuffer();
+ BufferedReader reader = new BufferedReader(new FileReader(licenseFile));
+ char[] buf = new char[1024];
+ int numRead = 0;
+ while ((numRead = reader.read(buf)) != -1) {
+ String readData = String.valueOf(buf, 0, numRead);
+ fileData.append(readData);
+ buf = new char[1024];
+ }
+ reader.close();
+ return fileData.toString();
+ }
+
+}
diff --git a/java/sca/itest/distribution/pom.xml b/java/sca/itest/distribution/pom.xml
index 579d39800b..c744478047 100644
--- a/java/sca/itest/distribution/pom.xml
+++ b/java/sca/itest/distribution/pom.xml
@@ -1,48 +1,48 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <packaging>pom</packaging>
- <artifactId>itest-distribution</artifactId>
- <name>Apache Tuscany SCA iTest Distribution</name>
-
- <build>
- <defaultGoal>install</defaultGoal>
- </build>
-
- <modules>
- <module>bin-distro-unzip</module>
- <module>binding-ws-calculator</module>
- <module>calculator-rmi</module>
- <module>implementation-java-calculator</module>
- <module>legal-checks</module>
- <module>webapp-helloworld</module>
- <module>webapp-helloworld-bpel</module>
- <module>webapp-helloworld-jsp</module>
- <module>webapp-helloworld-stripes</module>
- </modules>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <packaging>pom</packaging>
+ <artifactId>itest-distribution</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution</name>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ </build>
+
+ <modules>
+ <module>bin-distro-unzip</module>
+ <module>binding-ws-calculator</module>
+ <module>calculator-rmi</module>
+ <module>implementation-java-calculator</module>
+ <module>legal-checks</module>
+ <module>webapp-helloworld</module>
+ <module>webapp-helloworld-bpel</module>
+ <module>webapp-helloworld-jsp</module>
+ <module>webapp-helloworld-stripes</module>
+ </modules>
+
+</project>
diff --git a/java/sca/itest/distribution/webapp-helloworld-bpel/pom.xml b/java/sca/itest/distribution/webapp-helloworld-bpel/pom.xml
index d3c38e7bd5..e1c8a508f5 100644
--- a/java/sca/itest/distribution/webapp-helloworld-bpel/pom.xml
+++ b/java/sca/itest/distribution/webapp-helloworld-bpel/pom.xml
@@ -1,124 +1,124 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-distribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-distribution-webapp-helloworld-bpel</artifactId>
- <name>Apache Tuscany SCA iTest Distribution Webapp helloworld-bpel</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-bin-distro-unzip</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>helloworld-bpel</artifactId>
- <type>war</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- <version>1.9</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>start-container</id>
- <phase>compile</phase>
- <goals>
- <goal>start</goal>
- </goals>
- </execution>
- <execution>
- <id>stop-container</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <wait>false</wait>
- <container>
- <containerId>jetty6x</containerId>
- <type>embedded</type>
- <systemProperties>
- <org.apache.commons.logging.Log>org.apache.commons.logging.impl.SimpleLog</org.apache.commons.logging.Log>
- </systemProperties>
- </container>
- <!-- container>
- <containerId>tomcat6x</containerId>
- <home>/Tomcat/apache-tomcat-6.0.18</home>
- </container -->
- <configuration>
- <home>${project.build.directory}/cargo-jetty</home>
- <properties>
- <!-- NOTE: remote debugging doesn't work with the embedded Jetty container. To remote debug
- uncomment/comment the container above to be the Tomcat container and set home to point
- to your local Tomcat installation -->
- <cargo.jvmargs><![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y]]></cargo.jvmargs>
- <cargo.servlet.port>8085</cargo.servlet.port>
- <context>helloworld-bpel</context>
- </properties>
- <deployables>
- <deployable>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>helloworld-bpel</artifactId>
- <type>war</type>
- <properties>
- <context>helloworld-bpel</context>
- </properties>
- </deployable>
- </deployables>
- </configuration>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-webapp-helloworld-bpel</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution Webapp helloworld-bpel</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>helloworld-bpel</artifactId>
+ <type>war</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>1.9</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <wait>false</wait>
+ <container>
+ <containerId>jetty6x</containerId>
+ <type>embedded</type>
+ <systemProperties>
+ <org.apache.commons.logging.Log>org.apache.commons.logging.impl.SimpleLog</org.apache.commons.logging.Log>
+ </systemProperties>
+ </container>
+ <!-- container>
+ <containerId>tomcat6x</containerId>
+ <home>/Tomcat/apache-tomcat-6.0.18</home>
+ </container -->
+ <configuration>
+ <home>${project.build.directory}/cargo-jetty</home>
+ <properties>
+ <!-- NOTE: remote debugging doesn't work with the embedded Jetty container. To remote debug
+ uncomment/comment the container above to be the Tomcat container and set home to point
+ to your local Tomcat installation -->
+ <cargo.jvmargs><![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y]]></cargo.jvmargs>
+ <cargo.servlet.port>8085</cargo.servlet.port>
+ <context>helloworld-bpel</context>
+ </properties>
+ <deployables>
+ <deployable>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>helloworld-bpel</artifactId>
+ <type>war</type>
+ <properties>
+ <context>helloworld-bpel</context>
+ </properties>
+ </deployable>
+ </deployables>
+ </configuration>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/java/sca/itest/distribution/webapp-helloworld-bpel/src/test/java/itest/HelloworldTestCase.java b/java/sca/itest/distribution/webapp-helloworld-bpel/src/test/java/itest/HelloworldTestCase.java
index 194cb1e423..f418d6c8a7 100644
--- a/java/sca/itest/distribution/webapp-helloworld-bpel/src/test/java/itest/HelloworldTestCase.java
+++ b/java/sca/itest/distribution/webapp-helloworld-bpel/src/test/java/itest/HelloworldTestCase.java
@@ -1,51 +1,51 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package itest;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Iterator;
-
-import org.junit.Ignore;
-
-import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
-import com.gargoylesoftware.htmlunit.WebClient;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlParagraph;
-
-/**
- */
-public class HelloworldTestCase {
-
- //@Test
- @Ignore("TUSCANY-3134")
- public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException {
- HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-bpel");
- Iterator<?> ss = page.getAllHtmlChildElements();
- ss.next();
- ss.next();
- ss.next();
- HtmlParagraph p = (HtmlParagraph)ss.next();
- assertEquals("Hello world", p.asText());
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package itest;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.Iterator;
+
+import org.junit.Ignore;
+
+import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlParagraph;
+
+/**
+ */
+public class HelloworldTestCase {
+
+ //@Test
+ @Ignore("TUSCANY-3134")
+ public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException {
+ HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-bpel");
+ Iterator<?> ss = page.getAllHtmlChildElements();
+ ss.next();
+ ss.next();
+ ss.next();
+ HtmlParagraph p = (HtmlParagraph)ss.next();
+ assertEquals("Hello world", p.asText());
+ }
+
+}
diff --git a/java/sca/itest/distribution/webapp-helloworld-jsf/pom.xml b/java/sca/itest/distribution/webapp-helloworld-jsf/pom.xml
index 0d7d7f0ff5..3a2ff11a11 100644
--- a/java/sca/itest/distribution/webapp-helloworld-jsf/pom.xml
+++ b/java/sca/itest/distribution/webapp-helloworld-jsf/pom.xml
@@ -1,130 +1,130 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-distribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-distribution-webapp-helloworld-jsf</artifactId>
- <name>Apache Tuscany SCA iTest Distribution Webapp helloworld-jsf</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-bin-distro-unzip</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>helloworld-jsf</artifactId>
- <type>war</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- <version>1.9</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <version>1.0</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>start-container</id>
- <phase>compile</phase>
- <goals>
- <goal>start</goal>
- </goals>
- </execution>
- <execution>
- <id>stop-container</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <wait>false</wait>
- <container>
- <containerId>jetty6x</containerId>
- <type>embedded</type>
- <systemProperties>
- <org.apache.commons.logging.Log>org.apache.commons.logging.impl.SimpleLog</org.apache.commons.logging.Log>
- </systemProperties>
- </container>
- <!-- container>
- <containerId>tomcat6x</containerId>
- <home>/Tomcat/apache-tomcat-6.0.18</home>
- </container -->
- <configuration>
- <home>${project.build.directory}/cargo-jetty</home>
- <properties>
- <!-- NOTE: remote debugging doesn't work with the embedded Jetty container. To remote debug
- uncomment/comment the container above to be the Tomcat container and set home to point
- to your local Tomcat installation -->
- <cargo.jvmargs><![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y]]></cargo.jvmargs>
- <cargo.servlet.port>8085</cargo.servlet.port>
- <context>helloworld-jsf</context>
- </properties>
- <deployables>
- <deployable>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>helloworld-jsf</artifactId>
- <type>war</type>
- <properties>
- <context>helloworld-jsf</context>
- </properties>
- </deployable>
- </deployables>
- </configuration>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-webapp-helloworld-jsf</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution Webapp helloworld-jsf</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>helloworld-jsf</artifactId>
+ <type>war</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>1.9</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <wait>false</wait>
+ <container>
+ <containerId>jetty6x</containerId>
+ <type>embedded</type>
+ <systemProperties>
+ <org.apache.commons.logging.Log>org.apache.commons.logging.impl.SimpleLog</org.apache.commons.logging.Log>
+ </systemProperties>
+ </container>
+ <!-- container>
+ <containerId>tomcat6x</containerId>
+ <home>/Tomcat/apache-tomcat-6.0.18</home>
+ </container -->
+ <configuration>
+ <home>${project.build.directory}/cargo-jetty</home>
+ <properties>
+ <!-- NOTE: remote debugging doesn't work with the embedded Jetty container. To remote debug
+ uncomment/comment the container above to be the Tomcat container and set home to point
+ to your local Tomcat installation -->
+ <cargo.jvmargs><![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y]]></cargo.jvmargs>
+ <cargo.servlet.port>8085</cargo.servlet.port>
+ <context>helloworld-jsf</context>
+ </properties>
+ <deployables>
+ <deployable>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>helloworld-jsf</artifactId>
+ <type>war</type>
+ <properties>
+ <context>helloworld-jsf</context>
+ </properties>
+ </deployable>
+ </deployables>
+ </configuration>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/java/sca/itest/distribution/webapp-helloworld-jsf/src/test/java/itest/HelloworldTestCaseFIXME.java b/java/sca/itest/distribution/webapp-helloworld-jsf/src/test/java/itest/HelloworldTestCaseFIXME.java
index 2b7db9cb75..1f90a772ac 100644
--- a/java/sca/itest/distribution/webapp-helloworld-jsf/src/test/java/itest/HelloworldTestCaseFIXME.java
+++ b/java/sca/itest/distribution/webapp-helloworld-jsf/src/test/java/itest/HelloworldTestCaseFIXME.java
@@ -1,71 +1,71 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package itest;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Iterator;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
-import com.gargoylesoftware.htmlunit.WebClient;
-import com.gargoylesoftware.htmlunit.html.HtmlForm;
-import com.gargoylesoftware.htmlunit.html.HtmlInput;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlParagraph;
-
-/**
- * TODO: This doesn't work yet, I can't find the hello response in the
- * the response page from the button click. Not sure if thats just
- * looking in the wrong place or the button click is not working
- * Also the Cargo maven plugin has a problem finding the el-api when using Jetty
- */
-public class HelloworldTestCaseFIXME {
-
- @Test
- public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException {
- HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-jsf");
-
- HtmlForm form = page.getFormByName("mainForm");
-
- HtmlInput textField = form.getInputByName("mainForm:name");
- textField.setValueAttribute("root");
-
- Iterator i = form.getChildIterator();
- i.next();
- HtmlInput button = (HtmlInput)i.next();
-
- HtmlPage page2 = (HtmlPage)button.click();
-
- Iterator<?> ss = page2.getAllHtmlChildElements();
- ss.next();
- ss.next();
- ss.next();
- ss.next();
- HtmlForm form2 = (HtmlForm)ss.next();
-
- Object oow = form2.getFirstChild();
- System.out.println(oow);
-// assertTrue(p.asText().startsWith("Hello Petra"));
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package itest;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.Iterator;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlForm;
+import com.gargoylesoftware.htmlunit.html.HtmlInput;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlParagraph;
+
+/**
+ * TODO: This doesn't work yet, I can't find the hello response in the
+ * the response page from the button click. Not sure if thats just
+ * looking in the wrong place or the button click is not working
+ * Also the Cargo maven plugin has a problem finding the el-api when using Jetty
+ */
+public class HelloworldTestCaseFIXME {
+
+ @Test
+ public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException {
+ HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-jsf");
+
+ HtmlForm form = page.getFormByName("mainForm");
+
+ HtmlInput textField = form.getInputByName("mainForm:name");
+ textField.setValueAttribute("root");
+
+ Iterator i = form.getChildIterator();
+ i.next();
+ HtmlInput button = (HtmlInput)i.next();
+
+ HtmlPage page2 = (HtmlPage)button.click();
+
+ Iterator<?> ss = page2.getAllHtmlChildElements();
+ ss.next();
+ ss.next();
+ ss.next();
+ ss.next();
+ HtmlForm form2 = (HtmlForm)ss.next();
+
+ Object oow = form2.getFirstChild();
+ System.out.println(oow);
+// assertTrue(p.asText().startsWith("Hello Petra"));
+ }
+
+}
diff --git a/java/sca/itest/distribution/webapp-helloworld-jsp/pom.xml b/java/sca/itest/distribution/webapp-helloworld-jsp/pom.xml
index bd2232e3d8..7ce9ec0336 100644
--- a/java/sca/itest/distribution/webapp-helloworld-jsp/pom.xml
+++ b/java/sca/itest/distribution/webapp-helloworld-jsp/pom.xml
@@ -1,188 +1,188 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-distribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-distribution-webapp-helloworld-jsp</artifactId>
- <name>Apache Tuscany SCA iTest Distribution Webapp helloworld-jsp</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-bin-distro-unzip</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>sample-helloworld-jsp</artifactId>
- <type>war</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- <version>1.9</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jsp-2.0</artifactId>
- <version>6.1.19</version>
- <type>pom</type>
- <scope>compile</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>start-container</id>
- <phase>compile</phase>
- <goals>
- <goal>start</goal>
- </goals>
- </execution>
- <execution>
- <id>stop-container</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <wait>false</wait>
- <container>
- <!--
- you can call the containerid anything that doesn't start with 'jetty' (Jetty will work fine)
- if it starts with 'jetty' it will use the automatic dependency mechanism which you don't
- want
- -->
- <containerId>latest-jetty6x</containerId>
- <implementation>org.codehaus.cargo.container.jetty.Jetty6xEmbeddedLocalContainer
- </implementation>
- <type>embedded</type>
- <dependencies>
- <!-- add all the other dependencies that the embedded jetty server needs here -->
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-util</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jsp-2.0</artifactId>
- </dependency>
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>jasper-runtime</artifactId>
- </dependency>
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>jasper-compiler</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </dependency>
- <dependency>
- <groupId>tomcat</groupId>
- <artifactId>jasper-compiler-jdt</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jsp-api-2.0</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-el</groupId>
- <artifactId>commons-el</artifactId>
- </dependency>
-
- </dependencies>
- </container>
- <!-- Uncomment the following to enable Tomcat container -->
- <!--
- <container>
- <containerId>tomcat6x</containerId>
- <home>/Tomcat/apache-tomcat-6.0.18</home>
- </container>
- -->
- <configuration>
- <implementation>org.codehaus.cargo.container.jetty.Jetty6xEmbeddedStandaloneLocalConfiguration
- </implementation>
-
- <home>${project.build.directory}/cargo-jetty</home>
- <properties>
- <!--
- NOTE: remote debugging doesn't work with the embedded Jetty container. To remote debug
- uncomment/comment the container above to be the Tomcat container and set home to point
- to your local Tomcat installation
- -->
- <cargo.jvmargs><![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y]]></cargo.jvmargs>
- <cargo.servlet.port>8085</cargo.servlet.port>
- <context>helloworld-jsp</context>
- </properties>
- <deployables>
- <deployable>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>sample-helloworld-jsp</artifactId>
- <type>war</type>
- <properties>
- <context>helloworld-jsp</context>
- </properties>
- </deployable>
- </deployables>
- </configuration>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-webapp-helloworld-jsp</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution Webapp helloworld-jsp</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-helloworld-jsp</artifactId>
+ <type>war</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>1.9</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jsp-2.0</artifactId>
+ <version>6.1.19</version>
+ <type>pom</type>
+ <scope>compile</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <wait>false</wait>
+ <container>
+ <!--
+ you can call the containerid anything that doesn't start with 'jetty' (Jetty will work fine)
+ if it starts with 'jetty' it will use the automatic dependency mechanism which you don't
+ want
+ -->
+ <containerId>latest-jetty6x</containerId>
+ <implementation>org.codehaus.cargo.container.jetty.Jetty6xEmbeddedLocalContainer
+ </implementation>
+ <type>embedded</type>
+ <dependencies>
+ <!-- add all the other dependencies that the embedded jetty server needs here -->
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jsp-2.0</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-runtime</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-compiler</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-compiler-jdt</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jsp-api-2.0</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-el</groupId>
+ <artifactId>commons-el</artifactId>
+ </dependency>
+
+ </dependencies>
+ </container>
+ <!-- Uncomment the following to enable Tomcat container -->
+ <!--
+ <container>
+ <containerId>tomcat6x</containerId>
+ <home>/Tomcat/apache-tomcat-6.0.18</home>
+ </container>
+ -->
+ <configuration>
+ <implementation>org.codehaus.cargo.container.jetty.Jetty6xEmbeddedStandaloneLocalConfiguration
+ </implementation>
+
+ <home>${project.build.directory}/cargo-jetty</home>
+ <properties>
+ <!--
+ NOTE: remote debugging doesn't work with the embedded Jetty container. To remote debug
+ uncomment/comment the container above to be the Tomcat container and set home to point
+ to your local Tomcat installation
+ -->
+ <cargo.jvmargs><![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y]]></cargo.jvmargs>
+ <cargo.servlet.port>8085</cargo.servlet.port>
+ <context>helloworld-jsp</context>
+ </properties>
+ <deployables>
+ <deployable>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-helloworld-jsp</artifactId>
+ <type>war</type>
+ <properties>
+ <context>helloworld-jsp</context>
+ </properties>
+ </deployable>
+ </deployables>
+ </configuration>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/java/sca/itest/distribution/webapp-helloworld-jsp/src/test/java/itest/HelloworldTestCase.java b/java/sca/itest/distribution/webapp-helloworld-jsp/src/test/java/itest/HelloworldTestCase.java
index 7bcd590cf0..2be60be081 100644
--- a/java/sca/itest/distribution/webapp-helloworld-jsp/src/test/java/itest/HelloworldTestCase.java
+++ b/java/sca/itest/distribution/webapp-helloworld-jsp/src/test/java/itest/HelloworldTestCase.java
@@ -1,50 +1,50 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package itest;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Iterator;
-
-import org.junit.Test;
-
-import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
-import com.gargoylesoftware.htmlunit.WebClient;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlParagraph;
-
-/**
- */
-public class HelloworldTestCase {
-
- @Test
- public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException {
- HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-jsp");
- Iterator<?> ss = page.getAllHtmlChildElements();
- ss.next();
- ss.next();
- ss.next();
- HtmlParagraph p = (HtmlParagraph)ss.next();
- assertEquals("Hello world", p.asText());
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package itest;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.Iterator;
+
+import org.junit.Test;
+
+import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlParagraph;
+
+/**
+ */
+public class HelloworldTestCase {
+
+ @Test
+ public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException {
+ HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-jsp");
+ Iterator<?> ss = page.getAllHtmlChildElements();
+ ss.next();
+ ss.next();
+ ss.next();
+ HtmlParagraph p = (HtmlParagraph)ss.next();
+ assertEquals("Hello world", p.asText());
+ }
+
+}
diff --git a/java/sca/itest/distribution/webapp-helloworld-stripes/pom.xml b/java/sca/itest/distribution/webapp-helloworld-stripes/pom.xml
index ac02d163e1..b1b07c3f09 100644
--- a/java/sca/itest/distribution/webapp-helloworld-stripes/pom.xml
+++ b/java/sca/itest/distribution/webapp-helloworld-stripes/pom.xml
@@ -1,124 +1,124 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-distribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-distribution-webapp-helloworld-stripes</artifactId>
- <name>Apache Tuscany SCA iTest Distribution Webapp helloworld-stripes</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-bin-distro-unzip</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>sample-helloworld-stripes</artifactId>
- <type>war</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>htmlunit</groupId>
- <artifactId>htmlunit</artifactId>
- <version>1.9</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>start-container</id>
- <phase>compile</phase>
- <goals>
- <goal>start</goal>
- </goals>
- </execution>
- <execution>
- <id>stop-container</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <wait>false</wait>
- <container>
- <containerId>jetty6x</containerId>
- <type>embedded</type>
- <systemProperties>
- <org.apache.commons.logging.Log>org.apache.commons.logging.impl.SimpleLog</org.apache.commons.logging.Log>
- </systemProperties>
- </container>
- <!-- container>
- <containerId>tomcat6x</containerId>
- <home>/Tomcat/apache-tomcat-6.0.18</home>
- </container -->
- <configuration>
- <home>${project.build.directory}/cargo-jetty</home>
- <properties>
- <!-- NOTE: remote debugging doesn't work with the embedded Jetty container. To remote debug
- uncomment/comment the container above to be the Tomcat container and set home to point
- to your local Tomcat installation -->
- <cargo.jvmargs><![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y]]></cargo.jvmargs>
- <cargo.servlet.port>8085</cargo.servlet.port>
- <context>helloworld-stripes</context>
- </properties>
- <deployables>
- <deployable>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>sample-helloworld-stripes</artifactId>
- <type>war</type>
- <properties>
- <context>helloworld-stripes</context>
- </properties>
- </deployable>
- </deployables>
- </configuration>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-webapp-helloworld-stripes</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution Webapp helloworld-stripes</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-helloworld-stripes</artifactId>
+ <type>war</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>1.9</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <wait>false</wait>
+ <container>
+ <containerId>jetty6x</containerId>
+ <type>embedded</type>
+ <systemProperties>
+ <org.apache.commons.logging.Log>org.apache.commons.logging.impl.SimpleLog</org.apache.commons.logging.Log>
+ </systemProperties>
+ </container>
+ <!-- container>
+ <containerId>tomcat6x</containerId>
+ <home>/Tomcat/apache-tomcat-6.0.18</home>
+ </container -->
+ <configuration>
+ <home>${project.build.directory}/cargo-jetty</home>
+ <properties>
+ <!-- NOTE: remote debugging doesn't work with the embedded Jetty container. To remote debug
+ uncomment/comment the container above to be the Tomcat container and set home to point
+ to your local Tomcat installation -->
+ <cargo.jvmargs><![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y]]></cargo.jvmargs>
+ <cargo.servlet.port>8085</cargo.servlet.port>
+ <context>helloworld-stripes</context>
+ </properties>
+ <deployables>
+ <deployable>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-helloworld-stripes</artifactId>
+ <type>war</type>
+ <properties>
+ <context>helloworld-stripes</context>
+ </properties>
+ </deployable>
+ </deployables>
+ </configuration>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/java/sca/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java b/java/sca/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java
index 4c75e312b5..743ab054c8 100644
--- a/java/sca/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java
+++ b/java/sca/itest/distribution/webapp-helloworld-stripes/src/test/java/itest/HelloworldTestCase.java
@@ -1,53 +1,53 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package itest;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Iterator;
-
-import org.junit.Test;
-
-import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
-import com.gargoylesoftware.htmlunit.WebClient;
-import com.gargoylesoftware.htmlunit.html.HtmlPage;
-import com.gargoylesoftware.htmlunit.html.HtmlParagraph;
-
-/**
- */
-public class HelloworldTestCase {
-
- @Test
- public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException {
- HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-stripes");
- Iterator<?> ss = page.getAllHtmlChildElements();
- Object o1= ss.next();
- Object o2= ss.next();
- Object o3= ss.next();
- Object o4= ss.next();
- Object o5= ss.next();
- Object o6= ss.next();
- HtmlParagraph p = (HtmlParagraph)ss.next();
- assertEquals("sayHello returns: Hello world", p.asText());
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package itest;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.Iterator;
+
+import org.junit.Test;
+
+import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlParagraph;
+
+/**
+ */
+public class HelloworldTestCase {
+
+ @Test
+ public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException {
+ HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-stripes");
+ Iterator<?> ss = page.getAllHtmlChildElements();
+ Object o1= ss.next();
+ Object o2= ss.next();
+ Object o3= ss.next();
+ Object o4= ss.next();
+ Object o5= ss.next();
+ Object o6= ss.next();
+ HtmlParagraph p = (HtmlParagraph)ss.next();
+ assertEquals("sayHello returns: Hello world", p.asText());
+ }
+
+}
diff --git a/java/sca/itest/distribution/webapp-helloworld/pom.xml b/java/sca/itest/distribution/webapp-helloworld/pom.xml
index 076f46febe..c559283878 100644
--- a/java/sca/itest/distribution/webapp-helloworld/pom.xml
+++ b/java/sca/itest/distribution/webapp-helloworld/pom.xml
@@ -1,121 +1,121 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-distribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-distribution-webapp-helloworld</artifactId>
- <name>Apache Tuscany SCA iTest Distribution Webapp helloworld</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-bin-distro-unzip</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>sample-helloworld</artifactId>
- <type>war</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>httpunit</groupId>
- <artifactId>httpunit</artifactId>
- <version>1.6.1</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>start-container</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>start</goal>
- </goals>
- </execution>
- <execution>
- <id>stop-container</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <wait>false</wait>
- <container>
- <containerId>jetty6x</containerId>
- <type>embedded</type>
- <systemProperties>
- <org.apache.commons.logging.Log>org.apache.commons.logging.impl.SimpleLog</org.apache.commons.logging.Log>
- </systemProperties>
- </container>
- <!-- container>
- <containerId>tomcat6x</containerId>
- <home>/Tomcat/apache-tomcat-6.0.18</home>
- </container -->
- <configuration>
- <home>${project.build.directory}/cargo-jetty</home>
- <properties>
- <!-- NOTE: remote debugging doesn't work with the embedded Jetty container. To remote debug
- uncomment/comment the container above to be the Tomcat container and set home to point
- to your local Tomcat installation -->
- <cargo.jvmargs><![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y]]></cargo.jvmargs>
- <cargo.servlet.port>8085</cargo.servlet.port>
- </properties>
- <deployables>
- <deployable>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>sample-helloworld</artifactId>
- <type>war</type>
- <pingURL>http://localhost:8085/helloworld</pingURL>
- </deployable>
- </deployables>
- </configuration>
- </configuration>
- </plugin>
-
- </plugins>
- </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-distribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-distribution-webapp-helloworld</artifactId>
+ <name>Apache Tuscany SCA iTest Distribution Webapp helloworld</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-bin-distro-unzip</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-helloworld</artifactId>
+ <type>war</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>httpunit</groupId>
+ <artifactId>httpunit</artifactId>
+ <version>1.6.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>start-container</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>stop-container</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <wait>false</wait>
+ <container>
+ <containerId>jetty6x</containerId>
+ <type>embedded</type>
+ <systemProperties>
+ <org.apache.commons.logging.Log>org.apache.commons.logging.impl.SimpleLog</org.apache.commons.logging.Log>
+ </systemProperties>
+ </container>
+ <!-- container>
+ <containerId>tomcat6x</containerId>
+ <home>/Tomcat/apache-tomcat-6.0.18</home>
+ </container -->
+ <configuration>
+ <home>${project.build.directory}/cargo-jetty</home>
+ <properties>
+ <!-- NOTE: remote debugging doesn't work with the embedded Jetty container. To remote debug
+ uncomment/comment the container above to be the Tomcat container and set home to point
+ to your local Tomcat installation -->
+ <cargo.jvmargs><![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y]]></cargo.jvmargs>
+ <cargo.servlet.port>8085</cargo.servlet.port>
+ </properties>
+ <deployables>
+ <deployable>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>sample-helloworld</artifactId>
+ <type>war</type>
+ <pingURL>http://localhost:8085/helloworld</pingURL>
+ </deployable>
+ </deployables>
+ </configuration>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/java/sca/itest/implementation-spring/pom.xml b/java/sca/itest/implementation-spring/pom.xml
index 94bf716141..1ce02ed1ee 100644
--- a/java/sca/itest/implementation-spring/pom.xml
+++ b/java/sca/itest/implementation-spring/pom.xml
@@ -1,80 +1,80 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-implementation-spring</artifactId>
- <name>Apache Tuscany SCA iTest Spring Implementation</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-spring</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-spring-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Spring dependencies... -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>2.5.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <version>2.5.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>2.5.5</version>
- </dependency>
- </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-implementation-spring</artifactId>
+ <name>Apache Tuscany SCA iTest Spring Implementation</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-spring-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Spring dependencies... -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>2.5.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>2.5.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>2.5.5</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/java/sca/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteImpl.java b/java/sca/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteImpl.java
index 833cc50f71..bd7770ca7d 100644
--- a/java/sca/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteImpl.java
+++ b/java/sca/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteImpl.java
@@ -1,38 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package bigbank.stockquote;
-
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements the StockQuote service.
- */
-@Service(StockQuoteService.class)
-public class StockQuoteImpl implements StockQuoteService {
-
- public double getQuote(String symbol) {
- double price = 104.0 + Math.random();
- price = ((int)(price * 100)) / 100.0;
-
- System.out.println("Getting stock quote for: " + symbol + ", value: "+ price);
-
- return price;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.stockquote;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * This class implements the StockQuote service.
+ */
+@Service(StockQuoteService.class)
+public class StockQuoteImpl implements StockQuoteService {
+
+ public double getQuote(String symbol) {
+ double price = 104.0 + Math.random();
+ price = ((int)(price * 100)) / 100.0;
+
+ System.out.println("Getting stock quote for: " + symbol + ", value: "+ price);
+
+ return price;
+ }
+
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteService.java b/java/sca/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteService.java
index d6db2bd182..747433a9e7 100644
--- a/java/sca/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteService.java
+++ b/java/sca/itest/implementation-spring/src/main/java/bigbank/stockquote/StockQuoteService.java
@@ -1,30 +1,30 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package bigbank.stockquote;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * This is the business interface of the StockQuote service.
- */
-@Remotable
-public interface StockQuoteService {
-
- public double getQuote(String symbol);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package bigbank.stockquote;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * This is the business interface of the StockQuote service.
+ */
+@Remotable
+public interface StockQuoteService {
+
+ public double getQuote(String symbol);
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/calculator/AddService.java b/java/sca/itest/implementation-spring/src/main/java/calculator/AddService.java
index 5a1e7a638a..188451ebac 100644
--- a/java/sca/itest/implementation-spring/src/main/java/calculator/AddService.java
+++ b/java/sca/itest/implementation-spring/src/main/java/calculator/AddService.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The Add service interface
- */
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * The Add service interface
+ */
+public interface AddService {
+
+ double add(double n1, double n2);
+
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/calculator/AddServiceImpl.java b/java/sca/itest/implementation-spring/src/main/java/calculator/AddServiceImpl.java
index a597691905..eae607a7ca 100644
--- a/java/sca/itest/implementation-spring/src/main/java/calculator/AddServiceImpl.java
+++ b/java/sca/itest/implementation-spring/src/main/java/calculator/AddServiceImpl.java
@@ -1,35 +1,35 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * An implementation of the Add service
- */
-public class AddServiceImpl implements AddService {
-
- public double add(double n1, double n2) {
- Logger logger = Logger.getLogger("calculator");
- logger.log(Level.FINEST, "Adding " + n1 + " and " + n2);
- return n1 + n2;
- }
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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 java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the Add service
+ */
+public class AddServiceImpl implements AddService {
+
+ public double add(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Adding " + n1 + " and " + n2);
+ return n1 + n2;
+ }
+
} \ No newline at end of file
diff --git a/java/sca/itest/implementation-spring/src/main/java/calculator/CalculatorService.java b/java/sca/itest/implementation-spring/src/main/java/calculator/CalculatorService.java
index 78eea39c71..ce1cdaae5a 100644
--- a/java/sca/itest/implementation-spring/src/main/java/calculator/CalculatorService.java
+++ b/java/sca/itest/implementation-spring/src/main/java/calculator/CalculatorService.java
@@ -1,37 +1,37 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The Calculator service interface.
- */
-@Remotable
-public interface CalculatorService {
-
- double add(double n1, double n2);
-
- double subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The Calculator service interface.
+ */
+@Remotable
+public interface CalculatorService {
+
+ double add(double n1, double n2);
+
+ double subtract(double n1, double n2);
+
+ double multiply(double n1, double n2);
+
+ double divide(double n1, double n2);
+
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/calculator/CalculatorServiceImpl.java b/java/sca/itest/implementation-spring/src/main/java/calculator/CalculatorServiceImpl.java
index 4363650e52..b033516c1b 100644
--- a/java/sca/itest/implementation-spring/src/main/java/calculator/CalculatorServiceImpl.java
+++ b/java/sca/itest/implementation-spring/src/main/java/calculator/CalculatorServiceImpl.java
@@ -1,79 +1,79 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * An implementation of the Calculator service.
- */
-public class CalculatorServiceImpl implements CalculatorService {
-
- private AddService addService;
- private SubtractService subtractService;
- private MultiplyService multiplyService;
- private DivideService divideService;
-
- public void setAddService(AddService addService) {
- this.addService = addService;
- }
-
- public AddService getAddService() {
- return addService;
- }
-
- public void setSubtractService(SubtractService subtractService) {
- this.subtractService = subtractService;
- }
-
- public SubtractService getSubtractService() {
- return subtractService;
- }
-
- public void setDivideService(DivideService divideService) {
- this.divideService = divideService;
- }
-
- public DivideService getDivideService() {
- return divideService;
- }
-
- public void setMultiplyService(MultiplyService multiplyService) {
- this.multiplyService = multiplyService;
- }
-
- public MultiplyService getMultiplyService() {
- return multiplyService;
- }
-
- public double add(double n1, double n2) {
- return addService.add(n1, n2);
- }
-
- public double subtract(double n1, double n2) {
- return subtractService.subtract(n1, n2);
- }
-
- public double multiply(double n1, double n2) {
- return multiplyService.multiply(n1, n2);
- }
-
- public double divide(double n1, double n2) {
- return divideService.divide(n1, n2);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * An implementation of the Calculator service.
+ */
+public class CalculatorServiceImpl implements CalculatorService {
+
+ private AddService addService;
+ private SubtractService subtractService;
+ private MultiplyService multiplyService;
+ private DivideService divideService;
+
+ public void setAddService(AddService addService) {
+ this.addService = addService;
+ }
+
+ public AddService getAddService() {
+ return addService;
+ }
+
+ public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ public SubtractService getSubtractService() {
+ return subtractService;
+ }
+
+ public void setDivideService(DivideService divideService) {
+ this.divideService = divideService;
+ }
+
+ public DivideService getDivideService() {
+ return divideService;
+ }
+
+ public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ public MultiplyService getMultiplyService() {
+ return multiplyService;
+ }
+
+ public double add(double n1, double n2) {
+ return addService.add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ return subtractService.subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ return multiplyService.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return divideService.divide(n1, n2);
+ }
+
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/calculator/DivideService.java b/java/sca/itest/implementation-spring/src/main/java/calculator/DivideService.java
index ef6a8b375b..30d248208b 100644
--- a/java/sca/itest/implementation-spring/src/main/java/calculator/DivideService.java
+++ b/java/sca/itest/implementation-spring/src/main/java/calculator/DivideService.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The divide service interface
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * The divide service interface
+ */
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/calculator/DivideServiceImpl.java b/java/sca/itest/implementation-spring/src/main/java/calculator/DivideServiceImpl.java
index cd91935f08..1323edf55a 100644
--- a/java/sca/itest/implementation-spring/src/main/java/calculator/DivideServiceImpl.java
+++ b/java/sca/itest/implementation-spring/src/main/java/calculator/DivideServiceImpl.java
@@ -1,35 +1,35 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * An implementation of the Divide service.
- */
-public class DivideServiceImpl implements DivideService {
-
- public double divide(double n1, double n2) {
- Logger logger = Logger.getLogger("calculator");
- logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2);
- return n1 / n2;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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 java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the Divide service.
+ */
+public class DivideServiceImpl implements DivideService {
+
+ public double divide(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2);
+ return n1 / n2;
+ }
+
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/calculator/MultiplyService.java b/java/sca/itest/implementation-spring/src/main/java/calculator/MultiplyService.java
index db568cc762..5290605938 100644
--- a/java/sca/itest/implementation-spring/src/main/java/calculator/MultiplyService.java
+++ b/java/sca/itest/implementation-spring/src/main/java/calculator/MultiplyService.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/calculator/MultiplyServiceImpl.java b/java/sca/itest/implementation-spring/src/main/java/calculator/MultiplyServiceImpl.java
index c85357fcd8..91b803bc9e 100644
--- a/java/sca/itest/implementation-spring/src/main/java/calculator/MultiplyServiceImpl.java
+++ b/java/sca/itest/implementation-spring/src/main/java/calculator/MultiplyServiceImpl.java
@@ -1,35 +1,35 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * An implementation of the Multiply service.
- */
-public class MultiplyServiceImpl implements MultiplyService {
-
- public double multiply(double n1, double n2) {
- Logger logger = Logger.getLogger("calculator");
- logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2);
- return n1 * n2;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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 java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the Multiply service.
+ */
+public class MultiplyServiceImpl implements MultiplyService {
+
+ public double multiply(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2);
+ return n1 * n2;
+ }
+
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/calculator/SubtractService.java b/java/sca/itest/implementation-spring/src/main/java/calculator/SubtractService.java
index 56ee372fc4..bf0d1882b6 100644
--- a/java/sca/itest/implementation-spring/src/main/java/calculator/SubtractService.java
+++ b/java/sca/itest/implementation-spring/src/main/java/calculator/SubtractService.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/calculator/SubtractServiceImpl.java b/java/sca/itest/implementation-spring/src/main/java/calculator/SubtractServiceImpl.java
index 1b669084d9..58cc4a3547 100644
--- a/java/sca/itest/implementation-spring/src/main/java/calculator/SubtractServiceImpl.java
+++ b/java/sca/itest/implementation-spring/src/main/java/calculator/SubtractServiceImpl.java
@@ -1,35 +1,35 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * An implementation of the subtract service.
- */
-public class SubtractServiceImpl implements SubtractService {
-
- public double subtract(double n1, double n2) {
- Logger logger = Logger.getLogger("calculator");
- logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2);
- return n1 - n2;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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 java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * An implementation of the subtract service.
+ */
+public class SubtractServiceImpl implements SubtractService {
+
+ public double subtract(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2);
+ return n1 - n2;
+ }
+
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/calculator/security/CalculatorCallbackHandler.java b/java/sca/itest/implementation-spring/src/main/java/calculator/security/CalculatorCallbackHandler.java
index b48fb90148..4f063993a3 100644
--- a/java/sca/itest/implementation-spring/src/main/java/calculator/security/CalculatorCallbackHandler.java
+++ b/java/sca/itest/implementation-spring/src/main/java/calculator/security/CalculatorCallbackHandler.java
@@ -1,50 +1,50 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package calculator.security;
-
-import java.io.IOException;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-/**
- * @version $Rev$ $Date$
- */
-public class CalculatorCallbackHandler implements CallbackHandler {
-
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
- if (callbacks[i] instanceof NameCallback) {
- NameCallback nc = (NameCallback)callbacks[i];
- nc.setName("CalculatorUser");
- } else if (callbacks[i] instanceof PasswordCallback) {
- PasswordCallback pc = (PasswordCallback)callbacks[i];
- pc.setPassword("CalculatorUserPasswd".toCharArray());
- } else {
- throw new UnsupportedCallbackException
- (callbacks[i], "Unsupported Callback!");
- }
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.security;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class CalculatorCallbackHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ if (callbacks[i] instanceof NameCallback) {
+ NameCallback nc = (NameCallback)callbacks[i];
+ nc.setName("CalculatorUser");
+ } else if (callbacks[i] instanceof PasswordCallback) {
+ PasswordCallback pc = (PasswordCallback)callbacks[i];
+ pc.setPassword("CalculatorUserPasswd".toCharArray());
+ } else {
+ throw new UnsupportedCallbackException
+ (callbacks[i], "Unsupported Callback!");
+ }
+ }
+ }
+
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/calculator/security/JaasLoginModule.java b/java/sca/itest/implementation-spring/src/main/java/calculator/security/JaasLoginModule.java
index fe4097640b..b3ef6e7312 100644
--- a/java/sca/itest/implementation-spring/src/main/java/calculator/security/JaasLoginModule.java
+++ b/java/sca/itest/implementation-spring/src/main/java/calculator/security/JaasLoginModule.java
@@ -1,178 +1,178 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.security;
-
-import java.security.Principal;
-import java.util.Map;
-
-import javax.security.auth.Subject;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.login.LoginException;
-import javax.security.auth.spi.LoginModule;
-
-/**
- * @version $Rev$ $Date$
- */
-public class JaasLoginModule implements LoginModule {
-
- private CallbackHandler callbackHandler;
- private Subject subject;
- private Principal userPrincipal;
- private String userId;
- private String password;
- private boolean succeeded;
- private boolean commitSucceeded;
-
- public void initialize(Subject subject,
- CallbackHandler callbackHandler,
- Map<String, ?> sharedState,
- Map<String, ?> options) {
- this.callbackHandler = callbackHandler;
- this.subject = subject;
- }
-
- public boolean login() throws LoginException {
- Callback[] callbacks = new Callback[2];
- callbacks[0] = new NameCallback("UserId:");
- callbacks[1] = new PasswordCallback("Password:", false);
-
- try {
- callbackHandler.handle(callbacks);
- userId = ((NameCallback)callbacks[0]).getName();
- password = new String(((PasswordCallback)callbacks[1]).getPassword());
-
- if (userId.equals("CalculatorUser") && password.equals("CalculatorUserPasswd")) {
- System.out.println("Successfully AUTHENTICATED!!");
- succeeded = true;
- return true;
- } else {
- System.out.println("Incorrect userId / password! AUTHENTICATION FAILED!!");
- return false;
- }
- } catch (Exception e) {
- e.printStackTrace();
- return false;
- }
- }
-
- /**
- * <p> This method is called if the LoginContext's
- * overall authentication succeeded
- * (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules
- * succeeded).
- *
- * <p> If this LoginModule's own authentication attempt
- * succeeded (checked by retrieving the private state saved by the
- * <code>login</code> method), then this method associates a
- * <code>UserPrincipal</code>
- * with the <code>Subject</code> located in the
- * <code>LoginModule</code>. If this LoginModule's own
- * authentication attempted failed, then this method removes
- * any state that was originally saved.
- *
- * <p>
- *
- * @exception LoginException if the commit fails.
- *
- * @return true if this LoginModule's own login and commit
- * attempts succeeded, or false otherwise.
- */
- public boolean commit() throws LoginException {
- if (succeeded == false) {
- return false;
- } else {
- // add a Principal (authenticated identity) to the Subject
-
- // assume the user we authenticated is the UserPrincipal
- userPrincipal = new UserPrincipal(userId);
- if (!subject.getPrincipals().contains(userPrincipal))
- subject.getPrincipals().add(userPrincipal);
-
- // in any case, clean out state
- userId = null;
- password = null;
- commitSucceeded = true;
- return true;
- }
- }
-
- /**
- * <p> This method is called if the LoginContext's
- * overall authentication failed.
- * (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules
- * did not succeed).
- *
- * <p> If this LoginModule's own authentication attempt
- * succeeded (checked by retrieving the private state saved by the
- * <code>login</code> and <code>commit</code> methods),
- * then this method cleans up any state that was originally saved.
- *
- * <p>
- *
- * @exception LoginException if the abort fails.
- *
- * @return false if this LoginModule's own login and/or commit attempts
- * failed, and true otherwise.
- */
- public boolean abort() throws LoginException {
- if (succeeded == false) {
- return false;
- } else if (succeeded == true && commitSucceeded == false) {
- // login succeeded but overall authentication failed
- succeeded = false;
- userId = null;
- password = null;
- userPrincipal = null;
- } else {
- // overall authentication succeeded and commit succeeded,
- // but someone else's commit failed
- logout();
- }
- return true;
- }
-
- /**
- * Logout the user.
- *
- * <p> This method removes the <code>SimplePrincipal</code>
- * that was added by the <code>commit</code> method.
- *
- * <p>
- *
- * @exception LoginException if the logout fails.
- *
- * @return true in all cases since this <code>LoginModule</code>
- * should not be ignored.
- */
- public boolean logout() throws LoginException {
- subject.getPrincipals().remove(userPrincipal);
- succeeded = false;
- succeeded = commitSucceeded;
- userId = null;
- if (password != null)
- password = null;
- userPrincipal = null;
- return true;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.security;
+
+import java.security.Principal;
+import java.util.Map;
+
+import javax.security.auth.Subject;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.login.LoginException;
+import javax.security.auth.spi.LoginModule;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class JaasLoginModule implements LoginModule {
+
+ private CallbackHandler callbackHandler;
+ private Subject subject;
+ private Principal userPrincipal;
+ private String userId;
+ private String password;
+ private boolean succeeded;
+ private boolean commitSucceeded;
+
+ public void initialize(Subject subject,
+ CallbackHandler callbackHandler,
+ Map<String, ?> sharedState,
+ Map<String, ?> options) {
+ this.callbackHandler = callbackHandler;
+ this.subject = subject;
+ }
+
+ public boolean login() throws LoginException {
+ Callback[] callbacks = new Callback[2];
+ callbacks[0] = new NameCallback("UserId:");
+ callbacks[1] = new PasswordCallback("Password:", false);
+
+ try {
+ callbackHandler.handle(callbacks);
+ userId = ((NameCallback)callbacks[0]).getName();
+ password = new String(((PasswordCallback)callbacks[1]).getPassword());
+
+ if (userId.equals("CalculatorUser") && password.equals("CalculatorUserPasswd")) {
+ System.out.println("Successfully AUTHENTICATED!!");
+ succeeded = true;
+ return true;
+ } else {
+ System.out.println("Incorrect userId / password! AUTHENTICATION FAILED!!");
+ return false;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ /**
+ * <p> This method is called if the LoginContext's
+ * overall authentication succeeded
+ * (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules
+ * succeeded).
+ *
+ * <p> If this LoginModule's own authentication attempt
+ * succeeded (checked by retrieving the private state saved by the
+ * <code>login</code> method), then this method associates a
+ * <code>UserPrincipal</code>
+ * with the <code>Subject</code> located in the
+ * <code>LoginModule</code>. If this LoginModule's own
+ * authentication attempted failed, then this method removes
+ * any state that was originally saved.
+ *
+ * <p>
+ *
+ * @exception LoginException if the commit fails.
+ *
+ * @return true if this LoginModule's own login and commit
+ * attempts succeeded, or false otherwise.
+ */
+ public boolean commit() throws LoginException {
+ if (succeeded == false) {
+ return false;
+ } else {
+ // add a Principal (authenticated identity) to the Subject
+
+ // assume the user we authenticated is the UserPrincipal
+ userPrincipal = new UserPrincipal(userId);
+ if (!subject.getPrincipals().contains(userPrincipal))
+ subject.getPrincipals().add(userPrincipal);
+
+ // in any case, clean out state
+ userId = null;
+ password = null;
+ commitSucceeded = true;
+ return true;
+ }
+ }
+
+ /**
+ * <p> This method is called if the LoginContext's
+ * overall authentication failed.
+ * (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules
+ * did not succeed).
+ *
+ * <p> If this LoginModule's own authentication attempt
+ * succeeded (checked by retrieving the private state saved by the
+ * <code>login</code> and <code>commit</code> methods),
+ * then this method cleans up any state that was originally saved.
+ *
+ * <p>
+ *
+ * @exception LoginException if the abort fails.
+ *
+ * @return false if this LoginModule's own login and/or commit attempts
+ * failed, and true otherwise.
+ */
+ public boolean abort() throws LoginException {
+ if (succeeded == false) {
+ return false;
+ } else if (succeeded == true && commitSucceeded == false) {
+ // login succeeded but overall authentication failed
+ succeeded = false;
+ userId = null;
+ password = null;
+ userPrincipal = null;
+ } else {
+ // overall authentication succeeded and commit succeeded,
+ // but someone else's commit failed
+ logout();
+ }
+ return true;
+ }
+
+ /**
+ * Logout the user.
+ *
+ * <p> This method removes the <code>SimplePrincipal</code>
+ * that was added by the <code>commit</code> method.
+ *
+ * <p>
+ *
+ * @exception LoginException if the logout fails.
+ *
+ * @return true in all cases since this <code>LoginModule</code>
+ * should not be ignored.
+ */
+ public boolean logout() throws LoginException {
+ subject.getPrincipals().remove(userPrincipal);
+ succeeded = false;
+ succeeded = commitSucceeded;
+ userId = null;
+ if (password != null)
+ password = null;
+ userPrincipal = null;
+ return true;
+ }
+
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/calculator/security/UserPrincipal.java b/java/sca/itest/implementation-spring/src/main/java/calculator/security/UserPrincipal.java
index 09024197db..595626e672 100644
--- a/java/sca/itest/implementation-spring/src/main/java/calculator/security/UserPrincipal.java
+++ b/java/sca/itest/implementation-spring/src/main/java/calculator/security/UserPrincipal.java
@@ -1,66 +1,66 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES 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.security;
-
-import java.security.Principal;
-
-/**
- * @version $Rev: 637276 $ $Date: 2008-03-15 03:05:34 +0530 (Sat, 15 Mar 2008) $
- */
-public class UserPrincipal implements Principal {
-
- private final String name;
-
- public UserPrincipal(String name) {
- if (name == null)
- throw new IllegalArgumentException("name cannot be null");
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public String toString() {
- return name;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final UserPrincipal other = (UserPrincipal)obj;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- return true;
- }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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.security;
+
+import java.security.Principal;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class UserPrincipal implements Principal {
+
+ private final String name;
+
+ public UserPrincipal(String name) {
+ if (name == null)
+ throw new IllegalArgumentException("name cannot be null");
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String toString() {
+ return name;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ final UserPrincipal other = (UserPrincipal)obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/context/access/SCAApplicationContextProvider.java b/java/sca/itest/implementation-spring/src/main/java/context/access/SCAApplicationContextProvider.java
index 77d98d50aa..fed509df98 100644
--- a/java/sca/itest/implementation-spring/src/main/java/context/access/SCAApplicationContextProvider.java
+++ b/java/sca/itest/implementation-spring/src/main/java/context/access/SCAApplicationContextProvider.java
@@ -1,37 +1,37 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package context.access;
-
-import org.springframework.beans.BeansException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-
-public class SCAApplicationContextProvider implements ApplicationContextAware {
-
- private static ApplicationContext ctx;
-
- public void setApplicationContext(ApplicationContext appContext) throws BeansException {
- // Wiring the ApplicationContext into a static method
- ctx = appContext;
- }
-
- public static ApplicationContext getApplicationContext() {
- return ctx;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package context.access;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
+public class SCAApplicationContextProvider implements ApplicationContextAware {
+
+ private static ApplicationContext ctx;
+
+ public void setApplicationContext(ApplicationContext appContext) throws BeansException {
+ // Wiring the ApplicationContext into a static method
+ ctx = appContext;
+ }
+
+ public static ApplicationContext getApplicationContext() {
+ return ctx;
+ }
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/helloworld/HelloWorld.java b/java/sca/itest/implementation-spring/src/main/java/helloworld/HelloWorld.java
index 830052ae19..8bb3006d12 100644
--- a/java/sca/itest/implementation-spring/src/main/java/helloworld/HelloWorld.java
+++ b/java/sca/itest/implementation-spring/src/main/java/helloworld/HelloWorld.java
@@ -1,35 +1,35 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package helloworld;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Interface for the "hello world" service - predictably simple with a single operation
- * "sayHello"
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface HelloWorld {
-
- String sayHello(String s);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Interface for the "hello world" service - predictably simple with a single operation
+ * "sayHello"
+ *
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface HelloWorld {
+
+ String sayHello(String s);
+
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/helloworld/HelloWorldImpl.java b/java/sca/itest/implementation-spring/src/main/java/helloworld/HelloWorldImpl.java
index 73939693a4..f68134702b 100644
--- a/java/sca/itest/implementation-spring/src/main/java/helloworld/HelloWorldImpl.java
+++ b/java/sca/itest/implementation-spring/src/main/java/helloworld/HelloWorldImpl.java
@@ -1,38 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package helloworld;
-
-/**
- * A simple proxy Java class which implements the HelloWorld interface but which uses
- * a reference "delegate" to actually provide the HelloWorld service
- *
- * @version $Rev$ $Date$
- */
-public class HelloWorldImpl implements HelloWorld {
-
- static String hello = "Hello ";
-
- public String sayHello(String s) {
- // Simply call the reference to satisfy the service request...
- System.out.println("HelloWorldImpl - sayHello called");
- return (hello + s);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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;
+
+/**
+ * A simple proxy Java class which implements the HelloWorld interface but which uses
+ * a reference "delegate" to actually provide the HelloWorld service
+ *
+ * @version $Rev$ $Date$
+ */
+public class HelloWorldImpl implements HelloWorld {
+
+ static String hello = "Hello ";
+
+ public String sayHello(String s) {
+ // Simply call the reference to satisfy the service request...
+ System.out.println("HelloWorldImpl - sayHello called");
+ return (hello + s);
+ }
+
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/helloworld/HelloWorldProxy.java b/java/sca/itest/implementation-spring/src/main/java/helloworld/HelloWorldProxy.java
index 0e2374d599..78b3649b5b 100644
--- a/java/sca/itest/implementation-spring/src/main/java/helloworld/HelloWorldProxy.java
+++ b/java/sca/itest/implementation-spring/src/main/java/helloworld/HelloWorldProxy.java
@@ -1,42 +1,42 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.oasisopen.sca.annotation.Reference;
-
-/**
- * A simple proxy Java class which implements the HelloWorld interface but which uses
- * a reference "delegate" to actually provide the HelloWorld service
- *
- * @version $Rev$ $Date$
- */
-public class HelloWorldProxy implements HelloWorld {
-
- // Here is the reference "delegate" - it implements the HelloWorld interface...
- @Reference
- public HelloWorld delegate;
-
- public String sayHello(String s) {
- // Simply call the reference to satisfy the service request...
- System.out.println("HelloWorldProxy - calling sayHello");
- return delegate.sayHello(s);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.oasisopen.sca.annotation.Reference;
+
+/**
+ * A simple proxy Java class which implements the HelloWorld interface but which uses
+ * a reference "delegate" to actually provide the HelloWorld service
+ *
+ * @version $Rev$ $Date$
+ */
+public class HelloWorldProxy implements HelloWorld {
+
+ // Here is the reference "delegate" - it implements the HelloWorld interface...
+ @Reference
+ public HelloWorld delegate;
+
+ public String sayHello(String s) {
+ // Simply call the reference to satisfy the service request...
+ System.out.println("HelloWorldProxy - calling sayHello");
+ return delegate.sayHello(s);
+ }
+
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/mock/TestBean.java b/java/sca/itest/implementation-spring/src/main/java/mock/TestBean.java
index 96df81fc0c..1a0abd7f8f 100644
--- a/java/sca/itest/implementation-spring/src/main/java/mock/TestBean.java
+++ b/java/sca/itest/implementation-spring/src/main/java/mock/TestBean.java
@@ -1,31 +1,31 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package mock;
-
-/**
- * @version $Rev: 430937 $ $Date: 2006-08-12 02:17:56 +0100 (Sat, 12 Aug 2006) $
- */
-public interface TestBean {
- String echo(String msg);
-
- TestBean getBean();
-
- void setBean(TestBean bean);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package mock;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface TestBean {
+ String echo(String msg);
+
+ TestBean getBean();
+
+ void setBean(TestBean bean);
+
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/mock/TestBeanImpl.java b/java/sca/itest/implementation-spring/src/main/java/mock/TestBeanImpl.java
index 538d3547f4..e3d9a36bb8 100644
--- a/java/sca/itest/implementation-spring/src/main/java/mock/TestBeanImpl.java
+++ b/java/sca/itest/implementation-spring/src/main/java/mock/TestBeanImpl.java
@@ -1,42 +1,42 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package mock;
-
-/**
- * @version $Rev: 441406 $ $Date: 2006-09-08 08:20:10 +0100 (Fri, 08 Sep 2006) $
- */
-public class TestBeanImpl implements TestBean {
-
- private TestBean bean;
-
- public TestBeanImpl() {
- }
-
- public String echo(String msg) {
- return msg;
- }
-
- public TestBean getBean() {
- return bean;
- }
-
- public void setBean(TestBean bean) {
- this.bean = bean;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package mock;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class TestBeanImpl implements TestBean {
+
+ private TestBean bean;
+
+ public TestBeanImpl() {
+ }
+
+ public String echo(String msg) {
+ return msg;
+ }
+
+ public TestBean getBean() {
+ return bean;
+ }
+
+ public void setBean(TestBean bean) {
+ this.bean = bean;
+ }
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/mock/TestHelloWorldBean.java b/java/sca/itest/implementation-spring/src/main/java/mock/TestHelloWorldBean.java
index 5c9dede7ec..47342fded8 100644
--- a/java/sca/itest/implementation-spring/src/main/java/mock/TestHelloWorldBean.java
+++ b/java/sca/itest/implementation-spring/src/main/java/mock/TestHelloWorldBean.java
@@ -1,39 +1,39 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package mock;
-
-/**
- * A simple test Spring bean which provides the HelloWorld service
- *
- * @version $Rev$ $Date$
- */
-
-import helloworld.HelloWorld;
-
-public class TestHelloWorldBean implements HelloWorld {
-
- static String hello = "Hello ";
-
- // Classic "Hello xxx" response to any input message
- public String sayHello(String message) {
- System.out.println("TestHelloWorldBean - sayHello called");
- return (hello + message);
- }
-
-} // end class TestHelloWorldBean
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package mock;
+
+/**
+ * A simple test Spring bean which provides the HelloWorld service
+ *
+ * @version $Rev$ $Date$
+ */
+
+import helloworld.HelloWorld;
+
+public class TestHelloWorldBean implements HelloWorld {
+
+ static String hello = "Hello ";
+
+ // Classic "Hello xxx" response to any input message
+ public String sayHello(String message) {
+ System.out.println("TestHelloWorldBean - sayHello called");
+ return (hello + message);
+ }
+
+} // end class TestHelloWorldBean
diff --git a/java/sca/itest/implementation-spring/src/main/java/mock/TestReference.java b/java/sca/itest/implementation-spring/src/main/java/mock/TestReference.java
index 0a8742d242..6f5b280f31 100644
--- a/java/sca/itest/implementation-spring/src/main/java/mock/TestReference.java
+++ b/java/sca/itest/implementation-spring/src/main/java/mock/TestReference.java
@@ -1,27 +1,27 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package mock;
-
-/**
- * @version $Rev: 536115 $ $Date: 2007-05-08 09:04:20 +0100 (Tue, 08 May 2007) $
- */
-public interface TestReference {
- String echo(String msg);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package mock;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface TestReference {
+ String echo(String msg);
+}
diff --git a/java/sca/itest/implementation-spring/src/main/java/mock/TestReferenceBean.java b/java/sca/itest/implementation-spring/src/main/java/mock/TestReferenceBean.java
index 27ccdbdd77..dea7933e1a 100644
--- a/java/sca/itest/implementation-spring/src/main/java/mock/TestReferenceBean.java
+++ b/java/sca/itest/implementation-spring/src/main/java/mock/TestReferenceBean.java
@@ -1,57 +1,57 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package mock;
-
-/**
- * A test Spring bean which provides the HelloWorld service by calling a reference
- * to provide the content of the response
- *
- * @version $Rev$ $Date$
- */
-
-import helloworld.HelloWorld;
-
-public class TestReferenceBean implements HelloWorld {
-
- // The reference
- private HelloWorld bean;
-
- // Classic "Hello xxx" response to any input message
- public String sayHello(String message) {
- System.out.println("TestReferenceBean - sayHello called");
- return (bean.sayHello(message));
- }
-
- /**
- * Setter for the bean reference
- * @param theBean
- */
- public void setBean(HelloWorld theBean) {
- this.bean = theBean;
- }
-
- /**
- * Getter for the reference
- * @return
- */
- public HelloWorld getBean() {
- return this.bean;
- }
-
-} // end class TestReferenceBean
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package mock;
+
+/**
+ * A test Spring bean which provides the HelloWorld service by calling a reference
+ * to provide the content of the response
+ *
+ * @version $Rev$ $Date$
+ */
+
+import helloworld.HelloWorld;
+
+public class TestReferenceBean implements HelloWorld {
+
+ // The reference
+ private HelloWorld bean;
+
+ // Classic "Hello xxx" response to any input message
+ public String sayHello(String message) {
+ System.out.println("TestReferenceBean - sayHello called");
+ return (bean.sayHello(message));
+ }
+
+ /**
+ * Setter for the bean reference
+ * @param theBean
+ */
+ public void setBean(HelloWorld theBean) {
+ this.bean = theBean;
+ }
+
+ /**
+ * Getter for the reference
+ * @return
+ */
+ public HelloWorld getBean() {
+ return this.bean;
+ }
+
+} // end class TestReferenceBean
diff --git a/java/sca/itest/implementation-spring/src/main/java/mock/TestSCAPropertyBean.java b/java/sca/itest/implementation-spring/src/main/java/mock/TestSCAPropertyBean.java
index 881ca8bb7d..b80b05dc08 100644
--- a/java/sca/itest/implementation-spring/src/main/java/mock/TestSCAPropertyBean.java
+++ b/java/sca/itest/implementation-spring/src/main/java/mock/TestSCAPropertyBean.java
@@ -1,55 +1,55 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package mock;
-
-/**
- * A test Spring bean which provides the HelloWorld service.
- * This bean has a single String property called "hello" which must be set through
- * external configuration to give the correct response message, otherwise an (incorrect)
- * default message is generated
- *
- * @version $Rev$ $Date$
- */
-
-import helloworld.HelloWorld;
-
-public class TestSCAPropertyBean implements HelloWorld {
-
- private String hello = "Go away";
-
- /**
- * Provides the operation of the "HelloWorld" interface - a simple string response
- * to a string input message, where the response is a greeting followed by the original
- * input message.
- */
- public String sayHello(String message) {
- System.out.println("TestHelloWorldBean - sayHello called");
- return (hello + " " + message);
- }
-
- /**
- * Public setter for the (unannotated) field "hello" which constitutes an SCA
- * property
- * @param message - the message to use for the response to "sayHello"
- */
- public void setHello(String message) {
- hello = message;
- }
-
-} // end class TestSCAPropertyBean
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package mock;
+
+/**
+ * A test Spring bean which provides the HelloWorld service.
+ * This bean has a single String property called "hello" which must be set through
+ * external configuration to give the correct response message, otherwise an (incorrect)
+ * default message is generated
+ *
+ * @version $Rev$ $Date$
+ */
+
+import helloworld.HelloWorld;
+
+public class TestSCAPropertyBean implements HelloWorld {
+
+ private String hello = "Go away";
+
+ /**
+ * Provides the operation of the "HelloWorld" interface - a simple string response
+ * to a string input message, where the response is a greeting followed by the original
+ * input message.
+ */
+ public String sayHello(String message) {
+ System.out.println("TestHelloWorldBean - sayHello called");
+ return (hello + " " + message);
+ }
+
+ /**
+ * Public setter for the (unannotated) field "hello" which constitutes an SCA
+ * property
+ * @param message - the message to use for the response to "sayHello"
+ */
+ public void setHello(String message) {
+ hello = message;
+ }
+
+} // end class TestSCAPropertyBean
diff --git a/java/sca/itest/implementation-spring/src/main/java/spring/annotations/CalculatorServiceImpl.java b/java/sca/itest/implementation-spring/src/main/java/spring/annotations/CalculatorServiceImpl.java
index 000b135f01..ecb085858d 100644
--- a/java/sca/itest/implementation-spring/src/main/java/spring/annotations/CalculatorServiceImpl.java
+++ b/java/sca/itest/implementation-spring/src/main/java/spring/annotations/CalculatorServiceImpl.java
@@ -1,131 +1,131 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package spring.annotations;
-
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Service;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.ComponentName;
-
-import calculator.AddService;
-import calculator.CalculatorService;
-import calculator.DivideService;
-import calculator.MultiplyService;
-import calculator.SubtractService;
-
-/**
- * An implementation of the Calculator service.
- */
-@Service(CalculatorService.class)
-public class CalculatorServiceImpl implements AddService, SubtractService, MultiplyService, DivideService {
-
- public AddService addService; // setter injection
-
- @Reference
- public SubtractService subtractService; // field injection
-
- @Reference(name="multiplyService", required=false)
- public MultiplyService multiply; // field injection (different reference and field name)
-
- public DivideService divide; // setter injection (different reference and field name)
-
- public String message; // setter injection
-
- @Property(name="message", required=false)
- public String message2; // field injection
-
- public String componentName;
-
- @Init
- public void initMethod () {
- System.out.println("Init method is sucessfully called.....");
- // Property value should be null here.
- System.out.println("Property Value message is...." + message);
- }
-
- @Destroy
- public void destroyMethod () {
- System.out.println("Component Name is...." + componentName);
- System.out.println("Property Value message is...." + message);
- System.out.println("Property Value message2 is...." + message2);
- System.out.println("Destroy method is sucessfully called.....");
- }
-
- @Reference
- public void setAddService(AddService addService) {
- this.addService = addService;
- }
-
- public AddService getAddService() {
- return addService;
- }
-
- /*public void setSubtractService(SubtractService subtractService) {
- this.subtractService = subtractService;
- }
-
- public SubtractService getSubtractService() {
- return subtractService;
- }*/
-
- @Reference(name="divideService", required=false)
- public void setDivideService(DivideService divide) {
- this.divide = divide;
- }
-
- public DivideService getDivideService() {
- return divide;
- }
-
- /*public void setMultiplyService(MultiplyService multiplyService) {
- this.multiplyService = multiplyService;
- }
-
- public MultiplyService getMultiplyService() {
- return multiplyService;
- }*/
-
- @ComponentName
- public void setComponentName(String componentName) {
- this.componentName = componentName;
- }
-
- @Property
- public void setMessage(String message) {
- this.message = message;
- }
-
- public double add(double n1, double n2) {
- return addService.add(n1, n2);
- }
-
- public double subtract(double n1, double n2) {
- return subtractService.subtract(n1, n2);
- }
-
- public double multiply(double n1, double n2) {
- return multiply.multiply(n1, n2);
- }
-
- public double divide(double n1, double n2) {
- return divide.divide(n1, n2);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package spring.annotations;
+
+import org.oasisopen.sca.annotation.Destroy;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Service;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Property;
+import org.oasisopen.sca.annotation.ComponentName;
+
+import calculator.AddService;
+import calculator.CalculatorService;
+import calculator.DivideService;
+import calculator.MultiplyService;
+import calculator.SubtractService;
+
+/**
+ * An implementation of the Calculator service.
+ */
+@Service(CalculatorService.class)
+public class CalculatorServiceImpl implements AddService, SubtractService, MultiplyService, DivideService {
+
+ public AddService addService; // setter injection
+
+ @Reference
+ public SubtractService subtractService; // field injection
+
+ @Reference(name="multiplyService", required=false)
+ public MultiplyService multiply; // field injection (different reference and field name)
+
+ public DivideService divide; // setter injection (different reference and field name)
+
+ public String message; // setter injection
+
+ @Property(name="message", required=false)
+ public String message2; // field injection
+
+ public String componentName;
+
+ @Init
+ public void initMethod () {
+ System.out.println("Init method is sucessfully called.....");
+ // Property value should be null here.
+ System.out.println("Property Value message is...." + message);
+ }
+
+ @Destroy
+ public void destroyMethod () {
+ System.out.println("Component Name is...." + componentName);
+ System.out.println("Property Value message is...." + message);
+ System.out.println("Property Value message2 is...." + message2);
+ System.out.println("Destroy method is sucessfully called.....");
+ }
+
+ @Reference
+ public void setAddService(AddService addService) {
+ this.addService = addService;
+ }
+
+ public AddService getAddService() {
+ return addService;
+ }
+
+ /*public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ public SubtractService getSubtractService() {
+ return subtractService;
+ }*/
+
+ @Reference(name="divideService", required=false)
+ public void setDivideService(DivideService divide) {
+ this.divide = divide;
+ }
+
+ public DivideService getDivideService() {
+ return divide;
+ }
+
+ /*public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ public MultiplyService getMultiplyService() {
+ return multiplyService;
+ }*/
+
+ @ComponentName
+ public void setComponentName(String componentName) {
+ this.componentName = componentName;
+ }
+
+ @Property
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public double add(double n1, double n2) {
+ return addService.add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ return subtractService.subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ return multiply.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return divide.divide(n1, n2);
+ }
+}
diff --git a/java/sca/itest/implementation-spring/src/main/resources/CalculatorService-context.xml b/java/sca/itest/implementation-spring/src/main/resources/CalculatorService-context.xml
index 7c84965629..c50f0ef4d9 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/CalculatorService-context.xml
+++ b/java/sca/itest/implementation-spring/src/main/resources/CalculatorService-context.xml
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="CalculatorServiceBean" class="calculator.CalculatorServiceImpl">
- <property name="addService" ref="addService"/>
- <property name="subtractService" ref="subtractService"/>
- <property name="multiplyService" ref="multiplyService"/>
- <property name="divideService" ref="divideService"/>
- </bean>
-
- <sca:reference name="addService" type="calculator.AddService"/>
- <sca:reference name="subtractService" type="calculator.SubtractService"/>
- <sca:reference name="multiplyService" type="calculator.MultiplyService"/>
- <sca:reference name="divideService" type="calculator.DivideService"/>
-
-</beans>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="CalculatorServiceBean" class="calculator.CalculatorServiceImpl">
+ <property name="addService" ref="addService"/>
+ <property name="subtractService" ref="subtractService"/>
+ <property name="multiplyService" ref="multiplyService"/>
+ <property name="divideService" ref="divideService"/>
+ </bean>
+
+ <sca:reference name="addService" type="calculator.AddService"/>
+ <sca:reference name="subtractService" type="calculator.SubtractService"/>
+ <sca:reference name="multiplyService" type="calculator.MultiplyService"/>
+ <sca:reference name="divideService" type="calculator.DivideService"/>
+
+</beans>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/SpringDelegationHelloWorld-context.xml b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/SpringDelegationHelloWorld-context.xml
index 910771b34d..9912624870 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/SpringDelegationHelloWorld-context.xml
+++ b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/SpringDelegationHelloWorld-context.xml
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Application context for the SpringHelloWorld testcase -->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <sca:service name="HelloWorld" type="helloworld.HelloWorld" target="testBean"/>
-
- <bean id="delegateBean"
- class="org.apache.tuscany.sca.itest.spring.TestHelloWorldBean" lazy-init="true">
- </bean>
-
- <bean id="testBean"
- class="org.apache.tuscany.sca.itest.spring.TestHelloWorldDelegatorBean" lazy-init="true">
- <property name="delegate"><ref bean="delegateBean"/></property>
- </bean>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Application context for the SpringHelloWorld testcase -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <sca:service name="HelloWorld" type="helloworld.HelloWorld" target="testBean"/>
+
+ <bean id="delegateBean"
+ class="org.apache.tuscany.sca.itest.spring.TestHelloWorldBean" lazy-init="true">
+ </bean>
+
+ <bean id="testBean"
+ class="org.apache.tuscany.sca.itest.spring.TestHelloWorldDelegatorBean" lazy-init="true">
+ <property name="delegate"><ref bean="delegateBean"/></property>
+ </bean>
+
</beans> \ No newline at end of file
diff --git a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/SpringHelloWorld-context.xml b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/SpringHelloWorld-context.xml
index c20679241f..62e4e077b6 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/SpringHelloWorld-context.xml
+++ b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/SpringHelloWorld-context.xml
@@ -1,31 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Application context for the SpringHelloWorld testcase -->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="testBean" class="org.apache.tuscany.sca.itest.spring.TestHelloWorldBean" lazy-init="true">
- </bean>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Application context for the SpringHelloWorld testcase -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="testBean" class="org.apache.tuscany.sca.itest.spring.TestHelloWorldBean" lazy-init="true">
+ </bean>
+
</beans> \ No newline at end of file
diff --git a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-access/CalculatorService-context.xml b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-access/CalculatorService-context.xml
index 87458b99a3..81d59432b8 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-access/CalculatorService-context.xml
+++ b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-access/CalculatorService-context.xml
@@ -1,45 +1,45 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <sca:service name="CalculatorService"
- type="calculator.CalculatorService" target="CalculatorServiceBean"/>
-
- <bean id="CalculatorServiceBean" class="calculator.CalculatorServiceImpl">
- <property name="addService" ref="addService"/>
- <property name="subtractService" ref="subtractService"/>
- <property name="multiplyService" ref="multiplyService"/>
- <property name="divideService" ref="divideService"/>
- </bean>
-
- <bean id="contextAccess" class="context.access.SCAApplicationContextProvider">
- </bean>
-
- <sca:reference name="addService" type="calculator.AddService"/>
- <sca:reference name="subtractService" type="calculator.SubtractService"/>
- <sca:reference name="multiplyService" type="calculator.MultiplyService"/>
- <sca:reference name="divideService" type="calculator.DivideService"/>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <sca:service name="CalculatorService"
+ type="calculator.CalculatorService" target="CalculatorServiceBean"/>
+
+ <bean id="CalculatorServiceBean" class="calculator.CalculatorServiceImpl">
+ <property name="addService" ref="addService"/>
+ <property name="subtractService" ref="subtractService"/>
+ <property name="multiplyService" ref="multiplyService"/>
+ <property name="divideService" ref="divideService"/>
+ </bean>
+
+ <bean id="contextAccess" class="context.access.SCAApplicationContextProvider">
+ </bean>
+
+ <sca:reference name="addService" type="calculator.AddService"/>
+ <sca:reference name="subtractService" type="calculator.SubtractService"/>
+ <sca:reference name="multiplyService" type="calculator.MultiplyService"/>
+ <sca:reference name="divideService" type="calculator.DivideService"/>
+
</beans> \ No newline at end of file
diff --git a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/CalculatorService-context.xml b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/CalculatorService-context.xml
index 7c84965629..c50f0ef4d9 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/CalculatorService-context.xml
+++ b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/CalculatorService-context.xml
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="CalculatorServiceBean" class="calculator.CalculatorServiceImpl">
- <property name="addService" ref="addService"/>
- <property name="subtractService" ref="subtractService"/>
- <property name="multiplyService" ref="multiplyService"/>
- <property name="divideService" ref="divideService"/>
- </bean>
-
- <sca:reference name="addService" type="calculator.AddService"/>
- <sca:reference name="subtractService" type="calculator.SubtractService"/>
- <sca:reference name="multiplyService" type="calculator.MultiplyService"/>
- <sca:reference name="divideService" type="calculator.DivideService"/>
-
-</beans>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="CalculatorServiceBean" class="calculator.CalculatorServiceImpl">
+ <property name="addService" ref="addService"/>
+ <property name="subtractService" ref="subtractService"/>
+ <property name="multiplyService" ref="multiplyService"/>
+ <property name="divideService" ref="divideService"/>
+ </bean>
+
+ <sca:reference name="addService" type="calculator.AddService"/>
+ <sca:reference name="subtractService" type="calculator.SubtractService"/>
+ <sca:reference name="multiplyService" type="calculator.MultiplyService"/>
+ <sca:reference name="divideService" type="calculator.DivideService"/>
+
+</beans>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/SpringImport-context.xml b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/SpringImport-context.xml
index 3faed92fd2..a0bb10e8dd 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/SpringImport-context.xml
+++ b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-imports/SpringImport-context.xml
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <import resource="CalculatorService-context.xml"/>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <import resource="CalculatorService-context.xml"/>
+
</beans> \ No newline at end of file
diff --git a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/SpringHelloWorld-context.xml b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/SpringHelloWorld-context.xml
index c20679241f..62e4e077b6 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/SpringHelloWorld-context.xml
+++ b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/SpringHelloWorld-context.xml
@@ -1,31 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Application context for the SpringHelloWorld testcase -->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="testBean" class="org.apache.tuscany.sca.itest.spring.TestHelloWorldBean" lazy-init="true">
- </bean>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Application context for the SpringHelloWorld testcase -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="testBean" class="org.apache.tuscany.sca.itest.spring.TestHelloWorldBean" lazy-init="true">
+ </bean>
+
</beans> \ No newline at end of file
diff --git a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/StockQuoteService-context.xml b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/StockQuoteService-context.xml
index 74473073ea..5b1885d6b3 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/StockQuoteService-context.xml
+++ b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/StockQuoteService-context.xml
@@ -1,36 +1,36 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <sca:service name="StockQuoteService"
- type="bigbank.stockquote.StockQuoteService" target="StockQuoteServiceBean"/>
-
- <bean id="StockQuoteServiceBean" class="bigbank.stockquote.StockQuoteImpl">
- </bean>
-
- <bean id="applicationContextProvider" class="context.access.SCAApplicationContextProvider">
- </bean>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <sca:service name="StockQuoteService"
+ type="bigbank.stockquote.StockQuoteService" target="StockQuoteServiceBean"/>
+
+ <bean id="StockQuoteServiceBean" class="bigbank.stockquote.StockQuoteImpl">
+ </bean>
+
+ <bean id="applicationContextProvider" class="context.access.SCAApplicationContextProvider">
+ </bean>
+
</beans> \ No newline at end of file
diff --git a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/beanRefContext.xml b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/beanRefContext.xml
index 930b92f4be..244e730921 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/beanRefContext.xml
+++ b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/context-multiple/beanRefContext.xml
@@ -1,35 +1,35 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="beanRefFactory" class="org.springframework.context.support.ClassPathXmlApplicationContext">
- <constructor-arg>
- <list>
- <value>META-INF/sca/context-multiple/StockQuoteService-context.xml</value>
- <value>META-INF/sca/context-multiple/SpringHelloWorld-context.xml</value>
- </list>
- </constructor-arg>
- </bean>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="beanRefFactory" class="org.springframework.context.support.ClassPathXmlApplicationContext">
+ <constructor-arg>
+ <list>
+ <value>META-INF/sca/context-multiple/StockQuoteService-context.xml</value>
+ <value>META-INF/sca/context-multiple/SpringHelloWorld-context.xml</value>
+ </list>
+ </constructor-arg>
+ </bean>
</beans> \ No newline at end of file
diff --git a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/implementation-policies/CalculatorService-context.xml b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/implementation-policies/CalculatorService-context.xml
index 7c84965629..c50f0ef4d9 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/implementation-policies/CalculatorService-context.xml
+++ b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/implementation-policies/CalculatorService-context.xml
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="CalculatorServiceBean" class="calculator.CalculatorServiceImpl">
- <property name="addService" ref="addService"/>
- <property name="subtractService" ref="subtractService"/>
- <property name="multiplyService" ref="multiplyService"/>
- <property name="divideService" ref="divideService"/>
- </bean>
-
- <sca:reference name="addService" type="calculator.AddService"/>
- <sca:reference name="subtractService" type="calculator.SubtractService"/>
- <sca:reference name="multiplyService" type="calculator.MultiplyService"/>
- <sca:reference name="divideService" type="calculator.DivideService"/>
-
-</beans>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="CalculatorServiceBean" class="calculator.CalculatorServiceImpl">
+ <property name="addService" ref="addService"/>
+ <property name="subtractService" ref="subtractService"/>
+ <property name="multiplyService" ref="multiplyService"/>
+ <property name="divideService" ref="divideService"/>
+ </bean>
+
+ <sca:reference name="addService" type="calculator.AddService"/>
+ <sca:reference name="subtractService" type="calculator.SubtractService"/>
+ <sca:reference name="multiplyService" type="calculator.MultiplyService"/>
+ <sca:reference name="divideService" type="calculator.DivideService"/>
+
+</beans>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringExplicitReference-context.xml b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringExplicitReference-context.xml
index d18d8312e3..1705164104 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringExplicitReference-context.xml
+++ b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringExplicitReference-context.xml
@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="testBean" class="mock.TestReferenceBean">
- <property name="bean" ref="testReference"/>
- </bean>
-
- <sca:reference name="testReference" type="helloworld.HelloWorld"/>
-
-</beans>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="testBean" class="mock.TestReferenceBean">
+ <property name="bean" ref="testReference"/>
+ </bean>
+
+ <sca:reference name="testReference" type="helloworld.HelloWorld"/>
+
+</beans>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringImplicitReference-context.xml b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringImplicitReference-context.xml
index df4b9b28cf..539dfa6e32 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringImplicitReference-context.xml
+++ b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-references/SpringImplicitReference-context.xml
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="testBean" class="mock.TestReferenceBean">
- <!-- Here is the implicit reference - a property with a ref not satisifed within the
- * Spring application context.
- -->
- <property name="bean" ref="testReference"/>
- </bean>
-
-</beans>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="testBean" class="mock.TestReferenceBean">
+ <!-- Here is the implicit reference - a property with a ref not satisifed within the
+ * Spring application context.
+ -->
+ <property name="bean" ref="testReference"/>
+ </bean>
+
+</beans>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringExplicitService-context.xml b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringExplicitService-context.xml
index 194bc4bcc9..42e0cdbd23 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringExplicitService-context.xml
+++ b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringExplicitService-context.xml
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Application context for the SpringExplicitHelloWorld testcase
-In this case, the service offered by the Spring application is specified
-explicitly using an sca:service element -->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <sca:service name="fooService"
- type="helloworld.HelloWorld"
- target="testBean"/>
-
- <bean id="testBean"
- class="mock.TestHelloWorldBean"
- lazy-init="true">
- </bean>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Application context for the SpringExplicitHelloWorld testcase
+In this case, the service offered by the Spring application is specified
+explicitly using an sca:service element -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <sca:service name="fooService"
+ type="helloworld.HelloWorld"
+ target="testBean"/>
+
+ <bean id="testBean"
+ class="mock.TestHelloWorldBean"
+ lazy-init="true">
+ </bean>
+
</beans> \ No newline at end of file
diff --git a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringImplicitService-context.xml b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringImplicitService-context.xml
index 1c63311367..83558e8abc 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringImplicitService-context.xml
+++ b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/sca-services/SpringImplicitService-context.xml
@@ -1,31 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Application context for the SpringHelloWorld testcase -->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="testBean" class="mock.TestHelloWorldBean" lazy-init="true">
- </bean>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Application context for the SpringHelloWorld testcase -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="testBean" class="mock.TestHelloWorldBean" lazy-init="true">
+ </bean>
+
</beans> \ No newline at end of file
diff --git a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/spring-annotation/CalculatorService-context.xml b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/spring-annotation/CalculatorService-context.xml
index 4110a9a7b7..4a873f2424 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/spring-annotation/CalculatorService-context.xml
+++ b/java/sca/itest/implementation-spring/src/main/resources/META-INF/sca/spring-annotation/CalculatorService-context.xml
@@ -1,41 +1,41 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:sca="http://www.springframework.org/schema/sca"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
-
- <bean id="CalculatorServiceBean" class="spring.annotations.CalculatorServiceImpl">
- <property name="addService" ref="addService"/>
- <!-- <property name="subtractService" ref="subtractService"/>
- <property name="multiplyService" ref="multiplyService"/> -->
- <property name="divideService" ref="divideService"/>
- </bean>
-
- <sca:reference name="addService" type="calculator.AddService"/>
- <sca:reference name="subtractService" type="calculator.SubtractService"/>
- <sca:reference name="multiplyService" type="calculator.MultiplyService"/>
- <sca:reference name="divideService" type="calculator.DivideService"/>
-
- <sca:property id="msg" name="message" type="java.lang.String"/>
-
-</beans>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sca="http://www.springframework.org/schema/sca"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://www.springframework.org/schema/sca http://www.osoa.org/xmlns/sca/1.0/spring-sca.xsd">
+
+ <bean id="CalculatorServiceBean" class="spring.annotations.CalculatorServiceImpl">
+ <property name="addService" ref="addService"/>
+ <!-- <property name="subtractService" ref="subtractService"/>
+ <property name="multiplyService" ref="multiplyService"/> -->
+ <property name="divideService" ref="divideService"/>
+ </bean>
+
+ <sca:reference name="addService" type="calculator.AddService"/>
+ <sca:reference name="subtractService" type="calculator.SubtractService"/>
+ <sca:reference name="multiplyService" type="calculator.MultiplyService"/>
+ <sca:reference name="divideService" type="calculator.DivideService"/>
+
+ <sca:property id="msg" name="message" type="java.lang.String"/>
+
+</beans>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/context/access/ContextAccess.composite b/java/sca/itest/implementation-spring/src/main/resources/context/access/ContextAccess.composite
index 8863553419..209f2cb065 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/context/access/ContextAccess.composite
+++ b/java/sca/itest/implementation-spring/src/main/resources/context/access/ContextAccess.composite
@@ -1,49 +1,49 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://contextaccess"
- xmlns:sample="http://contextaccess"
- name="ContextAccess"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
-
- <component name="CalculatorServiceComponent">
- <implementation.spring location="META-INF/sca/context-access/CalculatorService-context.xml"/>
- <reference name="addService" target="AddServiceComponent" />
- <reference name="subtractService" target="SubtractServiceComponent" />
- <reference name="multiplyService" target="MultiplyServiceComponent" />
- <reference name="divideService" target="DivideServiceComponent" />
- </component>
-
- <component name="AddServiceComponent">
- <implementation.java class="calculator.AddServiceImpl"/>
- </component>
-
- <component name="SubtractServiceComponent">
- <implementation.java class="calculator.SubtractServiceImpl"/>
- </component>
-
- <component name="MultiplyServiceComponent">
- <implementation.java class="calculator.MultiplyServiceImpl"/>
- </component>
-
- <component name="DivideServiceComponent">
- <implementation.java class="calculator.DivideServiceImpl"/>
- </component>
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://contextaccess"
+ xmlns:sample="http://contextaccess"
+ name="ContextAccess"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.spring location="META-INF/sca/context-access/CalculatorService-context.xml"/>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+</composite>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/context/imports/ContextImports.composite b/java/sca/itest/implementation-spring/src/main/resources/context/imports/ContextImports.composite
index 2d6705ce56..9829b79104 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/context/imports/ContextImports.composite
+++ b/java/sca/itest/implementation-spring/src/main/resources/context/imports/ContextImports.composite
@@ -1,49 +1,49 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://contextimports"
- xmlns:sample="http://contextimports"
- name="ContextImports"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
-
- <component name="CalculatorServiceComponent">
- <implementation.spring location="META-INF/sca/context-imports/SpringImport-context.xml"/>
- <reference name="addService" target="AddServiceComponent" />
- <reference name="subtractService" target="SubtractServiceComponent" />
- <reference name="multiplyService" target="MultiplyServiceComponent" />
- <reference name="divideService" target="DivideServiceComponent" />
- </component>
-
- <component name="AddServiceComponent">
- <implementation.java class="calculator.AddServiceImpl"/>
- </component>
-
- <component name="SubtractServiceComponent">
- <implementation.java class="calculator.SubtractServiceImpl"/>
- </component>
-
- <component name="MultiplyServiceComponent">
- <implementation.java class="calculator.MultiplyServiceImpl"/>
- </component>
-
- <component name="DivideServiceComponent">
- <implementation.java class="calculator.DivideServiceImpl"/>
- </component>
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://contextimports"
+ xmlns:sample="http://contextimports"
+ name="ContextImports"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.spring location="META-INF/sca/context-imports/SpringImport-context.xml"/>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+</composite>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/context/multiple/MultipleContext.composite b/java/sca/itest/implementation-spring/src/main/resources/context/multiple/MultipleContext.composite
index 15c0c39f51..1a66ff20f1 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/context/multiple/MultipleContext.composite
+++ b/java/sca/itest/implementation-spring/src/main/resources/context/multiple/MultipleContext.composite
@@ -1,35 +1,35 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://stockquote"
- xmlns:hw="http://stockquote"
- name="MultipleContext">
-
- <service name="StockQuoteService" promote="StockQuoteServiceComponent">
- <interface.java interface="bigbank.stockquote.StockQuoteService"/>
- <binding.ws uri="http://localhost:8081/services/StockQuoteWebService"/>
- </service>
-
- <component name="StockQuoteServiceComponent">
- <implementation.spring location="META-INF/sca/context-multiple/beanRefContext.xml"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://stockquote"
+ xmlns:hw="http://stockquote"
+ name="MultipleContext">
+
+ <service name="StockQuoteService" promote="StockQuoteServiceComponent">
+ <interface.java interface="bigbank.stockquote.StockQuoteService"/>
+ <binding.ws uri="http://localhost:8081/services/StockQuoteWebService"/>
+ </service>
+
+ <component name="StockQuoteServiceComponent">
+ <implementation.spring location="META-INF/sca/context-multiple/beanRefContext.xml"/>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties b/java/sca/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties
index f62125eaa9..0238f0b013 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties
+++ b/java/sca/itest/implementation-spring/src/main/resources/implementation/policies/CalculatorLogMessages.properties
@@ -1,18 +1,18 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-CALLING_OPERATION=Inovoking operation {0} with arguments {1}
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+CALLING_OPERATION=Inovoking operation {0} with arguments {1}
OPERATION_RETURNED=Returning from operation {0} with return value {1} \ No newline at end of file
diff --git a/java/sca/itest/implementation-spring/src/main/resources/implementation/policies/ImplementationPolicies.composite b/java/sca/itest/implementation-spring/src/main/resources/implementation/policies/ImplementationPolicies.composite
index 28b62dfeb9..9d8068368b 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/implementation/policies/ImplementationPolicies.composite
+++ b/java/sca/itest/implementation-spring/src/main/resources/implementation/policies/ImplementationPolicies.composite
@@ -1,58 +1,58 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://sample"
- xmlns:sample="http://sample"
- name="Calculator"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
-
- <component name="CalculatorServiceComponent">
- <implementation.spring location="META-INF/sca/implementation-policies/CalculatorService-context.xml"/>
- <reference name="addService" target="AddServiceComponent" />
- <reference name="subtractService" target="SubtractServiceComponent" />
- <reference name="multiplyService" target="MultiplyServiceComponent" />
- <reference name="divideService" target="DivideServiceComponent" />
- </component>
-
- <component name="AddServiceComponent">
- <implementation.java class="calculator.AddServiceImpl"/>
- </component>
-
- <component name="SubtractServiceComponent">
- <implementation.java class="calculator.SubtractServiceImpl"/>
- </component>
-
- <component name="MultiplyServiceComponent">
- <implementation.java class="calculator.MultiplyServiceImpl" requires="tuscany:jaasAuthentication"/>
- </component>
-
- <component name="DivideServiceComponent">
- <implementation.java class="calculator.DivideServiceImpl"/>
- </component>
-
- <component name="AnotherCalculatorServiceComponent">
- <implementation.spring location="META-INF/sca/implementation-policies/CalculatorService-context.xml" requires="tuscany:logging"/>
- <reference name="addService" target="AddServiceComponent" />
- <reference name="subtractService" target="SubtractServiceComponent" />
- <reference name="multiplyService" target="MultiplyServiceComponent" />
- <reference name="divideService" target="DivideServiceComponent" />
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Calculator"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.spring location="META-INF/sca/implementation-policies/CalculatorService-context.xml"/>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl" requires="tuscany:jaasAuthentication"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+
+ <component name="AnotherCalculatorServiceComponent">
+ <implementation.spring location="META-INF/sca/implementation-policies/CalculatorService-context.xml" requires="tuscany:logging"/>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+</composite>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/implementation/policies/definitions.xml b/java/sca/itest/implementation-spring/src/main/resources/implementation/policies/definitions.xml
index 94e4997734..278c94a18e 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/implementation/policies/definitions.xml
+++ b/java/sca/itest/implementation-spring/src/main/resources/implementation/policies/definitions.xml
@@ -1,40 +1,40 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:calc="http://calculator">
-
- <!-- PolicySets -->
- <policySet name="JaasPolicy" provides="tuscany:jaasAuthentication" appliesTo="sca:implementation.java"
- xmlns="http://www.osoa.org/xmlns/sca/1.0">
- <tuscany:jaasAuthentication>
- <tuscany:configurationName>Calculator</tuscany:configurationName>
- <tuscany:callbackHandler>calculator.security.CalculatorCallbackHandler</tuscany:callbackHandler>
- </tuscany:jaasAuthentication>
- </policySet>
-
- <!-- PolicySets -->
- <policySet name="JDKLoggingPolicy" provides="tuscany:logging" appliesTo="sca:implementation.spring"
- xmlns="http://www.osoa.org/xmlns/sca/1.0">
- <tuscany:jdkLogger name="calculator">
- <logLevel>FINER</logLevel>
- </tuscany:jdkLogger>
- </policySet>
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:calc="http://calculator">
+
+ <!-- PolicySets -->
+ <policySet name="JaasPolicy" provides="tuscany:jaasAuthentication" appliesTo="sca:implementation.java"
+ xmlns="http://www.osoa.org/xmlns/sca/1.0">
+ <tuscany:jaasAuthentication>
+ <tuscany:configurationName>Calculator</tuscany:configurationName>
+ <tuscany:callbackHandler>calculator.security.CalculatorCallbackHandler</tuscany:callbackHandler>
+ </tuscany:jaasAuthentication>
+ </policySet>
+
+ <!-- PolicySets -->
+ <policySet name="JDKLoggingPolicy" provides="tuscany:logging" appliesTo="sca:implementation.spring"
+ xmlns="http://www.osoa.org/xmlns/sca/1.0">
+ <tuscany:jdkLogger name="calculator">
+ <logLevel>FINER</logLevel>
+ </tuscany:jdkLogger>
+ </policySet>
</definitions> \ No newline at end of file
diff --git a/java/sca/itest/implementation-spring/src/main/resources/location/folder/SpringFolderLocation.composite b/java/sca/itest/implementation-spring/src/main/resources/location/folder/SpringFolderLocation.composite
index d33ae8ca4b..9c5cf9be65 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/location/folder/SpringFolderLocation.composite
+++ b/java/sca/itest/implementation-spring/src/main/resources/location/folder/SpringFolderLocation.composite
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Composite for the SpringSCAPropertyTestCase
- * This composite has the HelloWorldComponent implemented with a Spring implementation where
- * the Spring application context uses an explicit SCA property. The value of the property
- * is set in this composite and is used to compute the response to a service invocation from
- * the ClientComponent.
- -->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- name="SpringFolderLocation">
-
- <component name="ClientComponent">
- <implementation.java class="helloworld.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.spring location="META-INF/sca/location-folder"/>
- <property name="TestProperty">Hello</property>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Composite for the SpringSCAPropertyTestCase
+ * This composite has the HelloWorldComponent implemented with a Spring implementation where
+ * the Spring application context uses an explicit SCA property. The value of the property
+ * is set in this composite and is used to compute the response to a service invocation from
+ * the ClientComponent.
+ -->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="SpringFolderLocation">
+
+ <component name="ClientComponent">
+ <implementation.java class="helloworld.HelloWorldProxy"/>
+ <reference name="delegate" target="HelloWorldComponent"/>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.spring location="META-INF/sca/location-folder"/>
+ <property name="TestProperty">Hello</property>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/location/jar/SpringJarLocation.composite b/java/sca/itest/implementation-spring/src/main/resources/location/jar/SpringJarLocation.composite
index e47b6526ff..fb8b4255fb 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/location/jar/SpringJarLocation.composite
+++ b/java/sca/itest/implementation-spring/src/main/resources/location/jar/SpringJarLocation.composite
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Composite for the SpringSCAPropertyTestCase
- * This composite has the HelloWorldComponent implemented with a Spring implementation where
- * the Spring application context uses an explicit SCA property. The value of the property
- * is set in this composite and is used to compute the response to a service invocation from
- * the ClientComponent.
- -->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- name="SpringJarLocation">
-
- <component name="ClientComponent">
- <implementation.java class="helloworld.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.spring location="META-INF/sca/location-jar/spring-context.jar"/>
- <property name="TestProperty">Hello</property>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Composite for the SpringSCAPropertyTestCase
+ * This composite has the HelloWorldComponent implemented with a Spring implementation where
+ * the Spring application context uses an explicit SCA property. The value of the property
+ * is set in this composite and is used to compute the response to a service invocation from
+ * the ClientComponent.
+ -->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="SpringJarLocation">
+
+ <component name="ClientComponent">
+ <implementation.java class="helloworld.HelloWorldProxy"/>
+ <reference name="delegate" target="HelloWorldComponent"/>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.spring location="META-INF/sca/location-jar/spring-context.jar"/>
+ <property name="TestProperty">Hello</property>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite b/java/sca/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite
index 9099abdbeb..c2fc0f2e75 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite
+++ b/java/sca/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorld.composite
@@ -1,32 +1,32 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- name="SpringDelegationHelloWorld">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.spring.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.spring location="META-INF/sca/SpringDelegationHelloWorld-context.xml"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="SpringDelegationHelloWorld">
+
+ <component name="ClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.spring.HelloWorldProxy"/>
+ <reference name="delegate" target="HelloWorldComponent"/>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.spring location="META-INF/sca/SpringDelegationHelloWorld-context.xml"/>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite b/java/sca/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite
index 42c67ffa39..1b18f3def8 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite
+++ b/java/sca/itest/implementation-spring/src/main/resources/org/apache/tuscany/sca/itest/spring/SpringHelloWorld.composite
@@ -1,32 +1,32 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- name="SpringHelloWorld">
-
- <component name="ClientComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.spring.HelloWorldProxy"/>
- <reference name="delegate" target="HelloWorldComponent"/>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.spring location="META-INF/sca/SpringHelloWorld-context.xml"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="SpringHelloWorld">
+
+ <component name="ClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.spring.HelloWorldProxy"/>
+ <reference name="delegate" target="HelloWorldComponent"/>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.spring location="META-INF/sca/SpringHelloWorld-context.xml"/>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/sca/references/SpringExplicitReference.composite b/java/sca/itest/implementation-spring/src/main/resources/sca/references/SpringExplicitReference.composite
index 4aa9b7a56d..7d73b287bb 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/sca/references/SpringExplicitReference.composite
+++ b/java/sca/itest/implementation-spring/src/main/resources/sca/references/SpringExplicitReference.composite
@@ -1,32 +1,32 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- name="SpringExplicitReference">
-
- <component name="ClientComponent">
- <implementation.spring location="META-INF/sca/sca-references/SpringExplicitReference-context.xml"/>
- <reference name="testReference" target="ExplicitReferenceComponent"/>
- </component>
-
- <component name="ExplicitReferenceComponent">
- <implementation.java class="helloworld.HelloWorldImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="SpringExplicitReference">
+
+ <component name="ClientComponent">
+ <implementation.spring location="META-INF/sca/sca-references/SpringExplicitReference-context.xml"/>
+ <reference name="testReference" target="ExplicitReferenceComponent"/>
+ </component>
+
+ <component name="ExplicitReferenceComponent">
+ <implementation.java class="helloworld.HelloWorldImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/sca/references/SpringImplicitReference.composite b/java/sca/itest/implementation-spring/src/main/resources/sca/references/SpringImplicitReference.composite
index ae972f8647..476a82adb9 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/sca/references/SpringImplicitReference.composite
+++ b/java/sca/itest/implementation-spring/src/main/resources/sca/references/SpringImplicitReference.composite
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- Composite for the SpringImplicitReferenceTestCase
- * This composite has a ClientComponent implemented with a Spring implementation where
- * Spring application context uses an implicit reference definition through a Bean with
- * a property with an unsatisfied ref attribute, which forms the reference.
- * The reference is satisified by a wire to a ReferenceComponent which is implemented
- * by a plain Java POJO.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- name="SpringImplicitReference">
-
- <component name="ClientComponent">
- <implementation.spring location="META-INF/sca/sca-references/SpringImplicitReference-context.xml"/>
- <reference name="testReference" target="ImplicitReferenceComponent"/>
- </component>
-
- <component name="ImplicitReferenceComponent">
- <implementation.java class="helloworld.HelloWorldImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- Composite for the SpringImplicitReferenceTestCase
+ * This composite has a ClientComponent implemented with a Spring implementation where
+ * Spring application context uses an implicit reference definition through a Bean with
+ * a property with an unsatisfied ref attribute, which forms the reference.
+ * The reference is satisified by a wire to a ReferenceComponent which is implemented
+ * by a plain Java POJO.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="SpringImplicitReference">
+
+ <component name="ClientComponent">
+ <implementation.spring location="META-INF/sca/sca-references/SpringImplicitReference-context.xml"/>
+ <reference name="testReference" target="ImplicitReferenceComponent"/>
+ </component>
+
+ <component name="ImplicitReferenceComponent">
+ <implementation.java class="helloworld.HelloWorldImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/sca/services/SpringExplicitService.composite b/java/sca/itest/implementation-spring/src/main/resources/sca/services/SpringExplicitService.composite
index b259b9d657..b367399ed4 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/sca/services/SpringExplicitService.composite
+++ b/java/sca/itest/implementation-spring/src/main/resources/sca/services/SpringExplicitService.composite
@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- name="SpringExplicitService">
-
- <component name="ClientComponent">
- <implementation.java class="helloworld.HelloWorldProxy"/>
- <reference name="delegate" target="ExplicitServiceComponent"/>
- </component>
-
- <component name="ExplicitServiceComponent">
- <implementation.spring location="META-INF/sca/sca-services/SpringExplicitService-context.xml"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ name="SpringExplicitService">
+
+ <component name="ClientComponent">
+ <implementation.java class="helloworld.HelloWorldProxy"/>
+ <reference name="delegate" target="ExplicitServiceComponent"/>
+ </component>
+
+ <component name="ExplicitServiceComponent">
+ <implementation.spring location="META-INF/sca/sca-services/SpringExplicitService-context.xml"/>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/sca/services/SpringImplicitService.composite b/java/sca/itest/implementation-spring/src/main/resources/sca/services/SpringImplicitService.composite
index 8ab04edc63..8d5b901378 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/sca/services/SpringImplicitService.composite
+++ b/java/sca/itest/implementation-spring/src/main/resources/sca/services/SpringImplicitService.composite
@@ -1,32 +1,32 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- name="SpringImplicitService">
-
- <component name="ClientComponent">
- <implementation.java class="helloworld.HelloWorldProxy"/>
- <reference name="delegate" target="ImplicitServiceComponent"/>
- </component>
-
- <component name="ImplicitServiceComponent">
- <implementation.spring location="META-INF/sca/sca-services/SpringImplicitService-context.xml"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="SpringImplicitService">
+
+ <component name="ClientComponent">
+ <implementation.java class="helloworld.HelloWorldProxy"/>
+ <reference name="delegate" target="ImplicitServiceComponent"/>
+ </component>
+
+ <component name="ImplicitServiceComponent">
+ <implementation.spring location="META-INF/sca/sca-services/SpringImplicitService-context.xml"/>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/implementation-spring/src/main/resources/spring/annotations/Calculator.composite b/java/sca/itest/implementation-spring/src/main/resources/spring/annotations/Calculator.composite
index 21f89e6a1c..2cb8037c72 100644
--- a/java/sca/itest/implementation-spring/src/main/resources/spring/annotations/Calculator.composite
+++ b/java/sca/itest/implementation-spring/src/main/resources/spring/annotations/Calculator.composite
@@ -1,60 +1,60 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite targetNamespace="http://sample"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sample="http://sample"
- name="Calculator"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
-
- <component name="CalculatorServiceComponent">
- <implementation.spring location="META-INF/sca/spring-annotation/CalculatorService-context.xml"/>
- <property name="message">HelloWorld</property>
- <reference name="addService" target="AddServiceComponent" />
- <reference name="subtractService" target="SubtractServiceComponent" />
- <reference name="multiplyService" target="MultiplyServiceComponent" />
- <reference name="divideService" target="DivideServiceComponent" />
- </component>
-
- <component name="AddServiceComponent">
- <implementation.java class="calculator.AddServiceImpl"/>
- </component>
-
- <component name="SubtractServiceComponent">
- <implementation.java class="calculator.SubtractServiceImpl"/>
- </component>
-
- <component name="MultiplyServiceComponent">
- <implementation.java class="calculator.MultiplyServiceImpl"/>
- </component>
-
- <component name="DivideServiceComponent">
- <implementation.java class="calculator.DivideServiceImpl"/>
- </component>
-
- <!--<component name="AnotherCalculatorServiceComponent">
- <implementation.spring location="META-INF/sca/spring-annotation/CalculatorService-context.xml"/>
- <property name="message">HelloWorld</property>
- <reference name="addService" target="AddServiceComponent" />
- <reference name="subtractService" target="SubtractServiceComponent" />
- <reference name="multiplyService" target="MultiplyServiceComponent" />
- <reference name="divideService" target="DivideServiceComponent" />
- </component>
-
---></composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite targetNamespace="http://sample"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sample="http://sample"
+ name="Calculator"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
+
+ <component name="CalculatorServiceComponent">
+ <implementation.spring location="META-INF/sca/spring-annotation/CalculatorService-context.xml"/>
+ <property name="message">HelloWorld</property>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+
+ <!--<component name="AnotherCalculatorServiceComponent">
+ <implementation.spring location="META-INF/sca/spring-annotation/CalculatorService-context.xml"/>
+ <property name="message">HelloWorld</property>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+--></composite>
diff --git a/java/sca/itest/implementation-spring/src/test/java/context/access/CalculatorClient.java b/java/sca/itest/implementation-spring/src/test/java/context/access/CalculatorClient.java
index 828e94ff65..dbbec2e91f 100644
--- a/java/sca/itest/implementation-spring/src/test/java/context/access/CalculatorClient.java
+++ b/java/sca/itest/implementation-spring/src/test/java/context/access/CalculatorClient.java
@@ -1,59 +1,59 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package context.access;
-
-import org.apache.tuscany.sca.node.Client;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.apache.tuscany.sca.node.Contribution;
-import org.springframework.context.ApplicationContext;
-
-import context.access.SCAApplicationContextProvider;
-import calculator.CalculatorService;
-
-/**
- * This client program shows how to create an SCA runtime, start it,
- * and locate and invoke a SCA component
- */
-public class CalculatorClient {
- public static void main(String[] args) throws Exception {
-
- String location = ContributionLocationHelper.getContributionLocation("context/access/ContextAccess.composite");
- Node node = NodeFactory.newInstance().createNode("context/access/ContextAccess.composite", new Contribution("c1", location));
- node.start();
-
- // Code: To access the Spring Application Context instance
- ApplicationContext ctx = SCAApplicationContextProvider.getApplicationContext();
- if (ctx.containsBean("CalculatorServiceBean"))
- System.out.println("CalculatorServiceBean is now available for use...");
-
- CalculatorService calculatorService =
- ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent");
-
- System.out.println("3 + 2=" + calculatorService.add(3, 2));
- System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
- System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
- System.out.println("3 / 2=" + calculatorService.divide(3, 2));
-
- node.stop();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package context.access;
+
+import org.apache.tuscany.sca.node.Client;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.Contribution;
+import org.springframework.context.ApplicationContext;
+
+import context.access.SCAApplicationContextProvider;
+import calculator.CalculatorService;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+public class CalculatorClient {
+ public static void main(String[] args) throws Exception {
+
+ String location = ContributionLocationHelper.getContributionLocation("context/access/ContextAccess.composite");
+ Node node = NodeFactory.newInstance().createNode("context/access/ContextAccess.composite", new Contribution("c1", location));
+ node.start();
+
+ // Code: To access the Spring Application Context instance
+ ApplicationContext ctx = SCAApplicationContextProvider.getApplicationContext();
+ if (ctx.containsBean("CalculatorServiceBean"))
+ System.out.println("CalculatorServiceBean is now available for use...");
+
+ CalculatorService calculatorService =
+ ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ System.out.println("3 + 2=" + calculatorService.add(3, 2));
+ System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
+ System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
+ System.out.println("3 / 2=" + calculatorService.divide(3, 2));
+
+ node.stop();
+ }
+
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/context/access/ContextAccessTestCase.java b/java/sca/itest/implementation-spring/src/test/java/context/access/ContextAccessTestCase.java
index 5feb293bc8..2602839d1d 100644
--- a/java/sca/itest/implementation-spring/src/test/java/context/access/ContextAccessTestCase.java
+++ b/java/sca/itest/implementation-spring/src/test/java/context/access/ContextAccessTestCase.java
@@ -1,32 +1,32 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package context.access;
-
-import junit.framework.TestCase;
-
-/**
- * Tests out the big bank service
- *
- */
-public class ContextAccessTestCase extends TestCase {
-
- public void testServer() throws Exception {
- CalculatorClient.main(new String[] {""});
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package context.access;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests out the big bank service
+ *
+ */
+public class ContextAccessTestCase extends TestCase {
+
+ public void testServer() throws Exception {
+ CalculatorClient.main(new String[] {""});
+ }
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/context/imports/CalculatorClient.java b/java/sca/itest/implementation-spring/src/test/java/context/imports/CalculatorClient.java
index e9bfaa0a1d..47a040c6dd 100644
--- a/java/sca/itest/implementation-spring/src/test/java/context/imports/CalculatorClient.java
+++ b/java/sca/itest/implementation-spring/src/test/java/context/imports/CalculatorClient.java
@@ -1,51 +1,51 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package context.imports;
-
-import org.apache.tuscany.sca.node.Client;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.apache.tuscany.sca.node.Contribution;
-import calculator.CalculatorService;
-
-/**
- * This client program shows how to create an SCA runtime, start it,
- * and locate and invoke a SCA component
- */
-public class CalculatorClient {
- public static void main(String[] args) throws Exception {
-
- String location = ContributionLocationHelper.getContributionLocation("context/imports/ContextImports.composite");
- Node node = NodeFactory.newInstance().createNode("context/imports/ContextImports.composite", new Contribution("c1", location));
- node.start();
-
- CalculatorService calculatorService =
- ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent");
-
- System.out.println("3 + 2=" + calculatorService.add(3, 2));
- System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
- System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
- System.out.println("3 / 2=" + calculatorService.divide(3, 2));
-
- node.stop();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package context.imports;
+
+import org.apache.tuscany.sca.node.Client;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.Contribution;
+import calculator.CalculatorService;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+public class CalculatorClient {
+ public static void main(String[] args) throws Exception {
+
+ String location = ContributionLocationHelper.getContributionLocation("context/imports/ContextImports.composite");
+ Node node = NodeFactory.newInstance().createNode("context/imports/ContextImports.composite", new Contribution("c1", location));
+ node.start();
+
+ CalculatorService calculatorService =
+ ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ System.out.println("3 + 2=" + calculatorService.add(3, 2));
+ System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
+ System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
+ System.out.println("3 / 2=" + calculatorService.divide(3, 2));
+
+ node.stop();
+ }
+
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/context/imports/ContextImportsTestCase.java b/java/sca/itest/implementation-spring/src/test/java/context/imports/ContextImportsTestCase.java
index 3940bf65fa..8df60c5bab 100644
--- a/java/sca/itest/implementation-spring/src/test/java/context/imports/ContextImportsTestCase.java
+++ b/java/sca/itest/implementation-spring/src/test/java/context/imports/ContextImportsTestCase.java
@@ -1,32 +1,32 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package context.imports;
-
-import junit.framework.TestCase;
-
-/**
- * Tests out the big bank service
- *
- */
-public class ContextImportsTestCase extends TestCase {
-
- public void testServer() throws Exception {
- CalculatorClient.main(new String[] {""});
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package context.imports;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests out the big bank service
+ *
+ */
+public class ContextImportsTestCase extends TestCase {
+
+ public void testServer() throws Exception {
+ CalculatorClient.main(new String[] {""});
+ }
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/context/multiple/MultipleContextTestCase.java b/java/sca/itest/implementation-spring/src/test/java/context/multiple/MultipleContextTestCase.java
index 75b296bf32..f5261c85bb 100644
--- a/java/sca/itest/implementation-spring/src/test/java/context/multiple/MultipleContextTestCase.java
+++ b/java/sca/itest/implementation-spring/src/test/java/context/multiple/MultipleContextTestCase.java
@@ -1,32 +1,32 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package context.multiple;
-
-import junit.framework.TestCase;
-
-/**
- * Tests out the big bank service
- *
- */
-public class MultipleContextTestCase extends TestCase {
-
- public void testServer() throws Exception {
- StockQuoteServer.main(new String[] {"1000"});
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package context.multiple;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests out the big bank service
+ *
+ */
+public class MultipleContextTestCase extends TestCase {
+
+ public void testServer() throws Exception {
+ StockQuoteServer.main(new String[] {"1000"});
+ }
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/context/multiple/StockQuoteServer.java b/java/sca/itest/implementation-spring/src/test/java/context/multiple/StockQuoteServer.java
index d8ecae99bd..1b48150043 100644
--- a/java/sca/itest/implementation-spring/src/test/java/context/multiple/StockQuoteServer.java
+++ b/java/sca/itest/implementation-spring/src/test/java/context/multiple/StockQuoteServer.java
@@ -1,53 +1,53 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package context.multiple;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.springframework.context.ApplicationContext;
-import context.access.SCAApplicationContextProvider;
-
-/**
- * This server program shows how to bootstrap SCA from a simple J2SE program
- * and start it which activates the StockQuote Web service endpoint.
- */
-public class StockQuoteServer {
-
- public static void main(String[] args) throws Exception {
-
- System.out.println("Starting the Sample SCA StockQuote Service...");
-
- String location = ContributionLocationHelper.getContributionLocation("context/multiple/MultipleContext.composite");
- Node node = NodeFactory.newInstance().createNode("context/multiple/MultipleContext.composite", new Contribution("c1", location));
- node.start();
-
- // Method 1: To access the Spring Application Context instance
- ApplicationContext ctx = SCAApplicationContextProvider.getApplicationContext();
- if (ctx.containsBean("StockQuoteServiceBean"))
- System.out.println("StockQuoteServiceBean is now available for use...");
-
- System.out.println("Press Enter to Exit...");
- Thread.sleep(1000);
-
- node.stop();
- System.out.println("Bye");
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package context.multiple;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.springframework.context.ApplicationContext;
+import context.access.SCAApplicationContextProvider;
+
+/**
+ * This server program shows how to bootstrap SCA from a simple J2SE program
+ * and start it which activates the StockQuote Web service endpoint.
+ */
+public class StockQuoteServer {
+
+ public static void main(String[] args) throws Exception {
+
+ System.out.println("Starting the Sample SCA StockQuote Service...");
+
+ String location = ContributionLocationHelper.getContributionLocation("context/multiple/MultipleContext.composite");
+ Node node = NodeFactory.newInstance().createNode("context/multiple/MultipleContext.composite", new Contribution("c1", location));
+ node.start();
+
+ // Method 1: To access the Spring Application Context instance
+ ApplicationContext ctx = SCAApplicationContextProvider.getApplicationContext();
+ if (ctx.containsBean("StockQuoteServiceBean"))
+ System.out.println("StockQuoteServiceBean is now available for use...");
+
+ System.out.println("Press Enter to Exit...");
+ Thread.sleep(1000);
+
+ node.stop();
+ System.out.println("Bye");
+ }
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/implementation/policies/CalculatorClient.java b/java/sca/itest/implementation-spring/src/test/java/implementation/policies/CalculatorClient.java
index 3f26b8c6db..308faf155d 100644
--- a/java/sca/itest/implementation-spring/src/test/java/implementation/policies/CalculatorClient.java
+++ b/java/sca/itest/implementation-spring/src/test/java/implementation/policies/CalculatorClient.java
@@ -1,74 +1,74 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package implementation.policies;
-
-import javax.security.auth.login.Configuration;
-import org.apache.tuscany.sca.node.Client;
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import calculator.CalculatorService;
-
-
-/**
- * This client program shows how to create an SCA runtime, start it,
- * and locate and invoke a SCA component
- */
-public class CalculatorClient {
- public static void main(String[] args) throws Exception {
- try {
- Configuration secConf = Configuration.getConfiguration();
- } catch (java.lang.SecurityException e) {
- System.setProperty("java.security.auth.login.config", CalculatorClient.class.getClassLoader()
- .getResource("implementation/policies/CalculatorJass.config").toString());
- }
-
- String location = ContributionLocationHelper.getContributionLocation("implementation/policies/ImplementationPolicies.composite");
- Node node = NodeFactory.newInstance().createNode("implementation/policies/ImplementationPolicies.composite", new Contribution("c1", location));
- node.start();
-
- CalculatorService calculatorService =
- ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent");
-
- // Calculate
- System.out.println("Calling CalculatorServiceComponent configured with 'logging' " +
- "policy for subtract and divide operations...");
- System.out.println("3 + 2=" + calculatorService.add(3, 2));
- System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
- System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
- System.out.println("3 / 2=" + calculatorService.divide(3, 2));
-
- calculatorService =
- ((Client)node).getService(CalculatorService.class, "AnotherCalculatorServiceComponent");
-
- // Calculate
- System.out.println("Calling CalculatorServiceComponent configured with 'logging' " +
- "for all operations in the implementation...");
- System.out.println("3 + 2=" + calculatorService.add(3, 2));
- System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
- System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
- System.out.println("3 / 2=" + calculatorService.divide(3, 2));
-
- node.stop();
- System.out.println("Bye");
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package implementation.policies;
+
+import javax.security.auth.login.Configuration;
+import org.apache.tuscany.sca.node.Client;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import calculator.CalculatorService;
+
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+public class CalculatorClient {
+ public static void main(String[] args) throws Exception {
+ try {
+ Configuration secConf = Configuration.getConfiguration();
+ } catch (java.lang.SecurityException e) {
+ System.setProperty("java.security.auth.login.config", CalculatorClient.class.getClassLoader()
+ .getResource("implementation/policies/CalculatorJass.config").toString());
+ }
+
+ String location = ContributionLocationHelper.getContributionLocation("implementation/policies/ImplementationPolicies.composite");
+ Node node = NodeFactory.newInstance().createNode("implementation/policies/ImplementationPolicies.composite", new Contribution("c1", location));
+ node.start();
+
+ CalculatorService calculatorService =
+ ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ // Calculate
+ System.out.println("Calling CalculatorServiceComponent configured with 'logging' " +
+ "policy for subtract and divide operations...");
+ System.out.println("3 + 2=" + calculatorService.add(3, 2));
+ System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
+ System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
+ System.out.println("3 / 2=" + calculatorService.divide(3, 2));
+
+ calculatorService =
+ ((Client)node).getService(CalculatorService.class, "AnotherCalculatorServiceComponent");
+
+ // Calculate
+ System.out.println("Calling CalculatorServiceComponent configured with 'logging' " +
+ "for all operations in the implementation...");
+ System.out.println("3 + 2=" + calculatorService.add(3, 2));
+ System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
+ System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
+ System.out.println("3 / 2=" + calculatorService.divide(3, 2));
+
+ node.stop();
+ System.out.println("Bye");
+ }
+
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.java b/java/sca/itest/implementation-spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.java
index efd5fd22df..b8bb93e295 100644
--- a/java/sca/itest/implementation-spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.java
+++ b/java/sca/itest/implementation-spring/src/test/java/implementation/policies/ImplementationPoliciesTestCase.java
@@ -1,35 +1,35 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package implementation.policies;
-
-import junit.framework.TestCase;
-
-import org.junit.Ignore;
-
-/**
- * Tests out the big bank service
- *
- */
-@Ignore("TUSCANY-3027")
-public class ImplementationPoliciesTestCase extends TestCase {
-
- public void testServer() throws Exception {
- CalculatorClient.main(new String[] {""});
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package implementation.policies;
+
+import junit.framework.TestCase;
+
+import org.junit.Ignore;
+
+/**
+ * Tests out the big bank service
+ *
+ */
+@Ignore("TUSCANY-3027")
+public class ImplementationPoliciesTestCase extends TestCase {
+
+ public void testServer() throws Exception {
+ CalculatorClient.main(new String[] {""});
+ }
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/location/folder/SpringFolderLocationTestCase.java b/java/sca/itest/implementation-spring/src/test/java/location/folder/SpringFolderLocationTestCase.java
index 88ac2e8cb5..539074c101 100644
--- a/java/sca/itest/implementation-spring/src/test/java/location/folder/SpringFolderLocationTestCase.java
+++ b/java/sca/itest/implementation-spring/src/test/java/location/folder/SpringFolderLocationTestCase.java
@@ -1,41 +1,41 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package location.folder;
-
-import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
-
-/**
- * A test case designed to test the implementation of Properties from a Spring application
- * context, where the properties are explicit, through the presence of an sca:property
- * element within the Spring application context
- *
- * The artifacts involved in this test are:
- *
- * 1) A composite containing a component with a Spring implementation
- * 2) The <implementation.spring.../> element references an application context that
- * uses an explicit sca:property element which is used to compute the response to an invocation
- * of the service of the implementation
- *
- * @version $Rev$ $Date$
- */
-public class SpringFolderLocationTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package location.folder;
+
+import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
+
+/**
+ * A test case designed to test the implementation of Properties from a Spring application
+ * context, where the properties are explicit, through the presence of an sca:property
+ * element within the Spring application context
+ *
+ * The artifacts involved in this test are:
+ *
+ * 1) A composite containing a component with a Spring implementation
+ * 2) The <implementation.spring.../> element references an application context that
+ * uses an explicit sca:property element which is used to compute the response to an invocation
+ * of the service of the implementation
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringFolderLocationTestCase extends AbstractHelloWorldTestCase {
+ // super class does it all getting composite based on this class name
+}
+
diff --git a/java/sca/itest/implementation-spring/src/test/java/location/jar/SpringJarLocationTestCase.java b/java/sca/itest/implementation-spring/src/test/java/location/jar/SpringJarLocationTestCase.java
index e3600a355c..7694e493ef 100644
--- a/java/sca/itest/implementation-spring/src/test/java/location/jar/SpringJarLocationTestCase.java
+++ b/java/sca/itest/implementation-spring/src/test/java/location/jar/SpringJarLocationTestCase.java
@@ -1,41 +1,41 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package location.jar;
-
-import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
-
-/**
- * A test case designed to test the implementation of Properties from a Spring application
- * context, where the properties are explicit, through the presence of an sca:property
- * element within the Spring application context
- *
- * The artifacts involved in this test are:
- *
- * 1) A composite containing a component with a Spring implementation
- * 2) The <implementation.spring.../> element references an application context that
- * uses an explicit sca:property element which is used to compute the response to an invocation
- * of the service of the implementation
- *
- * @version $Rev$ $Date$
- */
-public class SpringJarLocationTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package location.jar;
+
+import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
+
+/**
+ * A test case designed to test the implementation of Properties from a Spring application
+ * context, where the properties are explicit, through the presence of an sca:property
+ * element within the Spring application context
+ *
+ * The artifacts involved in this test are:
+ *
+ * 1) A composite containing a component with a Spring implementation
+ * 2) The <implementation.spring.../> element references an application context that
+ * uses an explicit sca:property element which is used to compute the response to an invocation
+ * of the service of the implementation
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringJarLocationTestCase extends AbstractHelloWorldTestCase {
+ // super class does it all getting composite based on this class name
+}
+
diff --git a/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java b/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java
index f93095e3c9..634e3d34af 100644
--- a/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java
+++ b/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractHelloWorldTestCase.java
@@ -1,40 +1,40 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.spring;
-
-
-/**
- * Basic "hello world" style test case for testing Spring component implementation
- *
- */
-public abstract class AbstractHelloWorldTestCase extends AbstractSCATestCase<HelloWorld> {
-
- /**
- * Calls the hello world service and checks that it gives the right response...
- */
- public void testHello() throws Exception {
- assertEquals("Hello petra", service.sayHello("petra"));
- }
-
- @Override
- protected Class<HelloWorld> getServiceClass() {
- return HelloWorld.class;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.spring;
+
+
+/**
+ * Basic "hello world" style test case for testing Spring component implementation
+ *
+ */
+public abstract class AbstractHelloWorldTestCase extends AbstractSCATestCase<HelloWorld> {
+
+ /**
+ * Calls the hello world service and checks that it gives the right response...
+ */
+ public void testHello() throws Exception {
+ assertEquals("Hello petra", service.sayHello("petra"));
+ }
+
+ @Override
+ protected Class<HelloWorld> getServiceClass() {
+ return HelloWorld.class;
+ }
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java b/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java
index 605a0079fb..fee7246439 100644
--- a/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java
+++ b/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/AbstractSCATestCase.java
@@ -1,57 +1,57 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.spring;
-
-import junit.framework.TestCase;
-import org.apache.tuscany.sca.node.Client;
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-public abstract class AbstractSCATestCase<T> extends TestCase {
-
- protected Node node;
- protected T service;
-
- @Override
- protected void setUp() throws Exception {
- NodeFactory factory = NodeFactory.newInstance();
- String location = ContributionLocationHelper.getContributionLocation(getCompositeName());
- node = factory.createNode(getCompositeName(), new Contribution("c1", location));
- node.start();
- service = ((Client)node).getService(getServiceClass(), "ClientComponent");
- }
-
- abstract protected Class<T> getServiceClass();
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- }
-
- protected String getCompositeName() {
- String className = this.getClass().getName();
- String compositeName = className.substring(0, className.length() - 8).replace('.', '/') + ".composite";
- System.out.println("Using composite: " + compositeName);
- return compositeName;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.spring;
+
+import junit.framework.TestCase;
+import org.apache.tuscany.sca.node.Client;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+public abstract class AbstractSCATestCase<T> extends TestCase {
+
+ protected Node node;
+ protected T service;
+
+ @Override
+ protected void setUp() throws Exception {
+ NodeFactory factory = NodeFactory.newInstance();
+ String location = ContributionLocationHelper.getContributionLocation(getCompositeName());
+ node = factory.createNode(getCompositeName(), new Contribution("c1", location));
+ node.start();
+ service = ((Client)node).getService(getServiceClass(), "ClientComponent");
+ }
+
+ abstract protected Class<T> getServiceClass();
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ }
+
+ protected String getCompositeName() {
+ String className = this.getClass().getName();
+ String compositeName = className.substring(0, className.length() - 8).replace('.', '/') + ".composite";
+ System.out.println("Using composite: " + compositeName);
+ return compositeName;
+ }
+
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.java b/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.java
index e712593fe3..5869d344f6 100644
--- a/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.java
+++ b/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorld.java
@@ -1,34 +1,34 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.spring;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Interface for the "hello world" service - predictably simple with a single operation
- * "sayHello"
- *
- */
-@Remotable
-public interface HelloWorld {
-
- public String sayHello(String s);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.spring;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Interface for the "hello world" service - predictably simple with a single operation
+ * "sayHello"
+ *
+ */
+@Remotable
+public interface HelloWorld {
+
+ public String sayHello(String s);
+
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java b/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java
index f75df2c75d..90d26dd89f 100644
--- a/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java
+++ b/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/HelloWorldProxy.java
@@ -1,41 +1,41 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.spring;
-
-import org.oasisopen.sca.annotation.Reference;
-
-/**
- * A simple proxy Java class which implements the HelloWorld interface but which uses
- * a reference "delegate" to actually provide the HelloWorld service
- *
- */
-public class HelloWorldProxy implements HelloWorld {
-
- // Here is the reference "delegate" - it implements the HelloWorld interface...
- @Reference
- public HelloWorld delegate;
-
- public String sayHello(String s) {
- // Simply call the reference to satisfy the service request...
- System.out.println("HelloWorldProxy - calling sayHello");
- return delegate.sayHello(s);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.spring;
+
+import org.oasisopen.sca.annotation.Reference;
+
+/**
+ * A simple proxy Java class which implements the HelloWorld interface but which uses
+ * a reference "delegate" to actually provide the HelloWorld service
+ *
+ */
+public class HelloWorldProxy implements HelloWorld {
+
+ // Here is the reference "delegate" - it implements the HelloWorld interface...
+ @Reference
+ public HelloWorld delegate;
+
+ public String sayHello(String s) {
+ // Simply call the reference to satisfy the service request...
+ System.out.println("HelloWorldProxy - calling sayHello");
+ return delegate.sayHello(s);
+ }
+
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java b/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java
index 32cb26979e..4088691ccd 100644
--- a/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java
+++ b/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringDelegationHelloWorldTestCase.java
@@ -1,31 +1,31 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.spring;
-
-/**
- * A basic test case of:
- * 1) A composite containing a component with a Spring implementation
- * 2) The composite has a component with a Java POJO implementation which uses the
- * Spring implementation to satisfy a reference
- *
- */
-public class SpringDelegationHelloWorldTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.spring;
+
+/**
+ * A basic test case of:
+ * 1) A composite containing a component with a Spring implementation
+ * 2) The composite has a component with a Java POJO implementation which uses the
+ * Spring implementation to satisfy a reference
+ *
+ */
+public class SpringDelegationHelloWorldTestCase extends AbstractHelloWorldTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java b/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java
index f8f8886f9f..840bf59b73 100644
--- a/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java
+++ b/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/SpringHelloWorldTestCase.java
@@ -1,32 +1,32 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.spring;
-
-/**
- * A basic test case of:
- * 1) A composite containing a component with a Spring implementation
- * 2) The composite has a component with a Java POJO implementation which uses the
- * Spring implementation to satisfy a reference
- * 3) The Spring component delegates function to a second spring bean
- *
- */
-public class SpringHelloWorldTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.spring;
+
+/**
+ * A basic test case of:
+ * 1) A composite containing a component with a Spring implementation
+ * 2) The composite has a component with a Java POJO implementation which uses the
+ * Spring implementation to satisfy a reference
+ * 3) The Spring component delegates function to a second spring bean
+ *
+ */
+public class SpringHelloWorldTestCase extends AbstractHelloWorldTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java b/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java
index d9522e12a0..fa7967c964 100644
--- a/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java
+++ b/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldBean.java
@@ -1,36 +1,36 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.itest.spring;
-
-/**
- * A simple test Spring bean which provides the HelloWorld service
- *
- */
-
-public class TestHelloWorldBean implements HelloWorld {
-
- static String hello = "Hello ";
-
- // Classic "Hello xxx" response to any input message
- public String sayHello(String message) {
- System.out.println("TestHelloWorldBean - sayHello called");
- return (hello + message);
- }
-
-} // end class TestHelloWorldBean
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.spring;
+
+/**
+ * A simple test Spring bean which provides the HelloWorld service
+ *
+ */
+
+public class TestHelloWorldBean implements HelloWorld {
+
+ static String hello = "Hello ";
+
+ // Classic "Hello xxx" response to any input message
+ public String sayHello(String message) {
+ System.out.println("TestHelloWorldBean - sayHello called");
+ return (hello + message);
+ }
+
+} // end class TestHelloWorldBean
diff --git a/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java b/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java
index 1ad1779ee2..b57cc7f366 100644
--- a/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java
+++ b/java/sca/itest/implementation-spring/src/test/java/org/apache/tuscany/sca/itest/spring/TestHelloWorldDelegatorBean.java
@@ -1,40 +1,40 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.spring;
-
-/**
- * A simple test Spring bean which delgates to another bean
- *
- */
-
-public class TestHelloWorldDelegatorBean implements HelloWorld {
-
- HelloWorld delegate;
-
- public void setDelegate(HelloWorld delegate) {
- this.delegate = delegate;
- }
-
- // Classic "Hello xxx" response to any input message
- public String sayHello(String message) {
- System.out.println("TestHelloWorldDelegatorBean - sayHello called");
- return delegate.sayHello(message);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.spring;
+
+/**
+ * A simple test Spring bean which delgates to another bean
+ *
+ */
+
+public class TestHelloWorldDelegatorBean implements HelloWorld {
+
+ HelloWorld delegate;
+
+ public void setDelegate(HelloWorld delegate) {
+ this.delegate = delegate;
+ }
+
+ // Classic "Hello xxx" response to any input message
+ public String sayHello(String message) {
+ System.out.println("TestHelloWorldDelegatorBean - sayHello called");
+ return delegate.sayHello(message);
+ }
+
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/sca/references/SpringExplicitReferenceTestCase.java b/java/sca/itest/implementation-spring/src/test/java/sca/references/SpringExplicitReferenceTestCase.java
index 9bc12c3e7b..e7f21e26ec 100644
--- a/java/sca/itest/implementation-spring/src/test/java/sca/references/SpringExplicitReferenceTestCase.java
+++ b/java/sca/itest/implementation-spring/src/test/java/sca/references/SpringExplicitReferenceTestCase.java
@@ -1,41 +1,41 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package sca.references;
-
-import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
-
-/**
- * A test case designed to test the implementation of References from a Spring application
- * context, where the references are explicit, through the presence of an sca:reference
- * element within the Spring application context
- *
- * The artifacts involved in this test are:
- *
- * 1) A composite containing a component with a Spring implementation which makes
- * a reference to a second component
- * 2) The composite has a component with a Java POJO implementation which satisfies the reference
- * 3) The <implementation.spring.../> element references an application context that
- * uses an explicit sca:reference element to identify the reference made by the Spring application
- *
- * @version $Rev$ $Date$
- */
-public class SpringExplicitReferenceTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package sca.references;
+
+import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
+
+/**
+ * A test case designed to test the implementation of References from a Spring application
+ * context, where the references are explicit, through the presence of an sca:reference
+ * element within the Spring application context
+ *
+ * The artifacts involved in this test are:
+ *
+ * 1) A composite containing a component with a Spring implementation which makes
+ * a reference to a second component
+ * 2) The composite has a component with a Java POJO implementation which satisfies the reference
+ * 3) The <implementation.spring.../> element references an application context that
+ * uses an explicit sca:reference element to identify the reference made by the Spring application
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringExplicitReferenceTestCase extends AbstractHelloWorldTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/sca/references/SpringImplicitReferenceTestCase.java b/java/sca/itest/implementation-spring/src/test/java/sca/references/SpringImplicitReferenceTestCase.java
index 52ea64a3ed..587cd638b2 100644
--- a/java/sca/itest/implementation-spring/src/test/java/sca/references/SpringImplicitReferenceTestCase.java
+++ b/java/sca/itest/implementation-spring/src/test/java/sca/references/SpringImplicitReferenceTestCase.java
@@ -1,44 +1,44 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package sca.references;
-
-import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
-
-/**
- * A test case designed to test the implementation of References from a Spring application
- * context, where the references are implicit, through the presence of Bean properties with a
- * ref attribute which is not satisfied by a Bean within the application context.
- *
- * The artifacts involved in this test are:
- *
- * 1) A composite containing a component with a Spring implementation which makes
- * a reference to a second component
- * 2) The composite has a component with a Java POJO implementation which satisfies the reference
- * 3) The <implementation.spring.../> element references an application context that
- * does not use an explicit sca:reference element to identify the reference made by the
- * Spring application, but relies on an unsatisfied Bean property with a ref attribute.
- *
- * @version $Rev$ $Date$
- */
-public class SpringImplicitReferenceTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
-
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package sca.references;
+
+import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
+
+/**
+ * A test case designed to test the implementation of References from a Spring application
+ * context, where the references are implicit, through the presence of Bean properties with a
+ * ref attribute which is not satisfied by a Bean within the application context.
+ *
+ * The artifacts involved in this test are:
+ *
+ * 1) A composite containing a component with a Spring implementation which makes
+ * a reference to a second component
+ * 2) The composite has a component with a Java POJO implementation which satisfies the reference
+ * 3) The <implementation.spring.../> element references an application context that
+ * does not use an explicit sca:reference element to identify the reference made by the
+ * Spring application, but relies on an unsatisfied Bean property with a ref attribute.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringImplicitReferenceTestCase extends AbstractHelloWorldTestCase {
+ // super class does it all getting composite based on this class name
+}
+
+
diff --git a/java/sca/itest/implementation-spring/src/test/java/sca/services/SpringExplicitServiceTestCase.java b/java/sca/itest/implementation-spring/src/test/java/sca/services/SpringExplicitServiceTestCase.java
index 35f44b2af7..51efa58a7d 100644
--- a/java/sca/itest/implementation-spring/src/test/java/sca/services/SpringExplicitServiceTestCase.java
+++ b/java/sca/itest/implementation-spring/src/test/java/sca/services/SpringExplicitServiceTestCase.java
@@ -1,36 +1,36 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package sca.services;
-
-import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
-
-/**
- * A basic test case of:
- * 1) A composite containing a component with a Spring implementation
- * 2) The composite has a component with a Java POJO implementation which uses the
- * Spring implementation to satisfy a reference
- * 3) The <implementation.spring.../> element references an application context that
- * uses an explicit sca: element to identify the service offered by the Spring application
- *
- * @version $Rev$ $Date$
- */
-public class SpringExplicitServiceTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package sca.services;
+
+import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
+
+/**
+ * A basic test case of:
+ * 1) A composite containing a component with a Spring implementation
+ * 2) The composite has a component with a Java POJO implementation which uses the
+ * Spring implementation to satisfy a reference
+ * 3) The <implementation.spring.../> element references an application context that
+ * uses an explicit sca: element to identify the service offered by the Spring application
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringExplicitServiceTestCase extends AbstractHelloWorldTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/sca/services/SpringImplicitServiceTestCase.java b/java/sca/itest/implementation-spring/src/test/java/sca/services/SpringImplicitServiceTestCase.java
index 488bdcb202..f02ed963dd 100644
--- a/java/sca/itest/implementation-spring/src/test/java/sca/services/SpringImplicitServiceTestCase.java
+++ b/java/sca/itest/implementation-spring/src/test/java/sca/services/SpringImplicitServiceTestCase.java
@@ -1,34 +1,34 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package sca.services;
-
-import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
-
-/**
- * A basic test case of:
- * 1) A composite containing a component with a Spring implementation
- * 2) The composite has a component with a Java POJO implementation which uses the
- * Spring implementation to satisfy a reference
- *
- * @version $Rev$ $Date$
- */
-public class SpringImplicitServiceTestCase extends AbstractHelloWorldTestCase {
- // super class does it all getting composite based on this class name
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package sca.services;
+
+import org.apache.tuscany.sca.itest.spring.AbstractHelloWorldTestCase;
+
+/**
+ * A basic test case of:
+ * 1) A composite containing a component with a Spring implementation
+ * 2) The composite has a component with a Java POJO implementation which uses the
+ * Spring implementation to satisfy a reference
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringImplicitServiceTestCase extends AbstractHelloWorldTestCase {
+ // super class does it all getting composite based on this class name
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/spring/annotations/CalculatorClient.java b/java/sca/itest/implementation-spring/src/test/java/spring/annotations/CalculatorClient.java
index 5a5056d91e..def0bb9d5f 100644
--- a/java/sca/itest/implementation-spring/src/test/java/spring/annotations/CalculatorClient.java
+++ b/java/sca/itest/implementation-spring/src/test/java/spring/annotations/CalculatorClient.java
@@ -1,61 +1,61 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package spring.annotations;
-
-import org.apache.tuscany.sca.node.Client;
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import calculator.CalculatorService;
-
-
-/**
- * This client program shows how to create an SCA runtime, start it,
- * and locate and invoke a SCA component
- */
-public class CalculatorClient {
- public static void main(String[] args) throws Exception {
-
- String location = ContributionLocationHelper.getContributionLocation("spring/annotations/Calculator.composite");
- Node node = NodeFactory.newInstance().createNode("spring/annotations/Calculator.composite", new Contribution("c1", location));
- node.start();
-
- CalculatorService calculatorService =
- ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent");
-
- System.out.println("3 + 2=" + calculatorService.add(3, 2));
- System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
- System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
- System.out.println("3 / 2=" + calculatorService.divide(3, 2));
-
- /*calculatorService =
- ((SCAClient)node).getService(CalculatorService.class, "AnotherCalculatorServiceComponent");
-
- System.out.println("3 + 2=" + calculatorService.add(3, 2));
- System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
- System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
- System.out.println("3 / 2=" + calculatorService.divide(3, 2));*/
-
- node.stop();
- System.out.println("Bye");
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package spring.annotations;
+
+import org.apache.tuscany.sca.node.Client;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import calculator.CalculatorService;
+
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+public class CalculatorClient {
+ public static void main(String[] args) throws Exception {
+
+ String location = ContributionLocationHelper.getContributionLocation("spring/annotations/Calculator.composite");
+ Node node = NodeFactory.newInstance().createNode("spring/annotations/Calculator.composite", new Contribution("c1", location));
+ node.start();
+
+ CalculatorService calculatorService =
+ ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ System.out.println("3 + 2=" + calculatorService.add(3, 2));
+ System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
+ System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
+ System.out.println("3 / 2=" + calculatorService.divide(3, 2));
+
+ /*calculatorService =
+ ((SCAClient)node).getService(CalculatorService.class, "AnotherCalculatorServiceComponent");
+
+ System.out.println("3 + 2=" + calculatorService.add(3, 2));
+ System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
+ System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
+ System.out.println("3 / 2=" + calculatorService.divide(3, 2));*/
+
+ node.stop();
+ System.out.println("Bye");
+ }
+
+}
diff --git a/java/sca/itest/implementation-spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.java b/java/sca/itest/implementation-spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.java
index 3a9ec4bbb2..5db9c84c00 100644
--- a/java/sca/itest/implementation-spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.java
+++ b/java/sca/itest/implementation-spring/src/test/java/spring/annotations/SpringAnnotationsTestCase.java
@@ -1,32 +1,32 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package spring.annotations;
-
-import junit.framework.TestCase;
-
-/**
- * Tests out the big bank service
- *
- */
-public class SpringAnnotationsTestCase extends TestCase {
-
- public void testServer() throws Exception {
- CalculatorClient.main(new String[] {""});
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package spring.annotations;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests out the big bank service
+ *
+ */
+public class SpringAnnotationsTestCase extends TestCase {
+
+ public void testServer() throws Exception {
+ CalculatorClient.main(new String[] {""});
+ }
+}
diff --git a/java/sca/itest/interfaces/src/main/resources/InterfacesTest.composite b/java/sca/itest/interfaces/src/main/resources/InterfacesTest.composite
index 8b3d0e8f63..27ada047b9 100644
--- a/java/sca/itest/interfaces/src/main/resources/InterfacesTest.composite
+++ b/java/sca/itest/interfaces/src/main/resources/InterfacesTest.composite
@@ -1,40 +1,40 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:foo="http://foo" targetNamespace="http://foo"
- name="InterfacesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
- <component name="LocalClientComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.interfaces.LocalClientComponentImpl" />
- <reference name="aCallBackService" target="LocalServiceComponent" />
- </component>
-
- <component name="RemoteClientComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.interfaces.RemoteClientComponentImpl" />
- <reference name="aCallBackService" target="RemoteServiceComponent" />
- </component>
-
- <component name="LocalServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.interfaces.LocalServiceComponentImpl" />
- </component>
-
- <component name="RemoteServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.interfaces.RemoteServiceComponentImpl" />
- </component>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:foo="http://foo" targetNamespace="http://foo"
+ name="InterfacesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <component name="LocalClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.interfaces.LocalClientComponentImpl" />
+ <reference name="aCallBackService" target="LocalServiceComponent" />
+ </component>
+
+ <component name="RemoteClientComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.interfaces.RemoteClientComponentImpl" />
+ <reference name="aCallBackService" target="RemoteServiceComponent" />
+ </component>
+
+ <component name="LocalServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.interfaces.LocalServiceComponentImpl" />
+ </component>
+
+ <component name="RemoteServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.interfaces.RemoteServiceComponentImpl" />
+ </component>
+
</composite> \ No newline at end of file
diff --git a/java/sca/itest/nodes/helloworld-client/pom.xml b/java/sca/itest/nodes/helloworld-client/pom.xml
index 8dfba43553..8367550f5a 100644
--- a/java/sca/itest/nodes/helloworld-client/pom.xml
+++ b/java/sca/itest/nodes/helloworld-client/pom.xml
@@ -1,44 +1,44 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-nodes-helloworld-client</artifactId>
- <name>Apache Tuscany SCA iTest Nodes Helloworld Client</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-nodes-helloworld-iface</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-helloworld-client</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes Helloworld Client</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/java/sca/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java b/java/sca/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java
index b10d9d37b2..bf8a588928 100644
--- a/java/sca/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java
+++ b/java/sca/itest/nodes/helloworld-client/src/main/java/itest/nodes/HelloworldImpl.java
@@ -1,43 +1,43 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package itest.nodes;
-
-import org.oasisopen.sca.annotation.EagerInit;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Scope;
-
-@EagerInit
-@Scope("COMPOSITE")
-public class HelloworldImpl implements Helloworld {
-
- @Reference
- public Helloworld service;
-
- @Init
- public void initialize(){
- System.out.println(">>>>>> " + sayHello("init"));
- }
-
- public String sayHello(String name) {
- return "Hi " + service.sayHello(name);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package itest.nodes;
+
+import org.oasisopen.sca.annotation.EagerInit;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Scope;
+
+@EagerInit
+@Scope("COMPOSITE")
+public class HelloworldImpl implements Helloworld {
+
+ @Reference
+ public Helloworld service;
+
+ @Init
+ public void initialize(){
+ System.out.println(">>>>>> " + sayHello("init"));
+ }
+
+ public String sayHello(String name) {
+ return "Hi " + service.sayHello(name);
+ }
+
+}
diff --git a/java/sca/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml b/java/sca/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml
index d55aa7ba9c..b4ba94220c 100644
--- a/java/sca/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml
+++ b/java/sca/itest/nodes/helloworld-client/src/main/resources/META-INF/sca-contribution.xml
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:itest="http://itest">
- <deployable composite="itest:HelloworldClient"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:itest="http://itest">
+ <deployable composite="itest:HelloworldClient"/>
</contribution> \ No newline at end of file
diff --git a/java/sca/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite b/java/sca/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite
index 81a3fa1f2d..9d5e9ae59a 100644
--- a/java/sca/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite
+++ b/java/sca/itest/nodes/helloworld-client/src/main/resources/helloworld-client.composite
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://itest"
- name="HelloworldClient">
-
- <component name="HelloworldClient">
- <implementation.java class="itest.nodes.HelloworldImpl"/>
- <reference name="service" target="HelloworldService"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://itest"
+ name="HelloworldClient">
+
+ <component name="HelloworldClient">
+ <implementation.java class="itest.nodes.HelloworldImpl"/>
+ <reference name="service" target="HelloworldService"/>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/nodes/helloworld-iface/pom.xml b/java/sca/itest/nodes/helloworld-iface/pom.xml
index fabfbb0c30..87b6a4fc51 100644
--- a/java/sca/itest/nodes/helloworld-iface/pom.xml
+++ b/java/sca/itest/nodes/helloworld-iface/pom.xml
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-nodes-helloworld-iface</artifactId>
- <name>Apache Tuscany SCA iTest Nodes Helloworld IFaces</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes Helloworld IFaces</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/java/sca/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java b/java/sca/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java
index ee15dfba12..76f8d4400d 100644
--- a/java/sca/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java
+++ b/java/sca/itest/nodes/helloworld-iface/src/main/java/itest/nodes/Helloworld.java
@@ -1,29 +1,29 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package itest.nodes;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface Helloworld {
-
- String sayHello(String name);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package itest.nodes;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface Helloworld {
+
+ String sayHello(String name);
+
+}
diff --git a/java/sca/itest/nodes/helloworld-service/pom.xml b/java/sca/itest/nodes/helloworld-service/pom.xml
index ddff68a80c..bae0db69bd 100644
--- a/java/sca/itest/nodes/helloworld-service/pom.xml
+++ b/java/sca/itest/nodes/helloworld-service/pom.xml
@@ -1,49 +1,49 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-nodes-helloworld-service</artifactId>
- <name>Apache Tuscany SCA iTest Nodes Helloworld Service</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-nodes-helloworld-iface</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-helloworld-service</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes Helloworld Service</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/java/sca/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java b/java/sca/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java
index 20233b0397..81f7e1747d 100644
--- a/java/sca/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java
+++ b/java/sca/itest/nodes/helloworld-service/src/main/java/itest/nodes/HelloworldImpl.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package itest.nodes;
-
-public class HelloworldImpl implements Helloworld {
-
- public String sayHello(String name) {
- return "Hello " + name;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package itest.nodes;
+
+public class HelloworldImpl implements Helloworld {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/java/sca/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml b/java/sca/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml
index 9c68ffd043..c65718909d 100644
--- a/java/sca/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml
+++ b/java/sca/itest/nodes/helloworld-service/src/main/resources/META-INF/sca-contribution.xml
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:itest="http://itest">
- <deployable composite="itest:HelloworldService"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:itest="http://itest">
+ <deployable composite="itest:HelloworldService"/>
</contribution> \ No newline at end of file
diff --git a/java/sca/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite b/java/sca/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite
index 95d78b1983..6b2d15b7a6 100644
--- a/java/sca/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite
+++ b/java/sca/itest/nodes/helloworld-service/src/main/resources/helloworld-service.composite
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://itest"
- name="HelloworldService">
-
- <component name="HelloworldService">
- <implementation.java class="itest.nodes.HelloworldImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://itest"
+ name="HelloworldService">
+
+ <component name="HelloworldService">
+ <implementation.java class="itest.nodes.HelloworldImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/nodes/one-node-test/pom.xml b/java/sca/itest/nodes/one-node-test/pom.xml
index 4d297c97a6..d35761bc88 100644
--- a/java/sca/itest/nodes/one-node-test/pom.xml
+++ b/java/sca/itest/nodes/one-node-test/pom.xml
@@ -1,48 +1,48 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-nodes-one-node-test</artifactId>
- <name>Apache Tuscany SCA iTest Nodes One Node Test</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-nodes-helloworld-iface</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-one-node-test</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes One Node Test</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/java/sca/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java b/java/sca/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java
index 63ddc789db..6d49b718ef 100644
--- a/java/sca/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java
+++ b/java/sca/itest/nodes/one-node-test/src/test/java/itest/OneNodeTestCase.java
@@ -1,87 +1,87 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package itest;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.File;
-
-import itest.nodes.Helloworld;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * This shows how to test the Calculator service component.
- */
-public class OneNodeTestCase{
-
- private static Node node;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled", "false");
- NodeFactory factory = NodeFactory.newInstance();
- node = factory.createNode(
- new Contribution("service", getJar("../helloworld-service/target")),
- new Contribution("client", getJar("../helloworld-client/target")));
- node.start();
- }
-
- /**
- * Get the jar in the target folder without being dependent on the version name to
- * make tuscany releases easier
- */
- private static String getJar(String targetDirectory) {
- File f = new File(targetDirectory);
- for (File file : f.listFiles()) {
- if (file.getName().endsWith(".jar")) {
- return file.toURI().toString();
- }
- }
- throw new IllegalStateException("Can't find jar in: " + targetDirectory);
- }
-
- @Test
- public void testCalculator() throws Exception {
-
- // Ideally this would use the SCAClient API but leaving that tillwe have the basics working
-
- Helloworld service = node.getService(Helloworld.class, "HelloworldService");
- assertNotNull(service);
- assertEquals("Hello Petra", service.sayHello("Petra"));
-
- Helloworld client = node.getService(Helloworld.class, "HelloworldClient");
- assertNotNull(client);
- assertEquals("Hi Hello Petra", client.sayHello("Petra"));
- }
-
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- if (node != null) {
- node.stop();
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package itest;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.File;
+
+import itest.nodes.Helloworld;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class OneNodeTestCase{
+
+ private static Node node;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled", "false");
+ NodeFactory factory = NodeFactory.newInstance();
+ node = factory.createNode(
+ new Contribution("service", getJar("../helloworld-service/target")),
+ new Contribution("client", getJar("../helloworld-client/target")));
+ node.start();
+ }
+
+ /**
+ * Get the jar in the target folder without being dependent on the version name to
+ * make tuscany releases easier
+ */
+ private static String getJar(String targetDirectory) {
+ File f = new File(targetDirectory);
+ for (File file : f.listFiles()) {
+ if (file.getName().endsWith(".jar")) {
+ return file.toURI().toString();
+ }
+ }
+ throw new IllegalStateException("Can't find jar in: " + targetDirectory);
+ }
+
+ @Test
+ public void testCalculator() throws Exception {
+
+ // Ideally this would use the SCAClient API but leaving that tillwe have the basics working
+
+ Helloworld service = node.getService(Helloworld.class, "HelloworldService");
+ assertNotNull(service);
+ assertEquals("Hello Petra", service.sayHello("Petra"));
+
+ Helloworld client = node.getService(Helloworld.class, "HelloworldClient");
+ assertNotNull(client);
+ assertEquals("Hi Hello Petra", client.sayHello("Petra"));
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+}
diff --git a/java/sca/itest/nodes/pom.xml b/java/sca/itest/nodes/pom.xml
index a49ae95fc7..5a3e4fe7e3 100644
--- a/java/sca/itest/nodes/pom.xml
+++ b/java/sca/itest/nodes/pom.xml
@@ -1,45 +1,45 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <packaging>pom</packaging>
- <artifactId>itest-nodes</artifactId>
- <name>Apache Tuscany SCA iTest Nodes</name>
-
- <build>
- <defaultGoal>install</defaultGoal>
- </build>
-
- <modules>
- <module>helloworld-iface</module>
- <module>helloworld-service</module>
- <module>helloworld-client</module>
- <module>one-node-test</module>
- <module>two-nodes-test</module>
- <module>two-nodes-two-vms-test</module>
- </modules>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <packaging>pom</packaging>
+ <artifactId>itest-nodes</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes</name>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ </build>
+
+ <modules>
+ <module>helloworld-iface</module>
+ <module>helloworld-service</module>
+ <module>helloworld-client</module>
+ <module>one-node-test</module>
+ <module>two-nodes-test</module>
+ <module>two-nodes-two-vms-test</module>
+ </modules>
+
+</project>
diff --git a/java/sca/itest/nodes/two-nodes-test/pom.xml b/java/sca/itest/nodes/two-nodes-test/pom.xml
index c03aac5bc7..a01b682803 100644
--- a/java/sca/itest/nodes/two-nodes-test/pom.xml
+++ b/java/sca/itest/nodes/two-nodes-test/pom.xml
@@ -1,58 +1,58 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-nodes-two-nodes-test</artifactId>
- <name>Apache Tuscany SCA iTest Nodes Two Nodes Test</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>itest-nodes-helloworld-iface</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-client-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-nodes-two-nodes-test</artifactId>
+ <name>Apache Tuscany SCA iTest Nodes Two Nodes Test</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>itest-nodes-helloworld-iface</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-client-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/ClientNode.java b/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/ClientNode.java
index 076c119335..5f9453a5d6 100644
--- a/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/ClientNode.java
+++ b/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/ClientNode.java
@@ -1,92 +1,92 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package itest;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import itest.nodes.Helloworld;
-
-import java.io.File;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.oasisopen.sca.client.SCAClient;
-
-/**
- * This shows how to test the Calculator service component.
- */
-public class ClientNode {
- private final static String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
- private static Node clientNode;
- private static TestCaseRunner runner;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- runner = new TestCaseRunner(ServiceNode.class);
- runner.beforeClass();
- System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled",
- "false");
- NodeFactory factory = NodeFactory.newInstance();
- NodeConfiguration conf =
- factory.createNodeConfiguration().setURI("clientNode").
- addBinding(new QName(SCA11_NS, "binding.sca"), "http://localhost:8085/sca https://localhost:9085/sca")
- .addBinding(new QName(SCA11_NS, "binding.ws"), "http://localhost:8086/ws")
- .addContribution("client", new File("../helloworld-client/target/classes").toURI().toString());
- clientNode = factory.createNode(conf).start();
- Thread.sleep(1000);
- }
-
- @Test
- public void testCalculator() throws Exception {
-
- Helloworld client = clientNode.getService(Helloworld.class, "HelloworldClient");
- assertNotNull(client);
- assertEquals("Hi Hello Petra", client.sayHello("Petra"));
- }
-
- @Test
- @Ignore("SCAClient needs to leverage the EndpointRegistry to invoke services that are not hosted on the local node")
- public void testCalculatorClientAPI() throws Exception {
- Helloworld service = SCAClient.getService(Helloworld.class, "HelloworldService");
- assertNotNull(service);
- assertEquals("Hello Petra", service.sayHello("Petra"));
-
- Helloworld client = SCAClient.getService(Helloworld.class, "HelloworldClient");
- assertNotNull(client);
- assertEquals("Hi Hello Petra", client.sayHello("Petra"));
- }
-
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- if (clientNode != null) {
- clientNode.stop();
- }
- if (runner != null) {
- runner.afterClass();
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package itest;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import itest.nodes.Helloworld;
+
+import java.io.File;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.oasisopen.sca.client.SCAClient;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class ClientNode {
+ private final static String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
+ private static Node clientNode;
+ private static TestCaseRunner runner;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ runner = new TestCaseRunner(ServiceNode.class);
+ runner.beforeClass();
+ System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled",
+ "false");
+ NodeFactory factory = NodeFactory.newInstance();
+ NodeConfiguration conf =
+ factory.createNodeConfiguration().setURI("clientNode").
+ addBinding(new QName(SCA11_NS, "binding.sca"), "http://localhost:8085/sca https://localhost:9085/sca")
+ .addBinding(new QName(SCA11_NS, "binding.ws"), "http://localhost:8086/ws")
+ .addContribution("client", new File("../helloworld-client/target/classes").toURI().toString());
+ clientNode = factory.createNode(conf).start();
+ Thread.sleep(1000);
+ }
+
+ @Test
+ public void testCalculator() throws Exception {
+
+ Helloworld client = clientNode.getService(Helloworld.class, "HelloworldClient");
+ assertNotNull(client);
+ assertEquals("Hi Hello Petra", client.sayHello("Petra"));
+ }
+
+ @Test
+ @Ignore("SCAClient needs to leverage the EndpointRegistry to invoke services that are not hosted on the local node")
+ public void testCalculatorClientAPI() throws Exception {
+ Helloworld service = SCAClient.getService(Helloworld.class, "HelloworldService");
+ assertNotNull(service);
+ assertEquals("Hello Petra", service.sayHello("Petra"));
+
+ Helloworld client = SCAClient.getService(Helloworld.class, "HelloworldClient");
+ assertNotNull(client);
+ assertEquals("Hi Hello Petra", client.sayHello("Petra"));
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (clientNode != null) {
+ clientNode.stop();
+ }
+ if (runner != null) {
+ runner.afterClass();
+ }
+ }
+}
diff --git a/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/ServiceNode.java b/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/ServiceNode.java
index 74136fe988..b413825106 100644
--- a/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/ServiceNode.java
+++ b/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/ServiceNode.java
@@ -1,58 +1,58 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package itest;
-
-import java.io.File;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-
-/**
- * This shows how to test the Calculator service component.
- */
-public class ServiceNode {
- private final static String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
- private static Node serviceNode;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled",
- "false");
- NodeFactory factory = NodeFactory.newInstance();
- NodeConfiguration conf =
- factory.createNodeConfiguration().setURI("serviceNode")
- .addBinding(new QName(SCA11_NS, "binding.sca"), "http://localhost:8087/sca")
- .addBinding(new QName(SCA11_NS, "binding.ws"), "http://localhost:8088/ws")
- .addContribution("service", new File("../helloworld-service/target/classes").toURI().toString());
- serviceNode = factory.createNode(conf).start();
- }
-
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- if (serviceNode != null) {
- serviceNode.stop();
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package itest;
+
+import java.io.File;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class ServiceNode {
+ private final static String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
+ private static Node serviceNode;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled",
+ "false");
+ NodeFactory factory = NodeFactory.newInstance();
+ NodeConfiguration conf =
+ factory.createNodeConfiguration().setURI("serviceNode")
+ .addBinding(new QName(SCA11_NS, "binding.sca"), "http://localhost:8087/sca")
+ .addBinding(new QName(SCA11_NS, "binding.ws"), "http://localhost:8088/ws")
+ .addContribution("service", new File("../helloworld-service/target/classes").toURI().toString());
+ serviceNode = factory.createNode(conf).start();
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (serviceNode != null) {
+ serviceNode.stop();
+ }
+ }
+}
diff --git a/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/TestCaseRunner.java b/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/TestCaseRunner.java
index 60e4ec516e..7dfa6e66cc 100644
--- a/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/TestCaseRunner.java
+++ b/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/TestCaseRunner.java
@@ -1,292 +1,292 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package itest;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
- * A helper class that can be used to run an SCA JUnit test case. The test case will run in an isolated class loader.
- *
- * @version $Rev$ $Date$
- */
-public class TestCaseRunner {
-
- private ClassLoader classLoader;
- private Class<?> testSuiteClass;
- private Object testSuite;
- private Class<?> testResultClass;
- private Class<?> testCaseClass;
- private Object testCase;
-
- private Class<?> beforeAnnotation;
- private Class<?> beforeClassAnnotation;
- private Class<?> afterAnnotation;
- private Class<?> afterClassAnnotation;
- private Class<?> junit4AdapterClass;
- private Class<?> junit3TestCaseClass;
-
- /**
- * Constructs a new TestCase runner.
- *
- * @param testClass
- */
- public TestCaseRunner(Class<?> testClass) {
- try {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- classLoader = testClass.getClassLoader();
- if (classLoader instanceof URLClassLoader) {
- URL[] urls = ((URLClassLoader)classLoader).getURLs();
- classLoader = new URLClassLoader(urls, classLoader.getParent());
- } else if (classLoader == tccl || classLoader.getParent() == tccl) {
- classLoader = new URLClassLoader(new URL[0], classLoader);
- } else {
- classLoader = tccl;
- }
-
- try {
- // Thread.currentThread().setContextClassLoader(classLoader);
- // Allow privileged access to set class loader. Requires RuntimePermission
- // setContextClassLoader in security policy.
- final ClassLoader finalClassLoader = classLoader;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(finalClassLoader);
- return null;
- }
- });
-
- testCaseClass = Class.forName(testClass.getName(), true, classLoader);
- testCase = testCaseClass.newInstance();
- ClassLoader testClassLoader = testCaseClass.getClassLoader();
-
- junit3TestCaseClass = Class.forName("junit.framework.TestCase", true, testClassLoader);
-
- testSuiteClass = Class.forName("junit.framework.TestSuite", true, testClassLoader);
- Constructor<?> testSuiteConstructor = testSuiteClass.getConstructor(Class.class);
- testSuite = testSuiteConstructor.newInstance(testCaseClass);
-
- testResultClass = Class.forName("junit.framework.TestResult", true, testClassLoader);
-
- try {
- beforeAnnotation = Class.forName("org.junit.Before", true, testClassLoader);
- afterAnnotation = Class.forName("org.junit.After", true, testClassLoader);
- beforeClassAnnotation = Class.forName("org.junit.BeforeClass", true, testClassLoader);
- afterClassAnnotation = Class.forName("org.junit.AfterClass", true, testClassLoader);
- junit4AdapterClass = Class.forName("junit.framework.JUnit4TestAdapter", true, testClassLoader);
- } catch (Exception e) {
- // Unexpected
- throw new AssertionError(e);
- }
- } catch (Throwable e) {
- e.printStackTrace();
- } finally {
- // Thread.currentThread().setContextClassLoader(tccl);
- // Allow privileged access to set class loader. Requires RuntimePermission
- // setContextClassLoader in security policy.
- final ClassLoader finaltccl = tccl;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(finaltccl);
- return null;
- }
- });
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Run the test case
- */
- public void run() {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- try {
- // Thread.currentThread().setContextClassLoader(classLoader);
- // Allow privileged access to set class loader. Requires RuntimePermission
- // setContextClassLoader in security policy.
- final ClassLoader finalClassLoader = classLoader;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(finalClassLoader);
- return null;
- }
- });
-
- if (junit3TestCaseClass.isAssignableFrom(testCaseClass)) {
- Object testResult = testResultClass.newInstance();
- Method runMethod = testSuiteClass.getMethod("run", testResultClass);
- runMethod.invoke(testSuite, testResult);
- } else {
- Object junit4Adapter = junit4AdapterClass.getConstructor(Class.class).newInstance(testCaseClass);
- Object testResult = testResultClass.newInstance();
- Method runMethod = junit4AdapterClass.getMethod("run", testResultClass);
- runMethod.invoke(junit4Adapter, testResult);
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- } finally {
- // Thread.currentThread().setContextClassLoader(tccl);
- // Allow privileged access to set class loader. Requires RuntimePermission
- // setContextClassLoader in security policy.
- final ClassLoader finaltccl = tccl;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(finaltccl);
- return null;
- }
- });
- }
- }
-
- /**
- * Invoke the setUp method
- */
- public void setUp() {
- execute("setUp");
- }
-
- /**
- * Invoke the before methods
- */
- public void before() {
- execute(beforeAnnotation);
- }
-
- /**
- * Invoke the beforeClass methods
- */
- public void beforeClass() {
- execute(beforeClassAnnotation);
- }
-
- /**
- * Invoke the tearDown method
- */
- public void tearDown() {
- execute("tearDown");
- }
-
- /**
- * Invoke the after methods
- */
- public void after() {
- execute(afterAnnotation);
- }
-
- /**
- * Invoke the afterClass methods
- */
- public void afterClass() {
- execute(afterClassAnnotation);
- }
-
- /**
- * Invoke the specified test method.
- */
- public void run(String methodName) {
- execute(methodName);
- }
-
- /**
- * Invoke the methods annotated with the specified annotation.
- */
- private void execute(Class<?> annotationClass) {
- if (annotationClass == null) {
- throw new RuntimeException(new NoSuchMethodException());
- }
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- try {
- // Thread.currentThread().setContextClassLoader(classLoader);
- // Allow privileged access to set class loader. Requires RuntimePermission
- // setContextClassLoader in security policy.
- final ClassLoader finalClassLoader = classLoader;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(finalClassLoader);
- return null;
- }
- });
-
- for (Method method : testCaseClass.getDeclaredMethods()) {
- for (Annotation annotation : method.getAnnotations()) {
- if (annotation.annotationType() == annotationClass) {
- method.invoke(testCase);
- }
- }
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- } finally {
- // Thread.currentThread().setContextClassLoader(tccl);
- // Allow privileged access to set class loader. Requires RuntimePermission
- // setContextClassLoader in security policy.
- final ClassLoader finaltccl = tccl;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(finaltccl);
- return null;
- }
- });
- }
- }
-
- /**
- * Invoke the specified method
- */
- private void execute(String methodName) {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- try {
- // Thread.currentThread().setContextClassLoader(classLoader);
- // Allow privileged access to set class loader. Requires RuntimePermission
- // setContextClassLoader in security policy.
- final ClassLoader finalClassLoader = classLoader;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(finalClassLoader);
- return null;
- }
- });
- Method setUpMethod = testCaseClass.getDeclaredMethod(methodName);
- setUpMethod.setAccessible(true);
- setUpMethod.invoke(testCase);
- } catch (Exception e) {
- throw new RuntimeException(e);
- } finally {
- // Thread.currentThread().setContextClassLoader(tccl);
- // Allow privileged access to set class loader. Requires RuntimePermission
- // setContextClassLoader in security policy.
- final ClassLoader finaltccl = tccl;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
- Thread.currentThread().setContextClassLoader(finaltccl);
- return null;
- }
- });
- }
- }
-
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package itest;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * A helper class that can be used to run an SCA JUnit test case. The test case will run in an isolated class loader.
+ *
+ * @version $Rev$ $Date$
+ */
+public class TestCaseRunner {
+
+ private ClassLoader classLoader;
+ private Class<?> testSuiteClass;
+ private Object testSuite;
+ private Class<?> testResultClass;
+ private Class<?> testCaseClass;
+ private Object testCase;
+
+ private Class<?> beforeAnnotation;
+ private Class<?> beforeClassAnnotation;
+ private Class<?> afterAnnotation;
+ private Class<?> afterClassAnnotation;
+ private Class<?> junit4AdapterClass;
+ private Class<?> junit3TestCaseClass;
+
+ /**
+ * Constructs a new TestCase runner.
+ *
+ * @param testClass
+ */
+ public TestCaseRunner(Class<?> testClass) {
+ try {
+ ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+ classLoader = testClass.getClassLoader();
+ if (classLoader instanceof URLClassLoader) {
+ URL[] urls = ((URLClassLoader)classLoader).getURLs();
+ classLoader = new URLClassLoader(urls, classLoader.getParent());
+ } else if (classLoader == tccl || classLoader.getParent() == tccl) {
+ classLoader = new URLClassLoader(new URL[0], classLoader);
+ } else {
+ classLoader = tccl;
+ }
+
+ try {
+ // Thread.currentThread().setContextClassLoader(classLoader);
+ // Allow privileged access to set class loader. Requires RuntimePermission
+ // setContextClassLoader in security policy.
+ final ClassLoader finalClassLoader = classLoader;
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ public Object run() {
+ Thread.currentThread().setContextClassLoader(finalClassLoader);
+ return null;
+ }
+ });
+
+ testCaseClass = Class.forName(testClass.getName(), true, classLoader);
+ testCase = testCaseClass.newInstance();
+ ClassLoader testClassLoader = testCaseClass.getClassLoader();
+
+ junit3TestCaseClass = Class.forName("junit.framework.TestCase", true, testClassLoader);
+
+ testSuiteClass = Class.forName("junit.framework.TestSuite", true, testClassLoader);
+ Constructor<?> testSuiteConstructor = testSuiteClass.getConstructor(Class.class);
+ testSuite = testSuiteConstructor.newInstance(testCaseClass);
+
+ testResultClass = Class.forName("junit.framework.TestResult", true, testClassLoader);
+
+ try {
+ beforeAnnotation = Class.forName("org.junit.Before", true, testClassLoader);
+ afterAnnotation = Class.forName("org.junit.After", true, testClassLoader);
+ beforeClassAnnotation = Class.forName("org.junit.BeforeClass", true, testClassLoader);
+ afterClassAnnotation = Class.forName("org.junit.AfterClass", true, testClassLoader);
+ junit4AdapterClass = Class.forName("junit.framework.JUnit4TestAdapter", true, testClassLoader);
+ } catch (Exception e) {
+ // Unexpected
+ throw new AssertionError(e);
+ }
+ } catch (Throwable e) {
+ e.printStackTrace();
+ } finally {
+ // Thread.currentThread().setContextClassLoader(tccl);
+ // Allow privileged access to set class loader. Requires RuntimePermission
+ // setContextClassLoader in security policy.
+ final ClassLoader finaltccl = tccl;
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ public Object run() {
+ Thread.currentThread().setContextClassLoader(finaltccl);
+ return null;
+ }
+ });
+ }
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Run the test case
+ */
+ public void run() {
+ ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+ try {
+ // Thread.currentThread().setContextClassLoader(classLoader);
+ // Allow privileged access to set class loader. Requires RuntimePermission
+ // setContextClassLoader in security policy.
+ final ClassLoader finalClassLoader = classLoader;
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ public Object run() {
+ Thread.currentThread().setContextClassLoader(finalClassLoader);
+ return null;
+ }
+ });
+
+ if (junit3TestCaseClass.isAssignableFrom(testCaseClass)) {
+ Object testResult = testResultClass.newInstance();
+ Method runMethod = testSuiteClass.getMethod("run", testResultClass);
+ runMethod.invoke(testSuite, testResult);
+ } else {
+ Object junit4Adapter = junit4AdapterClass.getConstructor(Class.class).newInstance(testCaseClass);
+ Object testResult = testResultClass.newInstance();
+ Method runMethod = junit4AdapterClass.getMethod("run", testResultClass);
+ runMethod.invoke(junit4Adapter, testResult);
+ }
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ } finally {
+ // Thread.currentThread().setContextClassLoader(tccl);
+ // Allow privileged access to set class loader. Requires RuntimePermission
+ // setContextClassLoader in security policy.
+ final ClassLoader finaltccl = tccl;
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ public Object run() {
+ Thread.currentThread().setContextClassLoader(finaltccl);
+ return null;
+ }
+ });
+ }
+ }
+
+ /**
+ * Invoke the setUp method
+ */
+ public void setUp() {
+ execute("setUp");
+ }
+
+ /**
+ * Invoke the before methods
+ */
+ public void before() {
+ execute(beforeAnnotation);
+ }
+
+ /**
+ * Invoke the beforeClass methods
+ */
+ public void beforeClass() {
+ execute(beforeClassAnnotation);
+ }
+
+ /**
+ * Invoke the tearDown method
+ */
+ public void tearDown() {
+ execute("tearDown");
+ }
+
+ /**
+ * Invoke the after methods
+ */
+ public void after() {
+ execute(afterAnnotation);
+ }
+
+ /**
+ * Invoke the afterClass methods
+ */
+ public void afterClass() {
+ execute(afterClassAnnotation);
+ }
+
+ /**
+ * Invoke the specified test method.
+ */
+ public void run(String methodName) {
+ execute(methodName);
+ }
+
+ /**
+ * Invoke the methods annotated with the specified annotation.
+ */
+ private void execute(Class<?> annotationClass) {
+ if (annotationClass == null) {
+ throw new RuntimeException(new NoSuchMethodException());
+ }
+ ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+ try {
+ // Thread.currentThread().setContextClassLoader(classLoader);
+ // Allow privileged access to set class loader. Requires RuntimePermission
+ // setContextClassLoader in security policy.
+ final ClassLoader finalClassLoader = classLoader;
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ public Object run() {
+ Thread.currentThread().setContextClassLoader(finalClassLoader);
+ return null;
+ }
+ });
+
+ for (Method method : testCaseClass.getDeclaredMethods()) {
+ for (Annotation annotation : method.getAnnotations()) {
+ if (annotation.annotationType() == annotationClass) {
+ method.invoke(testCase);
+ }
+ }
+ }
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ } finally {
+ // Thread.currentThread().setContextClassLoader(tccl);
+ // Allow privileged access to set class loader. Requires RuntimePermission
+ // setContextClassLoader in security policy.
+ final ClassLoader finaltccl = tccl;
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ public Object run() {
+ Thread.currentThread().setContextClassLoader(finaltccl);
+ return null;
+ }
+ });
+ }
+ }
+
+ /**
+ * Invoke the specified method
+ */
+ private void execute(String methodName) {
+ ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+ try {
+ // Thread.currentThread().setContextClassLoader(classLoader);
+ // Allow privileged access to set class loader. Requires RuntimePermission
+ // setContextClassLoader in security policy.
+ final ClassLoader finalClassLoader = classLoader;
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ public Object run() {
+ Thread.currentThread().setContextClassLoader(finalClassLoader);
+ return null;
+ }
+ });
+ Method setUpMethod = testCaseClass.getDeclaredMethod(methodName);
+ setUpMethod.setAccessible(true);
+ setUpMethod.invoke(testCase);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ } finally {
+ // Thread.currentThread().setContextClassLoader(tccl);
+ // Allow privileged access to set class loader. Requires RuntimePermission
+ // setContextClassLoader in security policy.
+ final ClassLoader finaltccl = tccl;
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
+ public Object run() {
+ Thread.currentThread().setContextClassLoader(finaltccl);
+ return null;
+ }
+ });
+ }
+ }
+
+}
+
diff --git a/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java b/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java
index 8c97bb9d81..769aad1940 100644
--- a/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java
+++ b/java/sca/itest/nodes/two-nodes-test/src/test/java/itest/TwoNodesTestCase.java
@@ -1,105 +1,105 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package itest;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import itest.nodes.Helloworld;
-
-import java.io.File;
-
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.oasisopen.sca.client.SCAClient;
-
-/**
- * This shows how to test the Calculator service component.
- */
-public class TwoNodesTestCase {
-
- private static Node serviceNode;
- private static Node clientNode;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled",
- "false");
- NodeFactory factory = NodeFactory.newInstance();
- NodeConfiguration configuration1 =
- factory.createNodeConfiguration().setURI("serviceNode")
- .addContribution("service", getJar("../helloworld-service/target"));
- serviceNode = factory.createNode(configuration1).start();
-
- NodeConfiguration configuration2 =
- factory.createNodeConfiguration().setURI("clientNode")
- .addContribution("client", getJar("../helloworld-client/target"));
- clientNode = factory.createNode(configuration2).start();
- }
-
- /**
- * Get the jar in the target folder without being dependent on the version name to
- * make tuscany releases easier
- */
- private static String getJar(String targetDirectory) {
- File f = new File(targetDirectory);
- for (File file : f.listFiles()) {
- if (file.getName().endsWith(".jar")) {
- return file.toURI().toString();
- }
- }
- throw new IllegalStateException("Can't find jar in: " + targetDirectory);
- }
-
- @Test
- public void testCalculator() throws Exception {
- Helloworld service = serviceNode.getService(Helloworld.class, "HelloworldService");
- assertNotNull(service);
- assertEquals("Hello Petra", service.sayHello("Petra"));
-
- Helloworld client = clientNode.getService(Helloworld.class, "HelloworldClient");
- assertNotNull(client);
- assertEquals("Hi Hello Petra", client.sayHello("Petra"));
- }
-
- @Test
- public void testCalculatorClientAPI() throws Exception {
- Helloworld service = SCAClient.getService(Helloworld.class, "HelloworldService");
- assertNotNull(service);
- assertEquals("Hello Petra", service.sayHello("Petra"));
-
- Helloworld client = SCAClient.getService(Helloworld.class, "HelloworldClient");
- assertNotNull(client);
- assertEquals("Hi Hello Petra", client.sayHello("Petra"));
- }
-
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- if (serviceNode != null) {
- serviceNode.stop();
- }
- if (clientNode != null) {
- clientNode.stop();
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package itest;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import itest.nodes.Helloworld;
+
+import java.io.File;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.oasisopen.sca.client.SCAClient;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class TwoNodesTestCase {
+
+ private static Node serviceNode;
+ private static Node clientNode;
+
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ System.setProperty("org.apache.tuscany.sca.contribution.processor.ValidationSchemaExtensionPoint.enabled",
+ "false");
+ NodeFactory factory = NodeFactory.newInstance();
+ NodeConfiguration configuration1 =
+ factory.createNodeConfiguration().setURI("serviceNode")
+ .addContribution("service", getJar("../helloworld-service/target"));
+ serviceNode = factory.createNode(configuration1).start();
+
+ NodeConfiguration configuration2 =
+ factory.createNodeConfiguration().setURI("clientNode")
+ .addContribution("client", getJar("../helloworld-client/target"));
+ clientNode = factory.createNode(configuration2).start();
+ }
+
+ /**
+ * Get the jar in the target folder without being dependent on the version name to
+ * make tuscany releases easier
+ */
+ private static String getJar(String targetDirectory) {
+ File f = new File(targetDirectory);
+ for (File file : f.listFiles()) {
+ if (file.getName().endsWith(".jar")) {
+ return file.toURI().toString();
+ }
+ }
+ throw new IllegalStateException("Can't find jar in: " + targetDirectory);
+ }
+
+ @Test
+ public void testCalculator() throws Exception {
+ Helloworld service = serviceNode.getService(Helloworld.class, "HelloworldService");
+ assertNotNull(service);
+ assertEquals("Hello Petra", service.sayHello("Petra"));
+
+ Helloworld client = clientNode.getService(Helloworld.class, "HelloworldClient");
+ assertNotNull(client);
+ assertEquals("Hi Hello Petra", client.sayHello("Petra"));
+ }
+
+ @Test
+ public void testCalculatorClientAPI() throws Exception {
+ Helloworld service = SCAClient.getService(Helloworld.class, "HelloworldService");
+ assertNotNull(service);
+ assertEquals("Hello Petra", service.sayHello("Petra"));
+
+ Helloworld client = SCAClient.getService(Helloworld.class, "HelloworldClient");
+ assertNotNull(client);
+ assertEquals("Hi Hello Petra", client.sayHello("Petra"));
+ }
+
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (serviceNode != null) {
+ serviceNode.stop();
+ }
+ if (clientNode != null) {
+ clientNode.stop();
+ }
+ }
+}
diff --git a/java/sca/itest/policies/pom.xml b/java/sca/itest/policies/pom.xml
index 4d9168ba95..daa3e395f5 100644
--- a/java/sca/itest/policies/pom.xml
+++ b/java/sca/itest/policies/pom.xml
@@ -1,59 +1,59 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-policies</artifactId>
- <name>Apache Tuscany SCA iTest Policies</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-logging</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-policies</artifactId>
+ <name>Apache Tuscany SCA iTest Policies</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy-logging</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCard.java b/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCard.java
index 2d7c9b163f..fd33be01d6 100644
--- a/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCard.java
+++ b/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCard.java
@@ -1,65 +1,65 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.policies;
-
-import java.io.Serializable;
-
-/**
- * Credit Card
- */
-public class CreditCard implements Serializable {
- private static final long serialVersionUID = -6107293191546007197L;
- private String type;
- private String number;
- private String owner;
- private int expMonth;
- private int expYear;
-
- public String getType() {
- return type;
- }
- public void setType(String type) {
- this.type = type;
- }
- public String getNumber() {
- return number;
- }
- public void setNumber(String number) {
- this.number = number;
- }
- public String getOwner() {
- return owner;
- }
- public void setOwner(String owner) {
- this.owner = owner;
- }
- public int getExpMonth() {
- return expMonth;
- }
- public void setExpMonth(int expMonth) {
- this.expMonth = expMonth;
- }
- public int getExpYear() {
- return expYear;
- }
- public void setExpYear(int expYear) {
- this.expYear = expYear;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.policies;
+
+import java.io.Serializable;
+
+/**
+ * Credit Card
+ */
+public class CreditCard implements Serializable {
+ private static final long serialVersionUID = -6107293191546007197L;
+ private String type;
+ private String number;
+ private String owner;
+ private int expMonth;
+ private int expYear;
+
+ public String getType() {
+ return type;
+ }
+ public void setType(String type) {
+ this.type = type;
+ }
+ public String getNumber() {
+ return number;
+ }
+ public void setNumber(String number) {
+ this.number = number;
+ }
+ public String getOwner() {
+ return owner;
+ }
+ public void setOwner(String owner) {
+ this.owner = owner;
+ }
+ public int getExpMonth() {
+ return expMonth;
+ }
+ public void setExpMonth(int expMonth) {
+ this.expMonth = expMonth;
+ }
+ public int getExpYear() {
+ return expYear;
+ }
+ public void setExpYear(int expYear) {
+ this.expYear = expYear;
+ }
+}
diff --git a/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCardPayment.java b/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCardPayment.java
index 14b7c06d41..368179dc29 100644
--- a/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCardPayment.java
+++ b/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CreditCardPayment.java
@@ -1,37 +1,37 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.policies;
-
-import org.oasisopen.sca.annotation.Authentication;
-import org.oasisopen.sca.annotation.Confidentiality;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- *
- */
-@Remotable
-@Authentication
-public interface CreditCardPayment {
- String COMPLETED = "Completed";
- String REJECTED = "Rejected";
-
- @Confidentiality
- String authorize(CreditCard creditCard, float amount);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.policies;
+
+import org.oasisopen.sca.annotation.Authentication;
+import org.oasisopen.sca.annotation.Confidentiality;
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ *
+ */
+@Remotable
+@Authentication
+public interface CreditCardPayment {
+ String COMPLETED = "Completed";
+ String REJECTED = "Rejected";
+
+ @Confidentiality
+ String authorize(CreditCard creditCard, float amount);
+}
diff --git a/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Customer.java b/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Customer.java
index c4c4688288..05ea341466 100644
--- a/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Customer.java
+++ b/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Customer.java
@@ -1,51 +1,51 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.policies;
-
-import java.io.Serializable;
-
-/**
- * Customer
- */
-public class Customer implements Serializable {
- private static final long serialVersionUID = 680227659536711695L;
- private String id;
- private String name;
- private CreditCard creditCard;
-
- public String getId() {
- return id;
- }
- public void setId(String id) {
- this.id = id;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public CreditCard getCreditCard() {
- return creditCard;
- }
- public void setCreditCard(CreditCard creditCard) {
- this.creditCard = creditCard;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.policies;
+
+import java.io.Serializable;
+
+/**
+ * Customer
+ */
+public class Customer implements Serializable {
+ private static final long serialVersionUID = 680227659536711695L;
+ private String id;
+ private String name;
+ private CreditCard creditCard;
+
+ public String getId() {
+ return id;
+ }
+ public void setId(String id) {
+ this.id = id;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public CreditCard getCreditCard() {
+ return creditCard;
+ }
+ public void setCreditCard(CreditCard creditCard) {
+ this.creditCard = creditCard;
+ }
+}
diff --git a/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CustomerRegistry.java b/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CustomerRegistry.java
index ef59dea27d..c9f50d08ee 100644
--- a/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CustomerRegistry.java
+++ b/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/CustomerRegistry.java
@@ -1,27 +1,27 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.policies;
-
-/**
- *
- */
-public interface CustomerRegistry {
- Customer find(String id);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.policies;
+
+/**
+ *
+ */
+public interface CustomerRegistry {
+ Customer find(String id);
+}
diff --git a/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Payment.java b/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Payment.java
index 849bf19863..cc7c555aff 100644
--- a/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Payment.java
+++ b/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/Payment.java
@@ -1,30 +1,30 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.policies;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- *
- */
-@Remotable
-public interface Payment {
- String charge(String customerID, float amount);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.policies;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ *
+ */
+@Remotable
+public interface Payment {
+ String charge(String customerID, float amount);
+}
diff --git a/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CreditCardPaymentImpl.java b/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CreditCardPaymentImpl.java
index 978d3316e8..01cc8ac636 100644
--- a/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CreditCardPaymentImpl.java
+++ b/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CreditCardPaymentImpl.java
@@ -1,40 +1,40 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.policies.impl;
-
-import org.apache.tuscany.sca.itest.policies.CreditCard;
-import org.apache.tuscany.sca.itest.policies.CreditCardPayment;
-
-/**
- *
- */
-public class CreditCardPaymentImpl implements CreditCardPayment {
-
- public String authorize(CreditCard creditCard, float amount) {
- System.out.println(creditCard.getType() + " " + creditCard.getNumber());
- System.out.println(amount);
- if (amount < 200f) {
- return COMPLETED;
- } else {
- return REJECTED;
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.policies.impl;
+
+import org.apache.tuscany.sca.itest.policies.CreditCard;
+import org.apache.tuscany.sca.itest.policies.CreditCardPayment;
+
+/**
+ *
+ */
+public class CreditCardPaymentImpl implements CreditCardPayment {
+
+ public String authorize(CreditCard creditCard, float amount) {
+ System.out.println(creditCard.getType() + " " + creditCard.getNumber());
+ System.out.println(amount);
+ if (amount < 200f) {
+ return COMPLETED;
+ } else {
+ return REJECTED;
+ }
+ }
+
+}
diff --git a/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CustomerRegistryImpl.java b/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CustomerRegistryImpl.java
index 381ef4f239..943720451f 100644
--- a/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CustomerRegistryImpl.java
+++ b/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/CustomerRegistryImpl.java
@@ -1,78 +1,78 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.policies.impl;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.itest.policies.CreditCard;
-import org.apache.tuscany.sca.itest.policies.Customer;
-import org.apache.tuscany.sca.itest.policies.CustomerRegistry;
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-/**
- *
- */
-@Service(CustomerRegistry.class)
-@Scope("COMPOSITE")
-public class CustomerRegistryImpl implements CustomerRegistry {
- private Map<String, Customer> customers = new HashMap<String, Customer>();
-
-
- @Init
- public void init() {
- Customer c1 = new Customer();
- c1.setId("001");
- c1.setName("John Smith");
- CreditCard creditCard = new CreditCard();
- creditCard.setNumber("1234-5678-1234");
- creditCard.setType("Visa");
- creditCard.setOwner("John Smith");
- creditCard.setExpMonth(6);
- creditCard.setExpYear(2015);
- c1.setCreditCard(creditCard);
- customers.put(c1.getId(), c1);
-
- Customer c2 = new Customer();
- c2.setId("002");
- c2.setName("Jane Smith");
- creditCard = new CreditCard();
- creditCard.setNumber("1234-5678-5678");
- creditCard.setType("MasterCard");
- creditCard.setOwner("Jane Smith");
- creditCard.setExpMonth(9);
- creditCard.setExpYear(2012);
- c2.setCreditCard(creditCard);
- customers.put(c2.getId(), c2);
- }
-
- public Customer find(String id) {
- return customers.get(id);
- }
-
- @Destroy
- public void destroy() {
- customers.clear();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.policies.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.tuscany.sca.itest.policies.CreditCard;
+import org.apache.tuscany.sca.itest.policies.Customer;
+import org.apache.tuscany.sca.itest.policies.CustomerRegistry;
+import org.oasisopen.sca.annotation.Destroy;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ *
+ */
+@Service(CustomerRegistry.class)
+@Scope("COMPOSITE")
+public class CustomerRegistryImpl implements CustomerRegistry {
+ private Map<String, Customer> customers = new HashMap<String, Customer>();
+
+
+ @Init
+ public void init() {
+ Customer c1 = new Customer();
+ c1.setId("001");
+ c1.setName("John Smith");
+ CreditCard creditCard = new CreditCard();
+ creditCard.setNumber("1234-5678-1234");
+ creditCard.setType("Visa");
+ creditCard.setOwner("John Smith");
+ creditCard.setExpMonth(6);
+ creditCard.setExpYear(2015);
+ c1.setCreditCard(creditCard);
+ customers.put(c1.getId(), c1);
+
+ Customer c2 = new Customer();
+ c2.setId("002");
+ c2.setName("Jane Smith");
+ creditCard = new CreditCard();
+ creditCard.setNumber("1234-5678-5678");
+ creditCard.setType("MasterCard");
+ creditCard.setOwner("Jane Smith");
+ creditCard.setExpMonth(9);
+ creditCard.setExpYear(2012);
+ c2.setCreditCard(creditCard);
+ customers.put(c2.getId(), c2);
+ }
+
+ public Customer find(String id) {
+ return customers.get(id);
+ }
+
+ @Destroy
+ public void destroy() {
+ customers.clear();
+ }
+
+}
diff --git a/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/PaymentImpl.java b/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/PaymentImpl.java
index 4bda0d5e95..b712b99388 100644
--- a/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/PaymentImpl.java
+++ b/java/sca/itest/policies/src/main/java/org/apache/tuscany/sca/itest/policies/impl/PaymentImpl.java
@@ -1,54 +1,54 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.policies.impl;
-
-import org.apache.tuscany.sca.itest.policies.CreditCard;
-import org.apache.tuscany.sca.itest.policies.CreditCardPayment;
-import org.apache.tuscany.sca.itest.policies.Customer;
-import org.apache.tuscany.sca.itest.policies.CustomerRegistry;
-import org.apache.tuscany.sca.itest.policies.Payment;
-import org.apache.tuscany.sca.policy.logging.Logging;
-import org.oasisopen.sca.annotation.Authentication;
-import org.oasisopen.sca.annotation.Confidentiality;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Requires;
-
-/**
- *
- */
-@Logging
-public class PaymentImpl implements Payment {
-
- @Reference
- protected CustomerRegistry customerRegistry;
-
- @Reference
- @Authentication
- @Requires({Confidentiality.CONFIDENTIALITY_MESSAGE, Confidentiality.CONFIDENTIALITY_TRANSPORT})
- protected CreditCardPayment creditCardPayment;
-
- public String charge(String customerID, float amount) {
- Customer customer = customerRegistry.find(customerID);
- CreditCard creditCard = customer.getCreditCard();
- String status = creditCardPayment.authorize(creditCard, amount);
- return status;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.policies.impl;
+
+import org.apache.tuscany.sca.itest.policies.CreditCard;
+import org.apache.tuscany.sca.itest.policies.CreditCardPayment;
+import org.apache.tuscany.sca.itest.policies.Customer;
+import org.apache.tuscany.sca.itest.policies.CustomerRegistry;
+import org.apache.tuscany.sca.itest.policies.Payment;
+import org.apache.tuscany.sca.policy.logging.Logging;
+import org.oasisopen.sca.annotation.Authentication;
+import org.oasisopen.sca.annotation.Confidentiality;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Requires;
+
+/**
+ *
+ */
+@Logging
+public class PaymentImpl implements Payment {
+
+ @Reference
+ protected CustomerRegistry customerRegistry;
+
+ @Reference
+ @Authentication
+ @Requires({Confidentiality.CONFIDENTIALITY_MESSAGE, Confidentiality.CONFIDENTIALITY_TRANSPORT})
+ protected CreditCardPayment creditCardPayment;
+
+ public String charge(String customerID, float amount) {
+ Customer customer = customerRegistry.find(customerID);
+ CreditCard creditCard = customer.getCreditCard();
+ String status = creditCardPayment.authorize(creditCard, amount);
+ return status;
+ }
+
+}
diff --git a/java/sca/itest/policies/src/main/resources/Customer.composite b/java/sca/itest/policies/src/main/resources/Customer.composite
index f38f5fe7f4..2a8f598b90 100644
--- a/java/sca/itest/policies/src/main/resources/Customer.composite
+++ b/java/sca/itest/policies/src/main/resources/Customer.composite
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:c="http://customer"
- targetNamespace="http://customer"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- name="Customer">
-
- <service name="Registry" promote="CustomerRegistry" requires="tuscany:logging">
- <binding.sca/>
- </service>
-
- <component name="CustomerRegistry">
- <implementation.java class="org.apache.tuscany.sca.itest.policies.impl.CustomerRegistryImpl" />
- </component>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:c="http://customer"
+ targetNamespace="http://customer"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ name="Customer">
+
+ <service name="Registry" promote="CustomerRegistry" requires="tuscany:logging">
+ <binding.sca/>
+ </service>
+
+ <component name="CustomerRegistry">
+ <implementation.java class="org.apache.tuscany.sca.itest.policies.impl.CustomerRegistryImpl" />
+ </component>
+
</composite> \ No newline at end of file
diff --git a/java/sca/itest/policies/src/main/resources/LoggingMessages.properties b/java/sca/itest/policies/src/main/resources/LoggingMessages.properties
index 09c0e7565d..ada808be0e 100644
--- a/java/sca/itest/policies/src/main/resources/LoggingMessages.properties
+++ b/java/sca/itest/policies/src/main/resources/LoggingMessages.properties
@@ -1,16 +1,16 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT 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/java/sca/itest/policies/src/main/resources/META-INF/definitions.xml b/java/sca/itest/policies/src/main/resources/META-INF/definitions.xml
index 9e8084ffcf..8ac31d5f56 100644
--- a/java/sca/itest/policies/src/main/resources/META-INF/definitions.xml
+++ b/java/sca/itest/policies/src/main/resources/META-INF/definitions.xml
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
-
- <policySet name="JDKLoggingPolicy"
- provides="tuscany:logging"
- appliesTo="//binding | //implementation">
- <tuscany:jdkLogger name="test.logger">
- <tuscany:logLevel>FINE</tuscany:logLevel>
- <tuscany:resourceBundle>LoggingMessages.properties</tuscany:resourceBundle>
- </tuscany:jdkLogger>
-
- </policySet>
-
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
+
+ <policySet name="JDKLoggingPolicy"
+ provides="tuscany:logging"
+ appliesTo="//binding | //implementation">
+ <tuscany:jdkLogger name="test.logger">
+ <tuscany:logLevel>FINE</tuscany:logLevel>
+ <tuscany:resourceBundle>LoggingMessages.properties</tuscany:resourceBundle>
+ </tuscany:jdkLogger>
+
+ </policySet>
+
</definitions> \ No newline at end of file
diff --git a/java/sca/itest/policies/src/main/resources/META-INF/sca-contribution.xml b/java/sca/itest/policies/src/main/resources/META-INF/sca-contribution.xml
index ca9ae2f775..be63597c12 100644
--- a/java/sca/itest/policies/src/main/resources/META-INF/sca-contribution.xml
+++ b/java/sca/itest/policies/src/main/resources/META-INF/sca-contribution.xml
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:p="http://payment">
- <deployable composite="p:Payment" />
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:p="http://payment">
+ <deployable composite="p:Payment" />
</contribution> \ No newline at end of file
diff --git a/java/sca/itest/policies/src/main/resources/Payment.composite b/java/sca/itest/policies/src/main/resources/Payment.composite
index 2b50c6a32a..df54d0c1c2 100644
--- a/java/sca/itest/policies/src/main/resources/Payment.composite
+++ b/java/sca/itest/policies/src/main/resources/Payment.composite
@@ -1,49 +1,49 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:p="http://payment"
- xmlns:c="http://customer"
- xmlns:sca = "http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- requires = "sca:authorization"
- targetNamespace="http://payment"
- name="Payment">
-
- <component name="Payment">
- <implementation.java class="org.apache.tuscany.sca.itest.policies.impl.PaymentImpl" />
- <reference name="creditCardPayment" target="CreditCardPayment">
- <binding.sca requires="sca:integrity tuscany:logging">
- </binding.sca>
- </reference>
- <reference name="customerRegistry" target="Customer/Registry" requires="sca:suspendsTransaction tuscany:logging"/>
- </component>
-
- <component name="CreditCardPayment">
- <implementation.java class="org.apache.tuscany.sca.itest.policies.impl.CreditCardPaymentImpl" />
- </component>
-
- <component name="Customer">
- <implementation.composite name="c:Customer" requires="sca:managedTransaction.global"/>
- <service name="Registry" requires="sca:suspendsTransaction">
- <binding.sca/>
- </service>
- </component>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:p="http://payment"
+ xmlns:c="http://customer"
+ xmlns:sca = "http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ requires = "sca:authorization"
+ targetNamespace="http://payment"
+ name="Payment">
+
+ <component name="Payment">
+ <implementation.java class="org.apache.tuscany.sca.itest.policies.impl.PaymentImpl" />
+ <reference name="creditCardPayment" target="CreditCardPayment">
+ <binding.sca requires="sca:integrity tuscany:logging">
+ </binding.sca>
+ </reference>
+ <reference name="customerRegistry" target="Customer/Registry" requires="sca:suspendsTransaction tuscany:logging"/>
+ </component>
+
+ <component name="CreditCardPayment">
+ <implementation.java class="org.apache.tuscany.sca.itest.policies.impl.CreditCardPaymentImpl" />
+ </component>
+
+ <component name="Customer">
+ <implementation.composite name="c:Customer" requires="sca:managedTransaction.global"/>
+ <service name="Registry" requires="sca:suspendsTransaction">
+ <binding.sca/>
+ </service>
+ </component>
+
</composite> \ No newline at end of file
diff --git a/java/sca/itest/policies/src/test/java/org/apache/tuscany/sca/itest/policies/PaymentTestCase.java b/java/sca/itest/policies/src/test/java/org/apache/tuscany/sca/itest/policies/PaymentTestCase.java
index 1845656c2d..3385ee9071 100644
--- a/java/sca/itest/policies/src/test/java/org/apache/tuscany/sca/itest/policies/PaymentTestCase.java
+++ b/java/sca/itest/policies/src/test/java/org/apache/tuscany/sca/itest/policies/PaymentTestCase.java
@@ -1,69 +1,69 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.itest.policies;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class PaymentTestCase {
- private static Node node;
-
- @BeforeClass
- public static void init() throws Exception {
- try {
- String location = ContributionLocationHelper.getContributionLocation("Payment.composite");
- node = NodeFactory.newInstance().createNode(new Contribution("c1", location));
- node.start();
- } catch (Exception e) {
- e.printStackTrace();
- throw e;
- }
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- if (node != null) {
- node.stop();
- }
- }
-
- @Test
- public void testPayment() {
- Payment payment = node.getService(Payment.class, "Payment");
- String status = payment.charge("001", 100f);
- Assert.assertEquals(CreditCardPayment.COMPLETED, status);
-
- status = payment.charge("002", 300f);
- Assert.assertEquals(CreditCardPayment.REJECTED, status);
- }
-
- public static void main(String[] args) throws Exception {
- PaymentTestCase.init();
- PaymentTestCase tester = new PaymentTestCase();
- tester.testPayment();
- PaymentTestCase.destroy();
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.policies;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class PaymentTestCase {
+ private static Node node;
+
+ @BeforeClass
+ public static void init() throws Exception {
+ try {
+ String location = ContributionLocationHelper.getContributionLocation("Payment.composite");
+ node = NodeFactory.newInstance().createNode(new Contribution("c1", location));
+ node.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw e;
+ }
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+ @Test
+ public void testPayment() {
+ Payment payment = node.getService(Payment.class, "Payment");
+ String status = payment.charge("001", 100f);
+ Assert.assertEquals(CreditCardPayment.COMPLETED, status);
+
+ status = payment.charge("002", 300f);
+ Assert.assertEquals(CreditCardPayment.REJECTED, status);
+ }
+
+ public static void main(String[] args) throws Exception {
+ PaymentTestCase.init();
+ PaymentTestCase tester = new PaymentTestCase();
+ tester.testPayment();
+ PaymentTestCase.destroy();
+ }
+}
diff --git a/java/sca/itest/properties/pom.xml b/java/sca/itest/properties/pom.xml
index a42f2e3a97..958c1b1a55 100644
--- a/java/sca/itest/properties/pom.xml
+++ b/java/sca/itest/properties/pom.xml
@@ -1,106 +1,106 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-itest</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>itest-properties</artifactId>
- <name>Apache Tuscany SCA iTest Properties</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <!-- XPathFactory -->
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.7.1</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-databinding</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-sdo</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding-jaxb</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.tuscany.sdo</groupId>
- <artifactId>tuscany-sdo-plugin</artifactId>
- <version>1.1.1</version>
- <executions>
- <execution>
- <id>generate-customer-sdo</id>
- <phase>generate-sources</phase>
- <configuration>
- <schemaFile>${basedir}/src/main/resources/customer.xsd</schemaFile>
- <javaPackage>com.example.customer.sdo</javaPackage>
- <noNotification>true</noNotification>
- <noContainer>true</noContainer>
- <noUnsettable>true</noUnsettable>
- </configuration>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-itest</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>itest-properties</artifactId>
+ <name>Apache Tuscany SCA iTest Properties</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- XPathFactory -->
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.7.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-databinding</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-sdo</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding-jaxb</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>tuscany-sdo-plugin</artifactId>
+ <version>1.1.1</version>
+ <executions>
+ <execution>
+ <id>generate-customer-sdo</id>
+ <phase>generate-sources</phase>
+ <configuration>
+ <schemaFile>${basedir}/src/main/resources/customer.xsd</schemaFile>
+ <javaPackage>com.example.customer.sdo</javaPackage>
+ <noNotification>true</noNotification>
+ <noContainer>true</noContainer>
+ <noUnsettable>true</noUnsettable>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java b/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java
index 87f87d6c22..1642ab55f5 100644
--- a/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java
+++ b/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/ComplexPropertyBean.java
@@ -1,151 +1,151 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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;
-
-/**
- * This is a Java Bean which has setter and getter methods for for the variables used in the property tests.
- */
-public class ComplexPropertyBean {
-
- /**
- * Variable declarations
- */
- protected int integerNumber = 25;
- protected float floatNumber = 50;
- protected double doubleNumber = 75;
- protected int[] intArray = null;
- protected double[] doubleArray = null;
- protected String[] stringArray = null;
-
- ComplexPropertyBean numberSet;
- protected ComplexPropertyBean[] numberSetArray = null;
-
- public ComplexPropertyBean() {
-
- }
-
- public double getDoubleNumber() {
- return doubleNumber;
- }
-
- /**
- * It is a setter method to set a value for the variable doubleNumber
- */
- public void setDoubleNumber(double doubleNumber) {
- this.doubleNumber = doubleNumber;
- }
-
- /**
- * It is a getter method to get a value for the variable floatNumber
- */
- public float getFloatNumber() {
- return floatNumber;
- }
-
- /**
- * It is a setter method to set a value for the variable floatNumber
- */
- public void setFloatNumber(float floatNumber) {
- this.floatNumber = floatNumber;
- }
-
- /**
- * It is a getter method to get a value for the variable floatNumber
- */
- public int getIntegerNumber() {
- return integerNumber;
- }
-
- /**
- * It is a getter method to get a value for the variable integerNumber
- */
- public void setIntegerNumber(int integerNumber) {
- this.integerNumber = integerNumber;
- }
-
- /**
- * It is a getter method to set a value for the variable numberSet
- */
- public ComplexPropertyBean getNumberSet() {
- return numberSet;
- }
-
- /**
- * It is a setter method to set a value for the variable numberSet
- */
- public void setNumberSet(ComplexPropertyBean numberSet) {
- this.numberSet = numberSet;
- }
-
- /**
- * It is a method which implements toString() function
- */
-
- public String toString() {
- return Double.toString(integerNumber) + " - "
- + Double.toString(floatNumber)
- + " - "
- + Double.toString(doubleNumber)
- + " \n"
- + ((intArray == null) ? "" : intArray[0] + " - " + intArray[1] + " \n ")
- + ((doubleArray == null) ? "" : doubleArray[0] + " - " + doubleArray[1] + " \n ")
- + ((stringArray == null) ? "" : stringArray[0] + " - " + stringArray[1] + " \n ")
- + ((numberSetArray == null) ? "" : numberSetArray[0] + " - " + numberSetArray[1] + " \n ")
- + ((numberSet == null) ? "" : numberSet.toString());
- }
-
- /**
- * It is a setter method to set values for the variable stringArray
- */
- public String[] getStringArray() {
- return stringArray;
- }
-
- /**
- * It is a setter method to set values for the variable stringArray
- */
- public void setStringArray(String[] stringArray) {
- this.stringArray = stringArray;
- }
-
- public int[] getIntArray() {
- return intArray;
- }
-
- public void setIntArray(int[] intArray) {
- this.intArray = intArray;
- }
-
- public double[] getDoubleArray() {
- return doubleArray;
- }
-
- public void setDoubleArray(double[] doubleArray) {
- this.doubleArray = doubleArray;
- }
-
- public ComplexPropertyBean[] getNumberSetArray() {
- return numberSetArray;
- }
-
- public void setNumberSetArray(ComplexPropertyBean[] numberSetArray) {
- this.numberSetArray = numberSetArray;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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;
+
+/**
+ * This is a Java Bean which has setter and getter methods for for the variables used in the property tests.
+ */
+public class ComplexPropertyBean {
+
+ /**
+ * Variable declarations
+ */
+ protected int integerNumber = 25;
+ protected float floatNumber = 50;
+ protected double doubleNumber = 75;
+ protected int[] intArray = null;
+ protected double[] doubleArray = null;
+ protected String[] stringArray = null;
+
+ ComplexPropertyBean numberSet;
+ protected ComplexPropertyBean[] numberSetArray = null;
+
+ public ComplexPropertyBean() {
+
+ }
+
+ public double getDoubleNumber() {
+ return doubleNumber;
+ }
+
+ /**
+ * It is a setter method to set a value for the variable doubleNumber
+ */
+ public void setDoubleNumber(double doubleNumber) {
+ this.doubleNumber = doubleNumber;
+ }
+
+ /**
+ * It is a getter method to get a value for the variable floatNumber
+ */
+ public float getFloatNumber() {
+ return floatNumber;
+ }
+
+ /**
+ * It is a setter method to set a value for the variable floatNumber
+ */
+ public void setFloatNumber(float floatNumber) {
+ this.floatNumber = floatNumber;
+ }
+
+ /**
+ * It is a getter method to get a value for the variable floatNumber
+ */
+ public int getIntegerNumber() {
+ return integerNumber;
+ }
+
+ /**
+ * It is a getter method to get a value for the variable integerNumber
+ */
+ public void setIntegerNumber(int integerNumber) {
+ this.integerNumber = integerNumber;
+ }
+
+ /**
+ * It is a getter method to set a value for the variable numberSet
+ */
+ public ComplexPropertyBean getNumberSet() {
+ return numberSet;
+ }
+
+ /**
+ * It is a setter method to set a value for the variable numberSet
+ */
+ public void setNumberSet(ComplexPropertyBean numberSet) {
+ this.numberSet = numberSet;
+ }
+
+ /**
+ * It is a method which implements toString() function
+ */
+
+ public String toString() {
+ return Double.toString(integerNumber) + " - "
+ + Double.toString(floatNumber)
+ + " - "
+ + Double.toString(doubleNumber)
+ + " \n"
+ + ((intArray == null) ? "" : intArray[0] + " - " + intArray[1] + " \n ")
+ + ((doubleArray == null) ? "" : doubleArray[0] + " - " + doubleArray[1] + " \n ")
+ + ((stringArray == null) ? "" : stringArray[0] + " - " + stringArray[1] + " \n ")
+ + ((numberSetArray == null) ? "" : numberSetArray[0] + " - " + numberSetArray[1] + " \n ")
+ + ((numberSet == null) ? "" : numberSet.toString());
+ }
+
+ /**
+ * It is a setter method to set values for the variable stringArray
+ */
+ public String[] getStringArray() {
+ return stringArray;
+ }
+
+ /**
+ * It is a setter method to set values for the variable stringArray
+ */
+ public void setStringArray(String[] stringArray) {
+ this.stringArray = stringArray;
+ }
+
+ public int[] getIntArray() {
+ return intArray;
+ }
+
+ public void setIntArray(int[] intArray) {
+ this.intArray = intArray;
+ }
+
+ public double[] getDoubleArray() {
+ return doubleArray;
+ }
+
+ public void setDoubleArray(double[] doubleArray) {
+ this.doubleArray = doubleArray;
+ }
+
+ public ComplexPropertyBean[] getNumberSetArray() {
+ return numberSetArray;
+ }
+
+ public void setNumberSetArray(ComplexPropertyBean[] numberSetArray) {
+ this.numberSetArray = numberSetArray;
+ }
+}
diff --git a/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java b/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
index 5217ede572..616d59bd50 100644
--- a/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
+++ b/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponent.java
@@ -1,135 +1,135 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.util.Collection;
-
-import test.jaxb.props.ReturnCodeProperties;
-
-import commonj.sdo.DataObject;
-
-/**
- * It is an Interface which has method declarations. Methods which are to be accessed as a service are declared in this
- * interface. Implementation for these methods is provided in PropertyComponentImpl Class
- */
-public interface PropertyComponent {
-
- /**
- * This is a method to get a value for a property name 'location' from the SCA runtime environment. It is
- * implemented in the class PropertyComponentImpl
- */
- public String getLocation();
-
- /**
- * This is a method to get a value for a property name 'year' from the SCA runtime environment. It is implemented in
- * the class PropertyComponentImpl
- */
- public String getYear();
-
- /**
- * This method is used to test injecting a primitive String Array
- *
- * @return The injected array
- */
- public String[] getDaysOfTheWeek();
-
- /**
- * This method is used to test injecting an Object Integer Array
- *
- * @return The injected array
- */
- public Integer[] getIntegerNumbers();
-
- /**
- * This method is used to test injecting an int Array
- *
- * @return The injected array
- */
- public int[] getIntNumbers();
-
- /**
- * This method is used to test injecting an Object Array
- *
- * @return The injected array
- */
- public DataObject[] getSdoArrayProperty();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * PropertyComponentImpl
- */
-
- public ComplexPropertyBean getComplexPropertyOne();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * PropertyComponentImpl
- */
- public ComplexPropertyBean getComplexPropertyTwo();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * PropertyComponentImpl
- */
- public ComplexPropertyBean getComplexPropertyThree();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * PropertyComponentImpl
- */
- public Collection<ComplexPropertyBean> getComplexPropertyFour();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * PropertyComponentImpl
- */
-
- public ComplexPropertyBean getComplexPropertyFive();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * PropertyComponentImpl
- */
- public DataObject getSdoProperty();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * PropertyComponentImpl
- */
- public DataObject getCustomerSdo();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * PropertyComponentImpl
- */
- public ReturnCodeProperties getComplexJAXBPropertyOne();
-
- /**
- * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
- * PropertyComponentImpl
- */
- public ReturnCodeProperties getComplexJAXBPropertyTwo();
-
- /**
- * @return
- */
- public String getLocationFromComponentContext();
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.util.Collection;
+
+import test.jaxb.props.ReturnCodeProperties;
+
+import commonj.sdo.DataObject;
+
+/**
+ * It is an Interface which has method declarations. Methods which are to be accessed as a service are declared in this
+ * interface. Implementation for these methods is provided in PropertyComponentImpl Class
+ */
+public interface PropertyComponent {
+
+ /**
+ * This is a method to get a value for a property name 'location' from the SCA runtime environment. It is
+ * implemented in the class PropertyComponentImpl
+ */
+ public String getLocation();
+
+ /**
+ * This is a method to get a value for a property name 'year' from the SCA runtime environment. It is implemented in
+ * the class PropertyComponentImpl
+ */
+ public String getYear();
+
+ /**
+ * This method is used to test injecting a primitive String Array
+ *
+ * @return The injected array
+ */
+ public String[] getDaysOfTheWeek();
+
+ /**
+ * This method is used to test injecting an Object Integer Array
+ *
+ * @return The injected array
+ */
+ public Integer[] getIntegerNumbers();
+
+ /**
+ * This method is used to test injecting an int Array
+ *
+ * @return The injected array
+ */
+ public int[] getIntNumbers();
+
+ /**
+ * This method is used to test injecting an Object Array
+ *
+ * @return The injected array
+ */
+ public DataObject[] getSdoArrayProperty();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+
+ public ComplexPropertyBean getComplexPropertyOne();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public ComplexPropertyBean getComplexPropertyTwo();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public ComplexPropertyBean getComplexPropertyThree();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public Collection<ComplexPropertyBean> getComplexPropertyFour();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+
+ public ComplexPropertyBean getComplexPropertyFive();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public DataObject getSdoProperty();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public DataObject getCustomerSdo();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public ReturnCodeProperties getComplexJAXBPropertyOne();
+
+ /**
+ * This is a method to get a property value from the SCA runtime environment. It is implemented in the class
+ * PropertyComponentImpl
+ */
+ public ReturnCodeProperties getComplexJAXBPropertyTwo();
+
+ /**
+ * @return
+ */
+ public String getLocationFromComponentContext();
+
+}
diff --git a/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java b/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
index 5f8f28e46a..da04b1b12a 100644
--- a/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
+++ b/java/sca/itest/properties/src/main/java/org/apache/tuscany/sca/itest/PropertyComponentImpl.java
@@ -1,188 +1,188 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.util.Collection;
-
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Property;
-
-import test.jaxb.props.ReturnCodeProperties;
-
-import com.example.customer.sdo.impl.CustomerImpl;
-import commonj.sdo.DataObject;
-
-/**
- * This class Implements the interface PropertyComponent and gives implementation for all methods which are declared in
- * that interface.
- */
-public class PropertyComponentImpl implements PropertyComponent {
- @Context
- protected ComponentContext context;
-
- @Property
- protected CustomerImpl customerSdo;
-
- @Property
- protected DataObject sdoProperty;
-
- @Property
- protected ComplexPropertyBean complexPropertyOne;
-
- @Property
- protected ComplexPropertyBean complexPropertyTwo;
-
- @Property
- protected ComplexPropertyBean complexPropertyThree;
-
- @Property
- protected Collection<ComplexPropertyBean> complexPropertyFour;
-
- @Property
- protected ComplexPropertyBean complexPropertyFive;
-
- @Property(name = "location")
- protected String location;
-
- @Property(name = "year")
- protected String year;
-
- @Property(name = "daysOfTheWeek")
- protected String[] daysOfTheWeek;
-
- @Property(name = "integerNumbers")
- protected Integer[] integerNumbers;
-
- @Property(name = "intNumbers")
- protected int[] intNumbers;
-
- @Property(name = "sdoArray")
- protected DataObject[] sdoArray;
-
- @Property
- protected ReturnCodeProperties complexJAXBPropertyOne;
-
- @Property
- protected ReturnCodeProperties complexJAXBPropertyTwo;
-
- public String getLocation() {
- return location;
- }
-
- public String getYear() {
- return year;
- }
-
- public ComplexPropertyBean getComplexPropertyOne() {
- //System.out.println(complexPropertyOne);
- return complexPropertyOne;
- }
-
- public ComplexPropertyBean getComplexPropertyTwo() {
- //System.out.println(complexPropertyTwo);
- return complexPropertyTwo;
- }
-
- public ComplexPropertyBean getComplexPropertyThree() {
- //System.out.println(complexPropertyThree);
- return complexPropertyThree;
- }
-
- public Collection<ComplexPropertyBean> getComplexPropertyFour() {
- //System.out.println(complexPropertyThree);
- return complexPropertyFour;
- }
-
- public ComplexPropertyBean getComplexPropertyFive() {
- return complexPropertyFive;
- }
-
- public DataObject getSdoProperty() {
- return sdoProperty;
- }
-
- /**
- * It is a method which injects the property value to the variable 'sdoProperty' from the SCA runtime environment.
- */
- public void setSdoProperty(DataObject sdoProperty) {
- System.out.println("Reached here da machi");
- this.sdoProperty = sdoProperty;
- }
-
- public CustomerImpl getCustomerSdo() {
- return customerSdo;
- }
-
- /**
- * It is a method which injects the property value to the variable 'customerSdo' from the SCA runtime environment.
- */
- public void setCustomerSdo(CustomerImpl customerSdo) {
- this.customerSdo = customerSdo;
- }
-
- /**
- * This method is used to test injecting an Array
- *
- * @return The injected array
- */
- public String[] getDaysOfTheWeek() {
- return daysOfTheWeek;
- }
-
- /**
- * This method is used to test injecting an Object Integer Array
- *
- * @return The injected array
- */
- public Integer[] getIntegerNumbers() {
- return integerNumbers;
- }
-
- /**
- * This method is used to test injecting an int Array
- *
- * @return The injected array
- */
- public int[] getIntNumbers() {
- return intNumbers;
- }
-
- /**
- * This method is used to test injecting an Object Array
- *
- * @return The injected array
- */
- public DataObject[] getSdoArrayProperty() {
- return sdoArray;
- }
-
- public String getLocationFromComponentContext() {
- return context.getProperty(String.class, "location");
- }
-
- public ReturnCodeProperties getComplexJAXBPropertyOne() {
- return complexJAXBPropertyOne;
- }
-
- public ReturnCodeProperties getComplexJAXBPropertyTwo() {
- return complexJAXBPropertyTwo;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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.util.Collection;
+
+import org.oasisopen.sca.ComponentContext;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.Property;
+
+import test.jaxb.props.ReturnCodeProperties;
+
+import com.example.customer.sdo.impl.CustomerImpl;
+import commonj.sdo.DataObject;
+
+/**
+ * This class Implements the interface PropertyComponent and gives implementation for all methods which are declared in
+ * that interface.
+ */
+public class PropertyComponentImpl implements PropertyComponent {
+ @Context
+ protected ComponentContext context;
+
+ @Property
+ protected CustomerImpl customerSdo;
+
+ @Property
+ protected DataObject sdoProperty;
+
+ @Property
+ protected ComplexPropertyBean complexPropertyOne;
+
+ @Property
+ protected ComplexPropertyBean complexPropertyTwo;
+
+ @Property
+ protected ComplexPropertyBean complexPropertyThree;
+
+ @Property
+ protected Collection<ComplexPropertyBean> complexPropertyFour;
+
+ @Property
+ protected ComplexPropertyBean complexPropertyFive;
+
+ @Property(name = "location")
+ protected String location;
+
+ @Property(name = "year")
+ protected String year;
+
+ @Property(name = "daysOfTheWeek")
+ protected String[] daysOfTheWeek;
+
+ @Property(name = "integerNumbers")
+ protected Integer[] integerNumbers;
+
+ @Property(name = "intNumbers")
+ protected int[] intNumbers;
+
+ @Property(name = "sdoArray")
+ protected DataObject[] sdoArray;
+
+ @Property
+ protected ReturnCodeProperties complexJAXBPropertyOne;
+
+ @Property
+ protected ReturnCodeProperties complexJAXBPropertyTwo;
+
+ public String getLocation() {
+ return location;
+ }
+
+ public String getYear() {
+ return year;
+ }
+
+ public ComplexPropertyBean getComplexPropertyOne() {
+ //System.out.println(complexPropertyOne);
+ return complexPropertyOne;
+ }
+
+ public ComplexPropertyBean getComplexPropertyTwo() {
+ //System.out.println(complexPropertyTwo);
+ return complexPropertyTwo;
+ }
+
+ public ComplexPropertyBean getComplexPropertyThree() {
+ //System.out.println(complexPropertyThree);
+ return complexPropertyThree;
+ }
+
+ public Collection<ComplexPropertyBean> getComplexPropertyFour() {
+ //System.out.println(complexPropertyThree);
+ return complexPropertyFour;
+ }
+
+ public ComplexPropertyBean getComplexPropertyFive() {
+ return complexPropertyFive;
+ }
+
+ public DataObject getSdoProperty() {
+ return sdoProperty;
+ }
+
+ /**
+ * It is a method which injects the property value to the variable 'sdoProperty' from the SCA runtime environment.
+ */
+ public void setSdoProperty(DataObject sdoProperty) {
+ System.out.println("Reached here da machi");
+ this.sdoProperty = sdoProperty;
+ }
+
+ public CustomerImpl getCustomerSdo() {
+ return customerSdo;
+ }
+
+ /**
+ * It is a method which injects the property value to the variable 'customerSdo' from the SCA runtime environment.
+ */
+ public void setCustomerSdo(CustomerImpl customerSdo) {
+ this.customerSdo = customerSdo;
+ }
+
+ /**
+ * This method is used to test injecting an Array
+ *
+ * @return The injected array
+ */
+ public String[] getDaysOfTheWeek() {
+ return daysOfTheWeek;
+ }
+
+ /**
+ * This method is used to test injecting an Object Integer Array
+ *
+ * @return The injected array
+ */
+ public Integer[] getIntegerNumbers() {
+ return integerNumbers;
+ }
+
+ /**
+ * This method is used to test injecting an int Array
+ *
+ * @return The injected array
+ */
+ public int[] getIntNumbers() {
+ return intNumbers;
+ }
+
+ /**
+ * This method is used to test injecting an Object Array
+ *
+ * @return The injected array
+ */
+ public DataObject[] getSdoArrayProperty() {
+ return sdoArray;
+ }
+
+ public String getLocationFromComponentContext() {
+ return context.getProperty(String.class, "location");
+ }
+
+ public ReturnCodeProperties getComplexJAXBPropertyOne() {
+ return complexJAXBPropertyOne;
+ }
+
+ public ReturnCodeProperties getComplexJAXBPropertyTwo() {
+ return complexJAXBPropertyTwo;
+ }
+}
diff --git a/java/sca/itest/properties/src/main/resources/ConstructorPropertyInjection.composite b/java/sca/itest/properties/src/main/resources/ConstructorPropertyInjection.composite
index 24a2cca822..af65f887c0 100644
--- a/java/sca/itest/properties/src/main/resources/ConstructorPropertyInjection.composite
+++ b/java/sca/itest/properties/src/main/resources/ConstructorPropertyInjection.composite
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" name="ConstructorPropertyInjection">
-
- <component name="Foo1Component">
- <implementation.java class="org.apache.tuscany.sca.itest.cdi.Foo1" />
- <property name="bar" value="foobar" />
- </component>
-
- <component name="Foo2Component">
- <implementation.java class="org.apache.tuscany.sca.itest.cdi.Foo2" />
- <property name="bar">fubar</property>
- </component>
-
- <component name="Foo3Component">
- <implementation.java class="org.apache.tuscany.sca.itest.cdi.Foo3" />
- <property name="bar">
- <value>fubar</value>
- </property>
- </component>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" name="ConstructorPropertyInjection">
+
+ <component name="Foo1Component">
+ <implementation.java class="org.apache.tuscany.sca.itest.cdi.Foo1" />
+ <property name="bar" value="foobar" />
+ </component>
+
+ <component name="Foo2Component">
+ <implementation.java class="org.apache.tuscany.sca.itest.cdi.Foo2" />
+ <property name="bar">fubar</property>
+ </component>
+
+ <component name="Foo3Component">
+ <implementation.java class="org.apache.tuscany.sca.itest.cdi.Foo3" />
+ <property name="bar">
+ <value>fubar</value>
+ </property>
+ </component>
+
</composite> \ No newline at end of file
diff --git a/java/sca/itest/properties/src/main/resources/Outer.composite b/java/sca/itest/properties/src/main/resources/Outer.composite
index 0ada194cb3..5e767b1e0e 100644
--- a/java/sca/itest/properties/src/main/resources/Outer.composite
+++ b/java/sca/itest/properties/src/main/resources/Outer.composite
@@ -1,43 +1,43 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:foo="http://foo" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xsi:schemaLocation="http://docs.oasis-open.org/ns/opencsa/sca/200903 http://docs.oasis-open.org/ns/opencsa/sca/200903" name="Iteration3Composite"
- targetNamespace="http://foo" local="true" autowire="false">
-
- <property name="newLocation" type="xsd:anyURI">Raleigh</property>
- <property name="newYear" type="xsd:anyURI">2008</property>
- <component name="MyServiceComponent">
- <implementation.java class="mysca.test.myservice.impl.MyServiceImpl" />
- </component>
- <component name="MyServiceComponentNew">
- <implementation.java class="mysca.test.myservice.impl.MyServiceImpl" />
- <property name="location" source="$newLocation" />
- <property name="year" source="$newYear" />
- </component>
- <component name="MyTotalServiceNewComponent">
- <implementation.java class="mysca.test.myservice.impl.MyTotalServiceImpl" />
- <reference name="myService" target="MyServiceComponentNew/MyService" />
- </component>
- <component name="MySimpleServiceInRecursiveAnother">
- <implementation.composite name="foo:MySimpleService" />
- <property name="newLocation">Durham</property>
- <property name="newYear">2009</property>
- </component>
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:foo="http://foo" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xsi:schemaLocation="http://docs.oasis-open.org/ns/opencsa/sca/200903 http://docs.oasis-open.org/ns/opencsa/sca/200903" name="Iteration3Composite"
+ targetNamespace="http://foo" local="true" autowire="false">
+
+ <property name="newLocation" type="xsd:anyURI">Raleigh</property>
+ <property name="newYear" type="xsd:anyURI">2008</property>
+ <component name="MyServiceComponent">
+ <implementation.java class="mysca.test.myservice.impl.MyServiceImpl" />
+ </component>
+ <component name="MyServiceComponentNew">
+ <implementation.java class="mysca.test.myservice.impl.MyServiceImpl" />
+ <property name="location" source="$newLocation" />
+ <property name="year" source="$newYear" />
+ </component>
+ <component name="MyTotalServiceNewComponent">
+ <implementation.java class="mysca.test.myservice.impl.MyTotalServiceImpl" />
+ <reference name="myService" target="MyServiceComponentNew/MyService" />
+ </component>
+ <component name="MySimpleServiceInRecursiveAnother">
+ <implementation.composite name="foo:MySimpleService" />
+ <property name="newLocation">Durham</property>
+ <property name="newYear">2009</property>
+ </component>
+</composite>
diff --git a/java/sca/itest/properties/src/main/resources/customer.xsd b/java/sca/itest/properties/src/main/resources/customer.xsd
index 8861d7e7b8..7421750f1b 100644
--- a/java/sca/itest/properties/src/main/resources/customer.xsd
+++ b/java/sca/itest/properties/src/main/resources/customer.xsd
@@ -1,30 +1,30 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns="http://www.example.com/Customer" targetNamespace="http://www.example.com/Customer">
-
- <xsd:element name="customer" type="Customer"/>
- <xsd:complexType name="Customer">
- <xsd:sequence>
- <xsd:element name="firstName" type="xsd:string"/>
- <xsd:element name="middleName" type="xsd:string"/>
- <xsd:element name="lastName" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:schema>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://www.example.com/Customer" targetNamespace="http://www.example.com/Customer">
+
+ <xsd:element name="customer" type="Customer"/>
+ <xsd:complexType name="Customer">
+ <xsd:sequence>
+ <xsd:element name="firstName" type="xsd:string"/>
+ <xsd:element name="middleName" type="xsd:string"/>
+ <xsd:element name="lastName" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
diff --git a/java/sca/itest/properties/src/main/resources/mySimpleService.composite b/java/sca/itest/properties/src/main/resources/mySimpleService.composite
index b22b32bc30..3cf25384e6 100644
--- a/java/sca/itest/properties/src/main/resources/mySimpleService.composite
+++ b/java/sca/itest/properties/src/main/resources/mySimpleService.composite
@@ -1,40 +1,40 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite autowire="false" local="true" name="MySimpleService"
- targetNamespace="http://foo" xmlns:foo="http://foo" xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://docs.oasis-open.org/ns/opencsa/sca/200903 http://docs.oasis-open.org/ns/opencsa/sca/200903 ">
-
-
- <service name="MyServiceNew1" promote="MyServiceComponentNew/MyService">
- <interface.java interface="mysca.test.myservice.impl.MyService" />
- </service>
-
- <property name="newLocation" type="xsd:anyURI">Raleigh</property>
- <property name="newYear" type="xsd:anyURI">2008</property>
-
-
- <component name="MyServiceComponentNew">
- <implementation.java class="mysca.test.myservice.impl.MyServiceImpl" />
- <property name="location" source="$newLocation" />
- <property name="year" source="$newYear" />
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite autowire="false" local="true" name="MySimpleService"
+ targetNamespace="http://foo" xmlns:foo="http://foo" xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://docs.oasis-open.org/ns/opencsa/sca/200903 http://docs.oasis-open.org/ns/opencsa/sca/200903 ">
+
+
+ <service name="MyServiceNew1" promote="MyServiceComponentNew/MyService">
+ <interface.java interface="mysca.test.myservice.impl.MyService" />
+ </service>
+
+ <property name="newLocation" type="xsd:anyURI">Raleigh</property>
+ <property name="newYear" type="xsd:anyURI">2008</property>
+
+
+ <component name="MyServiceComponentNew">
+ <implementation.java class="mysca.test.myservice.impl.MyServiceImpl" />
+ <property name="location" source="$newLocation" />
+ <property name="year" source="$newYear" />
+ </component>
+
+</composite>
diff --git a/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java b/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java
index da1ec5186f..0906a45ab3 100644
--- a/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java
+++ b/java/sca/itest/properties/src/test/java/org/apache/tuscany/sca/itest/OuterPropertyTestCase.java
@@ -1,169 +1,169 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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 static org.junit.Assert.assertEquals;
-
-import java.util.Iterator;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * This is a class which makes user of JUnit Framework, all tests are written using JUnit notation. These tests are used
- * to test different property values returned from the SCA Runtime Environment which is initialized with the composite
- * 'OuterPropertyTest.composite'. It basically tests the Simple type of property and Complex type of property from the
- * SCA Runtime Environment.
- */
-public class OuterPropertyTestCase {
-
- private static Node node;
- private static ABComponent outerABService;
-
- /**
- * Method annotated with
- *
- * @BeforeClass is used for one time set Up, it executes before every tests. This method is used to create a test
- * Embedded SCA node, to start the SCA node and to get a reference to the 'outerABService' service
- */
- @BeforeClass
- public static void init() throws Exception {
- String location = ContributionLocationHelper.getContributionLocation("OuterPropertyTest.composite");
- node = NodeFactory.newInstance().createNode("OuterPropertyTest.composite", new Contribution("c1", location));
- node.start();
- outerABService = node.getService(ABComponent.class, "OuterComponent");
- }
-
- /**
- * Method annotated with
- *
- * @AfterClass is used for one time Tear Down, it executes after every tests. This method is used to close the
- * node, close any previously opened connections etc
- */
- @AfterClass
- public static void destroy() throws Exception {
- node.stop();
- }
-
- /**
- * Method annotated with
- *
- * @Test is a test method where testing logic is written using various assert methods. This test verifies the
- * property value obtained using a service from the SCA runtime environment with the expected value 'Overriden
- * A'
- */
- @Test
- public void testOverridenA() {
- assertEquals("Overriden A", outerABService.getA());
- }
-
- /**
- * Method annotated with
- *
- * @Test is a test method where testing logic is written using various assert methods. This test verifies the
- * property value obtained using a service from the SCA runtime environment with the expected value 'Overriden
- * B'
- */
- @Test
- public void testOverridenB() {
- assertEquals("Overriden B", outerABService.getB());
- }
-
- /**
- * Method annotated with
- *
- * @Test is a test method where testing logic is written using various assert methods. This test verifies the
- * property value obtained using a service from the SCA runtime environment with the expected value 'Overriden
- * A'
- */
- @Test
- public void testOverridenF() {
- assertEquals("Overriden A", outerABService.getF());
- }
-
- /**
- * Method annotated with
- *
- * @Test is a test method where testing logic is written using various assert methods. This test verifies the
- * property value obtained using a service from the SCA runtime environment with the expected value 'Overriden
- * Z'
- */
- @Test
- public void testOverridenZ() {
- assertEquals("Overriden Z", outerABService.getZ());
- }
-
- /**
- * Method annotated with
- *
- * @Test is a test method where testing logic is written using various assert methods. This test verifies the
- * property value obtained using a service from the SCA runtime environment with the expected value 125
- */
- @Test
- public void testOverridenIntValue() {
- assertEquals(125, outerABService.getIntValue());
- }
-
- /**
- * Method annotated with
- *
- * @Test is a test method where testing logic is written using various assert methods. This test verifies the
- * property value obtained using a service from the SCA runtime environment with the expected value 125
- */
- @Test
- public void testDefaultValue() {
- assertEquals(125, outerABService.getIntValue());
- }
-
- /**
- * Method annotated with
- *
- * @Test is a test method where testing logic is written using various assert methods. This test verifies the
- * property values obtained using a service from the SCA runtime environment with the expected values 'Apache' ,
- * 'Tuscany' and 'Java SCA' respectively .
- */
- @Test
- public void testManySimpleStringValues() {
- Iterator<String> iterator = outerABService.getManyStringValues().iterator();
- assertEquals("Apache", iterator.next());
- assertEquals("Tuscany", iterator.next());
- assertEquals("Java SCA", iterator.next());
- }
-
- /**
- * Method annotated with
- *
- * @Test is a test method where testing logic is written using various assert methods. This test verifies the
- * property values obtained using a service from the SCA runtime environment with the expected values 123, 456
- * and 789
- */
- @Test
- public void testManySimpleIntegerValues() {
- Iterator<Integer> iterator = outerABService.getManyIntegers().iterator();
- assertEquals(123, iterator.next().intValue());
- assertEquals(456, iterator.next().intValue());
- assertEquals(789, iterator.next().intValue());
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 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 static org.junit.Assert.assertEquals;
+
+import java.util.Iterator;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * This is a class which makes user of JUnit Framework, all tests are written using JUnit notation. These tests are used
+ * to test different property values returned from the SCA Runtime Environment which is initialized with the composite
+ * 'OuterPropertyTest.composite'. It basically tests the Simple type of property and Complex type of property from the
+ * SCA Runtime Environment.
+ */
+public class OuterPropertyTestCase {
+
+ private static Node node;
+ private static ABComponent outerABService;
+
+ /**
+ * Method annotated with
+ *
+ * @BeforeClass is used for one time set Up, it executes before every tests. This method is used to create a test
+ * Embedded SCA node, to start the SCA node and to get a reference to the 'outerABService' service
+ */
+ @BeforeClass
+ public static void init() throws Exception {
+ String location = ContributionLocationHelper.getContributionLocation("OuterPropertyTest.composite");
+ node = NodeFactory.newInstance().createNode("OuterPropertyTest.composite", new Contribution("c1", location));
+ node.start();
+ outerABService = node.getService(ABComponent.class, "OuterComponent");
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @AfterClass is used for one time Tear Down, it executes after every tests. This method is used to close the
+ * node, close any previously opened connections etc
+ */
+ @AfterClass
+ public static void destroy() throws Exception {
+ node.stop();
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 'Overriden
+ * A'
+ */
+ @Test
+ public void testOverridenA() {
+ assertEquals("Overriden A", outerABService.getA());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 'Overriden
+ * B'
+ */
+ @Test
+ public void testOverridenB() {
+ assertEquals("Overriden B", outerABService.getB());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 'Overriden
+ * A'
+ */
+ @Test
+ public void testOverridenF() {
+ assertEquals("Overriden A", outerABService.getF());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 'Overriden
+ * Z'
+ */
+ @Test
+ public void testOverridenZ() {
+ assertEquals("Overriden Z", outerABService.getZ());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 125
+ */
+ @Test
+ public void testOverridenIntValue() {
+ assertEquals(125, outerABService.getIntValue());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property value obtained using a service from the SCA runtime environment with the expected value 125
+ */
+ @Test
+ public void testDefaultValue() {
+ assertEquals(125, outerABService.getIntValue());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property values obtained using a service from the SCA runtime environment with the expected values 'Apache' ,
+ * 'Tuscany' and 'Java SCA' respectively .
+ */
+ @Test
+ public void testManySimpleStringValues() {
+ Iterator<String> iterator = outerABService.getManyStringValues().iterator();
+ assertEquals("Apache", iterator.next());
+ assertEquals("Tuscany", iterator.next());
+ assertEquals("Java SCA", iterator.next());
+ }
+
+ /**
+ * Method annotated with
+ *
+ * @Test is a test method where testing logic is written using various assert methods. This test verifies the
+ * property values obtained using a service from the SCA runtime environment with the expected values 123, 456
+ * and 789
+ */
+ @Test
+ public void testManySimpleIntegerValues() {
+ Iterator<Integer> iterator = outerABService.getManyIntegers().iterator();
+ assertEquals(123, iterator.next().intValue());
+ assertEquals(456, iterator.next().intValue());
+ assertEquals(789, iterator.next().intValue());
+ }
+}
diff --git a/java/sca/itest/references/src/main/resources/AutoWiredReferencesTest.composite b/java/sca/itest/references/src/main/resources/AutoWiredReferencesTest.composite
index 5300107706..77851b81a7 100644
--- a/java/sca/itest/references/src/main/resources/AutoWiredReferencesTest.composite
+++ b/java/sca/itest/references/src/main/resources/AutoWiredReferencesTest.composite
@@ -1,61 +1,61 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:foo="http://foo" targetNamespace="http://foo"
- name="AutowireReferencesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autowire="true">
-
- <component name="AComponent" autowire="false">
- <implementation.java class="org.apache.tuscany.sca.itest.references.AComponentImpl" />
- <reference name="bReference" target="BComponent" />
- <reference name="cReference" autowire="true" />
- <reference name="dReference1" />
- <!--
- <reference name="dReference1" target="DComponent" />
- -->
- <reference name="DReference2" target="DComponent" />
- <reference name="dReferences" autowire="true" />
- <reference name="dReferenceArray" autowire="true" />
- <reference name="dServiceReferences" target="DComponent DComponent1" />
-
- </component>
-
- <component name="AComponentAutowire" autowire="true">
- <implementation.java class="org.apache.tuscany.sca.itest.references.AComponentImpl" />
- <reference name="bReference" target="BComponent" />
- </component>
-
- <component name="BComponentWrongTarget">
- <implementation.java class="org.apache.tuscany.sca.itest.references.BComponentWrongTargetImpl" />
- </component>
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.references.BComponentImpl" />
- </component>
-
- <component name="CComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.references.CComponentImpl" />
- </component>
-
- <component name="DComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.references.DComponentImpl" />
- </component>
-
- <component name="DComponent1">
- <implementation.java class="org.apache.tuscany.sca.itest.references.DComponentImpl" />
- </component>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:foo="http://foo" targetNamespace="http://foo"
+ name="AutowireReferencesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autowire="true">
+
+ <component name="AComponent" autowire="false">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.AComponentImpl" />
+ <reference name="bReference" target="BComponent" />
+ <reference name="cReference" autowire="true" />
+ <reference name="dReference1" />
+ <!--
+ <reference name="dReference1" target="DComponent" />
+ -->
+ <reference name="DReference2" target="DComponent" />
+ <reference name="dReferences" autowire="true" />
+ <reference name="dReferenceArray" autowire="true" />
+ <reference name="dServiceReferences" target="DComponent DComponent1" />
+
+ </component>
+
+ <component name="AComponentAutowire" autowire="true">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.AComponentImpl" />
+ <reference name="bReference" target="BComponent" />
+ </component>
+
+ <component name="BComponentWrongTarget">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.BComponentWrongTargetImpl" />
+ </component>
+
+ <component name="BComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.BComponentImpl" />
+ </component>
+
+ <component name="CComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.CComponentImpl" />
+ </component>
+
+ <component name="DComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.DComponentImpl" />
+ </component>
+
+ <component name="DComponent1">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.DComponentImpl" />
+ </component>
</composite> \ No newline at end of file
diff --git a/java/sca/itest/references/src/main/resources/InnerReferencesTest.composite b/java/sca/itest/references/src/main/resources/InnerReferencesTest.composite
index be4ac75b3c..871a846edf 100644
--- a/java/sca/itest/references/src/main/resources/InnerReferencesTest.composite
+++ b/java/sca/itest/references/src/main/resources/InnerReferencesTest.composite
@@ -1,51 +1,51 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:foo="http://foo" targetNamespace="http://foo"
- name="InnerReferencesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
-
- <component name="AComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.references.AComponentImpl" />
- <reference name="bReference" target="BComponent" />
- <reference name="cReference" target="CComponent" />
- <reference name="dReference1" target="DComponent" />
- <reference name="DReference2" target="DComponent" />
- <reference name="dReferences" target="DComponent DComponent1" />
- <reference name="dReferenceArray" target="DComponent1" />
- <reference name="dServiceReferences" target="DComponent DComponent1" />
- </component>
-
- <component name="BComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.references.BComponentImpl" />
- <reference name="cReference" target="CComponent" />
- </component>
-
- <component name="CComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.references.CComponentImpl" />
- </component>
-
- <component name="DComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.references.DComponentImpl" />
- </component>
-
- <component name="DComponent1">
- <implementation.java class="org.apache.tuscany.sca.itest.references.DComponentImpl" />
- </component>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:foo="http://foo" targetNamespace="http://foo"
+ name="InnerReferencesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+
+ <component name="AComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.AComponentImpl" />
+ <reference name="bReference" target="BComponent" />
+ <reference name="cReference" target="CComponent" />
+ <reference name="dReference1" target="DComponent" />
+ <reference name="DReference2" target="DComponent" />
+ <reference name="dReferences" target="DComponent DComponent1" />
+ <reference name="dReferenceArray" target="DComponent1" />
+ <reference name="dServiceReferences" target="DComponent DComponent1" />
+ </component>
+
+ <component name="BComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.BComponentImpl" />
+ <reference name="cReference" target="CComponent" />
+ </component>
+
+ <component name="CComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.CComponentImpl" />
+ </component>
+
+ <component name="DComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.DComponentImpl" />
+ </component>
+
+ <component name="DComponent1">
+ <implementation.java class="org.apache.tuscany.sca.itest.references.DComponentImpl" />
+ </component>
+
</composite> \ No newline at end of file
diff --git a/java/sca/itest/scaclient-api/src/main/resources/Helloworld.composite b/java/sca/itest/scaclient-api/src/main/resources/Helloworld.composite
index 0352aabfb1..3f0e0a164c 100644
--- a/java/sca/itest/scaclient-api/src/main/resources/Helloworld.composite
+++ b/java/sca/itest/scaclient-api/src/main/resources/Helloworld.composite
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://itest"
- name="Helloworld">
-
- <component name="HelloworldComponent">
- <implementation.java class="itest.HelloworldServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://itest"
+ name="Helloworld">
+
+ <component name="HelloworldComponent">
+ <implementation.java class="itest.HelloworldServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/scopes/src/main/resources/scopes.composite b/java/sca/itest/scopes/src/main/resources/scopes.composite
index ac6de1b8bc..9b2b1cfb9f 100644
--- a/java/sca/itest/scopes/src/main/resources/scopes.composite
+++ b/java/sca/itest/scopes/src/main/resources/scopes.composite
@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- name="Scopes">
-
- <!-- Components used to test scopes. -->
-
- <component name="RequestScopeComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.scopes.RequestScopeStateVerifierImpl"/>
- </component>
-
- <component name="ModuleScopeComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.scopes.CompositeScopeStateVerifierImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ name="Scopes">
+
+ <!-- Components used to test scopes. -->
+
+ <component name="RequestScopeComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.scopes.RequestScopeStateVerifierImpl"/>
+ </component>
+
+ <component name="ModuleScopeComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.scopes.CompositeScopeStateVerifierImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/itest/services/src/main/resources/ServicesTest.composite b/java/sca/itest/services/src/main/resources/ServicesTest.composite
index 9b7a30d850..e7d56032ea 100644
--- a/java/sca/itest/services/src/main/resources/ServicesTest.composite
+++ b/java/sca/itest/services/src/main/resources/ServicesTest.composite
@@ -1,70 +1,70 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:foo="http://foo" targetNamespace="http://foo"
- name="InnerServicesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
- <component name="AComponent1">
- <implementation.java class="org.apache.tuscany.sca.itest.services.AComponentImpl" />
- </component>
-
- <component name="AComponent2">
- <implementation.java class="org.apache.tuscany.sca.itest.services.AComponentImpl" />
- <service name="AComponent">
- <interface.java interface="org.apache.tuscany.sca.itest.services.AComponent" />
- </service>
- </component>
-
- <component name="BComponent1">
- <implementation.java class="org.apache.tuscany.sca.itest.services.BComponentImpl" />
- </component>
-
- <component name="BComponent2">
- <implementation.java class="org.apache.tuscany.sca.itest.services.BComponentImpl" />
- <service name="BComponent">
- <interface.java interface="org.apache.tuscany.sca.itest.services.BComponent" />
- </service>
- </component>
-
- <component name="CComponent1">
- <implementation.java class="org.apache.tuscany.sca.itest.services.CComponentImpl" />
- </component>
-
- <component name="CComponent2">
- <implementation.java class="org.apache.tuscany.sca.itest.services.CComponentImpl" />
- <service name="CComponent">
- <interface.java interface="org.apache.tuscany.sca.itest.services.CComponent" />
- </service>
- </component>
-
- <component name="DComponent1">
- <implementation.java class="org.apache.tuscany.sca.itest.services.DComponentImpl" />
- </component>
-
- <component name="DComponent2">
- <implementation.java class="org.apache.tuscany.sca.itest.services.DComponentImpl" />
- <service name="DComponent">
- <interface.java interface="org.apache.tuscany.sca.itest.services.DComponent" />
- </service>
- <service name="D1Component">
- <interface.java interface="org.apache.tuscany.sca.itest.services.D1Component" />
- </service>
- </component>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:foo="http://foo" targetNamespace="http://foo"
+ name="InnerServicesTest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <component name="AComponent1">
+ <implementation.java class="org.apache.tuscany.sca.itest.services.AComponentImpl" />
+ </component>
+
+ <component name="AComponent2">
+ <implementation.java class="org.apache.tuscany.sca.itest.services.AComponentImpl" />
+ <service name="AComponent">
+ <interface.java interface="org.apache.tuscany.sca.itest.services.AComponent" />
+ </service>
+ </component>
+
+ <component name="BComponent1">
+ <implementation.java class="org.apache.tuscany.sca.itest.services.BComponentImpl" />
+ </component>
+
+ <component name="BComponent2">
+ <implementation.java class="org.apache.tuscany.sca.itest.services.BComponentImpl" />
+ <service name="BComponent">
+ <interface.java interface="org.apache.tuscany.sca.itest.services.BComponent" />
+ </service>
+ </component>
+
+ <component name="CComponent1">
+ <implementation.java class="org.apache.tuscany.sca.itest.services.CComponentImpl" />
+ </component>
+
+ <component name="CComponent2">
+ <implementation.java class="org.apache.tuscany.sca.itest.services.CComponentImpl" />
+ <service name="CComponent">
+ <interface.java interface="org.apache.tuscany.sca.itest.services.CComponent" />
+ </service>
+ </component>
+
+ <component name="DComponent1">
+ <implementation.java class="org.apache.tuscany.sca.itest.services.DComponentImpl" />
+ </component>
+
+ <component name="DComponent2">
+ <implementation.java class="org.apache.tuscany.sca.itest.services.DComponentImpl" />
+ <service name="DComponent">
+ <interface.java interface="org.apache.tuscany.sca.itest.services.DComponent" />
+ </service>
+ <service name="D1Component">
+ <interface.java interface="org.apache.tuscany.sca.itest.services.D1Component" />
+ </service>
+ </component>
+
</composite> \ No newline at end of file
diff --git a/java/sca/itest/wires/src/main/resources/WireTest.composite b/java/sca/itest/wires/src/main/resources/WireTest.composite
index fc8f61f459..614beaec00 100644
--- a/java/sca/itest/wires/src/main/resources/WireTest.composite
+++ b/java/sca/itest/wires/src/main/resources/WireTest.composite
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://wires" name="WireTest">
-
- <component name="WireClient">
- <implementation.java class="org.apache.tuscany.sca.itest.WireClientImpl"/>
-<!-- We are not using a reference - we are using a wire - see below -->
-<!-- The equivalent reference for the wire would be as follows -->
-<!-- <reference name="aWireService" target="WireService"/>-->
- </component>
-
- <component name="AnotherWireClient">
- <implementation.java class="org.apache.tuscany.sca.itest.WireClientImpl"/>
- </component>
-
- <component name="WireServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.itest.WireServiceImpl"/>
- </component>
-
- <wire source="WireClient/aWireService" target="WireServiceComponent"/>
- <wire source="AnotherWireClient/aWireService" target="WireServiceComponent/WireService"/>
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://wires" name="WireTest">
+
+ <component name="WireClient">
+ <implementation.java class="org.apache.tuscany.sca.itest.WireClientImpl"/>
+<!-- We are not using a reference - we are using a wire - see below -->
+<!-- The equivalent reference for the wire would be as follows -->
+<!-- <reference name="aWireService" target="WireService"/>-->
+ </component>
+
+ <component name="AnotherWireClient">
+ <implementation.java class="org.apache.tuscany.sca.itest.WireClientImpl"/>
+ </component>
+
+ <component name="WireServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.itest.WireServiceImpl"/>
+ </component>
+
+ <wire source="WireClient/aWireService" target="WireServiceComponent"/>
+ <wire source="AnotherWireClient/aWireService" target="WireServiceComponent/WireService"/>
+</composite>
diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java
index 1f9dfcd237..8a25912bb1 100644
--- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java
+++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/EndpointProcessor.java
@@ -1,123 +1,123 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- *
- */
-public class EndpointProcessor extends BaseAssemblyProcessor implements StAXArtifactProcessor<Endpoint> {
- private final static String ENDPOINT = "endpoint";
- private final static QName ENDPOINT_QNAME = new QName(Constants.SCA11_TUSCANY_NS, ENDPOINT);
-
- private ExtensionPointRegistry registry;
-
- public EndpointProcessor(ExtensionPointRegistry registry,
- StAXArtifactProcessor extensionProcessor,
- StAXAttributeProcessor extensionAttributeProcessor,
- Monitor monitor) {
-
- super(modelFactories(registry), extensionProcessor, monitor);
- this.registry = registry;
- }
-
- /**
- * Returns the model factory extension point to use.
- *
- * @param extensionPoints
- * @return
- */
- private static FactoryExtensionPoint modelFactories(ExtensionPointRegistry extensionPoints) {
- return extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- }
-
- public QName getArtifactType() {
- return ENDPOINT_QNAME;
- }
-
- public Endpoint read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- Endpoint endpoint = assemblyFactory.createEndpoint();
- reader.nextTag();
- Object model = extensionProcessor.read(reader);
- if (model instanceof Composite) {
- Composite composite = (Composite)model;
- Component component = composite.getComponents().get(0);
- ComponentService service = component.getServices().get(0);
- Binding binding = service.getBindings().get(0);
- endpoint.setComponent(component);
- endpoint.setService(service);
- endpoint.setBinding(binding);
- }
- return endpoint;
- }
-
- public void write(Endpoint model, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
- // writeStart(writer, ENDPOINT_QNAME);
- extensionProcessor.write(wrap(model), writer);
- // writeEnd(writer);
- }
-
- private Composite wrap(Endpoint endpoint) {
- try {
- Composite composite = assemblyFactory.createComposite();
- composite.setName(ENDPOINT_QNAME);
- composite.setLocal(false);
- Component component = (Component)endpoint.getComponent().clone();
- composite.getComponents().add(component);
- component.getReferences().clear();
- component.getServices().clear();
- ComponentService service = (ComponentService)endpoint.getService().clone();
- component.getServices().add(service);
- service.getBindings().clear();
- service.setInterfaceContract(endpoint.getInterfaceContract());
- Binding binding = (Binding)endpoint.getBinding().clone();
- service.getBindings().add(binding);
- return composite;
- } catch (CloneNotSupportedException e) {
- return null;
- }
- }
-
- public Class<Endpoint> getModelType() {
- return Endpoint.class;
- }
-
- public void resolve(Endpoint model, ModelResolver resolver) throws ContributionResolveException {
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.assembly.xml;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+
+/**
+ *
+ */
+public class EndpointProcessor extends BaseAssemblyProcessor implements StAXArtifactProcessor<Endpoint> {
+ private final static String ENDPOINT = "endpoint";
+ private final static QName ENDPOINT_QNAME = new QName(Constants.SCA11_TUSCANY_NS, ENDPOINT);
+
+ private ExtensionPointRegistry registry;
+
+ public EndpointProcessor(ExtensionPointRegistry registry,
+ StAXArtifactProcessor extensionProcessor,
+ StAXAttributeProcessor extensionAttributeProcessor,
+ Monitor monitor) {
+
+ super(modelFactories(registry), extensionProcessor, monitor);
+ this.registry = registry;
+ }
+
+ /**
+ * Returns the model factory extension point to use.
+ *
+ * @param extensionPoints
+ * @return
+ */
+ private static FactoryExtensionPoint modelFactories(ExtensionPointRegistry extensionPoints) {
+ return extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
+ }
+
+ public QName getArtifactType() {
+ return ENDPOINT_QNAME;
+ }
+
+ public Endpoint read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+ Endpoint endpoint = assemblyFactory.createEndpoint();
+ reader.nextTag();
+ Object model = extensionProcessor.read(reader);
+ if (model instanceof Composite) {
+ Composite composite = (Composite)model;
+ Component component = composite.getComponents().get(0);
+ ComponentService service = component.getServices().get(0);
+ Binding binding = service.getBindings().get(0);
+ endpoint.setComponent(component);
+ endpoint.setService(service);
+ endpoint.setBinding(binding);
+ }
+ return endpoint;
+ }
+
+ public void write(Endpoint model, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
+ // writeStart(writer, ENDPOINT_QNAME);
+ extensionProcessor.write(wrap(model), writer);
+ // writeEnd(writer);
+ }
+
+ private Composite wrap(Endpoint endpoint) {
+ try {
+ Composite composite = assemblyFactory.createComposite();
+ composite.setName(ENDPOINT_QNAME);
+ composite.setLocal(false);
+ Component component = (Component)endpoint.getComponent().clone();
+ composite.getComponents().add(component);
+ component.getReferences().clear();
+ component.getServices().clear();
+ ComponentService service = (ComponentService)endpoint.getService().clone();
+ component.getServices().add(service);
+ service.getBindings().clear();
+ service.setInterfaceContract(endpoint.getInterfaceContract());
+ Binding binding = (Binding)endpoint.getBinding().clone();
+ service.getBindings().add(binding);
+ return composite;
+ } catch (CloneNotSupportedException e) {
+ return null;
+ }
+ }
+
+ public Class<Endpoint> getModelType() {
+ return Endpoint.class;
+ }
+
+ public void resolve(Endpoint model, ModelResolver resolver) throws ContributionResolveException {
+ }
+}
diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/SCABindingProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/SCABindingProcessor.java
index a5c1f97c66..88d8abdf2e 100644
--- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/SCABindingProcessor.java
+++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/SCABindingProcessor.java
@@ -1,131 +1,131 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.SCABindingFactory;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.policy.ExtensionType;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.apache.tuscany.sca.policy.PolicySubject;
-
-/**
- * A processor to read the XML that describes the SCA binding.
- *
- * @version $Rev: 750765 $ $Date: 2009-03-06 04:36:04 +0000 (Fri, 06 Mar 2009) $
- */
-
-public class SCABindingProcessor implements StAXArtifactProcessor<SCABinding> {
- private static final String NAME = "name";
- private static final String URI = "uri";
-
- private static final String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
- private static final String BINDING_SCA = "binding.sca";
- private static final QName BINDING_SCA_QNAME = new QName(SCA11_NS, BINDING_SCA);
-
- private PolicyFactory policyFactory;
- private SCABindingFactory scaBindingFactory;
- private PolicySubjectProcessor policyProcessor;
- private PolicyFactory intentAttachPointTypeFactory;
-
-
- public SCABindingProcessor(FactoryExtensionPoint modelFactories) {
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
- this.scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
- policyProcessor = new PolicySubjectProcessor(policyFactory);
- this.intentAttachPointTypeFactory = modelFactories.getFactory(PolicyFactory.class);
- }
-
- public QName getArtifactType() {
- return BINDING_SCA_QNAME;
- }
-
- public Class<SCABinding> getModelType() {
- return SCABinding.class;
- }
-
- public SCABinding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- SCABinding scaBinding = scaBindingFactory.createSCABinding();
- ExtensionType bindingType = intentAttachPointTypeFactory.createBindingType();
- bindingType.setType(getArtifactType());
- bindingType.setUnresolved(true);
- ((PolicySubject)scaBinding).setExtensionType(bindingType);
-
- // Read policies
- policyProcessor.readPolicies(scaBinding, reader);
-
- // Read binding name
- String name = reader.getAttributeValue(null, NAME);
- if (name != null) {
- scaBinding.setName(name);
- }
-
- // Read binding URI
- String uri = reader.getAttributeValue(null, URI);
- if (uri != null) {
- scaBinding.setURI(uri);
- }
-
- // Skip to end element
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && BINDING_SCA_QNAME.equals(reader.getName())) {
- break;
- }
- }
- return scaBinding;
- }
-
- public void resolve(SCABinding model, ModelResolver resolver) throws ContributionResolveException {
- policyProcessor.resolvePolicies(model, resolver);
- }
-
- public void write(SCABinding scaBinding, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <binding.sca>
- policyProcessor.writePolicyPrefixes(scaBinding, writer);
- writer.writeStartElement(SCA11_NS, BINDING_SCA);
- policyProcessor.writePolicyAttributes(scaBinding, writer);
-
- // Write binding name
- if (scaBinding.getName() != null) {
- writer.writeAttribute(NAME, scaBinding.getName());
- }
-
- // Write binding URI
- if (scaBinding.getURI() != null) {
- writer.writeAttribute(URI, scaBinding.getURI());
- }
-
- writer.writeEndElement();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.assembly.xml;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.SCABinding;
+import org.apache.tuscany.sca.assembly.SCABindingFactory;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.policy.ExtensionType;
+import org.apache.tuscany.sca.policy.PolicyFactory;
+import org.apache.tuscany.sca.policy.PolicySubject;
+
+/**
+ * A processor to read the XML that describes the SCA binding.
+ *
+ * @version $Rev$ $Date$
+ */
+
+public class SCABindingProcessor implements StAXArtifactProcessor<SCABinding> {
+ private static final String NAME = "name";
+ private static final String URI = "uri";
+
+ private static final String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
+ private static final String BINDING_SCA = "binding.sca";
+ private static final QName BINDING_SCA_QNAME = new QName(SCA11_NS, BINDING_SCA);
+
+ private PolicyFactory policyFactory;
+ private SCABindingFactory scaBindingFactory;
+ private PolicySubjectProcessor policyProcessor;
+ private PolicyFactory intentAttachPointTypeFactory;
+
+
+ public SCABindingProcessor(FactoryExtensionPoint modelFactories) {
+ this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
+ this.scaBindingFactory = modelFactories.getFactory(SCABindingFactory.class);
+ policyProcessor = new PolicySubjectProcessor(policyFactory);
+ this.intentAttachPointTypeFactory = modelFactories.getFactory(PolicyFactory.class);
+ }
+
+ public QName getArtifactType() {
+ return BINDING_SCA_QNAME;
+ }
+
+ public Class<SCABinding> getModelType() {
+ return SCABinding.class;
+ }
+
+ public SCABinding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+ SCABinding scaBinding = scaBindingFactory.createSCABinding();
+ ExtensionType bindingType = intentAttachPointTypeFactory.createBindingType();
+ bindingType.setType(getArtifactType());
+ bindingType.setUnresolved(true);
+ ((PolicySubject)scaBinding).setExtensionType(bindingType);
+
+ // Read policies
+ policyProcessor.readPolicies(scaBinding, reader);
+
+ // Read binding name
+ String name = reader.getAttributeValue(null, NAME);
+ if (name != null) {
+ scaBinding.setName(name);
+ }
+
+ // Read binding URI
+ String uri = reader.getAttributeValue(null, URI);
+ if (uri != null) {
+ scaBinding.setURI(uri);
+ }
+
+ // Skip to end element
+ while (reader.hasNext()) {
+ if (reader.next() == END_ELEMENT && BINDING_SCA_QNAME.equals(reader.getName())) {
+ break;
+ }
+ }
+ return scaBinding;
+ }
+
+ public void resolve(SCABinding model, ModelResolver resolver) throws ContributionResolveException {
+ policyProcessor.resolvePolicies(model, resolver);
+ }
+
+ public void write(SCABinding scaBinding, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
+
+ // Write <binding.sca>
+ policyProcessor.writePolicyPrefixes(scaBinding, writer);
+ writer.writeStartElement(SCA11_NS, BINDING_SCA);
+ policyProcessor.writePolicyAttributes(scaBinding, writer);
+
+ // Write binding name
+ if (scaBinding.getName() != null) {
+ writer.writeAttribute(NAME, scaBinding.getName());
+ }
+
+ // Write binding URI
+ if (scaBinding.getURI() != null) {
+ writer.writeAttribute(URI, scaBinding.getURI());
+ }
+
+ writer.writeEndElement();
+ }
+
+}
diff --git a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/BuildPolicyTestCase.java b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/BuildPolicyTestCase.java
index fa0e9bdf5b..a7bb140500 100644
--- a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/BuildPolicyTestCase.java
+++ b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/BuildPolicyTestCase.java
@@ -58,7 +58,7 @@ import org.junit.Test;
/**
* Test reading SCA XML assembly documents.
*
- * @version $Rev: 561254 $ $Date: 2007-07-31 13:16:27 +0530 (Tue, 31 Jul 2007) $
+ * @version $Rev$ $Date$
*/
public class BuildPolicyTestCase {
private static URLArtifactProcessor<Object> documentProcessor;
diff --git a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteLocalCompositeTestCase.java b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteLocalCompositeTestCase.java
index 6c8aa9acc9..bd21c0630e 100644
--- a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteLocalCompositeTestCase.java
+++ b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ReadWriteLocalCompositeTestCase.java
@@ -1,100 +1,100 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xml;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessorExtensionPoint;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-
-/**
- * Test reading SCA XML assemblies.
- *
- * @version $Rev: 711584 $ $Date: 2008-11-05 15:07:03 +0000 (Wed, 05 Nov 2008) $
- */
-public class ReadWriteLocalCompositeTestCase {
-
- private XMLInputFactory inputFactory;
- private ExtensibleStAXArtifactProcessor staxProcessor;
-
- private static final String LOCAL_COMPOSITE_XML = "<?xml version='1.0' encoding='UTF-8'?>"+
- "<composite xmlns=\"http://docs.oasis-open.org/ns/opencsa/sca/200903\" xmlns:ns1=\"http://docs.oasis-open.org/ns/opencsa/sca/200903\" targetNamespace=\"http://localcalc\" name=\"LocalCalculator\" local=\"true\">"+
- "</composite>";
-
- @Before
- public void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
-
- StAXAttributeProcessorExtensionPoint staxAttributeProcessors = extensionPoints.getExtensionPoint(StAXAttributeProcessorExtensionPoint.class);
- staxAttributeProcessors.addArtifactProcessor(new TestAttributeProcessor());
-
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance(), null);
- }
-
- @After
- public void tearDown() throws Exception {
-
- }
-
- @Test
- public void testReadComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("local.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite composite = (Composite) staxProcessor.read(reader);
- assertNotNull(composite);
- assertTrue(composite.isLocal());
- is.close();
- }
-
- @Test
- public void testWriteComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("local.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite composite = (Composite) staxProcessor.read(reader);
- assertNotNull(composite);
- assertTrue(composite.isLocal());
- is.close();
-
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(composite, bos);
- System.out.println(bos.toString());
-
- assertEquals(LOCAL_COMPOSITE_XML, bos.toString());
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.assembly.xml;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+
+/**
+ * Test reading SCA XML assemblies.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ReadWriteLocalCompositeTestCase {
+
+ private XMLInputFactory inputFactory;
+ private ExtensibleStAXArtifactProcessor staxProcessor;
+
+ private static final String LOCAL_COMPOSITE_XML = "<?xml version='1.0' encoding='UTF-8'?>"+
+ "<composite xmlns=\"http://docs.oasis-open.org/ns/opencsa/sca/200903\" xmlns:ns1=\"http://docs.oasis-open.org/ns/opencsa/sca/200903\" targetNamespace=\"http://localcalc\" name=\"LocalCalculator\" local=\"true\">"+
+ "</composite>";
+
+ @Before
+ public void setUp() throws Exception {
+ ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+ inputFactory = XMLInputFactory.newInstance();
+ StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+
+ StAXAttributeProcessorExtensionPoint staxAttributeProcessors = extensionPoints.getExtensionPoint(StAXAttributeProcessorExtensionPoint.class);
+ staxAttributeProcessors.addArtifactProcessor(new TestAttributeProcessor());
+
+ staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance(), null);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+
+ }
+
+ @Test
+ public void testReadComposite() throws Exception {
+ InputStream is = getClass().getResourceAsStream("local.composite");
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
+ Composite composite = (Composite) staxProcessor.read(reader);
+ assertNotNull(composite);
+ assertTrue(composite.isLocal());
+ is.close();
+ }
+
+ @Test
+ public void testWriteComposite() throws Exception {
+ InputStream is = getClass().getResourceAsStream("local.composite");
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
+ Composite composite = (Composite) staxProcessor.read(reader);
+ assertNotNull(composite);
+ assertTrue(composite.isLocal());
+ is.close();
+
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ staxProcessor.write(composite, bos);
+ System.out.println(bos.toString());
+
+ assertEquals(LOCAL_COMPOSITE_XML, bos.toString());
+ }
+}
diff --git a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolvePolicyTestCase.java b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolvePolicyTestCase.java
index d9be1dff90..1e8e838a45 100644
--- a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolvePolicyTestCase.java
+++ b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ResolvePolicyTestCase.java
@@ -45,7 +45,7 @@ import org.junit.Test;
/**
* Test reading SCA XML assembly documents.
*
- * @version $Rev: 561254 $ $Date: 2007-07-31 13:16:27 +0530 (Tue, 31 Jul 2007) $
+ * @version $Rev$ $Date$
*/
public class ResolvePolicyTestCase {
diff --git a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestPolicyProcessor.java b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestPolicyProcessor.java
index e1a149494d..6180a940d4 100644
--- a/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestPolicyProcessor.java
+++ b/java/sca/modules/assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/TestPolicyProcessor.java
@@ -1,82 +1,82 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.xml;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.policy.PolicyExpression;
-
-/**
- * A PolicyExpression Processor used for testing.
- *
- * @version $Rev$ $Date$
- */
-public class TestPolicyProcessor implements StAXArtifactProcessor<PolicyExpression> {
-
- public QName getArtifactType() {
- return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
- }
-
- public PolicyExpression read(XMLStreamReader arg0) throws ContributionReadException, XMLStreamException {
- return new MockPolicyImplOne();
- }
-
- public void write(PolicyExpression arg0, XMLStreamWriter arg1) throws ContributionWriteException,
- XMLStreamException {
- }
-
- public Class<PolicyExpression> getModelType() {
- return PolicyExpression.class;
- }
-
- public void resolve(PolicyExpression arg0, ModelResolver arg1) throws ContributionResolveException {
- }
-
- public class MockPolicyImplOne implements PolicyExpression {
- public <T> T getPolicy() {
- return null;
- }
-
- public void setName(QName name) {
- }
-
- public <T> void setPolicy(T policy) {
- }
-
- public QName getName() {
- return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- }
-
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.assembly.xml;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.policy.PolicyExpression;
+
+/**
+ * A PolicyExpression Processor used for testing.
+ *
+ * @version $Rev$ $Date$
+ */
+public class TestPolicyProcessor implements StAXArtifactProcessor<PolicyExpression> {
+
+ public QName getArtifactType() {
+ return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
+ }
+
+ public PolicyExpression read(XMLStreamReader arg0) throws ContributionReadException, XMLStreamException {
+ return new MockPolicyImplOne();
+ }
+
+ public void write(PolicyExpression arg0, XMLStreamWriter arg1) throws ContributionWriteException,
+ XMLStreamException {
+ }
+
+ public Class<PolicyExpression> getModelType() {
+ return PolicyExpression.class;
+ }
+
+ public void resolve(PolicyExpression arg0, ModelResolver arg1) throws ContributionResolveException {
+ }
+
+ public class MockPolicyImplOne implements PolicyExpression {
+ public <T> T getPolicy() {
+ return null;
+ }
+
+ public void setName(QName name) {
+ }
+
+ public <T> void setPolicy(T policy) {
+ }
+
+ public QName getName() {
+ return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
+ }
+
+ public boolean isUnresolved() {
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ }
+
+ }
+}
diff --git a/java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Multiplicity.composite b/java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Multiplicity.composite
index d713a381f9..0d73d1a189 100644
--- a/java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Multiplicity.composite
+++ b/java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/Multiplicity.composite
@@ -1,32 +1,32 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://temp"
- name="composite1">
- <component name="data7">
- <implementation.java class="temp.EchoImpl"/>
- <service name="Echo">
- <interface.wsdl interface="http://echo.webservice#wsdl.interface(Echo)"/>
- </service>
- <reference multiplicity="0..n" name="reference" requires=""/>
- </component>
-
- <reference multiplicity="1..n" name="reference" promote="" requires=""/>
-</composite>
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://temp"
+ name="composite1">
+ <component name="data7">
+ <implementation.java class="temp.EchoImpl"/>
+ <service name="Echo">
+ <interface.wsdl interface="http://echo.webservice#wsdl.interface(Echo)"/>
+ </service>
+ <reference multiplicity="0..n" name="reference" requires=""/>
+ </component>
+
+ <reference multiplicity="1..n" name="reference" promote="" requires=""/>
+</composite>
diff --git a/java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/another_test_definitions.xml b/java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/another_test_definitions.xml
index bb1f3118ce..22c01b887a 100644
--- a/java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/another_test_definitions.xml
+++ b/java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/another_test_definitions.xml
@@ -1,96 +1,96 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<sca:definitions xmlns="http://test"
- targetNamespace="http://test"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
-
-<!-- simple intent -->
- <sca:intent name="tuscanyIntent_1"
- constrains="sca:binding">
- <sca:description>
- Sample Intent
- </sca:description>
- <sca:qualifier name="qualified" default="true"/>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_2"
- constrains="sca:binding">
- <sca:description>
- Sample Intent
- </sca:description>
- <sca:qualifier name="qualified" default="true"/>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_3"
- constrains="sca:binding">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_4"
- constrains="sca:binding">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
-<sca:intent name="tuscanyIntent_5"
- constrains="sca:binding">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_6"
- constrains="sca:binding">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_7"
- constrains="sca:binding">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_8"
- constrains="sca:binding">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_9"
- constrains="sca:binding">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_10"
- constrains="sca:binding">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<sca:definitions xmlns="http://test"
+ targetNamespace="http://test"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+
+<!-- simple intent -->
+ <sca:intent name="tuscanyIntent_1"
+ constrains="sca:binding">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ <sca:qualifier name="qualified" default="true"/>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_2"
+ constrains="sca:binding">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ <sca:qualifier name="qualified" default="true"/>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_3"
+ constrains="sca:binding">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_4"
+ constrains="sca:binding">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+<sca:intent name="tuscanyIntent_5"
+ constrains="sca:binding">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_6"
+ constrains="sca:binding">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_7"
+ constrains="sca:binding">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_8"
+ constrains="sca:binding">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_9"
+ constrains="sca:binding">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_10"
+ constrains="sca:binding">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
</sca:definitions> \ No newline at end of file
diff --git a/java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/local.composite b/java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/local.composite
index 6aa2ab4979..4949cd017f 100644
--- a/java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/local.composite
+++ b/java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/local.composite
@@ -1,27 +1,27 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:calc="http://localcalc"
- xmlns:test="http://testlocal"
- targetNamespace="http://localcalc"
- name="LocalCalculator"
- local="true">
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:calc="http://localcalc"
+ xmlns:test="http://testlocal"
+ targetNamespace="http://localcalc"
+ name="LocalCalculator"
+ local="true">
+
+</composite>
diff --git a/java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/test_definitions.xml b/java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/test_definitions.xml
index c59fb3537b..9de5be3212 100644
--- a/java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/test_definitions.xml
+++ b/java/sca/modules/assembly-xml/src/test/resources/org/apache/tuscany/sca/assembly/xml/test_definitions.xml
@@ -1,206 +1,206 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://test"
- xmlns:test="http://test" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
-
- <!-- Extension Types Metadata -->
- <implementationType type="sca:implementation.java" alwaysProvides="test:logging" mayProvide="test:tracing" />
- <bindingType type="sca:binding.ws" alwaysProvides="test:confidentiality" mayProvide="test:integrity" />
-
- <!-- Intents and Policysets to assume targetnamespace -->
- <intent name="TestIntentOne" constrains="sca:binding">
- <description>
- Test Intent
- </description>
- </intent>
-
- <intent name="TestIntentTwo" constrains="sca:binding" requires="test:TestIntentOne">
- <description>
- Protect messages from unauthorized reading or modification
- </description>
- </intent>
-
- <policySet name="TestPolicySetOne" provides="test:TestIntentOne" appliesTo="sca:binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for
- "basic authentication" -->
- </wsp:PolicyAttachment>
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for
- "reliability" -->
- </wsp:PolicyAttachment>
- </policySet>
-
- <!-- POLICY SETS -->
- <policySet name="SecureReliablePolicy" provides="test:confidentiality.transport test:integrity" appliesTo="sca:binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for
- "basic authentication" -->
- </wsp:PolicyAttachment>
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for
- "reliability" -->
- </wsp:PolicyAttachment>
- </policySet>
-
- <policySet name="SecureMessagingPolicies" provides="test:confidentiality" appliesTo="binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <intentMap provides="test:confidentiality" default="transport">
- <qualifier name="transport">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for "transport" alternative -->
- </wsp:PolicyAttachment>
- <wsp:PolicyAttachment>...</wsp:PolicyAttachment>
- </qualifier>
- <qualifier name="message">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for "message" alternative" -->
- </wsp:PolicyAttachment>
- </qualifier>
- </intentMap>
- </policySet>
-
- <policySet name="SecurityPolicy" provides="test:confidentiality" appliesTo="binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <intentMap provides="test:confidentiality" default="message">
- <qualifier name="message">
- <wsp:PolicyAttachment>
- <!-- policy attachment for body encryption -->
- </wsp:PolicyAttachment>
- <wsp:PolicyAttachment>
- <!-- policy attachment for whole message encryption -->
- </wsp:PolicyAttachment>
- </qualifier>
- <qualifier name="transport">
- <wsp:PolicyAttachment>
- <!-- policy attachment for transport encryption -->
- </wsp:PolicyAttachment>
- </qualifier>
- </intentMap>
- </policySet>
-
- <policySet name="BasicAuthMsgProtSecurity" provides="test:authentication test:confidentiality" appliesTo="binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903">
- <policySetReference name="test:AuthenticationPolicies" />
- <policySetReference name="test:ConfidentialityPolicies" />
- </policySet>
-
- <policySet name="AuthenticationPolicies" provides="test:authentication" appliesTo="binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for "basic
- authentication" -->
- </wsp:PolicyAttachment>
- </policySet>
-
- <policySet name="ConfidentialityPolicies" provides="test:confidentiality" appliesTo="binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <intentMap provides="test:confidentiality" default="transport">
- <qualifier name="transport">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for "transport"
- alternative -->
- </wsp:PolicyAttachment>
- <wsp:PolicyAttachment>...</wsp:PolicyAttachment>
- </qualifier>
- <qualifier name="message">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for "message"
- alternative" -->
- ...
- </wsp:PolicyAttachment>
- </qualifier>
- </intentMap>
- </policySet>
-
- <policySet name="SecureWSPolicy" provides="test:confidentiality" appliesTo="sca:binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:sp="http://schemas.xmlsoap.org/ws/2002/12/secext"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:Policy>
- <wsp:ExactlyOne>
- <wsp:All>
- <sp:SecurityToken>
- <sp:TokenType>sp:X509v3</sp:TokenType>
- </sp:SecurityToken>
- <sp:UsernameToken />
- <sp:SignedParts />
- <sp:EncryptedParts>
- <sp:Body />
- </sp:EncryptedParts>
- <sp:TransportBinding>
- <sp:IncludeTimeStamp />
- </sp:TransportBinding>
- </wsp:All>
- </wsp:ExactlyOne>
- </wsp:Policy>
- </policySet>
-
- <!-- profile intent -->
- <intent name="reliableMessageProtection" constrains="sca:binding" requires="test:messageProtection">
- <description>
- Protect messages from unauthorized reading or modification
- </description>
- </intent>
-
- <intent name="messageProtection" constrains="sca:binding" requires="test:confidentiality test:integrity">
- <description>
- Protect messages from unauthorized reading or modification
- </description>
- </intent>
-
- <!-- simple intent -->
- <intent name="confidentiality" constrains="sca:binding">
- <description>
- Communitcation thro this binding must prevent
- unauthorized users from reading the messages.
- </description>
- <qualifier name="transport" />
- <qualifier name="message" default="true" />
- </intent>
-
- <intent name="integrity" constrains="sca:binding">
- <description>
- Communitcation thro this binding must prevent
- unauthorized modification of the messages.
- </description>
- </intent>
-
- <intent name="authentication" constrains="sca:binding">
- <description>
- Communitcation thro this binding required
- Authentication.
- </description>
- </intent>
-
- <intent name="logging" constrains="sca:implementation">
- <description>
- All messages to and from this implementation must be logged
- </description>
- </intent>
-
- <intent name="tracing" constrains="sca:implementation.java">
- <description>
- Need to figure out some description for this
- </description>
- </intent>
-
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://test"
+ xmlns:test="http://test" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+
+ <!-- Extension Types Metadata -->
+ <implementationType type="sca:implementation.java" alwaysProvides="test:logging" mayProvide="test:tracing" />
+ <bindingType type="sca:binding.ws" alwaysProvides="test:confidentiality" mayProvide="test:integrity" />
+
+ <!-- Intents and Policysets to assume targetnamespace -->
+ <intent name="TestIntentOne" constrains="sca:binding">
+ <description>
+ Test Intent
+ </description>
+ </intent>
+
+ <intent name="TestIntentTwo" constrains="sca:binding" requires="test:TestIntentOne">
+ <description>
+ Protect messages from unauthorized reading or modification
+ </description>
+ </intent>
+
+ <policySet name="TestPolicySetOne" provides="test:TestIntentOne" appliesTo="sca:binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for
+ "basic authentication" -->
+ </wsp:PolicyAttachment>
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for
+ "reliability" -->
+ </wsp:PolicyAttachment>
+ </policySet>
+
+ <!-- POLICY SETS -->
+ <policySet name="SecureReliablePolicy" provides="test:confidentiality.transport test:integrity" appliesTo="sca:binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for
+ "basic authentication" -->
+ </wsp:PolicyAttachment>
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for
+ "reliability" -->
+ </wsp:PolicyAttachment>
+ </policySet>
+
+ <policySet name="SecureMessagingPolicies" provides="test:confidentiality" appliesTo="binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <intentMap provides="test:confidentiality" default="transport">
+ <qualifier name="transport">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for "transport" alternative -->
+ </wsp:PolicyAttachment>
+ <wsp:PolicyAttachment>...</wsp:PolicyAttachment>
+ </qualifier>
+ <qualifier name="message">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for "message" alternative" -->
+ </wsp:PolicyAttachment>
+ </qualifier>
+ </intentMap>
+ </policySet>
+
+ <policySet name="SecurityPolicy" provides="test:confidentiality" appliesTo="binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <intentMap provides="test:confidentiality" default="message">
+ <qualifier name="message">
+ <wsp:PolicyAttachment>
+ <!-- policy attachment for body encryption -->
+ </wsp:PolicyAttachment>
+ <wsp:PolicyAttachment>
+ <!-- policy attachment for whole message encryption -->
+ </wsp:PolicyAttachment>
+ </qualifier>
+ <qualifier name="transport">
+ <wsp:PolicyAttachment>
+ <!-- policy attachment for transport encryption -->
+ </wsp:PolicyAttachment>
+ </qualifier>
+ </intentMap>
+ </policySet>
+
+ <policySet name="BasicAuthMsgProtSecurity" provides="test:authentication test:confidentiality" appliesTo="binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+ <policySetReference name="test:AuthenticationPolicies" />
+ <policySetReference name="test:ConfidentialityPolicies" />
+ </policySet>
+
+ <policySet name="AuthenticationPolicies" provides="test:authentication" appliesTo="binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for "basic
+ authentication" -->
+ </wsp:PolicyAttachment>
+ </policySet>
+
+ <policySet name="ConfidentialityPolicies" provides="test:confidentiality" appliesTo="binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <intentMap provides="test:confidentiality" default="transport">
+ <qualifier name="transport">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for "transport"
+ alternative -->
+ </wsp:PolicyAttachment>
+ <wsp:PolicyAttachment>...</wsp:PolicyAttachment>
+ </qualifier>
+ <qualifier name="message">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for "message"
+ alternative" -->
+ ...
+ </wsp:PolicyAttachment>
+ </qualifier>
+ </intentMap>
+ </policySet>
+
+ <policySet name="SecureWSPolicy" provides="test:confidentiality" appliesTo="sca:binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:sp="http://schemas.xmlsoap.org/ws/2002/12/secext"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:Policy>
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SecurityToken>
+ <sp:TokenType>sp:X509v3</sp:TokenType>
+ </sp:SecurityToken>
+ <sp:UsernameToken />
+ <sp:SignedParts />
+ <sp:EncryptedParts>
+ <sp:Body />
+ </sp:EncryptedParts>
+ <sp:TransportBinding>
+ <sp:IncludeTimeStamp />
+ </sp:TransportBinding>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ </policySet>
+
+ <!-- profile intent -->
+ <intent name="reliableMessageProtection" constrains="sca:binding" requires="test:messageProtection">
+ <description>
+ Protect messages from unauthorized reading or modification
+ </description>
+ </intent>
+
+ <intent name="messageProtection" constrains="sca:binding" requires="test:confidentiality test:integrity">
+ <description>
+ Protect messages from unauthorized reading or modification
+ </description>
+ </intent>
+
+ <!-- simple intent -->
+ <intent name="confidentiality" constrains="sca:binding">
+ <description>
+ Communitcation thro this binding must prevent
+ unauthorized users from reading the messages.
+ </description>
+ <qualifier name="transport" />
+ <qualifier name="message" default="true" />
+ </intent>
+
+ <intent name="integrity" constrains="sca:binding">
+ <description>
+ Communitcation thro this binding must prevent
+ unauthorized modification of the messages.
+ </description>
+ </intent>
+
+ <intent name="authentication" constrains="sca:binding">
+ <description>
+ Communitcation thro this binding required
+ Authentication.
+ </description>
+ </intent>
+
+ <intent name="logging" constrains="sca:implementation">
+ <description>
+ All messages to and from this implementation must be logged
+ </description>
+ </intent>
+
+ <intent name="tracing" constrains="sca:implementation.java">
+ <description>
+ Need to figure out some description for this
+ </description>
+ </intent>
+
</definitions> \ No newline at end of file
diff --git a/java/sca/modules/assembly-xsd/src/main/java/org/apache/tuscany/sca/assembly/xsd/Constants.java b/java/sca/modules/assembly-xsd/src/main/java/org/apache/tuscany/sca/assembly/xsd/Constants.java
index cf85f5657e..b265eb4c07 100644
--- a/java/sca/modules/assembly-xsd/src/main/java/org/apache/tuscany/sca/assembly/xsd/Constants.java
+++ b/java/sca/modules/assembly-xsd/src/main/java/org/apache/tuscany/sca/assembly/xsd/Constants.java
@@ -1,101 +1,101 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.xsd;
-
-import javax.xml.namespace.QName;
-
-/**
- * Constants used in SCA assembly XML files.
- *
- * @version $Rev: 750765 $ $Date: 2009-03-06 04:36:04 +0000 (Fri, 06 Mar 2009) $
- */
-public interface Constants {
- String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
- String SCA11_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1";
-
- String COMPONENT_TYPE = "componentType";
- QName COMPONENT_TYPE_QNAME = new QName(SCA11_NS, COMPONENT_TYPE);
-
- String SERVICE = "service";
- QName SERVICE_QNAME = new QName(SCA11_NS, SERVICE);
-
- String REFERENCE = "reference";
- QName REFERENCE_QNAME = new QName(SCA11_NS, REFERENCE);
-
- String PROPERTY = "property";
- QName PROPERTY_QNAME = new QName(SCA11_NS, PROPERTY);
-
- String CONSTRAINING_TYPE = "constrainingType";
- QName CONSTRAINING_TYPE_QNAME = new QName(SCA11_NS, CONSTRAINING_TYPE);
-
- String COMPOSITE = "composite";
- QName COMPOSITE_QNAME = new QName(SCA11_NS, COMPOSITE);
-
- String INCLUDE = "include";
- QName INCLUDE_QNAME = new QName(SCA11_NS, INCLUDE);
-
- String COMPONENT = "component";
- QName COMPONENT_QNAME = new QName(SCA11_NS, COMPONENT);
-
- String WIRE = "wire";
- QName WIRE_QNAME = new QName(SCA11_NS, WIRE);
-
- String OPERATION = "operation";
- QName OPERATION_QNAME = new QName(SCA11_NS, OPERATION);
-
- String CALLBACK = "callback";
- QName CALLBACK_QNAME = new QName(SCA11_NS, CALLBACK);
-
- String IMPLEMENTATION_COMPOSITE = "implementation.composite";
- QName IMPLEMENTATION_COMPOSITE_QNAME = new QName(SCA11_NS, IMPLEMENTATION_COMPOSITE);
-
- String IMPLEMENTATION = "implementation";
- QName IMPLEMENTATION_QNAME = new QName(SCA11_NS, IMPLEMENTATION);
-
- String BINDING_SCA = "binding.sca";
- QName BINDING_SCA_QNAME = new QName(Constants.SCA11_NS, BINDING_SCA);
-
- String NAME = "name";
- String VALUE = "value";
- QName VALUE_QNAME = new QName(SCA11_NS, VALUE);
- String TARGET_NAMESPACE = "targetNamespace";
- String LOCAL = "local";
- String AUTOWIRE = "autowire";
- String NONOVERRIDABLE = "nonOverridable";
- String REPLACE = "replace";
- String REQUIRES = "requires";
- String POLICY_SETS = "policySets";
- String APPLICABLE_POLICY_SETS = "applicablePolicySets";
- String PROMOTE = "promote";
- String TARGET = "target";
- String WIRED_BY_IMPL = "wiredByImpl";
- String MULTIPLICITY = "multiplicity";
- String TYPE = "type";
- String ELEMENT = "element";
- String MANY = "many";
- String MUST_SUPPLY = "mustSupply";
- String SOURCE = "source";
- String FILE = "file";
- String URI = "uri";
- String ZERO_ONE = "0..1";
- String ZERO_N = "0..n";
- String ONE_ONE = "1..1";
- String ONE_N = "1..n";
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.assembly.xsd;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Constants used in SCA assembly XML files.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface Constants {
+ String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
+ String SCA11_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1";
+
+ String COMPONENT_TYPE = "componentType";
+ QName COMPONENT_TYPE_QNAME = new QName(SCA11_NS, COMPONENT_TYPE);
+
+ String SERVICE = "service";
+ QName SERVICE_QNAME = new QName(SCA11_NS, SERVICE);
+
+ String REFERENCE = "reference";
+ QName REFERENCE_QNAME = new QName(SCA11_NS, REFERENCE);
+
+ String PROPERTY = "property";
+ QName PROPERTY_QNAME = new QName(SCA11_NS, PROPERTY);
+
+ String CONSTRAINING_TYPE = "constrainingType";
+ QName CONSTRAINING_TYPE_QNAME = new QName(SCA11_NS, CONSTRAINING_TYPE);
+
+ String COMPOSITE = "composite";
+ QName COMPOSITE_QNAME = new QName(SCA11_NS, COMPOSITE);
+
+ String INCLUDE = "include";
+ QName INCLUDE_QNAME = new QName(SCA11_NS, INCLUDE);
+
+ String COMPONENT = "component";
+ QName COMPONENT_QNAME = new QName(SCA11_NS, COMPONENT);
+
+ String WIRE = "wire";
+ QName WIRE_QNAME = new QName(SCA11_NS, WIRE);
+
+ String OPERATION = "operation";
+ QName OPERATION_QNAME = new QName(SCA11_NS, OPERATION);
+
+ String CALLBACK = "callback";
+ QName CALLBACK_QNAME = new QName(SCA11_NS, CALLBACK);
+
+ String IMPLEMENTATION_COMPOSITE = "implementation.composite";
+ QName IMPLEMENTATION_COMPOSITE_QNAME = new QName(SCA11_NS, IMPLEMENTATION_COMPOSITE);
+
+ String IMPLEMENTATION = "implementation";
+ QName IMPLEMENTATION_QNAME = new QName(SCA11_NS, IMPLEMENTATION);
+
+ String BINDING_SCA = "binding.sca";
+ QName BINDING_SCA_QNAME = new QName(Constants.SCA11_NS, BINDING_SCA);
+
+ String NAME = "name";
+ String VALUE = "value";
+ QName VALUE_QNAME = new QName(SCA11_NS, VALUE);
+ String TARGET_NAMESPACE = "targetNamespace";
+ String LOCAL = "local";
+ String AUTOWIRE = "autowire";
+ String NONOVERRIDABLE = "nonOverridable";
+ String REPLACE = "replace";
+ String REQUIRES = "requires";
+ String POLICY_SETS = "policySets";
+ String APPLICABLE_POLICY_SETS = "applicablePolicySets";
+ String PROMOTE = "promote";
+ String TARGET = "target";
+ String WIRED_BY_IMPL = "wiredByImpl";
+ String MULTIPLICITY = "multiplicity";
+ String TYPE = "type";
+ String ELEMENT = "element";
+ String MANY = "many";
+ String MUST_SUPPLY = "mustSupply";
+ String SOURCE = "source";
+ String FILE = "file";
+ String URI = "uri";
+ String ZERO_ONE = "0..1";
+ String ZERO_N = "0..n";
+ String ONE_ONE = "1..1";
+ String ONE_N = "1..n";
+}
diff --git a/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/oasis-200401-wss-wssecurity-secext-1.0.xsd b/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/oasis-200401-wss-wssecurity-secext-1.0.xsd
index 7596dc5dc1..641798b17f 100644
--- a/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/oasis-200401-wss-wssecurity-secext-1.0.xsd
+++ b/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/oasis-200401-wss-wssecurity-secext-1.0.xsd
@@ -1,195 +1,195 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS's procedures with respect to rights in OASIS specifications can be found at the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification, can be obtained from the OASIS Executive Director.
-OASIS invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to implement this specification. Please address the information to the OASIS Executive Director.
-Copyright © OASIS Open 2002-2004. All Rights Reserved.
-This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself does not be modified in any way, such as by removing the copyright notice or references to OASIS, except as needed for the purpose of developing OASIS specifications, in which case the procedures for copyrights defined in the OASIS Intellectual Property Rights document must be followed, or as required to translate it into languages other than English.
-The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.
-This document and the information contained herein is provided on an “AS IS” basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
--->
-<xsd:schema targetNamespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" elementFormDefault="qualified" attributeFormDefault="unqualified" blockDefault="#all" version="0.2">
- <xsd:import namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
- <xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/>
- <xsd:complexType name="AttributedString">
- <xsd:annotation>
- <xsd:documentation>This type represents an element with arbitrary attributes.</xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute ref="wsu:Id"/>
- <xsd:anyAttribute namespace="##other" processContents="lax"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- <xsd:complexType name="PasswordString">
- <xsd:annotation>
- <xsd:documentation>This type is used for password elements per Section 4.1.</xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="wsse:AttributedString">
- <xsd:attribute name="Type" type="xsd:anyURI"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- <xsd:complexType name="EncodedString">
- <xsd:annotation>
- <xsd:documentation>This type is used for elements containing stringified binary data.</xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="wsse:AttributedString">
- <xsd:attribute name="EncodingType" type="xsd:anyURI"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- <xsd:complexType name="UsernameTokenType">
- <xsd:annotation>
- <xsd:documentation>This type represents a username token per Section 4.1</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="Username" type="wsse:AttributedString"/>
- <xsd:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute ref="wsu:Id"/>
- <xsd:anyAttribute namespace="##other" processContents="lax"/>
- </xsd:complexType>
- <xsd:complexType name="BinarySecurityTokenType">
- <xsd:annotation>
- <xsd:documentation>A security token that is encoded in binary</xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="wsse:EncodedString">
- <xsd:attribute name="ValueType" type="xsd:anyURI"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- <xsd:complexType name="KeyIdentifierType">
- <xsd:annotation>
- <xsd:documentation>A security token key identifier</xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="wsse:EncodedString">
- <xsd:attribute name="ValueType" type="xsd:anyURI"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- <xsd:simpleType name="tUsage">
- <xsd:annotation>
- <xsd:documentation>Typedef to allow a list of usages (as URIs).</xsd:documentation>
- </xsd:annotation>
- <xsd:list itemType="xsd:anyURI"/>
- </xsd:simpleType>
- <xsd:attribute name="Usage" type="tUsage">
- <xsd:annotation>
- <xsd:documentation>This global attribute is used to indicate the usage of a referenced or indicated token within the containing context</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:complexType name="ReferenceType">
- <xsd:annotation>
- <xsd:documentation>This type represents a reference to an external security token.</xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="URI" type="xsd:anyURI"/>
- <xsd:attribute name="ValueType" type="xsd:anyURI"/>
- <xsd:anyAttribute namespace="##other" processContents="lax"/>
- </xsd:complexType>
- <xsd:complexType name="EmbeddedType">
- <xsd:annotation>
- <xsd:documentation>This type represents a reference to an embedded security token.</xsd:documentation>
- </xsd:annotation>
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:any processContents="lax"/>
- </xsd:choice>
- <xsd:attribute name="ValueType" type="xsd:anyURI"/>
- <xsd:anyAttribute namespace="##other" processContents="lax"/>
- </xsd:complexType>
- <xsd:complexType name="SecurityTokenReferenceType">
- <xsd:annotation>
- <xsd:documentation>This type is used reference a security token.</xsd:documentation>
- </xsd:annotation>
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:any processContents="lax"/>
- </xsd:choice>
- <xsd:attribute ref="wsu:Id"/>
- <xsd:attribute ref="wsse:Usage"/>
- <xsd:anyAttribute namespace="##other" processContents="lax"/>
- </xsd:complexType>
- <xsd:complexType name="SecurityHeaderType">
- <xsd:annotation>
- <xsd:documentation>This complexType defines header block to use for security-relevant data directed at a specific SOAP actor.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:any processContents="lax" minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>The use of "any" is to allow extensibility and different forms of security data.</xsd:documentation>
- </xsd:annotation>
- </xsd:any>
- </xsd:sequence>
- <xsd:anyAttribute namespace="##other" processContents="lax"/>
- </xsd:complexType>
- <xsd:complexType name="TransformationParametersType">
- <xsd:annotation>
- <xsd:documentation>This complexType defines a container for elements to be specified from any namespace as properties/parameters of a DSIG transformation.</xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:any processContents="lax" minOccurs="0" maxOccurs="unbounded">
- <xsd:annotation>
- <xsd:documentation>The use of "any" is to allow extensibility from any namespace.</xsd:documentation>
- </xsd:annotation>
- </xsd:any>
- </xsd:sequence>
- <xsd:anyAttribute namespace="##other" processContents="lax"/>
- </xsd:complexType>
- <xsd:element name="UsernameToken" type="wsse:UsernameTokenType">
- <xsd:annotation>
- <xsd:documentation>This element defines the wsse:UsernameToken element per Section 4.1.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="BinarySecurityToken" type="wsse:BinarySecurityTokenType">
- <xsd:annotation>
- <xsd:documentation>This element defines the wsse:BinarySecurityToken element per Section 4.2.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="Reference" type="wsse:ReferenceType">
- <xsd:annotation>
- <xsd:documentation>This element defines a security token reference</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="Embedded" type="wsse:EmbeddedType">
- <xsd:annotation>
- <xsd:documentation>This element defines a security token embedded reference</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="KeyIdentifier" type="wsse:KeyIdentifierType">
- <xsd:annotation>
- <xsd:documentation>This element defines a key identifier reference</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="SecurityTokenReference" type="wsse:SecurityTokenReferenceType">
- <xsd:annotation>
- <xsd:documentation>This element defines the wsse:SecurityTokenReference per Section 4.3.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="Security" type="wsse:SecurityHeaderType">
- <xsd:annotation>
- <xsd:documentation>This element defines the wsse:Security SOAP header element per Section 4.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="TransformationParameters" type="wsse:TransformationParametersType">
- <xsd:annotation>
- <xsd:documentation>This element contains properties for transformations from any namespace, including DSIG.</xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="Password" type="wsse:PasswordString"/>
- <xsd:element name="Nonce" type="wsse:EncodedString"/>
- <xsd:simpleType name="FaultcodeEnum">
- <xsd:restriction base="xsd:QName">
- <xsd:enumeration value="wsse:UnsupportedSecurityToken"/>
- <xsd:enumeration value="wsse:UnsupportedAlgorithm"/>
- <xsd:enumeration value="wsse:InvalidSecurity"/>
- <xsd:enumeration value="wsse:InvalidSecurityToken"/>
- <xsd:enumeration value="wsse:FailedAuthentication"/>
- <xsd:enumeration value="wsse:FailedCheck"/>
- <xsd:enumeration value="wsse:SecurityTokenUnavailable"/>
- </xsd:restriction>
- </xsd:simpleType>
-</xsd:schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS's procedures with respect to rights in OASIS specifications can be found at the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification, can be obtained from the OASIS Executive Director.
+OASIS invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to implement this specification. Please address the information to the OASIS Executive Director.
+Copyright © OASIS Open 2002-2004. All Rights Reserved.
+This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself does not be modified in any way, such as by removing the copyright notice or references to OASIS, except as needed for the purpose of developing OASIS specifications, in which case the procedures for copyrights defined in the OASIS Intellectual Property Rights document must be followed, or as required to translate it into languages other than English.
+The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.
+This document and the information contained herein is provided on an “AS IS” basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+-->
+<xsd:schema targetNamespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" elementFormDefault="qualified" attributeFormDefault="unqualified" blockDefault="#all" version="0.2">
+ <xsd:import namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+ <xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"/>
+ <xsd:complexType name="AttributedString">
+ <xsd:annotation>
+ <xsd:documentation>This type represents an element with arbitrary attributes.</xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute ref="wsu:Id"/>
+ <xsd:anyAttribute namespace="##other" processContents="lax"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+ <xsd:complexType name="PasswordString">
+ <xsd:annotation>
+ <xsd:documentation>This type is used for password elements per Section 4.1.</xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="wsse:AttributedString">
+ <xsd:attribute name="Type" type="xsd:anyURI"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+ <xsd:complexType name="EncodedString">
+ <xsd:annotation>
+ <xsd:documentation>This type is used for elements containing stringified binary data.</xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="wsse:AttributedString">
+ <xsd:attribute name="EncodingType" type="xsd:anyURI"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+ <xsd:complexType name="UsernameTokenType">
+ <xsd:annotation>
+ <xsd:documentation>This type represents a username token per Section 4.1</xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="Username" type="wsse:AttributedString"/>
+ <xsd:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute ref="wsu:Id"/>
+ <xsd:anyAttribute namespace="##other" processContents="lax"/>
+ </xsd:complexType>
+ <xsd:complexType name="BinarySecurityTokenType">
+ <xsd:annotation>
+ <xsd:documentation>A security token that is encoded in binary</xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="wsse:EncodedString">
+ <xsd:attribute name="ValueType" type="xsd:anyURI"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+ <xsd:complexType name="KeyIdentifierType">
+ <xsd:annotation>
+ <xsd:documentation>A security token key identifier</xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="wsse:EncodedString">
+ <xsd:attribute name="ValueType" type="xsd:anyURI"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+ <xsd:simpleType name="tUsage">
+ <xsd:annotation>
+ <xsd:documentation>Typedef to allow a list of usages (as URIs).</xsd:documentation>
+ </xsd:annotation>
+ <xsd:list itemType="xsd:anyURI"/>
+ </xsd:simpleType>
+ <xsd:attribute name="Usage" type="tUsage">
+ <xsd:annotation>
+ <xsd:documentation>This global attribute is used to indicate the usage of a referenced or indicated token within the containing context</xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:complexType name="ReferenceType">
+ <xsd:annotation>
+ <xsd:documentation>This type represents a reference to an external security token.</xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute name="URI" type="xsd:anyURI"/>
+ <xsd:attribute name="ValueType" type="xsd:anyURI"/>
+ <xsd:anyAttribute namespace="##other" processContents="lax"/>
+ </xsd:complexType>
+ <xsd:complexType name="EmbeddedType">
+ <xsd:annotation>
+ <xsd:documentation>This type represents a reference to an embedded security token.</xsd:documentation>
+ </xsd:annotation>
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:any processContents="lax"/>
+ </xsd:choice>
+ <xsd:attribute name="ValueType" type="xsd:anyURI"/>
+ <xsd:anyAttribute namespace="##other" processContents="lax"/>
+ </xsd:complexType>
+ <xsd:complexType name="SecurityTokenReferenceType">
+ <xsd:annotation>
+ <xsd:documentation>This type is used reference a security token.</xsd:documentation>
+ </xsd:annotation>
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:any processContents="lax"/>
+ </xsd:choice>
+ <xsd:attribute ref="wsu:Id"/>
+ <xsd:attribute ref="wsse:Usage"/>
+ <xsd:anyAttribute namespace="##other" processContents="lax"/>
+ </xsd:complexType>
+ <xsd:complexType name="SecurityHeaderType">
+ <xsd:annotation>
+ <xsd:documentation>This complexType defines header block to use for security-relevant data directed at a specific SOAP actor.</xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:any processContents="lax" minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>The use of "any" is to allow extensibility and different forms of security data.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:any>
+ </xsd:sequence>
+ <xsd:anyAttribute namespace="##other" processContents="lax"/>
+ </xsd:complexType>
+ <xsd:complexType name="TransformationParametersType">
+ <xsd:annotation>
+ <xsd:documentation>This complexType defines a container for elements to be specified from any namespace as properties/parameters of a DSIG transformation.</xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:any processContents="lax" minOccurs="0" maxOccurs="unbounded">
+ <xsd:annotation>
+ <xsd:documentation>The use of "any" is to allow extensibility from any namespace.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:any>
+ </xsd:sequence>
+ <xsd:anyAttribute namespace="##other" processContents="lax"/>
+ </xsd:complexType>
+ <xsd:element name="UsernameToken" type="wsse:UsernameTokenType">
+ <xsd:annotation>
+ <xsd:documentation>This element defines the wsse:UsernameToken element per Section 4.1.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="BinarySecurityToken" type="wsse:BinarySecurityTokenType">
+ <xsd:annotation>
+ <xsd:documentation>This element defines the wsse:BinarySecurityToken element per Section 4.2.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="Reference" type="wsse:ReferenceType">
+ <xsd:annotation>
+ <xsd:documentation>This element defines a security token reference</xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="Embedded" type="wsse:EmbeddedType">
+ <xsd:annotation>
+ <xsd:documentation>This element defines a security token embedded reference</xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="KeyIdentifier" type="wsse:KeyIdentifierType">
+ <xsd:annotation>
+ <xsd:documentation>This element defines a key identifier reference</xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="SecurityTokenReference" type="wsse:SecurityTokenReferenceType">
+ <xsd:annotation>
+ <xsd:documentation>This element defines the wsse:SecurityTokenReference per Section 4.3.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="Security" type="wsse:SecurityHeaderType">
+ <xsd:annotation>
+ <xsd:documentation>This element defines the wsse:Security SOAP header element per Section 4.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="TransformationParameters" type="wsse:TransformationParametersType">
+ <xsd:annotation>
+ <xsd:documentation>This element contains properties for transformations from any namespace, including DSIG.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="Password" type="wsse:PasswordString"/>
+ <xsd:element name="Nonce" type="wsse:EncodedString"/>
+ <xsd:simpleType name="FaultcodeEnum">
+ <xsd:restriction base="xsd:QName">
+ <xsd:enumeration value="wsse:UnsupportedSecurityToken"/>
+ <xsd:enumeration value="wsse:UnsupportedAlgorithm"/>
+ <xsd:enumeration value="wsse:InvalidSecurity"/>
+ <xsd:enumeration value="wsse:InvalidSecurityToken"/>
+ <xsd:enumeration value="wsse:FailedAuthentication"/>
+ <xsd:enumeration value="wsse:FailedCheck"/>
+ <xsd:enumeration value="wsse:SecurityTokenUnavailable"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+</xsd:schema>
diff --git a/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/oasis-200401-wss-wssecurity-utility-1.0.xsd b/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/oasis-200401-wss-wssecurity-utility-1.0.xsd
index e088d137e4..f8d74e9c6e 100644
--- a/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/oasis-200401-wss-wssecurity-utility-1.0.xsd
+++ b/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/oasis-200401-wss-wssecurity-utility-1.0.xsd
@@ -1,108 +1,108 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS's procedures with respect to rights in OASIS specifications can be found at the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification, can be obtained from the OASIS Executive Director.
-OASIS invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to implement this specification. Please address the information to the OASIS Executive Director.
-Copyright © OASIS Open 2002-2004. All Rights Reserved.
-This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself does not be modified in any way, such as by removing the copyright notice or references to OASIS, except as needed for the purpose of developing OASIS specifications, in which case the procedures for copyrights defined in the OASIS Intellectual Property Rights document must be followed, or as required to translate it into languages other than English.
-The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.
-This document and the information contained herein is provided on an “AS IS” basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
--->
-<xsd:schema targetNamespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
-
-
-
-xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
-elementFormDefault="qualified" attributeFormDefault="unqualified" version="0.1">
- <!-- // Fault Codes /////////////////////////////////////////// -->
- <xsd:simpleType name="tTimestampFault">
- <xsd:annotation>
- <xsd:documentation>
-This type defines the fault code value for Timestamp message expiration.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:QName">
- <xsd:enumeration value="wsu:MessageExpired"/>
- </xsd:restriction>
- </xsd:simpleType>
- <!-- // Global attributes //////////////////////////////////// -->
- <xsd:attribute name="Id" type="xsd:ID">
- <xsd:annotation>
- <xsd:documentation>
-This global attribute supports annotating arbitrary elements with an ID.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attributeGroup name="commonAtts">
- <xsd:annotation>
- <xsd:documentation>
-Convenience attribute group used to simplify this schema.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute ref="wsu:Id" use="optional"/>
- <xsd:anyAttribute namespace="##other" processContents="lax"/>
- </xsd:attributeGroup>
- <!-- // Utility types //////////////////////////////////////// -->
- <xsd:complexType name="AttributedDateTime">
- <xsd:annotation>
- <xsd:documentation>
-This type is for elements whose [children] is a psuedo-dateTime and can have arbitrary attributes.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attributeGroup ref="wsu:commonAtts"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- <xsd:complexType name="AttributedURI">
- <xsd:annotation>
- <xsd:documentation>
-This type is for elements whose [children] is an anyURI and can have arbitrary attributes.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:anyURI">
- <xsd:attributeGroup ref="wsu:commonAtts"/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
- <!-- // Timestamp header components /////////////////////////// -->
- <xsd:complexType name="TimestampType">
- <xsd:annotation>
- <xsd:documentation>
-This complex type ties together the timestamp related elements into a composite type.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element ref="wsu:Created" minOccurs="0"/>
- <xsd:element ref="wsu:Expires" minOccurs="0"/>
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:any namespace="##other" processContents="lax"/>
- </xsd:choice>
- </xsd:sequence>
- <xsd:attributeGroup ref="wsu:commonAtts"/>
- </xsd:complexType>
- <xsd:element name="Timestamp" type="wsu:TimestampType">
- <xsd:annotation>
- <xsd:documentation>
-This element allows Timestamps to be applied anywhere element wildcards are present,
-including as a SOAP header.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <!-- global element decls to allow individual elements to appear anywhere -->
- <xsd:element name="Expires" type="wsu:AttributedDateTime">
- <xsd:annotation>
- <xsd:documentation>
-This element allows an expiration time to be applied anywhere element wildcards are present.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element name="Created" type="wsu:AttributedDateTime">
- <xsd:annotation>
- <xsd:documentation>
-This element allows a creation time to be applied anywhere element wildcards are present.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
-</xsd:schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS's procedures with respect to rights in OASIS specifications can be found at the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification, can be obtained from the OASIS Executive Director.
+OASIS invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to implement this specification. Please address the information to the OASIS Executive Director.
+Copyright © OASIS Open 2002-2004. All Rights Reserved.
+This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself does not be modified in any way, such as by removing the copyright notice or references to OASIS, except as needed for the purpose of developing OASIS specifications, in which case the procedures for copyrights defined in the OASIS Intellectual Property Rights document must be followed, or as required to translate it into languages other than English.
+The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.
+This document and the information contained herein is provided on an “AS IS” basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+-->
+<xsd:schema targetNamespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
+
+
+xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+elementFormDefault="qualified" attributeFormDefault="unqualified" version="0.1">
+ <!-- // Fault Codes /////////////////////////////////////////// -->
+ <xsd:simpleType name="tTimestampFault">
+ <xsd:annotation>
+ <xsd:documentation>
+This type defines the fault code value for Timestamp message expiration.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:restriction base="xsd:QName">
+ <xsd:enumeration value="wsu:MessageExpired"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ <!-- // Global attributes //////////////////////////////////// -->
+ <xsd:attribute name="Id" type="xsd:ID">
+ <xsd:annotation>
+ <xsd:documentation>
+This global attribute supports annotating arbitrary elements with an ID.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attributeGroup name="commonAtts">
+ <xsd:annotation>
+ <xsd:documentation>
+Convenience attribute group used to simplify this schema.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:attribute ref="wsu:Id" use="optional"/>
+ <xsd:anyAttribute namespace="##other" processContents="lax"/>
+ </xsd:attributeGroup>
+ <!-- // Utility types //////////////////////////////////////// -->
+ <xsd:complexType name="AttributedDateTime">
+ <xsd:annotation>
+ <xsd:documentation>
+This type is for elements whose [children] is a psuedo-dateTime and can have arbitrary attributes.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attributeGroup ref="wsu:commonAtts"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+ <xsd:complexType name="AttributedURI">
+ <xsd:annotation>
+ <xsd:documentation>
+This type is for elements whose [children] is an anyURI and can have arbitrary attributes.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:anyURI">
+ <xsd:attributeGroup ref="wsu:commonAtts"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+ <!-- // Timestamp header components /////////////////////////// -->
+ <xsd:complexType name="TimestampType">
+ <xsd:annotation>
+ <xsd:documentation>
+This complex type ties together the timestamp related elements into a composite type.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element ref="wsu:Created" minOccurs="0"/>
+ <xsd:element ref="wsu:Expires" minOccurs="0"/>
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:any namespace="##other" processContents="lax"/>
+ </xsd:choice>
+ </xsd:sequence>
+ <xsd:attributeGroup ref="wsu:commonAtts"/>
+ </xsd:complexType>
+ <xsd:element name="Timestamp" type="wsu:TimestampType">
+ <xsd:annotation>
+ <xsd:documentation>
+This element allows Timestamps to be applied anywhere element wildcards are present,
+including as a SOAP header.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <!-- global element decls to allow individual elements to appear anywhere -->
+ <xsd:element name="Expires" type="wsu:AttributedDateTime">
+ <xsd:annotation>
+ <xsd:documentation>
+This element allows an expiration time to be applied anywhere element wildcards are present.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+ <xsd:element name="Created" type="wsu:AttributedDateTime">
+ <xsd:annotation>
+ <xsd:documentation>
+This element allows a creation time to be applied anywhere element wildcards are present.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:element>
+</xsd:schema>
diff --git a/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/ws-addr.xsd b/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/ws-addr.xsd
index d4f272ec7f..f6fc9c53b0 100644
--- a/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/ws-addr.xsd
+++ b/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/ws-addr.xsd
@@ -1,137 +1,137 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- W3C XML Schema defined in the Web Services Addressing 1.0 specification
- http://www.w3.org/TR/ws-addr-core
-
- Copyright © 2005 World Wide Web Consortium,
-
- (Massachusetts Institute of Technology, European Research Consortium for
- Informatics and Mathematics, Keio University). All Rights Reserved. This
- work is distributed under the W3C® Software License [1] in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
-
- $Id: ws-addr.xsd,v 1.2 2008/07/23 13:38:16 plehegar Exp $
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.w3.org/2005/08/addressing" targetNamespace="http://www.w3.org/2005/08/addressing" blockDefault="#all" elementFormDefault="qualified" finalDefault="" attributeFormDefault="unqualified">
-
- <!-- Constructs from the WS-Addressing Core -->
-
- <xs:element name="EndpointReference" type="tns:EndpointReferenceType"/>
- <xs:complexType name="EndpointReferenceType" mixed="false">
- <xs:sequence>
- <xs:element name="Address" type="tns:AttributedURIType"/>
- <xs:element ref="tns:ReferenceParameters" minOccurs="0"/>
- <xs:element ref="tns:Metadata" minOccurs="0"/>
- <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:complexType>
-
- <xs:element name="ReferenceParameters" type="tns:ReferenceParametersType"/>
- <xs:complexType name="ReferenceParametersType" mixed="false">
- <xs:sequence>
- <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:complexType>
-
- <xs:element name="Metadata" type="tns:MetadataType"/>
- <xs:complexType name="MetadataType" mixed="false">
- <xs:sequence>
- <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:complexType>
-
- <xs:element name="MessageID" type="tns:AttributedURIType"/>
- <xs:element name="RelatesTo" type="tns:RelatesToType"/>
- <xs:complexType name="RelatesToType" mixed="false">
- <xs:simpleContent>
- <xs:extension base="xs:anyURI">
- <xs:attribute name="RelationshipType" type="tns:RelationshipTypeOpenEnum" use="optional" default="http://www.w3.org/2005/08/addressing/reply"/>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:simpleType name="RelationshipTypeOpenEnum">
- <xs:union memberTypes="tns:RelationshipType xs:anyURI"/>
- </xs:simpleType>
-
- <xs:simpleType name="RelationshipType">
- <xs:restriction base="xs:anyURI">
- <xs:enumeration value="http://www.w3.org/2005/08/addressing/reply"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:element name="ReplyTo" type="tns:EndpointReferenceType"/>
- <xs:element name="From" type="tns:EndpointReferenceType"/>
- <xs:element name="FaultTo" type="tns:EndpointReferenceType"/>
- <xs:element name="To" type="tns:AttributedURIType"/>
- <xs:element name="Action" type="tns:AttributedURIType"/>
-
- <xs:complexType name="AttributedURIType" mixed="false">
- <xs:simpleContent>
- <xs:extension base="xs:anyURI">
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <!-- Constructs from the WS-Addressing SOAP binding -->
-
- <xs:attribute name="IsReferenceParameter" type="xs:boolean"/>
-
- <xs:simpleType name="FaultCodesOpenEnumType">
- <xs:union memberTypes="tns:FaultCodesType xs:QName"/>
- </xs:simpleType>
-
- <xs:simpleType name="FaultCodesType">
- <xs:restriction base="xs:QName">
- <xs:enumeration value="tns:InvalidAddressingHeader"/>
- <xs:enumeration value="tns:InvalidAddress"/>
- <xs:enumeration value="tns:InvalidEPR"/>
- <xs:enumeration value="tns:InvalidCardinality"/>
- <xs:enumeration value="tns:MissingAddressInEPR"/>
- <xs:enumeration value="tns:DuplicateMessageID"/>
- <xs:enumeration value="tns:ActionMismatch"/>
- <xs:enumeration value="tns:MessageAddressingHeaderRequired"/>
- <xs:enumeration value="tns:DestinationUnreachable"/>
- <xs:enumeration value="tns:ActionNotSupported"/>
- <xs:enumeration value="tns:EndpointUnavailable"/>
- </xs:restriction>
- </xs:simpleType>
-
- <xs:element name="RetryAfter" type="tns:AttributedUnsignedLongType"/>
- <xs:complexType name="AttributedUnsignedLongType" mixed="false">
- <xs:simpleContent>
- <xs:extension base="xs:unsignedLong">
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="ProblemHeaderQName" type="tns:AttributedQNameType"/>
- <xs:complexType name="AttributedQNameType" mixed="false">
- <xs:simpleContent>
- <xs:extension base="xs:QName">
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
-
- <xs:element name="ProblemIRI" type="tns:AttributedURIType"/>
-
- <xs:element name="ProblemAction" type="tns:ProblemActionType"/>
- <xs:complexType name="ProblemActionType" mixed="false">
- <xs:sequence>
- <xs:element ref="tns:Action" minOccurs="0"/>
- <xs:element name="SoapAction" minOccurs="0" type="xs:anyURI"/>
- </xs:sequence>
- <xs:anyAttribute namespace="##other" processContents="lax"/>
- </xs:complexType>
-
-</xs:schema>
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ W3C XML Schema defined in the Web Services Addressing 1.0 specification
+ http://www.w3.org/TR/ws-addr-core
+
+ Copyright © 2005 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C® Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+
+ $Id: ws-addr.xsd,v 1.2 2008/07/23 13:38:16 plehegar Exp $
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.w3.org/2005/08/addressing" targetNamespace="http://www.w3.org/2005/08/addressing" blockDefault="#all" elementFormDefault="qualified" finalDefault="" attributeFormDefault="unqualified">
+
+ <!-- Constructs from the WS-Addressing Core -->
+
+ <xs:element name="EndpointReference" type="tns:EndpointReferenceType"/>
+ <xs:complexType name="EndpointReferenceType" mixed="false">
+ <xs:sequence>
+ <xs:element name="Address" type="tns:AttributedURIType"/>
+ <xs:element ref="tns:ReferenceParameters" minOccurs="0"/>
+ <xs:element ref="tns:Metadata" minOccurs="0"/>
+ <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:complexType>
+
+ <xs:element name="ReferenceParameters" type="tns:ReferenceParametersType"/>
+ <xs:complexType name="ReferenceParametersType" mixed="false">
+ <xs:sequence>
+ <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:complexType>
+
+ <xs:element name="Metadata" type="tns:MetadataType"/>
+ <xs:complexType name="MetadataType" mixed="false">
+ <xs:sequence>
+ <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:complexType>
+
+ <xs:element name="MessageID" type="tns:AttributedURIType"/>
+ <xs:element name="RelatesTo" type="tns:RelatesToType"/>
+ <xs:complexType name="RelatesToType" mixed="false">
+ <xs:simpleContent>
+ <xs:extension base="xs:anyURI">
+ <xs:attribute name="RelationshipType" type="tns:RelationshipTypeOpenEnum" use="optional" default="http://www.w3.org/2005/08/addressing/reply"/>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:simpleType name="RelationshipTypeOpenEnum">
+ <xs:union memberTypes="tns:RelationshipType xs:anyURI"/>
+ </xs:simpleType>
+
+ <xs:simpleType name="RelationshipType">
+ <xs:restriction base="xs:anyURI">
+ <xs:enumeration value="http://www.w3.org/2005/08/addressing/reply"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:element name="ReplyTo" type="tns:EndpointReferenceType"/>
+ <xs:element name="From" type="tns:EndpointReferenceType"/>
+ <xs:element name="FaultTo" type="tns:EndpointReferenceType"/>
+ <xs:element name="To" type="tns:AttributedURIType"/>
+ <xs:element name="Action" type="tns:AttributedURIType"/>
+
+ <xs:complexType name="AttributedURIType" mixed="false">
+ <xs:simpleContent>
+ <xs:extension base="xs:anyURI">
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <!-- Constructs from the WS-Addressing SOAP binding -->
+
+ <xs:attribute name="IsReferenceParameter" type="xs:boolean"/>
+
+ <xs:simpleType name="FaultCodesOpenEnumType">
+ <xs:union memberTypes="tns:FaultCodesType xs:QName"/>
+ </xs:simpleType>
+
+ <xs:simpleType name="FaultCodesType">
+ <xs:restriction base="xs:QName">
+ <xs:enumeration value="tns:InvalidAddressingHeader"/>
+ <xs:enumeration value="tns:InvalidAddress"/>
+ <xs:enumeration value="tns:InvalidEPR"/>
+ <xs:enumeration value="tns:InvalidCardinality"/>
+ <xs:enumeration value="tns:MissingAddressInEPR"/>
+ <xs:enumeration value="tns:DuplicateMessageID"/>
+ <xs:enumeration value="tns:ActionMismatch"/>
+ <xs:enumeration value="tns:MessageAddressingHeaderRequired"/>
+ <xs:enumeration value="tns:DestinationUnreachable"/>
+ <xs:enumeration value="tns:ActionNotSupported"/>
+ <xs:enumeration value="tns:EndpointUnavailable"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:element name="RetryAfter" type="tns:AttributedUnsignedLongType"/>
+ <xs:complexType name="AttributedUnsignedLongType" mixed="false">
+ <xs:simpleContent>
+ <xs:extension base="xs:unsignedLong">
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:element name="ProblemHeaderQName" type="tns:AttributedQNameType"/>
+ <xs:complexType name="AttributedQNameType" mixed="false">
+ <xs:simpleContent>
+ <xs:extension base="xs:QName">
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:element name="ProblemIRI" type="tns:AttributedURIType"/>
+
+ <xs:element name="ProblemAction" type="tns:ProblemActionType"/>
+ <xs:complexType name="ProblemActionType" mixed="false">
+ <xs:sequence>
+ <xs:element ref="tns:Action" minOccurs="0"/>
+ <xs:element name="SoapAction" minOccurs="0" type="xs:anyURI"/>
+ </xs:sequence>
+ <xs:anyAttribute namespace="##other" processContents="lax"/>
+ </xs:complexType>
+
+</xs:schema>
diff --git a/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/ws-policy.xsd b/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/ws-policy.xsd
index 8d4bd32fc4..c43e5814ed 100644
--- a/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/ws-policy.xsd
+++ b/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/ws-policy.xsd
@@ -1,141 +1,141 @@
-<?xml version='1.0' encoding='utf-8' ?>
-<!--
-
- W3C XML Schema defined in the Web Services Policy 1.5
- Framework specification
-
- http://www.w3.org/TR/ws-policy-framework
-
- Copyright © 2006 World Wide Web Consortium,
-
- (Massachusetts Institute of Technology, European Research Consortium for
- Informatics and Mathematics, Keio University). All Rights Reserved. This
- work is distributed under the W3C® Software License [1] in the hope that
- it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
-
- $Id: ws-policy.xsd,v 1.2 2007/02/14 16:38:37 fsasaki Exp $
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:tns="http://www.w3.org/ns/ws-policy"
- xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
- xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
- targetNamespace="http://www.w3.org/ns/ws-policy" blockDefault="#all"
- elementFormDefault="qualified">
-
- <xs:import
- namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
- schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" />
-
- <xs:import
- namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
- schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" />
-
- <xs:import
- namespace="http://www.w3.org/XML/1998/namespace"
- schemaLocation="http://www.w3.org/2001/xml.xsd" />
-
- <!-- Constructs from the Web Services Policy 1.5 Framework -->
-
- <xs:element name="Policy" >
- <xs:complexType>
-
- <xs:complexContent>
- <xs:extension base="tns:OperatorContentType" >
- <xs:attribute name="Name" type="xs:anyURI" />
- <xs:anyAttribute namespace="##any" processContents="lax" />
- </xs:extension>
- </xs:complexContent>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="All" type="tns:OperatorContentType" />
- <xs:element name="ExactlyOne" type="tns:OperatorContentType" />
-
- <xs:complexType name="OperatorContentType" >
- <xs:sequence>
- <xs:choice minOccurs="0" maxOccurs="unbounded" >
- <xs:element ref="tns:Policy" />
- <xs:element ref="tns:All" />
- <xs:element ref="tns:ExactlyOne" />
-
- <xs:element ref="tns:PolicyReference" />
- <xs:any namespace="##other" processContents="lax" />
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
-
- <xs:element name="PolicyReference" >
- <xs:complexType>
- <xs:sequence>
- <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </xs:sequence>
- <xs:attribute name="URI" type="xs:anyURI" use="required" />
-
- <xs:attribute name="Digest" type="xs:base64Binary" />
- <xs:attribute name="DigestAlgorithm"
- type="xs:anyURI"
- default="http://www.w3.org/ns/ws-policy/Sha1Exc"
- />
- <xs:anyAttribute namespace="##any" processContents="lax" />
- </xs:complexType>
- </xs:element>
-
- <xs:attribute name="Optional" type="xs:boolean" default="false" />
- <xs:attribute name="Ignorable" type="xs:boolean" default="false" />
-
- <!-- Constructs from the Web Services Policy 1.5 Attachment -->
-
- <xs:attribute name="PolicyURIs" >
- <xs:simpleType>
- <xs:list itemType="xs:anyURI" />
- </xs:simpleType>
- </xs:attribute>
-
- <xs:element name="PolicyAttachment" >
- <xs:complexType>
- <xs:sequence>
-
- <xs:element ref="tns:AppliesTo" />
- <xs:choice maxOccurs="unbounded" >
- <xs:element ref="tns:Policy" />
- <xs:element ref="tns:PolicyReference" />
- </xs:choice>
- <!-- omitted only because it causes the content model to be non-determistic
- <xs:element ref="wsse:Security" minOccurs="0" />
--->
- <xs:any namespace="##other"
- processContents="lax"
- minOccurs="0"
- maxOccurs="unbounded" />
- </xs:sequence>
- <xs:anyAttribute namespace="##any" processContents="lax" />
-
- </xs:complexType>
- </xs:element>
-
- <xs:element name="AppliesTo" >
- <xs:complexType>
- <xs:sequence>
- <xs:any namespace="##any"
- processContents="lax"
- maxOccurs="unbounded" />
- </xs:sequence>
- <xs:anyAttribute namespace="##any" processContents="lax" />
-
- </xs:complexType>
- </xs:element>
-
- <xs:element name="URI">
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:anyURI">
- <xs:anyAttribute namespace="##any" processContents="lax" />
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- </xs:element>
-
-</xs:schema>
+<?xml version='1.0' encoding='utf-8' ?>
+<!--
+
+ W3C XML Schema defined in the Web Services Policy 1.5
+ Framework specification
+
+ http://www.w3.org/TR/ws-policy-framework
+
+ Copyright © 2006 World Wide Web Consortium,
+
+ (Massachusetts Institute of Technology, European Research Consortium for
+ Informatics and Mathematics, Keio University). All Rights Reserved. This
+ work is distributed under the W3C® Software License [1] in the hope that
+ it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+ [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+
+ $Id: ws-policy.xsd,v 1.2 2007/02/14 16:38:37 fsasaki Exp $
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://www.w3.org/ns/ws-policy"
+ xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+ targetNamespace="http://www.w3.org/ns/ws-policy" blockDefault="#all"
+ elementFormDefault="qualified">
+
+ <xs:import
+ namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
+ schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" />
+
+ <xs:import
+ namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+ schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" />
+
+ <xs:import
+ namespace="http://www.w3.org/XML/1998/namespace"
+ schemaLocation="http://www.w3.org/2001/xml.xsd" />
+
+ <!-- Constructs from the Web Services Policy 1.5 Framework -->
+
+ <xs:element name="Policy" >
+ <xs:complexType>
+
+ <xs:complexContent>
+ <xs:extension base="tns:OperatorContentType" >
+ <xs:attribute name="Name" type="xs:anyURI" />
+ <xs:anyAttribute namespace="##any" processContents="lax" />
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="All" type="tns:OperatorContentType" />
+ <xs:element name="ExactlyOne" type="tns:OperatorContentType" />
+
+ <xs:complexType name="OperatorContentType" >
+ <xs:sequence>
+ <xs:choice minOccurs="0" maxOccurs="unbounded" >
+ <xs:element ref="tns:Policy" />
+ <xs:element ref="tns:All" />
+ <xs:element ref="tns:ExactlyOne" />
+
+ <xs:element ref="tns:PolicyReference" />
+ <xs:any namespace="##other" processContents="lax" />
+ </xs:choice>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name="PolicyReference" >
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="URI" type="xs:anyURI" use="required" />
+
+ <xs:attribute name="Digest" type="xs:base64Binary" />
+ <xs:attribute name="DigestAlgorithm"
+ type="xs:anyURI"
+ default="http://www.w3.org/ns/ws-policy/Sha1Exc"
+ />
+ <xs:anyAttribute namespace="##any" processContents="lax" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:attribute name="Optional" type="xs:boolean" default="false" />
+ <xs:attribute name="Ignorable" type="xs:boolean" default="false" />
+
+ <!-- Constructs from the Web Services Policy 1.5 Attachment -->
+
+ <xs:attribute name="PolicyURIs" >
+ <xs:simpleType>
+ <xs:list itemType="xs:anyURI" />
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:element name="PolicyAttachment" >
+ <xs:complexType>
+ <xs:sequence>
+
+ <xs:element ref="tns:AppliesTo" />
+ <xs:choice maxOccurs="unbounded" >
+ <xs:element ref="tns:Policy" />
+ <xs:element ref="tns:PolicyReference" />
+ </xs:choice>
+ <!-- omitted only because it causes the content model to be non-determistic
+ <xs:element ref="wsse:Security" minOccurs="0" />
+-->
+ <xs:any namespace="##other"
+ processContents="lax"
+ minOccurs="0"
+ maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:anyAttribute namespace="##any" processContents="lax" />
+
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="AppliesTo" >
+ <xs:complexType>
+ <xs:sequence>
+ <xs:any namespace="##any"
+ processContents="lax"
+ maxOccurs="unbounded" />
+ </xs:sequence>
+ <xs:anyAttribute namespace="##any" processContents="lax" />
+
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="URI">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:anyURI">
+ <xs:anyAttribute namespace="##any" processContents="lax" />
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
diff --git a/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/xml.xsd b/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/xml.xsd
index 267b0d33b4..ac4b0ec8e6 100644
--- a/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/xml.xsd
+++ b/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/xml.xsd
@@ -1,117 +1,117 @@
-<?xml version='1.0'?>
-<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" >
-<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en">
-
- <xs:annotation>
- <xs:documentation>
- See http://www.w3.org/XML/1998/namespace.html and
- http://www.w3.org/TR/REC-xml for information about this namespace.
-
- This schema document describes the XML namespace, in a form
- suitable for import by other schema documents.
-
- Note that local names in this namespace are intended to be defined
- only by the World Wide Web Consortium or its subgroups. The
- following names are currently defined in this namespace and should
- not be used with conflicting semantics by any Working Group,
- specification, or document instance:
-
- base (as an attribute name): denotes an attribute whose value
- provides a URI to be used as the base for interpreting any
- relative URIs in the scope of the element on which it
- appears; its value is inherited. This name is reserved
- by virtue of its definition in the XML Base specification.
-
- lang (as an attribute name): denotes an attribute whose value
- is a language code for the natural language of the content of
- any element; its value is inherited. This name is reserved
- by virtue of its definition in the XML specification.
-
- space (as an attribute name): denotes an attribute whose
- value is a keyword indicating what whitespace processing
- discipline is intended for the content of the element; its
- value is inherited. This name is reserved by virtue of its
- definition in the XML specification.
-
- Father (in any context at all): denotes Jon Bosak, the chair of
- the original XML Working Group. This name is reserved by
- the following decision of the W3C XML Plenary and
- XML Coordination groups:
-
- In appreciation for his vision, leadership and dedication
- the W3C XML Plenary on this 10th day of February, 2000
- reserves for Jon Bosak in perpetuity the XML name
- xml:Father
- </xs:documentation>
- </xs:annotation>
-
- <xs:annotation>
- <xs:documentation>This schema defines attributes and an attribute group
- suitable for use by
- schemas wishing to allow xml:base, xml:lang or xml:space attributes
- on elements they define.
-
- To enable this, such a schema must import this schema
- for the XML namespace, e.g. as follows:
- &lt;schema . . .>
- . . .
- &lt;import namespace="http://www.w3.org/XML/1998/namespace"
- schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
-
- Subsequently, qualified reference to any of the attributes
- or the group defined below will have the desired effect, e.g.
-
- &lt;type . . .>
- . . .
- &lt;attributeGroup ref="xml:specialAttrs"/>
-
- will define a type which will schema-validate an instance
- element with any of those attributes</xs:documentation>
- </xs:annotation>
-
- <xs:annotation>
- <xs:documentation>In keeping with the XML Schema WG's standard versioning
- policy, this schema document will persist at
- http://www.w3.org/2001/03/xml.xsd.
- At the date of issue it can also be found at
- http://www.w3.org/2001/xml.xsd.
- The schema document at that URI may however change in the future,
- in order to remain compatible with the latest version of XML Schema
- itself. In other words, if the XML Schema namespace changes, the version
- of this document at
- http://www.w3.org/2001/xml.xsd will change
- accordingly; the version at
- http://www.w3.org/2001/03/xml.xsd will not change.
- </xs:documentation>
- </xs:annotation>
-
- <xs:attribute name="lang" type="xs:language">
- <xs:annotation>
- <xs:documentation>In due course, we should install the relevant ISO 2- and 3-letter
- codes as the enumerated possible values . . .</xs:documentation>
- </xs:annotation>
- </xs:attribute>
-
- <xs:attribute name="space" default="preserve">
- <xs:simpleType>
- <xs:restriction base="xs:NCName">
- <xs:enumeration value="default"/>
- <xs:enumeration value="preserve"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
-
- <xs:attribute name="base" type="xs:anyURI">
- <xs:annotation>
- <xs:documentation>See http://www.w3.org/TR/xmlbase/ for
- information about this attribute.</xs:documentation>
- </xs:annotation>
- </xs:attribute>
-
- <xs:attributeGroup name="specialAttrs">
- <xs:attribute ref="xml:base"/>
- <xs:attribute ref="xml:lang"/>
- <xs:attribute ref="xml:space"/>
- </xs:attributeGroup>
-
-</xs:schema>
+<?xml version='1.0'?>
+<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" >
+<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en">
+
+ <xs:annotation>
+ <xs:documentation>
+ See http://www.w3.org/XML/1998/namespace.html and
+ http://www.w3.org/TR/REC-xml for information about this namespace.
+
+ This schema document describes the XML namespace, in a form
+ suitable for import by other schema documents.
+
+ Note that local names in this namespace are intended to be defined
+ only by the World Wide Web Consortium or its subgroups. The
+ following names are currently defined in this namespace and should
+ not be used with conflicting semantics by any Working Group,
+ specification, or document instance:
+
+ base (as an attribute name): denotes an attribute whose value
+ provides a URI to be used as the base for interpreting any
+ relative URIs in the scope of the element on which it
+ appears; its value is inherited. This name is reserved
+ by virtue of its definition in the XML Base specification.
+
+ lang (as an attribute name): denotes an attribute whose value
+ is a language code for the natural language of the content of
+ any element; its value is inherited. This name is reserved
+ by virtue of its definition in the XML specification.
+
+ space (as an attribute name): denotes an attribute whose
+ value is a keyword indicating what whitespace processing
+ discipline is intended for the content of the element; its
+ value is inherited. This name is reserved by virtue of its
+ definition in the XML specification.
+
+ Father (in any context at all): denotes Jon Bosak, the chair of
+ the original XML Working Group. This name is reserved by
+ the following decision of the W3C XML Plenary and
+ XML Coordination groups:
+
+ In appreciation for his vision, leadership and dedication
+ the W3C XML Plenary on this 10th day of February, 2000
+ reserves for Jon Bosak in perpetuity the XML name
+ xml:Father
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+ <xs:documentation>This schema defines attributes and an attribute group
+ suitable for use by
+ schemas wishing to allow xml:base, xml:lang or xml:space attributes
+ on elements they define.
+
+ To enable this, such a schema must import this schema
+ for the XML namespace, e.g. as follows:
+ &lt;schema . . .>
+ . . .
+ &lt;import namespace="http://www.w3.org/XML/1998/namespace"
+ schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
+
+ Subsequently, qualified reference to any of the attributes
+ or the group defined below will have the desired effect, e.g.
+
+ &lt;type . . .>
+ . . .
+ &lt;attributeGroup ref="xml:specialAttrs"/>
+
+ will define a type which will schema-validate an instance
+ element with any of those attributes</xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+ <xs:documentation>In keeping with the XML Schema WG's standard versioning
+ policy, this schema document will persist at
+ http://www.w3.org/2001/03/xml.xsd.
+ At the date of issue it can also be found at
+ http://www.w3.org/2001/xml.xsd.
+ The schema document at that URI may however change in the future,
+ in order to remain compatible with the latest version of XML Schema
+ itself. In other words, if the XML Schema namespace changes, the version
+ of this document at
+ http://www.w3.org/2001/xml.xsd will change
+ accordingly; the version at
+ http://www.w3.org/2001/03/xml.xsd will not change.
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:attribute name="lang" type="xs:language">
+ <xs:annotation>
+ <xs:documentation>In due course, we should install the relevant ISO 2- and 3-letter
+ codes as the enumerated possible values . . .</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attribute name="space" default="preserve">
+ <xs:simpleType>
+ <xs:restriction base="xs:NCName">
+ <xs:enumeration value="default"/>
+ <xs:enumeration value="preserve"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="base" type="xs:anyURI">
+ <xs:annotation>
+ <xs:documentation>See http://www.w3.org/TR/xmlbase/ for
+ information about this attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attributeGroup name="specialAttrs">
+ <xs:attribute ref="xml:base"/>
+ <xs:attribute ref="xml:lang"/>
+ <xs:attribute ref="xml:space"/>
+ </xs:attributeGroup>
+
+</xs:schema>
diff --git a/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/xmldsig-core-schema.xsd b/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/xmldsig-core-schema.xsd
index df126b30e6..16c791e533 100644
--- a/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/xmldsig-core-schema.xsd
+++ b/java/sca/modules/assembly-xsd/src/main/resources/org/apache/tuscany/sca/assembly/xsd/xmldsig-core-schema.xsd
@@ -11,7 +11,7 @@
<!-- Schema for XML Signatures
http://www.w3.org/2000/09/xmldsig#
- $Revision: 1.1 $ on $Date: 2002/02/08 20:32:26 $ by $Author: reagle $
+ $Revision$ on $Date$ by $Author: reagle $
Copyright 2001 The Internet Society and W3C (Massachusetts Institute
of Technology, Institut National de Recherche en Informatique et en
diff --git a/java/sca/modules/assembly-xsd/src/main/resources/sca-contribution-java-1.1-cd01.xsd b/java/sca/modules/assembly-xsd/src/main/resources/sca-contribution-java-1.1-cd01.xsd
index 8923a4b9e2..a5e0c87b22 100644
--- a/java/sca/modules/assembly-xsd/src/main/resources/sca-contribution-java-1.1-cd01.xsd
+++ b/java/sca/modules/assembly-xsd/src/main/resources/sca-contribution-java-1.1-cd01.xsd
@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2009. All Rights Reserved. OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- elementFormDefault="qualified">
-
- <include schemaLocation="sca-contribution-1.1-cd03.xsd"/>
-
- <!-- Import.java -->
- <element name="import.java" type="sca:JavaImportType"
- substitutionGroup="sca:importBase" />
- <complexType name="JavaImportType">
- <complexContent>
- <extension base="sca:Import">
- <attribute name="package" type="NCName" use="required"/>
- <attribute name="location" type="anyURI" use="optional"/>
- </extension>
- </complexContent>
- </complexType>
-
- <!-- Export.java -->
- <element name="export.java" type="sca:JavaExportType"
- substitutionGroup="sca:exportBase" />
- <complexType name="JavaExportType">
- <complexContent>
- <extension base="sca:Export">
- <attribute name="package" type="NCName" use="required"/>
- </extension>
- </complexContent>
- </complexType>
-
-</schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2009. All Rights Reserved. OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ elementFormDefault="qualified">
+
+ <include schemaLocation="sca-contribution-1.1-cd03.xsd"/>
+
+ <!-- Import.java -->
+ <element name="import.java" type="sca:JavaImportType"
+ substitutionGroup="sca:importBase" />
+ <complexType name="JavaImportType">
+ <complexContent>
+ <extension base="sca:Import">
+ <attribute name="package" type="NCName" use="required"/>
+ <attribute name="location" type="anyURI" use="optional"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- Export.java -->
+ <element name="export.java" type="sca:JavaExportType"
+ substitutionGroup="sca:exportBase" />
+ <complexType name="JavaExportType">
+ <complexContent>
+ <extension base="sca:Export">
+ <attribute name="package" type="NCName" use="required"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+</schema>
diff --git a/java/sca/modules/assembly-xsd/src/main/resources/sca-implementation-spring-1.1.xsd b/java/sca/modules/assembly-xsd/src/main/resources/sca-implementation-spring-1.1.xsd
index 1e64dd0e47..9c42063977 100644
--- a/java/sca/modules/assembly-xsd/src/main/resources/sca-implementation-spring-1.1.xsd
+++ b/java/sca/modules/assembly-xsd/src/main/resources/sca-implementation-spring-1.1.xsd
@@ -1,22 +1,22 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- elementFormDefault="qualified"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200903">
-
- <include schemaLocation="sca-core-1.1-cd03.xsd"/>
- <element name="implementation.spring" type="sca:SpringImplementation" substitutionGroup="sca:implementation"/>
- <complexType name="SpringImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="location" type="anyURI" use="required"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
-</schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ elementFormDefault="qualified"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+
+ <include schemaLocation="sca-core-1.1-cd03.xsd"/>
+ <element name="implementation.spring" type="sca:SpringImplementation" substitutionGroup="sca:implementation"/>
+ <complexType name="SpringImplementation">
+ <complexContent>
+ <extension base="sca:Implementation">
+ <sequence>
+ <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="location" type="anyURI" use="required"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </extension>
+ </complexContent>
+ </complexType>
+</schema>
diff --git a/java/sca/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1-implementation-osgi.xsd b/java/sca/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1-implementation-osgi.xsd
index 65d85066ae..4fd2bd0b06 100644
--- a/java/sca/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1-implementation-osgi.xsd
+++ b/java/sca/modules/assembly-xsd/src/main/resources/tuscany-sca-1.1-implementation-osgi.xsd
@@ -1,53 +1,53 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
- elementFormDefault="qualified">
-
- <import namespace="http://docs.oasis-open.org/ns/opencsa/sca/200903" schemaLocation="sca-1.1-cd03.xsd"/>
-
- <element name="implementation.osgi" type="t:OSGiImplementation"/>
-
- <complexType name="OSGiImplementation">
- <complexContent>
- <extension base="sca:Implementation">
- <sequence>
- <any namespace="##targetNamespace" processContents="lax"
- minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="bundleSymbolicName" type="string" use="required"/>
- <attribute name="bundleVersion" type="string" use="optional"/>
- <anyAttribute namespace="##any" processContents="lax"/>
- </extension>
- </complexContent>
- </complexType>
- <element name="osgi.property" type="t:OSGiProperty"/>
- <complexType name="OSGiProperty">
- <simpleContent>
- <extension base="string">
- <attribute name="name" type="NCName" use="required"/>
- <attribute name="value" type="string" use="optional"/>
- </extension>
- </simpleContent>
- </complexType>
-
-</schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
+ elementFormDefault="qualified">
+
+ <import namespace="http://docs.oasis-open.org/ns/opencsa/sca/200903" schemaLocation="sca-1.1-cd03.xsd"/>
+
+ <element name="implementation.osgi" type="t:OSGiImplementation"/>
+
+ <complexType name="OSGiImplementation">
+ <complexContent>
+ <extension base="sca:Implementation">
+ <sequence>
+ <any namespace="##targetNamespace" processContents="lax"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="bundleSymbolicName" type="string" use="required"/>
+ <attribute name="bundleVersion" type="string" use="optional"/>
+ <anyAttribute namespace="##any" processContents="lax"/>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name="osgi.property" type="t:OSGiProperty"/>
+ <complexType name="OSGiProperty">
+ <simpleContent>
+ <extension base="string">
+ <attribute name="name" type="NCName" use="required"/>
+ <attribute name="value" type="string" use="optional"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+
+</schema>
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DistributedSCABinding.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DistributedSCABinding.java
index f1e25a0867..5cc43d6333 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DistributedSCABinding.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/DistributedSCABinding.java
@@ -1,45 +1,45 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly;
-
-import javax.xml.namespace.QName;
-
-/**
- * Represents an SCA binding used in the distributed runtime.
- * It provides us with a sensibly named type against which
- * distributed sca binding providers can be registered
- *
- * @version $Rev: 556322 $ $Date: 2007-07-14 19:53:15 +0100 (Sat, 14 Jul 2007) $
- */
-public interface DistributedSCABinding extends Binding {
- QName TYPE = SCABinding.TYPE;
-
- /**
- * Return the wrapped SCA binding
- * @return the SCA binding model element
- */
- SCABinding getSCABinding();
-
- /**
- * Set the wrapped SCA binding
- * @param scaBinding the SCA binding model element
- */
- void setSCABinding(SCABinding scaBinding);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.assembly;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Represents an SCA binding used in the distributed runtime.
+ * It provides us with a sensibly named type against which
+ * distributed sca binding providers can be registered
+ *
+ * @version $Rev$ $Date$
+ */
+public interface DistributedSCABinding extends Binding {
+ QName TYPE = SCABinding.TYPE;
+
+ /**
+ * Return the wrapped SCA binding
+ * @return the SCA binding model element
+ */
+ SCABinding getSCABinding();
+
+ /**
+ * Set the wrapped SCA binding
+ * @param scaBinding the SCA binding model element
+ */
+ void setSCABinding(SCABinding scaBinding);
+
+}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DomainBuilder.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DomainBuilder.java
index 655e18ad08..6fa2d18037 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DomainBuilder.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/DomainBuilder.java
@@ -1,83 +1,83 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.Service;
-
-/**
- * A builder that handles the configuration of the components inside a
- * composite and the wiring of component references to component services.
- *
- * @version $Rev: 563358 $ $Date: 2007-08-07 01:26:27 +0100 (Tue, 07 Aug 2007) $
- */
-public interface DomainBuilder {
-
- /**
- * Wire up the references and service in a domain returning a list
- * of the composites that have changed
- *
- * @param domainLevelCompsite
- * @return a list of change composites
- * @throws CompositeBuilderException
- */
- List<Composite> wireDomain(Composite domainLevelComposite);
-
- /**
- * Locates the referenced service and updates the URI on the identified binding
- *
- * @param domainLevelComposite
- * @param referenceName
- * @param bindingClassName
- * @param URI
- */
- void updateDomainLevelServiceURI(Composite domainLevelComposite,
- String referenceName,
- String bindingClassName,
- String URI);
-
- /**
- * Get the component name out of the reference name that might look like Component/Service
- *
- * @param referenceName
- * @return
- */
- String getComponentNameFromReference(String referenceName);
-
- /**
- * Get the service name out of the reference name that might look like Component/Service
- *
- * @param referenceName
- * @return
- */
- String getServiceNameFromReference(String referenceName);
-
- /**
- * Find the service object given a reference name
- *
- * @param composite
- * @param referenceName
- * @return
- */
- Service findServiceForReference(Composite composite, String referenceName);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.assembly.builder;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.Service;
+
+/**
+ * A builder that handles the configuration of the components inside a
+ * composite and the wiring of component references to component services.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface DomainBuilder {
+
+ /**
+ * Wire up the references and service in a domain returning a list
+ * of the composites that have changed
+ *
+ * @param domainLevelCompsite
+ * @return a list of change composites
+ * @throws CompositeBuilderException
+ */
+ List<Composite> wireDomain(Composite domainLevelComposite);
+
+ /**
+ * Locates the referenced service and updates the URI on the identified binding
+ *
+ * @param domainLevelComposite
+ * @param referenceName
+ * @param bindingClassName
+ * @param URI
+ */
+ void updateDomainLevelServiceURI(Composite domainLevelComposite,
+ String referenceName,
+ String bindingClassName,
+ String URI);
+
+ /**
+ * Get the component name out of the reference name that might look like Component/Service
+ *
+ * @param referenceName
+ * @return
+ */
+ String getComponentNameFromReference(String referenceName);
+
+ /**
+ * Get the service name out of the reference name that might look like Component/Service
+ *
+ * @param referenceName
+ * @return
+ */
+ String getServiceNameFromReference(String referenceName);
+
+ /**
+ * Find the service object given a reference name
+ *
+ * @param composite
+ * @param referenceName
+ * @return
+ */
+ Service findServiceForReference(Composite composite, String referenceName);
+
+}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceConfigurationBuilderImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceConfigurationBuilderImpl.java
index e5b7444bcf..992d1915a3 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceConfigurationBuilderImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeReferenceConfigurationBuilderImpl.java
@@ -39,7 +39,7 @@ import org.apache.tuscany.sca.monitor.Monitor;
/**
* A composite builder that handles the configuration of composite references.
*
- * @version $Rev: 651179 $ $Date: 2008-04-24 08:21:13 +0100 (Thu, 24 Apr 2008) $
+ * @version $Rev$ $Date$
*/
public class CompositeReferenceConfigurationBuilderImpl implements CompositeBuilder {
private AssemblyFactory assemblyFactory;
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationException.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationException.java
index b53f3641f5..27f768fc53 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationException.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationException.java
@@ -1,38 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-/**
- * Exception to be throw for invalid policy intents / policysets
- *
- * @version $Rev$ $Date$
- */
-public class PolicyConfigurationException extends Exception {
- private static final long serialVersionUID = 506979037642587755L;
-
- public PolicyConfigurationException(String message) {
- super(message);
- }
-
- public PolicyConfigurationException(Throwable e) {
- super(e);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.assembly.builder.impl;
+
+/**
+ * Exception to be throw for invalid policy intents / policysets
+ *
+ * @version $Rev$ $Date$
+ */
+public class PolicyConfigurationException extends Exception {
+ private static final long serialVersionUID = 506979037642587755L;
+
+ public PolicyConfigurationException(String message) {
+ super(message);
+ }
+
+ public PolicyConfigurationException(Throwable e) {
+ super(e);
+ }
+
+}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationUtil.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationUtil.java
index ca23948632..82c88a92a8 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationUtil.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/PolicyConfigurationUtil.java
@@ -1,421 +1,421 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.assembly.builder.impl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Base;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.Contract;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.policy.ExtensionType;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentMap;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySubject;
-import org.apache.tuscany.sca.policy.util.PolicyComputationUtils;
-import org.apache.tuscany.sca.policy.util.PolicyValidationException;
-import org.apache.tuscany.sca.policy.util.PolicyValidationUtils;
-
-/**
- * This class contains policy computation methods common to computing implementation and binding policies
- *
- * @version $Rev$ $Date$
- */
-abstract class PolicyConfigurationUtil {
-
- private static List<Intent> computeInheritableIntents(ExtensionType attachPointType, List<Intent> inheritableIntents)
- throws PolicyValidationException {
- List<Intent> validInheritableIntents = new ArrayList<Intent>();
-
- //expand profile intents in inherited intents
- PolicyComputationUtils.expandProfileIntents(inheritableIntents);
-
- //validate if inherited intent applies to the attachpoint (binding / implementation) and
- //only add such intents to the attachpoint (binding / implementation)
- for (Intent intent : inheritableIntents) {
- if (!intent.isUnresolved()) {
- for (ExtensionType constrained : intent.getConstrainedTypes()) {
- if (PolicyValidationUtils.isConstrained(constrained, attachPointType)) {
- validInheritableIntents.add(intent);
- break;
- }
- }
- } else {
- throw new PolicyValidationException("Policy Intent '" + intent.getName()
- + "' is not defined in this domain");
- }
- }
-
- return validInheritableIntents;
- }
-
- private static void normalizeIntents(PolicySubject intentAttachPoint) {
- //expand profile intents specified in the attachpoint (binding / implementation)
- PolicyComputationUtils.expandProfileIntents(intentAttachPoint.getRequiredIntents());
-
- //remove duplicates and ...
- //where qualified form of intent exists retain it and remove the qualifiable intent
- filterDuplicatesAndQualifiableIntents(intentAttachPoint);
- }
-
- private static void trimInherentlyProvidedIntents(ExtensionType attachPointType, List<Intent> intents) {
- //exclude intents that are inherently supported by the
- //attachpoint-type (binding-type / implementation-type)
- List<Intent> requiredIntents = new ArrayList<Intent>(intents);
- for (Intent intent : requiredIntents) {
- if (isProvidedInherently(attachPointType, intent)) {
- intents.remove(intent);
- }
- }
- }
-
- private static List<PolicySet> computeInheritablePolicySets(List<PolicySet> inheritablePolicySets)
- throws PolicyValidationException {
- // FIXME:
- return inheritablePolicySets;
- }
-
- private static void normalizePolicySets(PolicySubject subject) {
- //get rid of duplicate entries
- Set<PolicySet> policySetTable = new HashSet<PolicySet>(subject.getPolicySets());
-
- subject.getPolicySets().clear();
- subject.getPolicySets().addAll(policySetTable);
-
- //expand profile intents
- for (PolicySet policySet : subject.getPolicySets()) {
- PolicyComputationUtils.expandProfileIntents(policySet.getProvidedIntents());
- }
- }
-
- private static void trimProvidedIntents(List<Intent> requiredIntents, List<PolicySet> policySets) {
- for (PolicySet policySet : policySets) {
- trimProvidedIntents(requiredIntents, policySet);
- }
- }
-
- private static void determineApplicableDomainPolicySets(List<PolicySet> applicablePolicySets,
- PolicySubject policySetAttachPoint,
- ExtensionType intentAttachPointType) {
-
- if (policySetAttachPoint.getRequiredIntents().size() > 0) {
-
- // form a list of all intents required by the attach point
- List<Intent> combinedTargetIntents = new ArrayList<Intent>();
- combinedTargetIntents.addAll(policySetAttachPoint.getRequiredIntents());
- for (PolicySet targetPolicySet : policySetAttachPoint.getPolicySets()) {
- combinedTargetIntents.addAll(PolicyComputationUtils.findAndExpandProfileIntents(targetPolicySet
- .getProvidedIntents()));
- }
-
- //since the set of applicable policysets for this attachpoint is known
- //we only need to check in that list if there is a policyset that matches
- for (PolicySet policySet : applicablePolicySets) {
- // do not use the policy set if it provides intents that conflict with required intents
- boolean conflict = false;
- List<Intent> providedIntents =
- PolicyComputationUtils.findAndExpandProfileIntents(policySet.getProvidedIntents());
- checkConflict: for (Intent intent : providedIntents) {
- for (Intent excluded : intent.getExcludedIntents()) {
- if (combinedTargetIntents.contains(excluded)) {
- conflict = true;
- break checkConflict;
- }
- }
- }
- if (conflict)
- continue;
- int prevSize = policySetAttachPoint.getRequiredIntents().size();
- trimProvidedIntents(policySetAttachPoint.getRequiredIntents(), policySet);
- // if any intent was trimmed off, then this policyset must
- // be attached to the intent attachpoint's policyset
- if (prevSize != policySetAttachPoint.getRequiredIntents().size()) {
- policySetAttachPoint.getPolicySets().add(policySet);
- }
- }
- }
- }
-
- private static boolean isProvidedInherently(ExtensionType attachPointType, Intent intent) {
- return (attachPointType != null && ((attachPointType.getAlwaysProvidedIntents() != null && attachPointType
- .getAlwaysProvidedIntents().contains(intent)) || (attachPointType.getMayProvidedIntents() != null && attachPointType
- .getMayProvidedIntents().contains(intent))));
- }
-
- private static void trimProvidedIntents(List<Intent> requiredIntents, PolicySet policySet) {
- for (Intent providedIntent : policySet.getProvidedIntents()) {
- if (requiredIntents.contains(providedIntent)) {
- requiredIntents.remove(providedIntent);
- }
- }
-
- for (IntentMap intentMap : policySet.getIntentMaps()) {
- if (requiredIntents.contains(intentMap.getProvidedIntent())) {
- requiredIntents.remove(intentMap.getProvidedIntent());
- }
- }
- }
-
- private static void filterDuplicatesAndQualifiableIntents(PolicySubject intentAttachPoint) {
- //remove duplicates
- Map<QName, Intent> intentsTable = new HashMap<QName, Intent>();
- for (Intent intent : intentAttachPoint.getRequiredIntents()) {
- intentsTable.put(intent.getName(), intent);
- }
-
- //where qualified form of intent exists retain it and remove the qualifiable intent
- Map<QName, Intent> intentsTableCopy = new HashMap<QName, Intent>(intentsTable);
- //if qualified form of intent exists remove the unqualified form
- for (Intent intent : intentsTableCopy.values()) {
- if (intent.getQualifiableIntent() != null) {
- if (intentsTable.get(intent.getQualifiableIntent().getName()) != null) {
- intentsTable.remove(intent.getQualifiableIntent().getName());
- }
- }
- }
- intentAttachPoint.getRequiredIntents().clear();
- intentAttachPoint.getRequiredIntents().addAll(intentsTable.values());
- }
-
- static void computeBindingIntentsAndPolicySets(Contract contract) throws PolicyValidationException {
- for (Binding binding : contract.getBindings()) {
- if (binding instanceof PolicySubject) {
- PolicySubject policiedBinding = (PolicySubject)binding;
- computeIntents((PolicySubject)binding, contract.getRequiredIntents());
-
- computePolicySets(policiedBinding, contract.getPolicySets());
-
- PolicyComputationUtils.checkForMutuallyExclusiveIntents(policiedBinding.getRequiredIntents(),
- policiedBinding.getPolicySets(),
- policiedBinding.getExtensionType(),
- contract.getName());
- }
- }
-
- if (contract.getCallback() != null) {
- for (Binding binding : contract.getCallback().getBindings()) {
- if (binding instanceof PolicySubject) {
- PolicySubject policiedBinding = (PolicySubject)binding;
- computeIntents((PolicySubject)binding, contract.getCallback().getRequiredIntents());
-
- computePolicySets(policiedBinding, contract.getCallback().getPolicySets());
-
- PolicyComputationUtils.checkForMutuallyExclusiveIntents(policiedBinding.getRequiredIntents(),
- policiedBinding.getPolicySets(),
- policiedBinding.getExtensionType(),
- contract.getName() + " callback");
-
- }
- }
- }
- }
-
- private static void computeIntents(PolicySubject policiedBinding, List<Intent> inheritedIntents)
- throws PolicyValidationException {
- //since the parent component could also contain intents that apply to implementation
- //and binding elements within, we filter out only those that apply to this binding type
- List<Intent> prunedIntents = computeInheritableIntents(policiedBinding.getExtensionType(), inheritedIntents);
- policiedBinding.getRequiredIntents().addAll(prunedIntents);
-
- normalizeIntents(policiedBinding);
- }
-
- private static void computePolicySets(PolicySubject policiedBinding, List<PolicySet> inheritedPolicySets)
- throws PolicyValidationException {
-
- List<PolicySet> prunedPolicySets = computeInheritablePolicySets(inheritedPolicySets);
- policiedBinding.getPolicySets().addAll(prunedPolicySets);
- normalizePolicySets(policiedBinding);
- }
-
- static void determineApplicableBindingPolicySets(Contract source, Contract target)
- throws PolicyConfigurationException {
- List<Intent> intentsCopy = null;
- for (Binding aBinding : source.getBindings()) {
- if (aBinding instanceof PolicySubject) {
- PolicySubject policiedBinding = (PolicySubject)aBinding;
- ExtensionType bindingType = policiedBinding.getExtensionType();
-
- intentsCopy = new ArrayList<Intent>(policiedBinding.getRequiredIntents());
- // add the target component's intents to the reference binding
- if (target != null) {
- for (Intent intent : target.getRequiredIntents()) {
- if (!policiedBinding.getRequiredIntents().contains(intent)) {
- for (ExtensionType constrained : intent.getConstrainedTypes()) {
- if (bindingType != null && bindingType.getType().getNamespaceURI().equals(constrained
- .getType().getNamespaceURI())
- && bindingType.getType().getLocalPart().startsWith(constrained.getType()
- .getLocalPart())) {
- policiedBinding.getRequiredIntents().add(intent);
- break;
- }
- }
- }
- }
- }
-
- trimInherentlyProvidedIntents(policiedBinding.getExtensionType(), policiedBinding.getRequiredIntents());
- trimProvidedIntents(policiedBinding.getRequiredIntents(), policiedBinding.getPolicySets());
-
- // determine additional policysets that match remaining intents
- // TODO: resolved to domain policy registry and attach suitable
- // policy sets to the binding
- // for now using the SCA Definitions instead of registry
- // if there are intents that are not provided by any policy set
- // throw a warning
- determineApplicableDomainPolicySets(source, policiedBinding);
-
- //the intents list could have been trimmed when matching for policysets
- //since the bindings may need the original set of intents we copy that back
- policiedBinding.getRequiredIntents().clear();
- policiedBinding.getRequiredIntents().addAll(intentsCopy);
-
- }
- }
- }
-
- private static void determineApplicableDomainPolicySets(Contract contract, PolicySubject policiedBinding)
- throws PolicyConfigurationException {
- // FIXME:
- /*
- //if ( domainPolicySets != null) {
- determineApplicableDomainPolicySets(policiedBinding.getApplicablePolicySets(),
- policiedBinding,
- policiedBinding.getExtensionType());
-
- if ( policiedBinding.getRequiredIntents().size() > 0 ) {
- if ( contract instanceof Service ) {
- throw new PolicyConfigurationException("The following are unfulfilled intents for " +
- "binding in service - " + contract.getName() + "\nUnfulfilled Intents = " +
- policiedBinding.getRequiredIntents());
- } else {
- throw new PolicyConfigurationException("The are unfulfilled intents for " +
- "binding in reference - " + contract.getName() + "\nUnfulfilled Intents = " +
- policiedBinding.getRequiredIntents());
- }
- }
- //}
- */
- }
-
- private static void aggregateAndPruneApplicablePolicySets(List<PolicySet> source, List<PolicySet> target) {
- target.addAll(source);
- //strip duplicates
- Hashtable<QName, PolicySet> policySetTable = new Hashtable<QName, PolicySet>();
- for (PolicySet policySet : target) {
- policySetTable.put(policySet.getName(), policySet);
- }
-
- target.clear();
- target.addAll(policySetTable.values());
- }
-
- static <C extends Contract> void inheritDefaultPolicies(Base parent, List<C> contracts) {
-
- for (Contract contract : contracts) {
-
- // The contract inherits default policies from the parent composite/component.
- if (parent instanceof PolicySubject) {
- PolicyComputationUtils.addDefaultPolicies(((PolicySubject)parent).getRequiredIntents(),
- ((PolicySubject)parent).getPolicySets(),
- contract.getRequiredIntents(),
- contract.getPolicySets());
- }
-
- // The contract's callback inherits default policies from the contract.
- if (contract.getCallback() != null) {
- PolicyComputationUtils.addDefaultPolicies(contract.getRequiredIntents(),
- contract.getPolicySets(),
- contract.getCallback().getRequiredIntents(),
- contract.getCallback().getPolicySets());
- }
-
- }
- }
-
- static void computeImplementationIntentsAndPolicySets(Implementation implementation, Component parent)
- throws PolicyValidationException, PolicyConfigurationException {
- if (implementation instanceof PolicySubject) {
- PolicySubject policiedImplementation = (PolicySubject)implementation;
- //since for an implementation the component has its policy intents and policysets its possible
- //that there are some intents there that does not constrain the implementation.. so prune
- List<Intent> prunedIntents =
- computeInheritableIntents(policiedImplementation.getExtensionType(), parent.getRequiredIntents());
- parent.getRequiredIntents().clear();
- parent.getRequiredIntents().addAll(prunedIntents);
- normalizeIntents(parent);
-
- List<PolicySet> prunedPolicySets = computeInheritablePolicySets(parent.getPolicySets());
- parent.getPolicySets().clear();
- parent.getPolicySets().addAll(prunedPolicySets);
- normalizePolicySets(parent);
-
- PolicyComputationUtils.checkForMutuallyExclusiveIntents(parent.getRequiredIntents(),
- parent.getPolicySets(),
- policiedImplementation.getExtensionType(),
- parent.getName());
-
- determineApplicableImplementationPolicySets(parent);
-
- }
- }
-
- private static void determineApplicableImplementationPolicySets(Component component)
- throws PolicyConfigurationException {
- List<Intent> intentsCopy = null;
- if (component.getImplementation() instanceof PolicySubject) {
- PolicySubject policiedImplementation = (PolicySubject)component.getImplementation();
-
- intentsCopy = new ArrayList<Intent>(component.getRequiredIntents());
- trimInherentlyProvidedIntents(policiedImplementation.getExtensionType(), component.getRequiredIntents());
- trimProvidedIntents(component.getRequiredIntents(), component.getPolicySets());
-
- //determine additional policysets that match remaining intents
- //if there are intents that are not provided by any policy set throw a warning
- //TODO: resolved to domain policy registry and attach suitable policy sets to the implementation
- //...for now using the SCA Definitions instead of registry
- //if ( domainPolicySets != null) {
-
- if (component.getRequiredIntents().size() > 0) {
- throw new PolicyConfigurationException(
- "The following are unfulfilled intents for component implementation - " + component
- .getName()
- + "\nUnfulfilled Intents = "
- + component.getRequiredIntents());
- }
- //}
-
- //the intents list could have been trimmed when matching for policysets
- //since the bindings may need the original set of intents we copy that back
- component.getRequiredIntents().clear();
- component.getRequiredIntents().addAll(intentsCopy);
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.assembly.builder.impl;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.Base;
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.Contract;
+import org.apache.tuscany.sca.assembly.Implementation;
+import org.apache.tuscany.sca.policy.ExtensionType;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.IntentMap;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.PolicySubject;
+import org.apache.tuscany.sca.policy.util.PolicyComputationUtils;
+import org.apache.tuscany.sca.policy.util.PolicyValidationException;
+import org.apache.tuscany.sca.policy.util.PolicyValidationUtils;
+
+/**
+ * This class contains policy computation methods common to computing implementation and binding policies
+ *
+ * @version $Rev$ $Date$
+ */
+abstract class PolicyConfigurationUtil {
+
+ private static List<Intent> computeInheritableIntents(ExtensionType attachPointType, List<Intent> inheritableIntents)
+ throws PolicyValidationException {
+ List<Intent> validInheritableIntents = new ArrayList<Intent>();
+
+ //expand profile intents in inherited intents
+ PolicyComputationUtils.expandProfileIntents(inheritableIntents);
+
+ //validate if inherited intent applies to the attachpoint (binding / implementation) and
+ //only add such intents to the attachpoint (binding / implementation)
+ for (Intent intent : inheritableIntents) {
+ if (!intent.isUnresolved()) {
+ for (ExtensionType constrained : intent.getConstrainedTypes()) {
+ if (PolicyValidationUtils.isConstrained(constrained, attachPointType)) {
+ validInheritableIntents.add(intent);
+ break;
+ }
+ }
+ } else {
+ throw new PolicyValidationException("Policy Intent '" + intent.getName()
+ + "' is not defined in this domain");
+ }
+ }
+
+ return validInheritableIntents;
+ }
+
+ private static void normalizeIntents(PolicySubject intentAttachPoint) {
+ //expand profile intents specified in the attachpoint (binding / implementation)
+ PolicyComputationUtils.expandProfileIntents(intentAttachPoint.getRequiredIntents());
+
+ //remove duplicates and ...
+ //where qualified form of intent exists retain it and remove the qualifiable intent
+ filterDuplicatesAndQualifiableIntents(intentAttachPoint);
+ }
+
+ private static void trimInherentlyProvidedIntents(ExtensionType attachPointType, List<Intent> intents) {
+ //exclude intents that are inherently supported by the
+ //attachpoint-type (binding-type / implementation-type)
+ List<Intent> requiredIntents = new ArrayList<Intent>(intents);
+ for (Intent intent : requiredIntents) {
+ if (isProvidedInherently(attachPointType, intent)) {
+ intents.remove(intent);
+ }
+ }
+ }
+
+ private static List<PolicySet> computeInheritablePolicySets(List<PolicySet> inheritablePolicySets)
+ throws PolicyValidationException {
+ // FIXME:
+ return inheritablePolicySets;
+ }
+
+ private static void normalizePolicySets(PolicySubject subject) {
+ //get rid of duplicate entries
+ Set<PolicySet> policySetTable = new HashSet<PolicySet>(subject.getPolicySets());
+
+ subject.getPolicySets().clear();
+ subject.getPolicySets().addAll(policySetTable);
+
+ //expand profile intents
+ for (PolicySet policySet : subject.getPolicySets()) {
+ PolicyComputationUtils.expandProfileIntents(policySet.getProvidedIntents());
+ }
+ }
+
+ private static void trimProvidedIntents(List<Intent> requiredIntents, List<PolicySet> policySets) {
+ for (PolicySet policySet : policySets) {
+ trimProvidedIntents(requiredIntents, policySet);
+ }
+ }
+
+ private static void determineApplicableDomainPolicySets(List<PolicySet> applicablePolicySets,
+ PolicySubject policySetAttachPoint,
+ ExtensionType intentAttachPointType) {
+
+ if (policySetAttachPoint.getRequiredIntents().size() > 0) {
+
+ // form a list of all intents required by the attach point
+ List<Intent> combinedTargetIntents = new ArrayList<Intent>();
+ combinedTargetIntents.addAll(policySetAttachPoint.getRequiredIntents());
+ for (PolicySet targetPolicySet : policySetAttachPoint.getPolicySets()) {
+ combinedTargetIntents.addAll(PolicyComputationUtils.findAndExpandProfileIntents(targetPolicySet
+ .getProvidedIntents()));
+ }
+
+ //since the set of applicable policysets for this attachpoint is known
+ //we only need to check in that list if there is a policyset that matches
+ for (PolicySet policySet : applicablePolicySets) {
+ // do not use the policy set if it provides intents that conflict with required intents
+ boolean conflict = false;
+ List<Intent> providedIntents =
+ PolicyComputationUtils.findAndExpandProfileIntents(policySet.getProvidedIntents());
+ checkConflict: for (Intent intent : providedIntents) {
+ for (Intent excluded : intent.getExcludedIntents()) {
+ if (combinedTargetIntents.contains(excluded)) {
+ conflict = true;
+ break checkConflict;
+ }
+ }
+ }
+ if (conflict)
+ continue;
+ int prevSize = policySetAttachPoint.getRequiredIntents().size();
+ trimProvidedIntents(policySetAttachPoint.getRequiredIntents(), policySet);
+ // if any intent was trimmed off, then this policyset must
+ // be attached to the intent attachpoint's policyset
+ if (prevSize != policySetAttachPoint.getRequiredIntents().size()) {
+ policySetAttachPoint.getPolicySets().add(policySet);
+ }
+ }
+ }
+ }
+
+ private static boolean isProvidedInherently(ExtensionType attachPointType, Intent intent) {
+ return (attachPointType != null && ((attachPointType.getAlwaysProvidedIntents() != null && attachPointType
+ .getAlwaysProvidedIntents().contains(intent)) || (attachPointType.getMayProvidedIntents() != null && attachPointType
+ .getMayProvidedIntents().contains(intent))));
+ }
+
+ private static void trimProvidedIntents(List<Intent> requiredIntents, PolicySet policySet) {
+ for (Intent providedIntent : policySet.getProvidedIntents()) {
+ if (requiredIntents.contains(providedIntent)) {
+ requiredIntents.remove(providedIntent);
+ }
+ }
+
+ for (IntentMap intentMap : policySet.getIntentMaps()) {
+ if (requiredIntents.contains(intentMap.getProvidedIntent())) {
+ requiredIntents.remove(intentMap.getProvidedIntent());
+ }
+ }
+ }
+
+ private static void filterDuplicatesAndQualifiableIntents(PolicySubject intentAttachPoint) {
+ //remove duplicates
+ Map<QName, Intent> intentsTable = new HashMap<QName, Intent>();
+ for (Intent intent : intentAttachPoint.getRequiredIntents()) {
+ intentsTable.put(intent.getName(), intent);
+ }
+
+ //where qualified form of intent exists retain it and remove the qualifiable intent
+ Map<QName, Intent> intentsTableCopy = new HashMap<QName, Intent>(intentsTable);
+ //if qualified form of intent exists remove the unqualified form
+ for (Intent intent : intentsTableCopy.values()) {
+ if (intent.getQualifiableIntent() != null) {
+ if (intentsTable.get(intent.getQualifiableIntent().getName()) != null) {
+ intentsTable.remove(intent.getQualifiableIntent().getName());
+ }
+ }
+ }
+ intentAttachPoint.getRequiredIntents().clear();
+ intentAttachPoint.getRequiredIntents().addAll(intentsTable.values());
+ }
+
+ static void computeBindingIntentsAndPolicySets(Contract contract) throws PolicyValidationException {
+ for (Binding binding : contract.getBindings()) {
+ if (binding instanceof PolicySubject) {
+ PolicySubject policiedBinding = (PolicySubject)binding;
+ computeIntents((PolicySubject)binding, contract.getRequiredIntents());
+
+ computePolicySets(policiedBinding, contract.getPolicySets());
+
+ PolicyComputationUtils.checkForMutuallyExclusiveIntents(policiedBinding.getRequiredIntents(),
+ policiedBinding.getPolicySets(),
+ policiedBinding.getExtensionType(),
+ contract.getName());
+ }
+ }
+
+ if (contract.getCallback() != null) {
+ for (Binding binding : contract.getCallback().getBindings()) {
+ if (binding instanceof PolicySubject) {
+ PolicySubject policiedBinding = (PolicySubject)binding;
+ computeIntents((PolicySubject)binding, contract.getCallback().getRequiredIntents());
+
+ computePolicySets(policiedBinding, contract.getCallback().getPolicySets());
+
+ PolicyComputationUtils.checkForMutuallyExclusiveIntents(policiedBinding.getRequiredIntents(),
+ policiedBinding.getPolicySets(),
+ policiedBinding.getExtensionType(),
+ contract.getName() + " callback");
+
+ }
+ }
+ }
+ }
+
+ private static void computeIntents(PolicySubject policiedBinding, List<Intent> inheritedIntents)
+ throws PolicyValidationException {
+ //since the parent component could also contain intents that apply to implementation
+ //and binding elements within, we filter out only those that apply to this binding type
+ List<Intent> prunedIntents = computeInheritableIntents(policiedBinding.getExtensionType(), inheritedIntents);
+ policiedBinding.getRequiredIntents().addAll(prunedIntents);
+
+ normalizeIntents(policiedBinding);
+ }
+
+ private static void computePolicySets(PolicySubject policiedBinding, List<PolicySet> inheritedPolicySets)
+ throws PolicyValidationException {
+
+ List<PolicySet> prunedPolicySets = computeInheritablePolicySets(inheritedPolicySets);
+ policiedBinding.getPolicySets().addAll(prunedPolicySets);
+ normalizePolicySets(policiedBinding);
+ }
+
+ static void determineApplicableBindingPolicySets(Contract source, Contract target)
+ throws PolicyConfigurationException {
+ List<Intent> intentsCopy = null;
+ for (Binding aBinding : source.getBindings()) {
+ if (aBinding instanceof PolicySubject) {
+ PolicySubject policiedBinding = (PolicySubject)aBinding;
+ ExtensionType bindingType = policiedBinding.getExtensionType();
+
+ intentsCopy = new ArrayList<Intent>(policiedBinding.getRequiredIntents());
+ // add the target component's intents to the reference binding
+ if (target != null) {
+ for (Intent intent : target.getRequiredIntents()) {
+ if (!policiedBinding.getRequiredIntents().contains(intent)) {
+ for (ExtensionType constrained : intent.getConstrainedTypes()) {
+ if (bindingType != null && bindingType.getType().getNamespaceURI().equals(constrained
+ .getType().getNamespaceURI())
+ && bindingType.getType().getLocalPart().startsWith(constrained.getType()
+ .getLocalPart())) {
+ policiedBinding.getRequiredIntents().add(intent);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ trimInherentlyProvidedIntents(policiedBinding.getExtensionType(), policiedBinding.getRequiredIntents());
+ trimProvidedIntents(policiedBinding.getRequiredIntents(), policiedBinding.getPolicySets());
+
+ // determine additional policysets that match remaining intents
+ // TODO: resolved to domain policy registry and attach suitable
+ // policy sets to the binding
+ // for now using the SCA Definitions instead of registry
+ // if there are intents that are not provided by any policy set
+ // throw a warning
+ determineApplicableDomainPolicySets(source, policiedBinding);
+
+ //the intents list could have been trimmed when matching for policysets
+ //since the bindings may need the original set of intents we copy that back
+ policiedBinding.getRequiredIntents().clear();
+ policiedBinding.getRequiredIntents().addAll(intentsCopy);
+
+ }
+ }
+ }
+
+ private static void determineApplicableDomainPolicySets(Contract contract, PolicySubject policiedBinding)
+ throws PolicyConfigurationException {
+ // FIXME:
+ /*
+ //if ( domainPolicySets != null) {
+ determineApplicableDomainPolicySets(policiedBinding.getApplicablePolicySets(),
+ policiedBinding,
+ policiedBinding.getExtensionType());
+
+ if ( policiedBinding.getRequiredIntents().size() > 0 ) {
+ if ( contract instanceof Service ) {
+ throw new PolicyConfigurationException("The following are unfulfilled intents for " +
+ "binding in service - " + contract.getName() + "\nUnfulfilled Intents = " +
+ policiedBinding.getRequiredIntents());
+ } else {
+ throw new PolicyConfigurationException("The are unfulfilled intents for " +
+ "binding in reference - " + contract.getName() + "\nUnfulfilled Intents = " +
+ policiedBinding.getRequiredIntents());
+ }
+ }
+ //}
+ */
+ }
+
+ private static void aggregateAndPruneApplicablePolicySets(List<PolicySet> source, List<PolicySet> target) {
+ target.addAll(source);
+ //strip duplicates
+ Hashtable<QName, PolicySet> policySetTable = new Hashtable<QName, PolicySet>();
+ for (PolicySet policySet : target) {
+ policySetTable.put(policySet.getName(), policySet);
+ }
+
+ target.clear();
+ target.addAll(policySetTable.values());
+ }
+
+ static <C extends Contract> void inheritDefaultPolicies(Base parent, List<C> contracts) {
+
+ for (Contract contract : contracts) {
+
+ // The contract inherits default policies from the parent composite/component.
+ if (parent instanceof PolicySubject) {
+ PolicyComputationUtils.addDefaultPolicies(((PolicySubject)parent).getRequiredIntents(),
+ ((PolicySubject)parent).getPolicySets(),
+ contract.getRequiredIntents(),
+ contract.getPolicySets());
+ }
+
+ // The contract's callback inherits default policies from the contract.
+ if (contract.getCallback() != null) {
+ PolicyComputationUtils.addDefaultPolicies(contract.getRequiredIntents(),
+ contract.getPolicySets(),
+ contract.getCallback().getRequiredIntents(),
+ contract.getCallback().getPolicySets());
+ }
+
+ }
+ }
+
+ static void computeImplementationIntentsAndPolicySets(Implementation implementation, Component parent)
+ throws PolicyValidationException, PolicyConfigurationException {
+ if (implementation instanceof PolicySubject) {
+ PolicySubject policiedImplementation = (PolicySubject)implementation;
+ //since for an implementation the component has its policy intents and policysets its possible
+ //that there are some intents there that does not constrain the implementation.. so prune
+ List<Intent> prunedIntents =
+ computeInheritableIntents(policiedImplementation.getExtensionType(), parent.getRequiredIntents());
+ parent.getRequiredIntents().clear();
+ parent.getRequiredIntents().addAll(prunedIntents);
+ normalizeIntents(parent);
+
+ List<PolicySet> prunedPolicySets = computeInheritablePolicySets(parent.getPolicySets());
+ parent.getPolicySets().clear();
+ parent.getPolicySets().addAll(prunedPolicySets);
+ normalizePolicySets(parent);
+
+ PolicyComputationUtils.checkForMutuallyExclusiveIntents(parent.getRequiredIntents(),
+ parent.getPolicySets(),
+ policiedImplementation.getExtensionType(),
+ parent.getName());
+
+ determineApplicableImplementationPolicySets(parent);
+
+ }
+ }
+
+ private static void determineApplicableImplementationPolicySets(Component component)
+ throws PolicyConfigurationException {
+ List<Intent> intentsCopy = null;
+ if (component.getImplementation() instanceof PolicySubject) {
+ PolicySubject policiedImplementation = (PolicySubject)component.getImplementation();
+
+ intentsCopy = new ArrayList<Intent>(component.getRequiredIntents());
+ trimInherentlyProvidedIntents(policiedImplementation.getExtensionType(), component.getRequiredIntents());
+ trimProvidedIntents(component.getRequiredIntents(), component.getPolicySets());
+
+ //determine additional policysets that match remaining intents
+ //if there are intents that are not provided by any policy set throw a warning
+ //TODO: resolved to domain policy registry and attach suitable policy sets to the implementation
+ //...for now using the SCA Definitions instead of registry
+ //if ( domainPolicySets != null) {
+
+ if (component.getRequiredIntents().size() > 0) {
+ throw new PolicyConfigurationException(
+ "The following are unfulfilled intents for component implementation - " + component
+ .getName()
+ + "\nUnfulfilled Intents = "
+ + component.getRequiredIntents());
+ }
+ //}
+
+ //the intents list could have been trimmed when matching for policysets
+ //since the bindings may need the original set of intents we copy that back
+ component.getRequiredIntents().clear();
+ component.getRequiredIntents().addAll(intentsCopy);
+ }
+ }
+}
diff --git a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/DistributedSCABindingImpl.java b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/DistributedSCABindingImpl.java
index fd58b44d21..99d68a11bc 100644
--- a/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/DistributedSCABindingImpl.java
+++ b/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/DistributedSCABindingImpl.java
@@ -1,76 +1,76 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.assembly.impl;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.DistributedSCABinding;
-import org.apache.tuscany.sca.assembly.SCABinding;
-
-/**
- * The Distributed SCA binding wrapper for the SCA binding model object. This is currently
- * just used to locate the remote binding extension and pass the SCA binding to the remote
- * extension. It isn't used in the model itself
- *
- * @version $Rev: 564307 $ $Date: 2007-08-09 18:48:29 +0100 (Thu, 09 Aug 2007) $
- */
-public class DistributedSCABindingImpl implements DistributedSCABinding {
-
- private SCABinding scaBinding;
-
- public SCABinding getSCABinding() {
- return scaBinding;
- }
-
- public void setSCABinding(SCABinding scaBinding) {
- this.scaBinding = scaBinding;
- }
-
- public String getURI() {
- return null;
- }
-
- public void setURI(String uri) {
- }
-
- public String getName() {
- return null;
- }
-
- public void setName(String name) {
-
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
-
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public QName getType() {
- return TYPE;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.assembly.impl;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.DistributedSCABinding;
+import org.apache.tuscany.sca.assembly.SCABinding;
+
+/**
+ * The Distributed SCA binding wrapper for the SCA binding model object. This is currently
+ * just used to locate the remote binding extension and pass the SCA binding to the remote
+ * extension. It isn't used in the model itself
+ *
+ * @version $Rev$ $Date$
+ */
+public class DistributedSCABindingImpl implements DistributedSCABinding {
+
+ private SCABinding scaBinding;
+
+ public SCABinding getSCABinding() {
+ return scaBinding;
+ }
+
+ public void setSCABinding(SCABinding scaBinding) {
+ this.scaBinding = scaBinding;
+ }
+
+ public String getURI() {
+ return null;
+ }
+
+ public void setURI(String uri) {
+ }
+
+ public String getName() {
+ return null;
+ }
+
+ public void setName(String name) {
+
+ }
+
+ public boolean isUnresolved() {
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+
+ public QName getType() {
+ return TYPE;
+ }
+}
diff --git a/java/sca/modules/binding-ejb-runtime/src/test/resources/account/account.composite b/java/sca/modules/binding-ejb-runtime/src/test/resources/account/account.composite
index 32fe80bfdf..472ae949b9 100644
--- a/java/sca/modules/binding-ejb-runtime/src/test/resources/account/account.composite
+++ b/java/sca/modules/binding-ejb-runtime/src/test/resources/account/account.composite
@@ -1,37 +1,37 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200712"
- targetNamespace="http://sample"
- name="account">
-
- <!-- composite refrence with ejb binding. Modify host and port number in uri attribute based on where you have installed target ResumeBank EJB -->
-
- <component name="CustomerComponent">
- <implementation.java class="account.CustomerImpl" />
- <reference name="extEJBService">
- <!-- To use the CosNaming, use the following URI -->
- <!--
- <binding.ejb uri="corbaname:iiop:1.2@localhost:1050#AddServiceBean" />
- -->
- <binding.ejb uri="hello-addservice/AddServiceBean/calculator.AddService" />
- </reference>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200712"
+ targetNamespace="http://sample"
+ name="account">
+
+ <!-- composite refrence with ejb binding. Modify host and port number in uri attribute based on where you have installed target ResumeBank EJB -->
+
+ <component name="CustomerComponent">
+ <implementation.java class="account.CustomerImpl" />
+ <reference name="extEJBService">
+ <!-- To use the CosNaming, use the following URI -->
+ <!--
+ <binding.ejb uri="corbaname:iiop:1.2@localhost:1050#AddServiceBean" />
+ -->
+ <binding.ejb uri="hello-addservice/AddServiceBean/calculator.AddService" />
+ </reference>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/binding-http-runtime/src/test/resources/testCache.composite b/java/sca/modules/binding-http-runtime/src/test/resources/testCache.composite
index d805402c4f..39e651bb6e 100644
--- a/java/sca/modules/binding-http-runtime/src/test/resources/testCache.composite
+++ b/java/sca/modules/binding-http-runtime/src/test/resources/testCache.composite
@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://sample/test"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:sr="http://sample/test"
- name="test">
-
- <component name="HTTPBindingComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.http.TestBindingCacheImpl"/>
- <service name="TestBindingCacheImpl">
- <tuscany:binding.http uri="http://localhost:8085/httpbinding"/>
- </service>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://sample/test"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ xmlns:sr="http://sample/test"
+ name="test">
+
+ <component name="HTTPBindingComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.http.TestBindingCacheImpl"/>
+ <service name="TestBindingCacheImpl">
+ <tuscany:binding.http uri="http://localhost:8085/httpbinding"/>
+ </service>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java b/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java
index 1d872d6a51..874c23c7e0 100644
--- a/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java
+++ b/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/xml/HTTPBindingProcessor.java
@@ -1,166 +1,166 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.http.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.OperationSelector;
-import org.apache.tuscany.sca.assembly.WireFormat;
-import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.binding.http.HTTPBinding;
-import org.apache.tuscany.sca.binding.http.HTTPBindingFactory;
-import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.service.ContributionReadException;
-import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-public class HTTPBindingProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<HTTPBinding> {
- private static final String BINDING_HTTP = "binding.http";
- private static final QName BINDING_HTTP_QNAME = new QName(Constants.SCA10_TUSCANY_NS, BINDING_HTTP);
-
- private static final String NAME = "name";
- private static final String URI = "uri";
-
- private HTTPBindingFactory httpBindingFactory;
- private StAXArtifactProcessor<Object> extensionProcessor;
- private StAXAttributeProcessor<Object> extensionAttributeProcessor;
- private Monitor monitor;
-
- public HTTPBindingProcessor(ExtensionPointRegistry extensionPoints,
- StAXArtifactProcessor extensionProcessor,
- StAXAttributeProcessor extensionAttributeProcessor,
- Monitor monitor) {
- ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
- this.httpBindingFactory = modelFactories.getFactory(HTTPBindingFactory.class);
- this.extensionProcessor = (StAXArtifactProcessor<Object>)extensionProcessor;
- this.extensionAttributeProcessor = extensionAttributeProcessor;
- this.monitor = monitor;
- }
-
- public QName getArtifactType() {
- return BINDING_HTTP_QNAME;
- }
-
- public Class<HTTPBinding> getModelType() {
- return HTTPBinding.class;
- }
-
- public HTTPBinding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- HTTPBinding httpBinding = httpBindingFactory.createHTTPBinding();
-
- while(reader.hasNext()) {
- QName elementName = null;
- int event = reader.getEventType();
- switch (event) {
- case START_ELEMENT:
- elementName = reader.getName();
-
- if (BINDING_HTTP_QNAME.equals(elementName)) {
- String name = getString(reader, NAME);
- if(name != null) {
- httpBinding.setName(name);
- }
-
- String uri = getString(reader, URI);
- if (uri != null) {
- httpBinding.setURI(uri);
- }
- } else {
- // Read an extension element
- Object extension = extensionProcessor.read(reader);
- if (extension != null) {
- if (extension instanceof WireFormat) {
- httpBinding.setRequestWireFormat((WireFormat)extension);
- } else if(extension instanceof OperationSelector) {
- httpBinding.setOperationSelector((OperationSelector)extension);
- }
- }
- }
-
- }
-
- if (event == END_ELEMENT && BINDING_HTTP_QNAME.equals(reader.getName())) {
- break;
- }
-
- // Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
-
- return httpBinding;
- }
-
- public void write(HTTPBinding httpBinding, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
- //writer.writeStartElement(Constants.SCA10_NS, BINDING_HTTP);
-
- writeStart(writer, BINDING_HTTP_QNAME.getNamespaceURI(), BINDING_HTTP_QNAME.getLocalPart());
-
- // Write binding name
- if (httpBinding.getName() != null) {
- writer.writeAttribute(NAME, httpBinding.getName());
- }
-
- // Write binding URI
- if (httpBinding.getURI() != null) {
- writer.writeAttribute(URI, httpBinding.getURI());
- }
-
- writeEnd(writer);
- //writer.writeEndElement();
- }
-
-
- public void resolve(HTTPBinding model, ModelResolver resolver) throws ContributionResolveException {
- // Should not need to do anything here for now...
-
- }
-
- /**
- * Report a error.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void error(String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem = new ProblemImpl(this.getClass().getName(), "binding-http-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.http.xml;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.OperationSelector;
+import org.apache.tuscany.sca.assembly.WireFormat;
+import org.apache.tuscany.sca.assembly.builder.impl.ProblemImpl;
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.binding.http.HTTPBinding;
+import org.apache.tuscany.sca.binding.http.HTTPBindingFactory;
+import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXAttributeProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.service.ContributionReadException;
+import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
+
+public class HTTPBindingProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<HTTPBinding> {
+ private static final String BINDING_HTTP = "binding.http";
+ private static final QName BINDING_HTTP_QNAME = new QName(Constants.SCA10_TUSCANY_NS, BINDING_HTTP);
+
+ private static final String NAME = "name";
+ private static final String URI = "uri";
+
+ private HTTPBindingFactory httpBindingFactory;
+ private StAXArtifactProcessor<Object> extensionProcessor;
+ private StAXAttributeProcessor<Object> extensionAttributeProcessor;
+ private Monitor monitor;
+
+ public HTTPBindingProcessor(ExtensionPointRegistry extensionPoints,
+ StAXArtifactProcessor extensionProcessor,
+ StAXAttributeProcessor extensionAttributeProcessor,
+ Monitor monitor) {
+ ModelFactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(ModelFactoryExtensionPoint.class);
+ this.httpBindingFactory = modelFactories.getFactory(HTTPBindingFactory.class);
+ this.extensionProcessor = (StAXArtifactProcessor<Object>)extensionProcessor;
+ this.extensionAttributeProcessor = extensionAttributeProcessor;
+ this.monitor = monitor;
+ }
+
+ public QName getArtifactType() {
+ return BINDING_HTTP_QNAME;
+ }
+
+ public Class<HTTPBinding> getModelType() {
+ return HTTPBinding.class;
+ }
+
+ public HTTPBinding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+ HTTPBinding httpBinding = httpBindingFactory.createHTTPBinding();
+
+ while(reader.hasNext()) {
+ QName elementName = null;
+ int event = reader.getEventType();
+ switch (event) {
+ case START_ELEMENT:
+ elementName = reader.getName();
+
+ if (BINDING_HTTP_QNAME.equals(elementName)) {
+ String name = getString(reader, NAME);
+ if(name != null) {
+ httpBinding.setName(name);
+ }
+
+ String uri = getString(reader, URI);
+ if (uri != null) {
+ httpBinding.setURI(uri);
+ }
+ } else {
+ // Read an extension element
+ Object extension = extensionProcessor.read(reader);
+ if (extension != null) {
+ if (extension instanceof WireFormat) {
+ httpBinding.setRequestWireFormat((WireFormat)extension);
+ } else if(extension instanceof OperationSelector) {
+ httpBinding.setOperationSelector((OperationSelector)extension);
+ }
+ }
+ }
+
+ }
+
+ if (event == END_ELEMENT && BINDING_HTTP_QNAME.equals(reader.getName())) {
+ break;
+ }
+
+ // Read the next element
+ if (reader.hasNext()) {
+ reader.next();
+ }
+ }
+
+ return httpBinding;
+ }
+
+ public void write(HTTPBinding httpBinding, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
+ //writer.writeStartElement(Constants.SCA10_NS, BINDING_HTTP);
+
+ writeStart(writer, BINDING_HTTP_QNAME.getNamespaceURI(), BINDING_HTTP_QNAME.getLocalPart());
+
+ // Write binding name
+ if (httpBinding.getName() != null) {
+ writer.writeAttribute(NAME, httpBinding.getName());
+ }
+
+ // Write binding URI
+ if (httpBinding.getURI() != null) {
+ writer.writeAttribute(URI, httpBinding.getURI());
+ }
+
+ writeEnd(writer);
+ //writer.writeEndElement();
+ }
+
+
+ public void resolve(HTTPBinding model, ModelResolver resolver) throws ContributionResolveException {
+ // Should not need to do anything here for now...
+
+ }
+
+ /**
+ * Report a error.
+ *
+ * @param problems
+ * @param message
+ * @param model
+ */
+ private void error(String message, Object model, Object... messageParameters) {
+ if (monitor != null) {
+ Problem problem = new ProblemImpl(this.getClass().getName(), "binding-http-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+ monitor.problem(problem);
+ }
+ }
+
+}
diff --git a/java/sca/modules/binding-jsonp-runtime/pom.xml b/java/sca/modules/binding-jsonp-runtime/pom.xml
index 503ebadd1a..7906a2d4c3 100644
--- a/java/sca/modules/binding-jsonp-runtime/pom.xml
+++ b/java/sca/modules/binding-jsonp-runtime/pom.xml
@@ -1,85 +1,85 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-binding-jsonp-runtime</artifactId>
- <name>Apache Tuscany SCA JSONP Binding Runtime</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-jsonp</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-http</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-core-asl</artifactId>
- <version>1.0.1</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-mapper-asl</artifactId>
- <version>1.0.1</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-jetty</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-binding-jsonp-runtime</artifactId>
+ <name>Apache Tuscany SCA JSONP Binding Runtime</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-jsonp</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-http</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-core-asl</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-jetty</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPBindingProviderFactory.java b/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPBindingProviderFactory.java
index 0954935098..f686d9d771 100644
--- a/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPBindingProviderFactory.java
+++ b/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPBindingProviderFactory.java
@@ -1,59 +1,59 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.jsonp.runtime;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.EndpointReference;
-import org.apache.tuscany.sca.binding.jsonp.JSONPBinding;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
-import org.apache.tuscany.sca.provider.BindingProviderFactory;
-import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-
-public class JSONPBindingProviderFactory implements BindingProviderFactory<JSONPBinding> {
-
- private ServletHost servletHost;
-
- public JSONPBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- List<ServletHost> hosts = servletHosts.getServletHosts();
- if (!hosts.isEmpty()) {
- this.servletHost = hosts.get(0);
- }
- }
-
- public Class<JSONPBinding> getModelType() {
- return JSONPBinding.class;
- }
-
- public ReferenceBindingProvider createReferenceBindingProvider(EndpointReference arg0) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public ServiceBindingProvider createServiceBindingProvider(Endpoint endpoint) {
- return new JSONPServiceBindingProvider(endpoint, servletHost);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.jsonp.runtime;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.binding.jsonp.JSONPBinding;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.host.http.ServletHost;
+import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
+import org.apache.tuscany.sca.provider.BindingProviderFactory;
+import org.apache.tuscany.sca.provider.ReferenceBindingProvider;
+import org.apache.tuscany.sca.provider.ServiceBindingProvider;
+
+public class JSONPBindingProviderFactory implements BindingProviderFactory<JSONPBinding> {
+
+ private ServletHost servletHost;
+
+ public JSONPBindingProviderFactory(ExtensionPointRegistry extensionPoints) {
+ ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
+ List<ServletHost> hosts = servletHosts.getServletHosts();
+ if (!hosts.isEmpty()) {
+ this.servletHost = hosts.get(0);
+ }
+ }
+
+ public Class<JSONPBinding> getModelType() {
+ return JSONPBinding.class;
+ }
+
+ public ReferenceBindingProvider createReferenceBindingProvider(EndpointReference arg0) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ServiceBindingProvider createServiceBindingProvider(Endpoint endpoint) {
+ return new JSONPServiceBindingProvider(endpoint, servletHost);
+ }
+
+}
diff --git a/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java b/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java
index dfd2faef7f..2876db430a 100644
--- a/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java
+++ b/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServiceBindingProvider.java
@@ -1,71 +1,71 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.jsonp.runtime;
-
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.provider.ServiceBindingProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-public class JSONPServiceBindingProvider implements ServiceBindingProvider {
-
- private Endpoint endpoint;
- private ServletHost servletHost;
-
- public JSONPServiceBindingProvider(Endpoint endpoint, ServletHost servletHost) {
- this.endpoint = endpoint;
- this.servletHost = servletHost;
- }
-
- public void start() {
- ComponentService service = endpoint.getService();
- RuntimeWire wire = ((RuntimeComponentService)service).getRuntimeWire(endpoint.getBinding());
- Interface serviceInterface = service.getInterfaceContract().getInterface();
- for (Operation op : serviceInterface.getOperations()) {
- JSONPServlet servlet = new JSONPServlet(wire, op);
- String path = service.getName() + "/" + op.getName();
- servletHost.addServletMapping(path, servlet);
- }
- }
-
- public void stop() {
- ComponentService service = endpoint.getService();
- Interface serviceInterface = service.getInterfaceContract().getInterface();
- for (Operation op : serviceInterface.getOperations()) {
- String path = service.getName() + "/" + op.getName();
- servletHost.removeServletMapping(path);
- }
- }
-
- // TODO: Why are these two still on the ServiceBindingProvider interface?
- public InterfaceContract getBindingInterfaceContract() {
- return null;
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.jsonp.runtime;
+
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.host.http.ServletHost;
+import org.apache.tuscany.sca.interfacedef.Interface;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.provider.ServiceBindingProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+import org.apache.tuscany.sca.runtime.RuntimeWire;
+
+public class JSONPServiceBindingProvider implements ServiceBindingProvider {
+
+ private Endpoint endpoint;
+ private ServletHost servletHost;
+
+ public JSONPServiceBindingProvider(Endpoint endpoint, ServletHost servletHost) {
+ this.endpoint = endpoint;
+ this.servletHost = servletHost;
+ }
+
+ public void start() {
+ ComponentService service = endpoint.getService();
+ RuntimeWire wire = ((RuntimeComponentService)service).getRuntimeWire(endpoint.getBinding());
+ Interface serviceInterface = service.getInterfaceContract().getInterface();
+ for (Operation op : serviceInterface.getOperations()) {
+ JSONPServlet servlet = new JSONPServlet(wire, op);
+ String path = service.getName() + "/" + op.getName();
+ servletHost.addServletMapping(path, servlet);
+ }
+ }
+
+ public void stop() {
+ ComponentService service = endpoint.getService();
+ Interface serviceInterface = service.getInterfaceContract().getInterface();
+ for (Operation op : serviceInterface.getOperations()) {
+ String path = service.getName() + "/" + op.getName();
+ servletHost.removeServletMapping(path);
+ }
+ }
+
+ // TODO: Why are these two still on the ServiceBindingProvider interface?
+ public InterfaceContract getBindingInterfaceContract() {
+ return null;
+ }
+
+ public boolean supportsOneWayInvocation() {
+ return false;
+ }
+
+}
diff --git a/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java b/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java
index 6521e336e6..6eb323527c 100644
--- a/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java
+++ b/java/sca/modules/binding-jsonp-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonp/runtime/JSONPServlet.java
@@ -1,114 +1,114 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.jsonp.runtime;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Enumeration;
-
-import javax.servlet.GenericServlet;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.codehaus.jackson.JsonParseException;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.codehaus.jackson.map.ObjectMapper;
-
-public class JSONPServlet extends GenericServlet {
- private static final long serialVersionUID = 1L;
-
- protected transient RuntimeWire wire;
- protected transient Operation operation;
- protected transient ObjectMapper mapper;
-
- public JSONPServlet(RuntimeWire wire, Operation operation) {
- this.wire = wire;
- this.operation = operation;
- this.mapper = new ObjectMapper();
- }
-
- @Override
- public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
- String jsonRequest = getJSONRequest(servletRequest);
- Object[] args = jsonToObjects(jsonRequest);
- Object response = invokeService(args);
- String jsonResponse = getJSONResponse(servletRequest, response);
- servletResponse.getOutputStream().println(jsonResponse);
- }
-
- /**
- * Turn the request into JSON
- */
- protected String getJSONRequest(ServletRequest servletRequest) throws IOException, JsonParseException, JsonMappingException {
- String jsonRequest = "[";
- for (Enumeration<?> ns = servletRequest.getParameterNames(); ns.hasMoreElements(); ) {
- String name = (String) ns.nextElement();
- if (!name.startsWith("_") && !"callback".equals(name)) {
- if (jsonRequest.length() > 1) {
- jsonRequest += ", ";
- }
- //jsonRequest += name + ":" + servletRequest.getParameter(name);
- jsonRequest += "\""+ servletRequest.getParameter(name) + "\"";
- }
- }
- jsonRequest += "]";
- return jsonRequest;
- }
-
- /**
- * Turn the response object into JSON
- */
- protected String getJSONResponse(ServletRequest servletRequest, Object response) throws IOException, JsonParseException {
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- mapper.writeValue(os , response);
- String jsonResponse = os.toString();
-
- String callback = servletRequest.getParameter("callback");
- if (callback != null && callback.length() > 1) {
- jsonResponse = callback + "(" + jsonResponse + ");";
- }
-
- return jsonResponse;
- }
-
- /**
- * Turn the request JSON into objects
- */
- protected Object[] jsonToObjects(String jsonRequest) throws IOException, JsonParseException, JsonMappingException {
- Class<?> c = new Object[0].getClass();
- Object[] args = (Object[])mapper.readValue(jsonRequest, c);
- return args;
- }
-
- /**
- * Send the request down the wire to invoke the service
- */
- protected Object invokeService(Object[] args) {
- try {
- return wire.invoke(operation, args);
- } catch (InvocationTargetException e) {
- throw new RuntimeException(e);
- }
- }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.jsonp.runtime;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Enumeration;
+
+import javax.servlet.GenericServlet;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.runtime.RuntimeWire;
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+
+public class JSONPServlet extends GenericServlet {
+ private static final long serialVersionUID = 1L;
+
+ protected transient RuntimeWire wire;
+ protected transient Operation operation;
+ protected transient ObjectMapper mapper;
+
+ public JSONPServlet(RuntimeWire wire, Operation operation) {
+ this.wire = wire;
+ this.operation = operation;
+ this.mapper = new ObjectMapper();
+ }
+
+ @Override
+ public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
+ String jsonRequest = getJSONRequest(servletRequest);
+ Object[] args = jsonToObjects(jsonRequest);
+ Object response = invokeService(args);
+ String jsonResponse = getJSONResponse(servletRequest, response);
+ servletResponse.getOutputStream().println(jsonResponse);
+ }
+
+ /**
+ * Turn the request into JSON
+ */
+ protected String getJSONRequest(ServletRequest servletRequest) throws IOException, JsonParseException, JsonMappingException {
+ String jsonRequest = "[";
+ for (Enumeration<?> ns = servletRequest.getParameterNames(); ns.hasMoreElements(); ) {
+ String name = (String) ns.nextElement();
+ if (!name.startsWith("_") && !"callback".equals(name)) {
+ if (jsonRequest.length() > 1) {
+ jsonRequest += ", ";
+ }
+ //jsonRequest += name + ":" + servletRequest.getParameter(name);
+ jsonRequest += "\""+ servletRequest.getParameter(name) + "\"";
+ }
+ }
+ jsonRequest += "]";
+ return jsonRequest;
+ }
+
+ /**
+ * Turn the response object into JSON
+ */
+ protected String getJSONResponse(ServletRequest servletRequest, Object response) throws IOException, JsonParseException {
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ mapper.writeValue(os , response);
+ String jsonResponse = os.toString();
+
+ String callback = servletRequest.getParameter("callback");
+ if (callback != null && callback.length() > 1) {
+ jsonResponse = callback + "(" + jsonResponse + ");";
+ }
+
+ return jsonResponse;
+ }
+
+ /**
+ * Turn the request JSON into objects
+ */
+ protected Object[] jsonToObjects(String jsonRequest) throws IOException, JsonParseException, JsonMappingException {
+ Class<?> c = new Object[0].getClass();
+ Object[] args = (Object[])mapper.readValue(jsonRequest, c);
+ return args;
+ }
+
+ /**
+ * Send the request down the wire to invoke the service
+ */
+ protected Object invokeService(Object[] args) {
+ try {
+ return wire.invoke(operation, args);
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e);
+ }
+ }
} \ No newline at end of file
diff --git a/java/sca/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java b/java/sca/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java
index 16bf1db7ab..25a5cb24e0 100644
--- a/java/sca/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java
+++ b/java/sca/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldImpl.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package helloworld;
-
-
-public class HelloWorldImpl implements HelloWorldService {
-
- public String sayHello(String name) {
- return "Hello " + name;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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;
+
+
+public class HelloWorldImpl implements HelloWorldService {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/java/sca/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java b/java/sca/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java
index 064d615c45..59b4bd0d57 100644
--- a/java/sca/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java
+++ b/java/sca/modules/binding-jsonp-runtime/src/test/java/helloworld/HelloWorldService.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package helloworld;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface HelloWorldService {
-
- String sayHello(String name);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface HelloWorldService {
+
+ String sayHello(String name);
+
+}
diff --git a/java/sca/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java b/java/sca/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java
index 5bd52db1dc..d817aff0ff 100644
--- a/java/sca/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java
+++ b/java/sca/modules/binding-jsonp-runtime/src/test/java/test/BindingTestCase.java
@@ -1,62 +1,62 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package test;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.http.jetty.JettyServer;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class BindingTestCase {
-
- private static Node node;
-
- @Test
- public void testService() throws MalformedURLException, IOException {
- URL url = new URL("http://localhost:8085/HelloWorldService/sayHello?name=petra&callback=foo");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- String response = br.readLine();
- Assert.assertEquals("foo(\"Hello petra\");", response);
-
- }
-
- @BeforeClass
- public static void init() throws Exception {
- JettyServer.portDefault = 8085;
- node = NodeFactory.newInstance().createNode("helloworld.composite").start();
- }
-
- @AfterClass
- public static void destroy() throws Exception {
- if (node != null) {
- node.stop();
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package test;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.http.jetty.JettyServer;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class BindingTestCase {
+
+ private static Node node;
+
+ @Test
+ public void testService() throws MalformedURLException, IOException {
+ URL url = new URL("http://localhost:8085/HelloWorldService/sayHello?name=petra&callback=foo");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ String response = br.readLine();
+ Assert.assertEquals("foo(\"Hello petra\");", response);
+
+ }
+
+ @BeforeClass
+ public static void init() throws Exception {
+ JettyServer.portDefault = 8085;
+ node = NodeFactory.newInstance().createNode("helloworld.composite").start();
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ if (node != null) {
+ node.stop();
+ }
+ }
+
+}
diff --git a/java/sca/modules/binding-jsonp-runtime/src/test/resources/helloworld.composite b/java/sca/modules/binding-jsonp-runtime/src/test/resources/helloworld.composite
index cbfa8a204d..3ca0b4763e 100644
--- a/java/sca/modules/binding-jsonp-runtime/src/test/resources/helloworld.composite
+++ b/java/sca/modules/binding-jsonp-runtime/src/test/resources/helloworld.composite
@@ -1,32 +1,32 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- -->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://itest"
- name="HelloWorldComposite">
-
- <component name="HelloWorldComponent">
- <implementation.java class="helloworld.HelloWorldImpl"/>
- <service name="HelloWorldService" >
- <tuscany:binding.jsonp />
- </service>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://itest"
+ name="HelloWorldComposite">
+
+ <component name="HelloWorldComponent">
+ <implementation.java class="helloworld.HelloWorldImpl"/>
+ <service name="HelloWorldService" >
+ <tuscany:binding.jsonp />
+ </service>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/binding-jsonp/pom.xml b/java/sca/modules/binding-jsonp/pom.xml
index 059b71e694..89c83bad67 100644
--- a/java/sca/modules/binding-jsonp/pom.xml
+++ b/java/sca/modules/binding-jsonp/pom.xml
@@ -1,41 +1,41 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-binding-jsonp</artifactId>
- <name>Apache Tuscany SCA JSONP Binding Model</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-binding-jsonp</artifactId>
+ <name>Apache Tuscany SCA JSONP Binding Model</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBindingFactory.java b/java/sca/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBindingFactory.java
index 523235377f..2e8bebef0d 100644
--- a/java/sca/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBindingFactory.java
+++ b/java/sca/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/JSONPBindingFactory.java
@@ -1,31 +1,31 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.jsonp;
-
-/**
- * Factory to create JSONPBinding instances
- */
-public interface JSONPBindingFactory {
-
- /**
- * Create JSONPBinding model
- */
- JSONPBinding createJSONPBinding();
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.jsonp;
+
+/**
+ * Factory to create JSONPBinding instances
+ */
+public interface JSONPBindingFactory {
+
+ /**
+ * Create JSONPBinding model
+ */
+ JSONPBinding createJSONPBinding();
+}
diff --git a/java/sca/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/JSONPBindingFactoryImpl.java b/java/sca/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/JSONPBindingFactoryImpl.java
index cc757bfadd..be74a28e39 100644
--- a/java/sca/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/JSONPBindingFactoryImpl.java
+++ b/java/sca/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/JSONPBindingFactoryImpl.java
@@ -1,34 +1,34 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.jsonp.impl;
-
-import org.apache.tuscany.sca.binding.jsonp.JSONPBinding;
-import org.apache.tuscany.sca.binding.jsonp.JSONPBindingFactory;
-
-/**
- * Factory implementation to create JSONP Models
- */
-public class JSONPBindingFactoryImpl implements JSONPBindingFactory {
-
- public JSONPBinding createJSONPBinding() {
- return new JSONPBindingImpl();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.jsonp.impl;
+
+import org.apache.tuscany.sca.binding.jsonp.JSONPBinding;
+import org.apache.tuscany.sca.binding.jsonp.JSONPBindingFactory;
+
+/**
+ * Factory implementation to create JSONP Models
+ */
+public class JSONPBindingFactoryImpl implements JSONPBindingFactory {
+
+ public JSONPBinding createJSONPBinding() {
+ return new JSONPBindingImpl();
+ }
+
+}
diff --git a/java/sca/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/JSONPBindingImpl.java b/java/sca/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/JSONPBindingImpl.java
index baa1c5eb11..1cfbdc3ad7 100644
--- a/java/sca/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/JSONPBindingImpl.java
+++ b/java/sca/modules/binding-jsonp/src/main/java/org/apache/tuscany/sca/binding/jsonp/impl/JSONPBindingImpl.java
@@ -1,67 +1,67 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.jsonp.impl;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.binding.jsonp.JSONPBinding;
-
-/**
- * Represents a binding to an RMI service.
- *
- * @version $Rev: 718858 $ $Date: 2008-11-19 05:27:58 +0000 (Wed, 19 Nov 2008) $
- */
-public class JSONPBindingImpl implements JSONPBinding {
-
- private String name;
- private String uri;
-
- public String getName() {
- return name;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean arg0) {
- }
-
- public QName getType() {
- return TYPE;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.jsonp.impl;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.binding.jsonp.JSONPBinding;
+
+/**
+ * Represents a binding to an RMI service.
+ *
+ * @version $Rev$ $Date$
+ */
+public class JSONPBindingImpl implements JSONPBinding {
+
+ private String name;
+ private String uri;
+
+ public String getName() {
+ return name;
+ }
+
+ public String getURI() {
+ return uri;
+ }
+
+ public void setURI(String uri) {
+ this.uri = uri;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+
+ public boolean isUnresolved() {
+ return false;
+ }
+
+ public void setUnresolved(boolean arg0) {
+ }
+
+ public QName getType() {
+ return TYPE;
+ }
+
+}
diff --git a/java/sca/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RemoteBindingHelper.java b/java/sca/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RemoteBindingHelper.java
index 3d7cd07550..331f152b50 100644
--- a/java/sca/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RemoteBindingHelper.java
+++ b/java/sca/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/RemoteBindingHelper.java
@@ -1,43 +1,43 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.sca.provider;
-
-/**
- * TODO: TUSCANY-2578, implement a pluggable mechanism so sca binding impls can
- * add their own code to the decision on whether or not to use
- * the remote binding provider.
- */
-public class RemoteBindingHelper {
-
- private static boolean alwaysRemote;
- static {
- try {
- Class.forName("org.apache.tuscany.sca.binding.sca.jms.JMSSCABindingProviderFactory");
- alwaysRemote = true;
- } catch (ClassNotFoundException e) {
- alwaysRemote = false;
- }
- }
-
- public static boolean isTargetRemote() {
- return alwaysRemote;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.sca.provider;
+
+/**
+ * TODO: TUSCANY-2578, implement a pluggable mechanism so sca binding impls can
+ * add their own code to the decision on whether or not to use
+ * the remote binding provider.
+ */
+public class RemoteBindingHelper {
+
+ private static boolean alwaysRemote;
+ static {
+ try {
+ Class.forName("org.apache.tuscany.sca.binding.sca.jms.JMSSCABindingProviderFactory");
+ alwaysRemote = true;
+ } catch (ClassNotFoundException e) {
+ alwaysRemote = false;
+ }
+ }
+
+ public static boolean isTargetRemote() {
+ return alwaysRemote;
+ }
+
+}
diff --git a/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java b/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java
index db3a38f912..42b2f1c248 100644
--- a/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java
+++ b/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/ReadTestCase.java
@@ -1,97 +1,97 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apace.tuscany.sca.binding.sca.xml;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.SCABinding;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test reading WSDL interfaces.
- *
- * @version $Rev: 722930 $ $Date: 2008-12-03 15:27:31 +0000 (Wed, 03 Dec 2008) $
- */
-public class ReadTestCase {
-
- private static XMLInputFactory inputFactory;
- private static StAXArtifactProcessor<Object> staxProcessor;
- private static CompositeBuilder compositeBuilder;
-
- @BeforeClass
- public static void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
-
- inputFactory = XMLInputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
-
- compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
- }
-
- @Test
- public void testReadComponentType() throws Exception {
- InputStream is = getClass().getResourceAsStream("/CalculatorServiceImpl.componentType");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- ComponentType componentType = (ComponentType)staxProcessor.read(reader);
- assertNotNull(componentType);
-
- SCABinding referenceSCABinding = (SCABinding) componentType.getReferences().get(0).getBindings().get(0);
- assertNotNull(referenceSCABinding);
-
- SCABinding serviceSCABinding = (SCABinding) componentType.getServices().get(0).getBindings().get(0);
- assertNotNull(serviceSCABinding);
-
- //new PrintUtil(System.out).print(componentType);
- }
-
- @Test
- public void testReadComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("/Calculator.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite composite = (Composite)staxProcessor.read(reader);
- assertNotNull(composite);
-
- compositeBuilder.build(composite, null, null);
-
- SCABinding referenceSCABinding = (SCABinding) composite.getComponents().get(0).getReferences().get(0).getBindings().get(0);
- SCABinding serviceSCABinding = (SCABinding) composite.getComponents().get(1).getServices().get(0).getBindings().get(0);
-
- Assert.assertNotNull(referenceSCABinding);
- Assert.assertNotNull(serviceSCABinding);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apace.tuscany.sca.binding.sca.xml;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.SCABinding;
+import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
+import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Test reading WSDL interfaces.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ReadTestCase {
+
+ private static XMLInputFactory inputFactory;
+ private static StAXArtifactProcessor<Object> staxProcessor;
+ private static CompositeBuilder compositeBuilder;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+
+ inputFactory = XMLInputFactory.newInstance();
+ StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+ staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
+
+ compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
+ }
+
+ @Test
+ public void testReadComponentType() throws Exception {
+ InputStream is = getClass().getResourceAsStream("/CalculatorServiceImpl.componentType");
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
+ ComponentType componentType = (ComponentType)staxProcessor.read(reader);
+ assertNotNull(componentType);
+
+ SCABinding referenceSCABinding = (SCABinding) componentType.getReferences().get(0).getBindings().get(0);
+ assertNotNull(referenceSCABinding);
+
+ SCABinding serviceSCABinding = (SCABinding) componentType.getServices().get(0).getBindings().get(0);
+ assertNotNull(serviceSCABinding);
+
+ //new PrintUtil(System.out).print(componentType);
+ }
+
+ @Test
+ public void testReadComposite() throws Exception {
+ InputStream is = getClass().getResourceAsStream("/Calculator.composite");
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
+ Composite composite = (Composite)staxProcessor.read(reader);
+ assertNotNull(composite);
+
+ compositeBuilder.build(composite, null, null);
+
+ SCABinding referenceSCABinding = (SCABinding) composite.getComponents().get(0).getReferences().get(0).getBindings().get(0);
+ SCABinding serviceSCABinding = (SCABinding) composite.getComponents().get(1).getServices().get(0).getBindings().get(0);
+
+ Assert.assertNotNull(referenceSCABinding);
+ Assert.assertNotNull(serviceSCABinding);
+ }
+
+}
diff --git a/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java b/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java
index 7954c9c102..6073094249 100644
--- a/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java
+++ b/java/sca/modules/binding-sca-runtime/src/test/java/org/apace/tuscany/sca/binding/sca/xml/WriteTestCase.java
@@ -1,85 +1,85 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apace.tuscany.sca.binding.sca.xml;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * Test reading/write WSDL interfaces.
- *
- * @version $Rev: 750765 $ $Date: 2009-03-06 04:36:04 +0000 (Fri, 06 Mar 2009) $
- */
-public class WriteTestCase {
-
- private static StAXArtifactProcessor<Object> staxProcessor;
- private static XMLInputFactory inputFactory;
- private static XMLOutputFactory outputFactory;
-
- @BeforeClass
- public static void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- inputFactory = XMLInputFactory.newInstance();
- outputFactory = XMLOutputFactory.newInstance();
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
- }
-
- @Test
- @Ignore // broken in 2.0 bring up
- public void testReadWriteComponentType() throws Exception {
- InputStream is = getClass().getResourceAsStream("/CalculatorServiceImpl.componentType");
- ComponentType componentType = (ComponentType)staxProcessor.read(inputFactory.createXMLStreamReader(is));
- assertNotNull(componentType);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(componentType, outputFactory.createXMLStreamWriter(bos));
- assertEquals("<?xml version='1.0' encoding='UTF-8'?><componentType xmlns=\"http://docs.oasis-open.org/ns/opencsa/sca/200903\" xmlns:ns1=\"http://docs.oasis-open.org/ns/opencsa/sca/200903\"><service name=\"CalculatorService\"><binding.sca /><interface.java interface=\"calculator.CalculatorService\" /></service><reference name=\"addService\"><binding.sca /><interface.java interface=\"calculator.AddService\" /></reference></componentType>",
- bos.toString());
- }
-
- @Test
- @Ignore // broken in 2.0 bring up
- public void testReadWriteComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("/Calculator.composite");
- Composite composite = (Composite)staxProcessor.read(inputFactory.createXMLStreamReader(is));
- assertNotNull(composite);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(composite, outputFactory.createXMLStreamWriter(bos));
- assertEquals("<?xml version='1.0' encoding='UTF-8'?><composite xmlns=\"http://docs.oasis-open.org/ns/opencsa/sca/200903\" xmlns:ns1=\"http://docs.oasis-open.org/ns/opencsa/sca/200903\" targetNamespace=\"http://calc\" name=\"Calculator\"><service name=\"CalculatorService\" promote=\"CalculatorServiceComponent\"><binding.sca /><interface.java interface=\"calculator.CalculatorService\" /></service><component name=\"CalculatorServiceComponent\"><implementation.java class=\"calculator.CalculatorServiceImpl\" /><reference name=\"addService\" target=\"AddServiceComponent\"><binding.sca /></reference><reference name=\"subtractService\" target=\"SubtractServiceComponent\" /><reference name=\"multiplyService\" target=\"MultiplyServiceComponent\" /><reference name=\"divideService\" target=\"DivideServiceComponent\" /></component><component name=\"AddServiceComponent\"><implementation.java class=\"calculator.AddServiceImpl\" /><service name=\"AddService\"><binding.sca /><interface.java interface=\"calculator.AddService\" /></service></component><component name=\"SubtractServiceComponent\"><implementation.java class=\"calculator.SubtractServiceImpl\" /></component><component name=\"MultiplyServiceComponent\"><implementation.java class=\"calculator.MultiplyServiceImpl\" /></component><component name=\"DivideServiceComponent\"><implementation.java class=\"calculator.DivideServiceImpl\" /></component></composite>",
- bos.toString());
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apace.tuscany.sca.binding.sca.xml;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * Test reading/write WSDL interfaces.
+ *
+ * @version $Rev$ $Date$
+ */
+public class WriteTestCase {
+
+ private static StAXArtifactProcessor<Object> staxProcessor;
+ private static XMLInputFactory inputFactory;
+ private static XMLOutputFactory outputFactory;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+ StAXArtifactProcessorExtensionPoint staxProcessors = extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+ inputFactory = XMLInputFactory.newInstance();
+ outputFactory = XMLOutputFactory.newInstance();
+ staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
+ }
+
+ @Test
+ @Ignore // broken in 2.0 bring up
+ public void testReadWriteComponentType() throws Exception {
+ InputStream is = getClass().getResourceAsStream("/CalculatorServiceImpl.componentType");
+ ComponentType componentType = (ComponentType)staxProcessor.read(inputFactory.createXMLStreamReader(is));
+ assertNotNull(componentType);
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ staxProcessor.write(componentType, outputFactory.createXMLStreamWriter(bos));
+ assertEquals("<?xml version='1.0' encoding='UTF-8'?><componentType xmlns=\"http://docs.oasis-open.org/ns/opencsa/sca/200903\" xmlns:ns1=\"http://docs.oasis-open.org/ns/opencsa/sca/200903\"><service name=\"CalculatorService\"><binding.sca /><interface.java interface=\"calculator.CalculatorService\" /></service><reference name=\"addService\"><binding.sca /><interface.java interface=\"calculator.AddService\" /></reference></componentType>",
+ bos.toString());
+ }
+
+ @Test
+ @Ignore // broken in 2.0 bring up
+ public void testReadWriteComposite() throws Exception {
+ InputStream is = getClass().getResourceAsStream("/Calculator.composite");
+ Composite composite = (Composite)staxProcessor.read(inputFactory.createXMLStreamReader(is));
+ assertNotNull(composite);
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ staxProcessor.write(composite, outputFactory.createXMLStreamWriter(bos));
+ assertEquals("<?xml version='1.0' encoding='UTF-8'?><composite xmlns=\"http://docs.oasis-open.org/ns/opencsa/sca/200903\" xmlns:ns1=\"http://docs.oasis-open.org/ns/opencsa/sca/200903\" targetNamespace=\"http://calc\" name=\"Calculator\"><service name=\"CalculatorService\" promote=\"CalculatorServiceComponent\"><binding.sca /><interface.java interface=\"calculator.CalculatorService\" /></service><component name=\"CalculatorServiceComponent\"><implementation.java class=\"calculator.CalculatorServiceImpl\" /><reference name=\"addService\" target=\"AddServiceComponent\"><binding.sca /></reference><reference name=\"subtractService\" target=\"SubtractServiceComponent\" /><reference name=\"multiplyService\" target=\"MultiplyServiceComponent\" /><reference name=\"divideService\" target=\"DivideServiceComponent\" /></component><component name=\"AddServiceComponent\"><implementation.java class=\"calculator.AddServiceImpl\" /><service name=\"AddService\"><binding.sca /><interface.java interface=\"calculator.AddService\" /></service></component><component name=\"SubtractServiceComponent\"><implementation.java class=\"calculator.SubtractServiceImpl\" /></component><component name=\"MultiplyServiceComponent\"><implementation.java class=\"calculator.MultiplyServiceImpl\" /></component><component name=\"DivideServiceComponent\"><implementation.java class=\"calculator.DivideServiceImpl\" /></component></composite>",
+ bos.toString());
+ }
+
+}
diff --git a/java/sca/modules/binding-sca-runtime/src/test/resources/Calculator.composite b/java/sca/modules/binding-sca-runtime/src/test/resources/Calculator.composite
index b504e0a677..c404b3bcd4 100644
--- a/java/sca/modules/binding-sca-runtime/src/test/resources/Calculator.composite
+++ b/java/sca/modules/binding-sca-runtime/src/test/resources/Calculator.composite
@@ -1,59 +1,59 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:calc="http://calc"
- targetNamespace="http://calc"
- name="Calculator">
- <service name="CalculatorService" promote="CalculatorServiceComponent">
- <interface.java interface="calculator.CalculatorService"/>
- <binding.sca/>
- </service>
-
- <component name="CalculatorServiceComponent">
- <implementation.java class="calculator.CalculatorServiceImpl"/>
- <reference name="addService" target="AddServiceComponent">
- <binding.sca/>
- </reference>
- <reference name="subtractService" target="SubtractServiceComponent"/>
- <reference name="multiplyService" target="MultiplyServiceComponent"/>
- <reference name="divideService" target="DivideServiceComponent"/>
- </component>
-
- <component name="AddServiceComponent">
- <implementation.java class="calculator.AddServiceImpl"/>
- <service name="AddService">
- <interface.java interface="calculator.AddService"/>
- <binding.sca/>
- </service>
- </component>
-
- <component name="SubtractServiceComponent">
- <implementation.java class="calculator.SubtractServiceImpl"/>
- </component>
-
- <component name="MultiplyServiceComponent">
- <implementation.java class="calculator.MultiplyServiceImpl"/>
- </component>
-
- <component name="DivideServiceComponent">
- <implementation.java class="calculator.DivideServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:calc="http://calc"
+ targetNamespace="http://calc"
+ name="Calculator">
+ <service name="CalculatorService" promote="CalculatorServiceComponent">
+ <interface.java interface="calculator.CalculatorService"/>
+ <binding.sca/>
+ </service>
+
+ <component name="CalculatorServiceComponent">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <reference name="addService" target="AddServiceComponent">
+ <binding.sca/>
+ </reference>
+ <reference name="subtractService" target="SubtractServiceComponent"/>
+ <reference name="multiplyService" target="MultiplyServiceComponent"/>
+ <reference name="divideService" target="DivideServiceComponent"/>
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ <service name="AddService">
+ <interface.java interface="calculator.AddService"/>
+ <binding.sca/>
+ </service>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/binding-sca-runtime/src/test/resources/CalculatorServiceImpl.componentType b/java/sca/modules/binding-sca-runtime/src/test/resources/CalculatorServiceImpl.componentType
index 88611d47f2..85535842be 100644
--- a/java/sca/modules/binding-sca-runtime/src/test/resources/CalculatorServiceImpl.componentType
+++ b/java/sca/modules/binding-sca-runtime/src/test/resources/CalculatorServiceImpl.componentType
@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903">
-
- <service name="CalculatorService">
- <interface.java interface="calculator.CalculatorService" />
- <binding.sca/>
- </service>
-
- <reference name="addService">
- <interface.java interface="calculator.AddService" />
- <binding.sca/>
- </reference>
-
-</componentType>
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+
+ <service name="CalculatorService">
+ <interface.java interface="calculator.CalculatorService" />
+ <binding.sca/>
+ </service>
+
+ <reference name="addService">
+ <interface.java interface="calculator.AddService" />
+ <binding.sca/>
+ </reference>
+
+</componentType>
\ No newline at end of file
diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java
index 0d6743bfe2..985f387178 100644
--- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java
+++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicy.java
@@ -1,54 +1,54 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
-
-import javax.xml.namespace.QName;
-
-/**
- * Implementation for policies that could be injected as parameter
- * into the axis2config.
- *
- * @version $Rev: 695374 $ $Date: 2008-09-15 09:07:58 +0100 (Mon, 15 Sep 2008) $
- */
-public class Axis2TokenAuthenticationPolicy {
- private static final String SCA11_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1";
- public static final QName AXIS2_TOKEN_AUTHENTICATION_POLICY_QNAME = new QName(SCA11_TUSCANY_NS, "axis2TokenAuthentication");
- public static final String AXIS2_TOKEN_AUTHENTICATION_TOKEN_NAME = "tokenName";
-
- private QName tokenName;
-
- public QName getTokenName() {
- return tokenName;
- }
-
- public void setTokenName(QName tokenName) {
- this.tokenName = tokenName;
- }
-
- public QName getSchemaName() {
- return AXIS2_TOKEN_AUTHENTICATION_POLICY_QNAME;
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Implementation for policies that could be injected as parameter
+ * into the axis2config.
+ *
+ * @version $Rev$ $Date$
+ */
+public class Axis2TokenAuthenticationPolicy {
+ private static final String SCA11_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1";
+ public static final QName AXIS2_TOKEN_AUTHENTICATION_POLICY_QNAME = new QName(SCA11_TUSCANY_NS, "axis2TokenAuthentication");
+ public static final String AXIS2_TOKEN_AUTHENTICATION_TOKEN_NAME = "tokenName";
+
+ private QName tokenName;
+
+ public QName getTokenName() {
+ return tokenName;
+ }
+
+ public void setTokenName(QName tokenName) {
+ this.tokenName = tokenName;
+ }
+
+ public QName getSchemaName() {
+ return AXIS2_TOKEN_AUTHENTICATION_POLICY_QNAME;
+ }
+
+ public boolean isUnresolved() {
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ }
+}
diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProcessor.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProcessor.java
index 61624bb346..9b1f870cee 100644
--- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProcessor.java
+++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProcessor.java
@@ -1,113 +1,113 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/**
- *
- * Adjusted for 2.0 environment, Mike Edwards, 4th Dec 2008
- * @version $Rev: 695374 $ $Date: 2008-09-15 09:07:58 +0100 (Mon, 15 Sep 2008) $
- */
-public class Axis2TokenAuthenticationPolicyProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<Axis2TokenAuthenticationPolicy> {
- private static final String SCA11_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1";
-
- public QName getArtifactType() {
- return Axis2TokenAuthenticationPolicy.AXIS2_TOKEN_AUTHENTICATION_POLICY_QNAME;
- }
-
- public Axis2TokenAuthenticationPolicyProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- }
-
-
- public Axis2TokenAuthenticationPolicy read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- Axis2TokenAuthenticationPolicy policy = new Axis2TokenAuthenticationPolicy();
- int event = reader.getEventType();
- QName name = null;
-
- while (reader.hasNext()) {
- event = reader.getEventType();
- switch (event) {
- case START_ELEMENT : {
- name = reader.getName();
- if ( name.equals(getArtifactType()) ) {
- policy.setTokenName(getQName(reader, Axis2TokenAuthenticationPolicy.AXIS2_TOKEN_AUTHENTICATION_TOKEN_NAME));
- }
- break;
- }
- }
-
- if ( event == END_ELEMENT ) {
- if ( getArtifactType().equals(reader.getName()) ) {
- break;
- }
- }
-
- //Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
-
- return policy;
- }
-
- public void write(Axis2TokenAuthenticationPolicy policy, XMLStreamWriter writer)
- throws ContributionWriteException, XMLStreamException {
- String prefix = "tuscany";
- writer.writeStartElement(prefix,
- getArtifactType().getLocalPart(),
- getArtifactType().getNamespaceURI());
- writer.writeNamespace("tuscany", SCA11_TUSCANY_NS);
-
- if ( policy.getTokenName() != null ) {
- writer.writeStartElement(prefix,
- Axis2TokenAuthenticationPolicy.AXIS2_TOKEN_AUTHENTICATION_TOKEN_NAME,
- getArtifactType().getNamespaceURI());
- writer.writeCharacters(policy.getTokenName().toString());
- writer.writeEndElement();
- }
-
- writer.writeEndElement();
- }
-
- public Class<Axis2TokenAuthenticationPolicy> getModelType() {
- return Axis2TokenAuthenticationPolicy.class;
- }
-
- public void resolve(Axis2TokenAuthenticationPolicy arg0, ModelResolver arg1) throws ContributionResolveException {
-
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+
+/**
+ *
+ * Adjusted for 2.0 environment, Mike Edwards, 4th Dec 2008
+ * @version $Rev$ $Date$
+ */
+public class Axis2TokenAuthenticationPolicyProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<Axis2TokenAuthenticationPolicy> {
+ private static final String SCA11_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1";
+
+ public QName getArtifactType() {
+ return Axis2TokenAuthenticationPolicy.AXIS2_TOKEN_AUTHENTICATION_POLICY_QNAME;
+ }
+
+ public Axis2TokenAuthenticationPolicyProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
+ }
+
+
+ public Axis2TokenAuthenticationPolicy read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+ Axis2TokenAuthenticationPolicy policy = new Axis2TokenAuthenticationPolicy();
+ int event = reader.getEventType();
+ QName name = null;
+
+ while (reader.hasNext()) {
+ event = reader.getEventType();
+ switch (event) {
+ case START_ELEMENT : {
+ name = reader.getName();
+ if ( name.equals(getArtifactType()) ) {
+ policy.setTokenName(getQName(reader, Axis2TokenAuthenticationPolicy.AXIS2_TOKEN_AUTHENTICATION_TOKEN_NAME));
+ }
+ break;
+ }
+ }
+
+ if ( event == END_ELEMENT ) {
+ if ( getArtifactType().equals(reader.getName()) ) {
+ break;
+ }
+ }
+
+ //Read the next element
+ if (reader.hasNext()) {
+ reader.next();
+ }
+ }
+
+ return policy;
+ }
+
+ public void write(Axis2TokenAuthenticationPolicy policy, XMLStreamWriter writer)
+ throws ContributionWriteException, XMLStreamException {
+ String prefix = "tuscany";
+ writer.writeStartElement(prefix,
+ getArtifactType().getLocalPart(),
+ getArtifactType().getNamespaceURI());
+ writer.writeNamespace("tuscany", SCA11_TUSCANY_NS);
+
+ if ( policy.getTokenName() != null ) {
+ writer.writeStartElement(prefix,
+ Axis2TokenAuthenticationPolicy.AXIS2_TOKEN_AUTHENTICATION_TOKEN_NAME,
+ getArtifactType().getNamespaceURI());
+ writer.writeCharacters(policy.getTokenName().toString());
+ writer.writeEndElement();
+ }
+
+ writer.writeEndElement();
+ }
+
+ public Class<Axis2TokenAuthenticationPolicy> getModelType() {
+ return Axis2TokenAuthenticationPolicy.class;
+ }
+
+ public void resolve(Axis2TokenAuthenticationPolicy arg0, ModelResolver arg1) throws ContributionResolveException {
+
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProviderFactory.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProviderFactory.java
index af9689bc2a..5cf095a67f 100644
--- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProviderFactory.java
+++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationPolicyProviderFactory.java
@@ -1,59 +1,59 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
-
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.EndpointReference;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-import org.apache.tuscany.sca.provider.PolicyProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * @version $Rev: 695374 $ $Date: 2008-09-15 09:07:58 +0100 (Mon, 15 Sep 2008) $
- */
-public class Axis2TokenAuthenticationPolicyProviderFactory implements PolicyProviderFactory<Axis2TokenAuthenticationPolicy> {
- private ExtensionPointRegistry registry;
-
- public Axis2TokenAuthenticationPolicyProviderFactory(ExtensionPointRegistry registry) {
- super();
- this.registry = registry;
- }
-
- public PolicyProvider createImplementationPolicyProvider(RuntimeComponent component) {
- return null;//new TokenAuthenticationImplementationPolicyProvider(component, implementation);
- }
-
- public PolicyProvider createReferencePolicyProvider(EndpointReference endpointReference) {
- return new Axis2TokenAuthenticationReferencePolicyProvider(endpointReference);
- }
-
- public PolicyProvider createServicePolicyProvider(Endpoint endpoint) {
- return new Axis2TokenAuthenticationServicePolicyProvider(endpoint);
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.ProviderFactory#getModelType()
- */
- public Class<Axis2TokenAuthenticationPolicy> getModelType() {
- return Axis2TokenAuthenticationPolicy.class;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.provider.PolicyProvider;
+import org.apache.tuscany.sca.provider.PolicyProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class Axis2TokenAuthenticationPolicyProviderFactory implements PolicyProviderFactory<Axis2TokenAuthenticationPolicy> {
+ private ExtensionPointRegistry registry;
+
+ public Axis2TokenAuthenticationPolicyProviderFactory(ExtensionPointRegistry registry) {
+ super();
+ this.registry = registry;
+ }
+
+ public PolicyProvider createImplementationPolicyProvider(RuntimeComponent component) {
+ return null;//new TokenAuthenticationImplementationPolicyProvider(component, implementation);
+ }
+
+ public PolicyProvider createReferencePolicyProvider(EndpointReference endpointReference) {
+ return new Axis2TokenAuthenticationReferencePolicyProvider(endpointReference);
+ }
+
+ public PolicyProvider createServicePolicyProvider(Endpoint endpoint) {
+ return new Axis2TokenAuthenticationServicePolicyProvider(endpoint);
+ }
+
+ /**
+ * @see org.apache.tuscany.sca.provider.ProviderFactory#getModelType()
+ */
+ public Class<Axis2TokenAuthenticationPolicy> getModelType() {
+ return Axis2TokenAuthenticationPolicy.class;
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyInterceptor.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyInterceptor.java
index d9e4373c2f..00f93fed26 100644
--- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyInterceptor.java
+++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyInterceptor.java
@@ -1,90 +1,90 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
-
-import org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2SOAPHeaderString;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.Phase;
-import org.apache.tuscany.sca.invocation.PhasedInterceptor;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Policy handler to handle PolicySet related to Logging with the QName
- * {http://tuscany.apache.org/xmlns/sca/1.1/impl/java}LoggingPolicy
- *
- * @version $Rev: 698457 $ $Date: 2008-09-24 09:13:02 +0100 (Wed, 24 Sep 2008) $
- */
-public class Axis2TokenAuthenticationReferencePolicyInterceptor implements PhasedInterceptor {
-
- private Invoker next;
- private Operation operation;
- private PolicySet policySet = null;
- private String context;
- private Axis2TokenAuthenticationPolicy policy;
-
- public Axis2TokenAuthenticationReferencePolicyInterceptor(String context, Operation operation, PolicySet policySet) {
- super();
- this.operation = operation;
- this.policySet = policySet;
- this.context = context;
- init();
- }
-
- private void init() {
- if (policySet != null) {
- for (Object policyObject : policySet.getPolicies()){
- if (policyObject instanceof Axis2TokenAuthenticationPolicy){
- policy = (Axis2TokenAuthenticationPolicy)policyObject;
- break;
- }
- }
- }
- }
-
- public Message invoke(Message msg) {
- // could call out here to some 3rd party system to get credentials
-
- if ( policy.getTokenName() != null){
- // create Axis representation of header
- Axis2SOAPHeaderString header = new Axis2SOAPHeaderString();
- header.setHeaderName(policy.getTokenName());
- header.setHeaderString("SomeWSAuthorizationToken");
-
- // add header to Tuscany message
- msg.getHeaders().add(header);
- }
-
- return getNext().invoke(msg);
- }
-
- public Invoker getNext() {
- return next;
- }
-
- public void setNext(Invoker next) {
- this.next = next;
- }
-
- public String getPhase() {
- return Phase.REFERENCE_POLICY;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
+
+import org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2SOAPHeaderString;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.invocation.Phase;
+import org.apache.tuscany.sca.invocation.PhasedInterceptor;
+import org.apache.tuscany.sca.policy.PolicySet;
+
+/**
+ * Policy handler to handle PolicySet related to Logging with the QName
+ * {http://tuscany.apache.org/xmlns/sca/1.1/impl/java}LoggingPolicy
+ *
+ * @version $Rev$ $Date$
+ */
+public class Axis2TokenAuthenticationReferencePolicyInterceptor implements PhasedInterceptor {
+
+ private Invoker next;
+ private Operation operation;
+ private PolicySet policySet = null;
+ private String context;
+ private Axis2TokenAuthenticationPolicy policy;
+
+ public Axis2TokenAuthenticationReferencePolicyInterceptor(String context, Operation operation, PolicySet policySet) {
+ super();
+ this.operation = operation;
+ this.policySet = policySet;
+ this.context = context;
+ init();
+ }
+
+ private void init() {
+ if (policySet != null) {
+ for (Object policyObject : policySet.getPolicies()){
+ if (policyObject instanceof Axis2TokenAuthenticationPolicy){
+ policy = (Axis2TokenAuthenticationPolicy)policyObject;
+ break;
+ }
+ }
+ }
+ }
+
+ public Message invoke(Message msg) {
+ // could call out here to some 3rd party system to get credentials
+
+ if ( policy.getTokenName() != null){
+ // create Axis representation of header
+ Axis2SOAPHeaderString header = new Axis2SOAPHeaderString();
+ header.setHeaderName(policy.getTokenName());
+ header.setHeaderString("SomeWSAuthorizationToken");
+
+ // add header to Tuscany message
+ msg.getHeaders().add(header);
+ }
+
+ return getNext().invoke(msg);
+ }
+
+ public Invoker getNext() {
+ return next;
+ }
+
+ public void setNext(Invoker next) {
+ this.next = next;
+ }
+
+ public String getPhase() {
+ return Phase.REFERENCE_POLICY;
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java
index 94fcb236f8..cb2f004070 100644
--- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java
+++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationReferencePolicyProvider.java
@@ -1,71 +1,71 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.EndpointReference;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.PhasedInterceptor;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-
-/**
- * @version $Rev: 695374 $ $Date: 2008-09-15 09:07:58 +0100 (Mon, 15 Sep 2008) $
- */
-public class Axis2TokenAuthenticationReferencePolicyProvider implements PolicyProvider {
- private EndpointReference endpointReference;
-
- public Axis2TokenAuthenticationReferencePolicyProvider(EndpointReference endpointReference) {
- super();
- this.endpointReference = endpointReference;
- }
-
- private PolicySet findPolicySet() {
- List<PolicySet> policySets = endpointReference.getPolicySets();
- for (PolicySet ps : policySets) {
- for (Object p : ps.getPolicies()) {
- if (Axis2TokenAuthenticationPolicy.class.isInstance(p)) {
- return ps;
- }
- }
- }
- return null;
- }
-
- private String getContext() {
- return endpointReference.getURI();
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
- */
- public PhasedInterceptor createInterceptor(Operation operation) {
- PolicySet ps = findPolicySet();
- return ps == null ? null : new Axis2TokenAuthenticationReferencePolicyInterceptor(getContext(), operation, ps);
- }
-
- public void start() {
- }
-
- public void stop() {
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.PhasedInterceptor;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.provider.PolicyProvider;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class Axis2TokenAuthenticationReferencePolicyProvider implements PolicyProvider {
+ private EndpointReference endpointReference;
+
+ public Axis2TokenAuthenticationReferencePolicyProvider(EndpointReference endpointReference) {
+ super();
+ this.endpointReference = endpointReference;
+ }
+
+ private PolicySet findPolicySet() {
+ List<PolicySet> policySets = endpointReference.getPolicySets();
+ for (PolicySet ps : policySets) {
+ for (Object p : ps.getPolicies()) {
+ if (Axis2TokenAuthenticationPolicy.class.isInstance(p)) {
+ return ps;
+ }
+ }
+ }
+ return null;
+ }
+
+ private String getContext() {
+ return endpointReference.getURI();
+ }
+
+ /**
+ * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
+ */
+ public PhasedInterceptor createInterceptor(Operation operation) {
+ PolicySet ps = findPolicySet();
+ return ps == null ? null : new Axis2TokenAuthenticationReferencePolicyInterceptor(getContext(), operation, ps);
+ }
+
+ public void start() {
+ }
+
+ public void stop() {
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyInterceptor.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyInterceptor.java
index 33f7d97869..a863ef9f73 100644
--- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyInterceptor.java
+++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyInterceptor.java
@@ -1,98 +1,98 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
-
-
-import java.security.Principal;
-
-import javax.security.auth.Subject;
-
-import org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2HeaderPolicyUtil;
-import org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2SOAPHeaderString;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.invocation.Phase;
-import org.apache.tuscany.sca.invocation.PhasedInterceptor;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.authentication.token.TokenPrincipal;
-import org.apache.tuscany.sca.policy.security.SecurityUtil;
-
-/**
- * Policy handler to handle PolicySet related to Logging with the QName
- * {http://tuscany.apache.org/xmlns/sca/1.1/impl/java}LoggingPolicy
- *
- * @version $Rev: 721811 $ $Date: 2008-11-30 13:46:51 +0000 (Sun, 30 Nov 2008) $
- */
-public class Axis2TokenAuthenticationServicePolicyInterceptor implements PhasedInterceptor {
- private Invoker next;
- private Operation operation;
- private PolicySet policySet = null;
- private String context;
- private Axis2TokenAuthenticationPolicy policy;
-
- public Axis2TokenAuthenticationServicePolicyInterceptor(String context, Operation operation, PolicySet policySet) {
- super();
- this.operation = operation;
- this.policySet = policySet;
- this.context = context;
- init();
- }
-
- private void init() {
- if (policySet != null) {
- for (Object policyObject : policySet.getPolicies()){
- if (policyObject instanceof Axis2TokenAuthenticationPolicy){
- policy = (Axis2TokenAuthenticationPolicy)policyObject;
- break;
- }
- }
- }
- }
-
- public Message invoke(Message msg) {
-
- Axis2SOAPHeaderString header = (Axis2SOAPHeaderString)Axis2HeaderPolicyUtil.getHeader(msg, policy.getTokenName());
-
- if (header != null) {
- System.out.println("Web service received token: " + header.getHeaderString());
-
- // call out here to some 3rd party system to do whatever you
- // need to turn header credentials into an authenticated principal
-
- Subject subject = SecurityUtil.getSubject(msg);
- Principal principal = new TokenPrincipal(header.getHeaderString());
- subject.getPrincipals().add(principal);
- }
-
- return getNext().invoke(msg);
- }
-
- public Invoker getNext() {
- return next;
- }
-
- public void setNext(Invoker next) {
- this.next = next;
- }
-
- public String getPhase() {
- return Phase.SERVICE_POLICY;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
+
+
+import java.security.Principal;
+
+import javax.security.auth.Subject;
+
+import org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2HeaderPolicyUtil;
+import org.apache.tuscany.sca.binding.ws.axis2.policy.header.Axis2SOAPHeaderString;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.invocation.Phase;
+import org.apache.tuscany.sca.invocation.PhasedInterceptor;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.authentication.token.TokenPrincipal;
+import org.apache.tuscany.sca.policy.security.SecurityUtil;
+
+/**
+ * Policy handler to handle PolicySet related to Logging with the QName
+ * {http://tuscany.apache.org/xmlns/sca/1.1/impl/java}LoggingPolicy
+ *
+ * @version $Rev$ $Date$
+ */
+public class Axis2TokenAuthenticationServicePolicyInterceptor implements PhasedInterceptor {
+ private Invoker next;
+ private Operation operation;
+ private PolicySet policySet = null;
+ private String context;
+ private Axis2TokenAuthenticationPolicy policy;
+
+ public Axis2TokenAuthenticationServicePolicyInterceptor(String context, Operation operation, PolicySet policySet) {
+ super();
+ this.operation = operation;
+ this.policySet = policySet;
+ this.context = context;
+ init();
+ }
+
+ private void init() {
+ if (policySet != null) {
+ for (Object policyObject : policySet.getPolicies()){
+ if (policyObject instanceof Axis2TokenAuthenticationPolicy){
+ policy = (Axis2TokenAuthenticationPolicy)policyObject;
+ break;
+ }
+ }
+ }
+ }
+
+ public Message invoke(Message msg) {
+
+ Axis2SOAPHeaderString header = (Axis2SOAPHeaderString)Axis2HeaderPolicyUtil.getHeader(msg, policy.getTokenName());
+
+ if (header != null) {
+ System.out.println("Web service received token: " + header.getHeaderString());
+
+ // call out here to some 3rd party system to do whatever you
+ // need to turn header credentials into an authenticated principal
+
+ Subject subject = SecurityUtil.getSubject(msg);
+ Principal principal = new TokenPrincipal(header.getHeaderString());
+ subject.getPrincipals().add(principal);
+ }
+
+ return getNext().invoke(msg);
+ }
+
+ public Invoker getNext() {
+ return next;
+ }
+
+ public void setNext(Invoker next) {
+ this.next = next;
+ }
+
+ public String getPhase() {
+ return Phase.SERVICE_POLICY;
+ }
+}
diff --git a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java
index e229a7d328..9bfa1b8804 100644
--- a/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java
+++ b/java/sca/modules/binding-ws-axis2-policy/src/main/java/org/apache/tuscany/sca/binding/ws/axis2/policy/authentication/token/Axis2TokenAuthenticationServicePolicyProvider.java
@@ -1,70 +1,70 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.PhasedInterceptor;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.provider.PolicyProvider;
-
-/**
- * @version $Rev: 695374 $ $Date: 2008-09-15 09:07:58 +0100 (Mon, 15 Sep 2008) $
- */
-public class Axis2TokenAuthenticationServicePolicyProvider implements PolicyProvider {
- private Endpoint endpoint;
-
- public Axis2TokenAuthenticationServicePolicyProvider(Endpoint endpoint) {
- super();
- this.endpoint = endpoint;
- }
-
- private PolicySet findPolicySet() {
- List<PolicySet> policySets = endpoint.getPolicySets();
- for (PolicySet ps : policySets) {
- for (Object p : ps.getPolicies()) {
- if (Axis2TokenAuthenticationPolicy.class.isInstance(p)) {
- return ps;
- }
- }
- }
- return null;
- }
-
- private String getContext() {
- return endpoint.getURI();
- }
-
- /**
- * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
- */
- public PhasedInterceptor createInterceptor(Operation operation) {
- PolicySet ps = findPolicySet();
- return ps == null ? null : new Axis2TokenAuthenticationServicePolicyInterceptor(getContext(), operation, ps);
- }
-
- public void start() {
- }
-
- public void stop() {
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.policy.authentication.token;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.PhasedInterceptor;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.provider.PolicyProvider;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class Axis2TokenAuthenticationServicePolicyProvider implements PolicyProvider {
+ private Endpoint endpoint;
+
+ public Axis2TokenAuthenticationServicePolicyProvider(Endpoint endpoint) {
+ super();
+ this.endpoint = endpoint;
+ }
+
+ private PolicySet findPolicySet() {
+ List<PolicySet> policySets = endpoint.getPolicySets();
+ for (PolicySet ps : policySets) {
+ for (Object p : ps.getPolicies()) {
+ if (Axis2TokenAuthenticationPolicy.class.isInstance(p)) {
+ return ps;
+ }
+ }
+ }
+ return null;
+ }
+
+ private String getContext() {
+ return endpoint.getURI();
+ }
+
+ /**
+ * @see org.apache.tuscany.sca.provider.PolicyProvider#createInterceptor(org.apache.tuscany.sca.interfacedef.Operation)
+ */
+ public PhasedInterceptor createInterceptor(Operation operation) {
+ PolicySet ps = findPolicySet();
+ return ps == null ? null : new Axis2TokenAuthenticationServicePolicyInterceptor(getContext(), operation, ps);
+ }
+
+ public void start() {
+ }
+
+ public void stop() {
+ }
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/definitions.xml b/java/sca/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/definitions.xml
index f8b5b2063c..c2303caf50 100644
--- a/java/sca/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/definitions.xml
+++ b/java/sca/modules/binding-ws-axis2/src/main/resources/org/apache/tuscany/sca/binding/ws/axis2/definitions.xml
@@ -1,54 +1,54 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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$ -->
-
-<sca:definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
-
- <sca:bindingType type="sca:binding.ws" mayProvide="SOAP SOAP.1_1 SOAP.1_2 MTOM" alwaysProvides=""/>
-
- <!-- PolicyIntents defined by the SCA Runtime Extension for WS Binding Axis 2 -->
- <sca:intent name="SOAP" constrains="sca:binding.ws">
- <sca:description>
- Communication through this binding requires SOAP
- </sca:description>
- </sca:intent>
-
- <sca:intent name="SOAP.1_1">
- <sca:description>
- Communication through this binding requires SOAP 1.1
- </sca:description>
- </sca:intent>
-
- <sca:intent name="SOAP.1_2">
- <sca:description>
- Communication through this binding requires SOAP 1.2
- </sca:description>
- </sca:intent>
-
- <sca:intent name="MTOM" constrains="sca:binding.ws">
- <sca:description>
- Communication through this binding requires MTOM support
- </sca:description>
- </sca:intent>
- </sca:definitions>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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$ -->
+
+<sca:definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
+
+ <sca:bindingType type="sca:binding.ws" mayProvide="SOAP SOAP.1_1 SOAP.1_2 MTOM" alwaysProvides=""/>
+
+ <!-- PolicyIntents defined by the SCA Runtime Extension for WS Binding Axis 2 -->
+ <sca:intent name="SOAP" constrains="sca:binding.ws">
+ <sca:description>
+ Communication through this binding requires SOAP
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="SOAP.1_1">
+ <sca:description>
+ Communication through this binding requires SOAP 1.1
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="SOAP.1_2">
+ <sca:description>
+ Communication through this binding requires SOAP 1.2
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="MTOM" constrains="sca:binding.ws">
+ <sca:description>
+ Communication through this binding requires MTOM support
+ </sca:description>
+ </sca:intent>
+ </sca:definitions>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Account.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Account.java
index 40d769d83a..b9407c5778 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Account.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/Account.java
@@ -1,34 +1,34 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Test ?wsdl works and that the returned WSDL has the correct endpoint
- *
- * @version $Rev$ $Date$
- */
-@Remotable
-public interface Account {
-
- CustomerProfileData getCustomerProfile(String loginID);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Test ?wsdl works and that the returned WSDL has the correct endpoint
+ *
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface Account {
+
+ CustomerProfileData getCustomerProfile(String loginID);
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/AccountService.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/AccountService.java
index 5edb4ddc5a..16ff6f8e8c 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/AccountService.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/AccountService.java
@@ -1,33 +1,33 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-/**
- * Test ?wsdl works and that the returned WSDL has the correct endpoint
- *
- * @version $Rev$ $Date$
- */
-public class AccountService implements Account {
-
- public CustomerProfileData getCustomerProfile(String loginID) {
- return new CustomerProfileData(loginID);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+/**
+ * Test ?wsdl works and that the returned WSDL has the correct endpoint
+ *
+ * @version $Rev$ $Date$
+ */
+public class AccountService implements Account {
+
+ public CustomerProfileData getCustomerProfile(String loginID) {
+ return new CustomerProfileData(loginID);
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/CustomerProfileData.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/CustomerProfileData.java
index 5c1ee6a435..4ea341f05c 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/CustomerProfileData.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/CustomerProfileData.java
@@ -1,103 +1,103 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-/**
- * Test ?wsdl works and that the returned WSDL has the correct endpoint
- *
- * @version $Rev$ $Date$
- */
-public class CustomerProfileData {
-
- private String firstName;
- private String lastName;
- private String address;
- private String email;
- private String loginID;
- private String password;
- private int id;
-
- public CustomerProfileData(String loginID) {
- firstName = "John";
- lastName = "Doe";
- address = "345 Main Street";
- email = "john@doe.org";
- this.loginID = loginID;
- password = "hello";
- id = 1234;
- }
-
- public String getFirstName() {
- return firstName;
- }
-
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public void setLastName(String firstName) {
- this.lastName = lastName;
- }
-
- public String getAddress() {
- return address;
- }
-
- public void setAddress(String address) {
- this.address = address;
- }
-
- public String getEmail() {
- return email;
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
-
- public String getLoginID() {
- return loginID;
- }
-
- public void setLoginID(String loginID) {
- this.loginID = loginID;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+/**
+ * Test ?wsdl works and that the returned WSDL has the correct endpoint
+ *
+ * @version $Rev$ $Date$
+ */
+public class CustomerProfileData {
+
+ private String firstName;
+ private String lastName;
+ private String address;
+ private String email;
+ private String loginID;
+ private String password;
+ private int id;
+
+ public CustomerProfileData(String loginID) {
+ firstName = "John";
+ lastName = "Doe";
+ address = "345 Main Street";
+ email = "john@doe.org";
+ this.loginID = loginID;
+ password = "hello";
+ id = 1234;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String firstName) {
+ this.lastName = lastName;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getLoginID() {
+ return loginID;
+ }
+
+ public void setLoginID(String loginID) {
+ this.loginID = loginID;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCase.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCase.java
index a239d95c3a..1616f80cb4 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCase.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldWSDLMergedTestCase.java
@@ -1,64 +1,64 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMText;
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-public class HelloWorldWSDLMergedTestCase extends TestCase {
-
- private Node node;
- private HelloWorldOM helloWorld;
-
- public void testHelloWorld() throws Exception {
- OMFactory fac = OMAbstractFactory.getOMFactory();
- OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld");
- OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld");
- requestOM.addChild(parmE);
- parmE.addChild(fac.createOMText("petra"));
- OMElement responseOM = helloWorld.getGreetings(requestOM);
- OMElement child = (OMElement)responseOM.getFirstElement();
- Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText());
- }
-
- @Override
- protected void setUp() throws Exception {
- String contribution = ContributionLocationHelper.getContributionLocation(getClass());
- node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.composite", new Contribution("test", contribution));
- node.start();
- helloWorld = node.getService(HelloWorldOM.class, "HelloWorldWSDLMergedComponent");
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- node.destroy();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMText;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+public class HelloWorldWSDLMergedTestCase extends TestCase {
+
+ private Node node;
+ private HelloWorldOM helloWorld;
+
+ public void testHelloWorld() throws Exception {
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+ OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld");
+ OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld");
+ requestOM.addChild(parmE);
+ parmE.addChild(fac.createOMText("petra"));
+ OMElement responseOM = helloWorld.getGreetings(requestOM);
+ OMElement child = (OMElement)responseOM.getFirstElement();
+ Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText());
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ String contribution = ContributionLocationHelper.getContributionLocation(getClass());
+ node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.composite", new Contribution("test", contribution));
+ node.start();
+ helloWorld = node.getService(HelloWorldOM.class, "HelloWorldWSDLMergedComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ node.destroy();
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLImportTestCase.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLImportTestCase.java
index 15807c76de..51aa9f25f8 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLImportTestCase.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLImportTestCase.java
@@ -1,104 +1,104 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.List;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.axis2.transport.http.server.HttpUtils;
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-/**
- * Test ?wsdl works and that the returned WSDL has the correct endpoint
- *
- * @version $Rev$ $Date$
- */
-public class QuestionMarkWSDLImportTestCase extends TestCase {
-
- private Node node;
-
- /**
- * Tests ?wsdl works and returns the correct port endpoint from the WSDL
- */
- public void testWSDLImportPortEndpoint() throws Exception {
- InputStream inp = new URL("http://localhost:8086/AccountService?wsdl").openStream();
- BufferedReader br = new BufferedReader(new InputStreamReader(inp));
- String line;
- while((line = br.readLine()) != null) {
- System.out.println(line);
- }
- br.close();
-
- WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
- wsdlReader.setFeature("javax.wsdl.verbose", false);
- wsdlReader.setFeature("javax.wsdl.importDocuments", true);
-
- Definition definition = wsdlReader.readWSDL("http://localhost:8086/AccountService?wsdl");
- assertNotNull(definition);
- // TODO - EPR - $promoted$ no longer used
- //Service service = definition.getService(new QName("http://account2/AccountService/$promoted$ep1", "AccountService"));
- Service service = definition.getService(new QName("http://account2/AccountService/Account", "AccountService"));
- Port port = service.getPort("AccountSoapPort");
-
- String endpoint = getEndpoint(port);
- String ip = HttpUtils.getIpAddress();
- assertEquals("http://" + ip + ":8086/AccountService", endpoint);
- }
-
- private String getEndpoint(Port port) {
- List wsdlPortExtensions = port.getExtensibilityElements();
- for (final Object extension : wsdlPortExtensions) {
- if (extension instanceof SOAPAddress) {
- return ((SOAPAddress) extension).getLocationURI();
- }
- }
- throw new RuntimeException("no SOAPAddress");
- }
-
- @Override
- protected void setUp() throws Exception {
- String contribution = ContributionLocationHelper.getContributionLocation(getClass());
- node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-import.composite", new Contribution("test", contribution));
- node.start();
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- node.destroy();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.List;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.axis2.transport.http.server.HttpUtils;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+/**
+ * Test ?wsdl works and that the returned WSDL has the correct endpoint
+ *
+ * @version $Rev$ $Date$
+ */
+public class QuestionMarkWSDLImportTestCase extends TestCase {
+
+ private Node node;
+
+ /**
+ * Tests ?wsdl works and returns the correct port endpoint from the WSDL
+ */
+ public void testWSDLImportPortEndpoint() throws Exception {
+ InputStream inp = new URL("http://localhost:8086/AccountService?wsdl").openStream();
+ BufferedReader br = new BufferedReader(new InputStreamReader(inp));
+ String line;
+ while((line = br.readLine()) != null) {
+ System.out.println(line);
+ }
+ br.close();
+
+ WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+ wsdlReader.setFeature("javax.wsdl.verbose", false);
+ wsdlReader.setFeature("javax.wsdl.importDocuments", true);
+
+ Definition definition = wsdlReader.readWSDL("http://localhost:8086/AccountService?wsdl");
+ assertNotNull(definition);
+ // TODO - EPR - $promoted$ no longer used
+ //Service service = definition.getService(new QName("http://account2/AccountService/$promoted$ep1", "AccountService"));
+ Service service = definition.getService(new QName("http://account2/AccountService/Account", "AccountService"));
+ Port port = service.getPort("AccountSoapPort");
+
+ String endpoint = getEndpoint(port);
+ String ip = HttpUtils.getIpAddress();
+ assertEquals("http://" + ip + ":8086/AccountService", endpoint);
+ }
+
+ private String getEndpoint(Port port) {
+ List wsdlPortExtensions = port.getExtensibilityElements();
+ for (final Object extension : wsdlPortExtensions) {
+ if (extension instanceof SOAPAddress) {
+ return ((SOAPAddress) extension).getLocationURI();
+ }
+ }
+ throw new RuntimeException("no SOAPAddress");
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ String contribution = ContributionLocationHelper.getContributionLocation(getClass());
+ node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-import.composite", new Contribution("test", contribution));
+ node.start();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ node.destroy();
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLIncludeTestCase.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLIncludeTestCase.java
index fd95ff7473..0b780f2b96 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLIncludeTestCase.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/QuestionMarkWSDLIncludeTestCase.java
@@ -1,104 +1,104 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.List;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Port;
-import javax.wsdl.Service;
-import javax.wsdl.extensions.soap.SOAPAddress;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.axis2.transport.http.server.HttpUtils;
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-/**
- * Test ?wsdl works and that the returned WSDL has the correct endpoint
- *
- * @version $Rev: 660340 $ $Date: 2008-05-27 01:08:32 +0100 (Tue, 27 May 2008) $
- */
-public class QuestionMarkWSDLIncludeTestCase extends TestCase {
-
- private Node node;
-
- /**
- * Tests ?wsdl works and returns the correct port endpoint from the WSDL
- */
- public void testWSDLIncludePortEndpoint() throws Exception {
- InputStream inp = new URL("http://localhost:8085/AccountService?wsdl").openStream();
- BufferedReader br = new BufferedReader(new InputStreamReader(inp));
- String line;
- while((line = br.readLine()) != null) {
- System.out.println(line);
- }
- br.close();
-
- WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
- wsdlReader.setFeature("javax.wsdl.verbose", false);
- wsdlReader.setFeature("javax.wsdl.importDocuments", true);
-
- Definition definition = wsdlReader.readWSDL("http://localhost:8085/AccountService?wsdl");
- assertNotNull(definition);
- // TODO - EPR - $promoted$ no longer used
- //Service service = definition.getService(new QName("http://accounts/AccountService/$promoted$ep1", "AccountService"));
- Service service = definition.getService(new QName("http://accounts/AccountService/Account", "AccountService"));
- Port port = service.getPort("AccountSoapPort");
-
- String endpoint = getEndpoint(port);
- String ip = HttpUtils.getIpAddress();
- assertEquals("http://" + ip + ":8085/AccountService", endpoint);
- }
-
- private String getEndpoint(Port port) {
- List wsdlPortExtensions = port.getExtensibilityElements();
- for (final Object extension : wsdlPortExtensions) {
- if (extension instanceof SOAPAddress) {
- return ((SOAPAddress) extension).getLocationURI();
- }
- }
- throw new RuntimeException("no SOAPAddress");
- }
-
- @Override
- protected void setUp() throws Exception {
- String contribution = ContributionLocationHelper.getContributionLocation(getClass());
- node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-include.composite", new Contribution("test", contribution));
- node.start();
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- node.destroy();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.List;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Port;
+import javax.wsdl.Service;
+import javax.wsdl.extensions.soap.SOAPAddress;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.axis2.transport.http.server.HttpUtils;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+/**
+ * Test ?wsdl works and that the returned WSDL has the correct endpoint
+ *
+ * @version $Rev$ $Date$
+ */
+public class QuestionMarkWSDLIncludeTestCase extends TestCase {
+
+ private Node node;
+
+ /**
+ * Tests ?wsdl works and returns the correct port endpoint from the WSDL
+ */
+ public void testWSDLIncludePortEndpoint() throws Exception {
+ InputStream inp = new URL("http://localhost:8085/AccountService?wsdl").openStream();
+ BufferedReader br = new BufferedReader(new InputStreamReader(inp));
+ String line;
+ while((line = br.readLine()) != null) {
+ System.out.println(line);
+ }
+ br.close();
+
+ WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+ wsdlReader.setFeature("javax.wsdl.verbose", false);
+ wsdlReader.setFeature("javax.wsdl.importDocuments", true);
+
+ Definition definition = wsdlReader.readWSDL("http://localhost:8085/AccountService?wsdl");
+ assertNotNull(definition);
+ // TODO - EPR - $promoted$ no longer used
+ //Service service = definition.getService(new QName("http://accounts/AccountService/$promoted$ep1", "AccountService"));
+ Service service = definition.getService(new QName("http://accounts/AccountService/Account", "AccountService"));
+ Port port = service.getPort("AccountSoapPort");
+
+ String endpoint = getEndpoint(port);
+ String ip = HttpUtils.getIpAddress();
+ assertEquals("http://" + ip + ":8085/AccountService", endpoint);
+ }
+
+ private String getEndpoint(Port port) {
+ List wsdlPortExtensions = port.getExtensibilityElements();
+ for (final Object extension : wsdlPortExtensions) {
+ if (extension instanceof SOAPAddress) {
+ return ((SOAPAddress) extension).getLocationURI();
+ }
+ }
+ throw new RuntimeException("no SOAPAddress");
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ String contribution = ContributionLocationHelper.getContributionLocation(getClass());
+ node = NodeFactory.newInstance().createNode("org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-include.composite", new Contribution("test", contribution));
+ node.start();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ node.destroy();
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferClient.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferClient.java
index 5aefaac9ee..e020b03041 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferClient.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferClient.java
@@ -1,36 +1,36 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.mtom;
-
-import javax.activation.DataHandler;
-import org.oasisopen.sca.annotation.Reference;
-
-/**
- * This client program shows how to create an SCA runtime, start it,
- * locate the FileTransfer service and invoke it.
- */
-public class FileTransferClient implements FileTransferService {
-
- @Reference
- public FileTransferService fileTransferWS;
-
- public String uploadFile(DataHandler attachment) throws Exception {
- return fileTransferWS.uploadFile(attachment);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.mtom;
+
+import javax.activation.DataHandler;
+import org.oasisopen.sca.annotation.Reference;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * locate the FileTransfer service and invoke it.
+ */
+public class FileTransferClient implements FileTransferService {
+
+ @Reference
+ public FileTransferService fileTransferWS;
+
+ public String uploadFile(DataHandler attachment) throws Exception {
+ return fileTransferWS.uploadFile(attachment);
+ }
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCaseOFF.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCaseOFF.java
index f14229c541..ddd8fc0e5a 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCaseOFF.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferMTOMTestCaseOFF.java
@@ -1,81 +1,81 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.mtom;
-
-import javax.activation.DataHandler;
-import javax.activation.FileDataSource;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.equinox.launcher.Contribution;
-import org.apache.tuscany.sca.node.equinox.launcher.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher;
-
-// Removed imports of old host.embedded function
-// import org.apache.tuscany.sca.host.embedded.SCADomain;
-
-/**
- *
- * Modified by Mike Edwards, 4th Dec 2008, to adjust to new interfaces in the 2.0 stream.
- *
- */
-public class FileTransferMTOMTestCaseOFF extends TestCase {
-
- // private SCADomain domain;
- protected NodeLauncher launcher;
- protected Node node;
-
- public void testFileTransfer() throws Exception {
- // For testing purpose lets try uploading FileTransferClient.java file.
- DataHandler dataHandler = new DataHandler(new FileDataSource("FileTransferClient.java"));
- FileTransferService filetransfer = node.getService(FileTransferService.class, "FileTransferServiceComponent");
- assertEquals("File uploaded Sucessfully", filetransfer.uploadFile(dataHandler));
- }
-
- @Override
- protected void setUp() throws Exception {
- // domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransferservice.composite");
- // Tuscany specific code which starts the contribution holding the test
- launcher = NodeLauncher.newInstance();
- node = launcher.createNode("filetransferservice.composite", // testConfiguration.getComposite(),
- new Contribution("FileTransferMTOMTestCase", getContributionURI()));
- }
-
- @Override
- protected void tearDown() throws Exception {
- //domain.close();
- if (node != null) {
- node.stop();
- node.destroy();
- }
- if (launcher != null) {
- launcher.destroy();
- }
- }
-
- protected String getContributionURI() {
- Class<?> clazz = getClass();
- String location = ContributionLocationHelper.getContributionLocation(clazz);
- return location;
-
- } // end getContributionURI()
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.mtom;
+
+import javax.activation.DataHandler;
+import javax.activation.FileDataSource;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.equinox.launcher.Contribution;
+import org.apache.tuscany.sca.node.equinox.launcher.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher;
+
+// Removed imports of old host.embedded function
+// import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+/**
+ *
+ * Modified by Mike Edwards, 4th Dec 2008, to adjust to new interfaces in the 2.0 stream.
+ *
+ */
+public class FileTransferMTOMTestCaseOFF extends TestCase {
+
+ // private SCADomain domain;
+ protected NodeLauncher launcher;
+ protected Node node;
+
+ public void testFileTransfer() throws Exception {
+ // For testing purpose lets try uploading FileTransferClient.java file.
+ DataHandler dataHandler = new DataHandler(new FileDataSource("FileTransferClient.java"));
+ FileTransferService filetransfer = node.getService(FileTransferService.class, "FileTransferServiceComponent");
+ assertEquals("File uploaded Sucessfully", filetransfer.uploadFile(dataHandler));
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ // domain = SCADomain.newInstance("org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransferservice.composite");
+ // Tuscany specific code which starts the contribution holding the test
+ launcher = NodeLauncher.newInstance();
+ node = launcher.createNode("filetransferservice.composite", // testConfiguration.getComposite(),
+ new Contribution("FileTransferMTOMTestCase", getContributionURI()));
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ //domain.close();
+ if (node != null) {
+ node.stop();
+ node.destroy();
+ }
+ if (launcher != null) {
+ launcher.destroy();
+ }
+ }
+
+ protected String getContributionURI() {
+ Class<?> clazz = getClass();
+ String location = ContributionLocationHelper.getContributionLocation(clazz);
+ return location;
+
+ } // end getContributionURI()
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java
index 457e80ebdb..60b28ca4db 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java
@@ -1,32 +1,32 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.mtom;
-
-import org.oasisopen.sca.annotation.Remotable;
-import javax.activation.DataHandler;
-
-/**
- * This is the business interface of the HelloWorld greetings service.
- */
-@Remotable
-public interface FileTransferService {
-
- public String uploadFile(DataHandler attachment) throws Exception;
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.mtom;
+
+import org.oasisopen.sca.annotation.Remotable;
+import javax.activation.DataHandler;
+
+/**
+ * This is the business interface of the HelloWorld greetings service.
+ */
+@Remotable
+public interface FileTransferService {
+
+ public String uploadFile(DataHandler attachment) throws Exception;
+}
+
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java
index d947b0db0b..6591f2fc32 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferServiceImpl.java
@@ -1,50 +1,50 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.mtom;
-
-import javax.activation.DataHandler;
-
-import org.oasisopen.sca.annotation.Service;
-
-/**
- * This class implements the HelloWorld service.
- */
-@Service(FileTransferService.class)
-public class FileTransferServiceImpl implements FileTransferService {
-
- public String uploadFile(DataHandler attachment) throws Exception {
-
- //OMText binaryNode = (OMText) (attachment.getFirstElement()).getFirstOMChild();
- //DataHandler dataHandler = (DataHandler) binaryNode.getDataHandler();
-
- // Use this code to save the file we have received.
- /*DataHandler dataHandler = attachment;
-
- File file = new File("transferedfile.java");
- FileOutputStream fileOutputStream = new FileOutputStream(file);
- dataHandler.writeTo(fileOutputStream);
- fileOutputStream.flush();
- fileOutputStream.close();*/
-
- System.out.println(attachment.getContentType());
-
- return "File uploaded Sucessfully";
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.mtom;
+
+import javax.activation.DataHandler;
+
+import org.oasisopen.sca.annotation.Service;
+
+/**
+ * This class implements the HelloWorld service.
+ */
+@Service(FileTransferService.class)
+public class FileTransferServiceImpl implements FileTransferService {
+
+ public String uploadFile(DataHandler attachment) throws Exception {
+
+ //OMText binaryNode = (OMText) (attachment.getFirstElement()).getFirstOMChild();
+ //DataHandler dataHandler = (DataHandler) binaryNode.getDataHandler();
+
+ // Use this code to save the file we have received.
+ /*DataHandler dataHandler = attachment;
+
+ File file = new File("transferedfile.java");
+ FileOutputStream fileOutputStream = new FileOutputStream(file);
+ dataHandler.writeTo(fileOutputStream);
+ fileOutputStream.flush();
+ fileOutputStream.close();*/
+
+ System.out.println(attachment.getContentType());
+
+ return "File uploaded Sucessfully";
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCaseOFF.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCaseOFF.java
index 351cb87760..270ec4d097 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCaseOFF.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/AbstractHelloWorldOMTestCaseOFF.java
@@ -1,70 +1,70 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMText;
-import org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOM;
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-public abstract class AbstractHelloWorldOMTestCaseOFF extends TestCase {
-
- private Node node;
- private HelloWorldOM helloWorld;
-
- public void testHelloWorld() throws Exception {
- OMFactory fac = OMAbstractFactory.getOMFactory();
- OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld");
- OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld");
- requestOM.addChild(parmE);
- parmE.addChild(fac.createOMText("petra"));
- OMElement responseOM = helloWorld.getGreetings(requestOM);
- OMElement child = (OMElement)responseOM.getFirstElement();
- Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText());
- }
-
- @Override
- protected void setUp() throws Exception {
- String contribution = ContributionLocationHelper.getContributionLocation(getClass());
- node = NodeFactory.newInstance().createNode(getCompositeName(), new Contribution("test", contribution));
- node.start();
- helloWorld = node.getService(HelloWorldOM.class, "HelloWorldComponent");
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- node.destroy();
- }
-
- protected String getCompositeName() {
- String className = this.getClass().getName();
- return className.substring(0, className.length() - 8).replace('.', '/') + ".composite";
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMText;
+import org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOM;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+public abstract class AbstractHelloWorldOMTestCaseOFF extends TestCase {
+
+ private Node node;
+ private HelloWorldOM helloWorld;
+
+ public void testHelloWorld() throws Exception {
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+ OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld");
+ OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld");
+ requestOM.addChild(parmE);
+ parmE.addChild(fac.createOMText("petra"));
+ OMElement responseOM = helloWorld.getGreetings(requestOM);
+ OMElement child = (OMElement)responseOM.getFirstElement();
+ Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText());
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ String contribution = ContributionLocationHelper.getContributionLocation(getClass());
+ node = NodeFactory.newInstance().createNode(getCompositeName(), new Contribution("test", contribution));
+ node.start();
+ helloWorld = node.getService(HelloWorldOM.class, "HelloWorldComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ node.destroy();
+ }
+
+ protected String getCompositeName() {
+ String className = this.getClass().getName();
+ return className.substring(0, className.length() - 8).replace('.', '/') + ".composite";
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ClientPWCBHandler.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ClientPWCBHandler.java
index 67d6f1c56e..ff2d96c3a5 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ClientPWCBHandler.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ClientPWCBHandler.java
@@ -1,45 +1,45 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
-
-import java.io.IOException;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-import org.apache.ws.security.WSPasswordCallback;
-
-/**
- * Sample userid passwd generation class
- *
- * @version $Rev$ $Date$
- */
-public class ClientPWCBHandler implements CallbackHandler {
-
- public void handle(Callback[] callbacks) throws IOException,
- UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
- System.out.println("*** Calling Client UserId/Password Handler .... ");
- WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
- pwcb.setPassword("TuscanyWsUserPasswd");
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ *
+ * @version $Rev$ $Date$
+ */
+public class ClientPWCBHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ System.out.println("*** Calling Client UserId/Password Handler .... ");
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ pwcb.setPassword("TuscanyWsUserPasswd");
+ }
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/IntegrityPWCBHandler.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/IntegrityPWCBHandler.java
index 45c5472100..0b5a5031ce 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/IntegrityPWCBHandler.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/IntegrityPWCBHandler.java
@@ -1,45 +1,45 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
-
-import java.io.IOException;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-import org.apache.ws.security.WSPasswordCallback;
-
-/**
- * Sample userid passwd generation class
- *
- * @version $Rev$ $Date$
- */
-public class IntegrityPWCBHandler implements CallbackHandler {
-
- public void handle(Callback[] callbacks) throws IOException,
- UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
- System.out.println("*** Calling Integrity Password Handler .... ");
- WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
- pwcb.setPassword("TuscanyWsUserPasswd");
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ *
+ * @version $Rev$ $Date$
+ */
+public class IntegrityPWCBHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ System.out.println("*** Calling Integrity Password Handler .... ");
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ pwcb.setPassword("TuscanyWsUserPasswd");
+ }
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ServerPWCBHandler.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ServerPWCBHandler.java
index 7a4b50cc2c..14e69e7989 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ServerPWCBHandler.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/ServerPWCBHandler.java
@@ -1,45 +1,45 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
-
-import java.io.IOException;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-import org.apache.ws.security.WSPasswordCallback;
-
-/**
- * Sample userid passwd generation class
- *
- * @version $Rev$ $Date$
- */
-public class ServerPWCBHandler implements CallbackHandler {
-
- public void handle(Callback[] callbacks) throws IOException,
- UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
- System.out.println("*** Calling Server User/Passwd Handler....");
- WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
- pwcb.setPassword("TuscanyWsUserPasswd");
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ *
+ * @version $Rev$ $Date$
+ */
+public class ServerPWCBHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ System.out.println("*** Calling Server User/Passwd Handler....");
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ pwcb.setPassword("TuscanyWsUserPasswd");
+ }
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthenticationTestCaseFIXME.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthenticationTestCaseFIXME.java
index 5ddfe359a5..e27514681b 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthenticationTestCaseFIXME.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityAuthenticationTestCaseFIXME.java
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
-
-public class WSSecurityAuthenticationTestCaseFIXME extends AbstractHelloWorldOMTestCaseOFF {
- // super class does it all getting composite based on this class name
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
+
+public class WSSecurityAuthenticationTestCaseFIXME extends AbstractHelloWorldOMTestCaseOFF {
+ // super class does it all getting composite based on this class name
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java
index 15eda714f0..fde1864e43 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java
@@ -1,42 +1,42 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
-
-import java.security.Provider;
-import java.security.Security;
-
-public class WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue extends AbstractHelloWorldOMTestCaseOFF {
-
- /**
- * @see org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams.AbstractHelloWorldOMTestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- // Workaround an issue with IBM JDK
- Provider jce = Security.getProvider("IBMJCE");
- if (jce != null) {
- // Make sure IBMJCE is used first
- Security.removeProvider("IBMJCE");
- Security.insertProviderAt(jce, 1);
- }
- super.setUp();
- }
- // super class does it all getting composite based on this class name
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
+
+import java.security.Provider;
+import java.security.Security;
+
+public class WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue extends AbstractHelloWorldOMTestCaseOFF {
+
+ /**
+ * @see org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams.AbstractHelloWorldOMTestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ // Workaround an issue with IBM JDK
+ Provider jce = Security.getProvider("IBMJCE");
+ if (jce != null) {
+ // Make sure IBMJCE is used first
+ Security.removeProvider("IBMJCE");
+ Security.insertProviderAt(jce, 1);
+ }
+ super.setUp();
+ }
+ // super class does it all getting composite based on this class name
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCaseOFF.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCaseOFF.java
index fcb317013c..7144ad4b41 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCaseOFF.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/WSSecurityIntegrityTestCaseOFF.java
@@ -1,24 +1,24 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
-
-public class WSSecurityIntegrityTestCaseOFF extends AbstractHelloWorldOMTestCaseOFF {
- // super class does it all getting composite based on this class name
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams;
+
+public class WSSecurityIntegrityTestCaseOFF extends AbstractHelloWorldOMTestCaseOFF {
+ // super class does it all getting composite based on this class name
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCaseOFF.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCaseOFF.java
index 5f6824669a..81f2690709 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCaseOFF.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/AbstractHelloWorldOMTestCaseOFF.java
@@ -1,70 +1,70 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMText;
-import org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOM;
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-public abstract class AbstractHelloWorldOMTestCaseOFF extends TestCase {
-
- private Node node;
- private HelloWorldOM helloWorld;
-
- public void testHelloWorld() throws Exception {
- OMFactory fac = OMAbstractFactory.getOMFactory();
- OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld");
- OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld");
- requestOM.addChild(parmE);
- parmE.addChild(fac.createOMText("petra"));
- OMElement responseOM = helloWorld.getGreetings(requestOM);
- OMElement child = (OMElement)responseOM.getFirstElement();
- Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText());
- }
-
- @Override
- protected void setUp() throws Exception {
- String contribution = ContributionLocationHelper.getContributionLocation(getClass());
- node = NodeFactory.newInstance().createNode(getCompositeName(), new Contribution("test", contribution));
- node.start();
- helloWorld = node.getService(HelloWorldOM.class, "HelloWorldComponent");
- }
-
- @Override
- protected void tearDown() throws Exception {
- node.stop();
- node.destroy();
- }
-
- protected String getCompositeName() {
- String className = this.getClass().getName();
- return className.substring(0, className.length() - 8).replace('.', '/') + ".composite";
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMText;
+import org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOM;
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+public abstract class AbstractHelloWorldOMTestCaseOFF extends TestCase {
+
+ private Node node;
+ private HelloWorldOM helloWorld;
+
+ public void testHelloWorld() throws Exception {
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+ OMElement requestOM = fac.createOMElement("getGreetings", "http://helloworld-om", "helloworld");
+ OMElement parmE = fac.createOMElement("name", "http://helloworld-om", "helloworld");
+ requestOM.addChild(parmE);
+ parmE.addChild(fac.createOMText("petra"));
+ OMElement responseOM = helloWorld.getGreetings(requestOM);
+ OMElement child = (OMElement)responseOM.getFirstElement();
+ Assert.assertEquals("Hello petra", ((OMText)child.getFirstOMChild()).getText());
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ String contribution = ContributionLocationHelper.getContributionLocation(getClass());
+ node = NodeFactory.newInstance().createNode(getCompositeName(), new Contribution("test", contribution));
+ node.start();
+ helloWorld = node.getService(HelloWorldOM.class, "HelloWorldComponent");
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ node.stop();
+ node.destroy();
+ }
+
+ protected String getCompositeName() {
+ String className = this.getClass().getName();
+ return className.substring(0, className.length() - 8).replace('.', '/') + ".composite";
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ClientPWCBHandler.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ClientPWCBHandler.java
index cf342653c7..1437c2c866 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ClientPWCBHandler.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ClientPWCBHandler.java
@@ -1,45 +1,45 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
-
-import java.io.IOException;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-import org.apache.ws.security.WSPasswordCallback;
-
-/**
- * Sample userid passwd generation class
- *
- * @version $Rev$ $Date$
- */
-public class ClientPWCBHandler implements CallbackHandler {
-
- public void handle(Callback[] callbacks) throws IOException,
- UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
- System.out.println("*** Calling Client UserId/Password Handler .... ");
- WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
- pwcb.setPassword("TuscanyWsUserPasswd");
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ *
+ * @version $Rev$ $Date$
+ */
+public class ClientPWCBHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ System.out.println("*** Calling Client UserId/Password Handler .... ");
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ pwcb.setPassword("TuscanyWsUserPasswd");
+ }
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/IntegrityPWCBHandler.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/IntegrityPWCBHandler.java
index 84b64d3902..915c4f51c7 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/IntegrityPWCBHandler.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/IntegrityPWCBHandler.java
@@ -1,45 +1,45 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
-
-import java.io.IOException;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-import org.apache.ws.security.WSPasswordCallback;
-
-/**
- * Sample userid passwd generation class
- *
- * @version $Rev$ $Date$
- */
-public class IntegrityPWCBHandler implements CallbackHandler {
-
- public void handle(Callback[] callbacks) throws IOException,
- UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
- System.out.println("*** Calling Integrity Password Handler .... ");
- WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
- pwcb.setPassword("TuscanyWsUserPasswd");
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ *
+ * @version $Rev$ $Date$
+ */
+public class IntegrityPWCBHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ System.out.println("*** Calling Integrity Password Handler .... ");
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ pwcb.setPassword("TuscanyWsUserPasswd");
+ }
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ServerPWCBHandler.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ServerPWCBHandler.java
index 04825b6b56..8f3cd9fe32 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ServerPWCBHandler.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/ServerPWCBHandler.java
@@ -1,45 +1,45 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
-
-import java.io.IOException;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-import org.apache.ws.security.WSPasswordCallback;
-
-/**
- * Sample userid passwd generation class
- *
- * @version $Rev$ $Date$
- */
-public class ServerPWCBHandler implements CallbackHandler {
-
- public void handle(Callback[] callbacks) throws IOException,
- UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
- System.out.println("*** Calling Server User/Passwd Handler....");
- WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
- pwcb.setPassword("TuscanyWsUserPasswd");
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ *
+ * @version $Rev$ $Date$
+ */
+public class ServerPWCBHandler implements CallbackHandler {
+
+ public void handle(Callback[] callbacks) throws IOException,
+ UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
+ System.out.println("*** Calling Server User/Passwd Handler....");
+ WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+ pwcb.setPassword("TuscanyWsUserPasswd");
+ }
+ }
+
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCaseOFF.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCaseOFF.java
index 355fa657f0..9070053ece 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCaseOFF.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityAuthenticationTestCaseOFF.java
@@ -1,27 +1,27 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
-
-import org.junit.Ignore;
-
-@Ignore("Temporarily ignore rampart module validation failure")
-public class WSSecurityAuthenticationTestCaseOFF extends AbstractHelloWorldOMTestCaseOFF {
- // super class does it all getting composite based on this class name
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
+
+import org.junit.Ignore;
+
+@Ignore("Temporarily ignore rampart module validation failure")
+public class WSSecurityAuthenticationTestCaseOFF extends AbstractHelloWorldOMTestCaseOFF {
+ // super class does it all getting composite based on this class name
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java
index 3d514e5624..2bd6d41427 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue.java
@@ -1,42 +1,42 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
-
-import java.security.Provider;
-import java.security.Security;
-
-public class WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue extends AbstractHelloWorldOMTestCaseOFF {
-
- /**
- * @see org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams.AbstractHelloWorldOMTestCase#setUp()
- */
- @Override
- protected void setUp() throws Exception {
- // Workaround an issue with IBM JDK
- Provider jce = Security.getProvider("IBMJCE");
- if (jce != null) {
- // Make sure IBMJCE is used first
- Security.removeProvider("IBMJCE");
- Security.insertProviderAt(jce, 1);
- }
- super.setUp();
- }
- // super class does it all getting composite based on this class name
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
+
+import java.security.Provider;
+import java.security.Security;
+
+public class WSSecurityConfidentialityTestCaseFIXBouncyCastleIssue extends AbstractHelloWorldOMTestCaseOFF {
+
+ /**
+ * @see org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams.AbstractHelloWorldOMTestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ // Workaround an issue with IBM JDK
+ Provider jce = Security.getProvider("IBMJCE");
+ if (jce != null) {
+ // Make sure IBMJCE is used first
+ Security.removeProvider("IBMJCE");
+ Security.insertProviderAt(jce, 1);
+ }
+ super.setUp();
+ }
+ // super class does it all getting composite based on this class name
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCaseOFF.java b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCaseOFF.java
index 6a5ff8e231..dd215180fc 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCaseOFF.java
+++ b/java/sca/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/WSSecurityIntegrityTestCaseOFF.java
@@ -1,27 +1,27 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
-
-import org.junit.Ignore;
-
-@Ignore("Temporarily ignore rampart module validation failure")
-public class WSSecurityIntegrityTestCaseOFF extends AbstractHelloWorldOMTestCaseOFF {
- // super class does it all getting composite based on this class name
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy;
+
+import org.junit.Ignore;
+
+@Ignore("Temporarily ignore rampart module validation failure")
+public class WSSecurityIntegrityTestCaseOFF extends AbstractHelloWorldOMTestCaseOFF {
+ // super class does it all getting composite based on this class name
+}
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.composite b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.composite
index 061b68450c..f8e3f11284 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.composite
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorld.composite
@@ -1,47 +1,47 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="HelloWorld">
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldService"/>
- <service name="HelloWorld">
- <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld#wsdl.binding(HelloWorldSoapBinding)">
- <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
- <wsa:Address>http://localhost:8085/services/HelloWorldWebService</wsa:Address>
- </wsa:EndpointReference>
- </binding.ws>
- </service>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldComponent"/>
- <reference name="helloWorldWS">
- <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
- </reference>
- </component>
-
-
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
+ name="HelloWorld">
+
+ <component name="HelloWorldService">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldService"/>
+ <service name="HelloWorld">
+ <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
+ <binding.ws wsdlElement="http://helloworld#wsdl.binding(HelloWorldSoapBinding)">
+ <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
+ <wsa:Address>http://localhost:8085/services/HelloWorldWebService</wsa:Address>
+ </wsa:EndpointReference>
+ </binding.ws>
+ </service>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldComponent"/>
+ <reference name="helloWorldWS">
+ <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
+ <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
+ </reference>
+ </component>
+
+
+
+</composite>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDL.composite b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDL.composite
index 992d4463de..3c8ed37414 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDL.composite
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/HelloWorldNoWSDL.composite
@@ -1,53 +1,53 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="HelloWorldNoWSDL">
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldService"/>
- <service name="HelloWorld" >
- <binding.ws uri="http://localhost:8085/helloWorld"/>
- </service>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldComponent"/>
- <reference name="helloWorldWS" >
- <binding.ws uri="http://localhost:8085/helloWorld"/>
- </reference>
- </component>
-
- <component name="EchoService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.EchoImpl"/>
- <service name="Echo">
- <binding.ws uri="http://localhost:8085/Echo"/>
- </service>
- </component>
-
- <component name="EchoComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.EchoComponent"/>
- <reference name="echoWS">
- <binding.ws uri="http://localhost:8085/Echo"/>
- </reference>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
+ name="HelloWorldNoWSDL">
+
+ <component name="HelloWorldService">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldService"/>
+ <service name="HelloWorld" >
+ <binding.ws uri="http://localhost:8085/helloWorld"/>
+ </service>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldComponent"/>
+ <reference name="helloWorldWS" >
+ <binding.ws uri="http://localhost:8085/helloWorld"/>
+ </reference>
+ </component>
+
+ <component name="EchoService">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.EchoImpl"/>
+ <service name="Echo">
+ <binding.ws uri="http://localhost:8085/Echo"/>
+ </service>
+ </component>
+
+ <component name="EchoComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.EchoComponent"/>
+ <reference name="echoWS">
+ <binding.ws uri="http://localhost:8085/Echo"/>
+ </reference>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdata.xsd b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdata.xsd
index f09ed09b6a..421d5d6166 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdata.xsd
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdata.xsd
@@ -1,36 +1,36 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<xsd:schema elementFormDefault="qualified"
- targetNamespace="http://accounts"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:complexType name="CustomerProfileData">
- <xsd:sequence>
- <xsd:element name="firstName" type="xsd:string" />
- <xsd:element name="lastName" type="xsd:string" />
- <xsd:element name="address" type="xsd:string" />
- <xsd:element name="email" type="xsd:string" />
- <xsd:element name="loginID" type="xsd:string" />
- <xsd:element name="password" type="xsd:string" />
- <xsd:element name="id" type="xsd:int" />
- </xsd:sequence>
- </xsd:complexType>
-
-</xsd:schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<xsd:schema elementFormDefault="qualified"
+ targetNamespace="http://accounts"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <xsd:complexType name="CustomerProfileData">
+ <xsd:sequence>
+ <xsd:element name="firstName" type="xsd:string" />
+ <xsd:element name="lastName" type="xsd:string" />
+ <xsd:element name="address" type="xsd:string" />
+ <xsd:element name="email" type="xsd:string" />
+ <xsd:element name="loginID" type="xsd:string" />
+ <xsd:element name="password" type="xsd:string" />
+ <xsd:element name="id" type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdefs.xsd b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdefs.xsd
index ec67b84851..39d814ea40 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdefs.xsd
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerdefs.xsd
@@ -1,27 +1,27 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<xsd:schema elementFormDefault="qualified"
- targetNamespace="http://accounts"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:include schemaLocation="customerdata.xsd" />
- <xsd:include schemaLocation="/org/apache/tuscany/sca/binding/ws/axis2/itests/customerinfo.xsd" />
-
-</xsd:schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<xsd:schema elementFormDefault="qualified"
+ targetNamespace="http://accounts"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <xsd:include schemaLocation="customerdata.xsd" />
+ <xsd:include schemaLocation="/org/apache/tuscany/sca/binding/ws/axis2/itests/customerinfo.xsd" />
+
+</xsd:schema>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerinfo.xsd b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerinfo.xsd
index 7c903c6394..b78909142f 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerinfo.xsd
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/customerinfo.xsd
@@ -1,31 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<xsd:schema elementFormDefault="qualified"
- targetNamespace="http://accounts"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:complexType name="CustomerProfileInfo">
- <xsd:sequence>
- <xsd:element name="firstName" type="xsd:string" />
- <xsd:element name="lastName" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
-
-</xsd:schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<xsd:schema elementFormDefault="qualified"
+ targetNamespace="http://accounts"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <xsd:complexType name="CustomerProfileInfo">
+ <xsd:sequence>
+ <xsd:element name="firstName" type="xsd:string" />
+ <xsd:element name="lastName" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiService.composite b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiService.composite
index 0c5646e888..0a357e5110 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiService.composite
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultMultiService.composite
@@ -1,53 +1,53 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="endpoint1">
-
- <!--
- exposing a component which has multiple services with a WS binding,
- endpoint should be <componentURI>/<serviceName> so for this composite:
- http://localhost:8085/HelloWorldService/service1
- -->
-
-
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldMultiService"/>
- <service name="HelloWorldOM">
- <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
- <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld"
- wsdlElement="http://helloworld-om#wsdl.binding(HelloWorldSoapBinding)"/>
- </service>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS">
- <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld-om#wsdl.binding(HelloWorldSoapBinding)"
- uri="http://localhost:8085/HelloWorldService/helloWorld"/>
- </reference>
- </component>
-
-
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
+ name="endpoint1">
+
+ <!--
+ exposing a component which has multiple services with a WS binding,
+ endpoint should be <componentURI>/<serviceName> so for this composite:
+ http://localhost:8085/HelloWorldService/service1
+ -->
+
+
+
+ <component name="HelloWorldService">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldMultiService"/>
+ <service name="HelloWorldOM">
+ <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
+ <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld"
+ wsdlElement="http://helloworld-om#wsdl.binding(HelloWorldSoapBinding)"/>
+ </service>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
+ <reference name="helloWorldWS">
+ <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
+ <binding.ws wsdlElement="http://helloworld-om#wsdl.binding(HelloWorldSoapBinding)"
+ uri="http://localhost:8085/HelloWorldService/helloWorld"/>
+ </reference>
+ </component>
+
+
+
+</composite>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleService.composite b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleService.composite
index 5778f98593..50ff44c91e 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleService.composite
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/DefaultSingleService.composite
@@ -1,51 +1,51 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="endpoint1">
-
- <!--
- exposing a component with a WS binding, endpoint should be <componentURI>/<serviceName>
- unless the component has just a single service in which case its just <componentURI>
- so for this composite: http://localhost:8085/HelloWorldService
- -->
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- <service name="HelloWorldOM">
- <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
- <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld"
- wsdlElement="http://helloworld-om#wsdl.binding(HelloWorldSoapBinding)"/>
- </service>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS">
- <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld-om#wsdl.binding(HelloWorldSoapBinding)"
- uri="http://localhost:8085/HelloWorldService/helloWorld"/>
- </reference>
- </component>
-
-
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
+ name="endpoint1">
+
+ <!--
+ exposing a component with a WS binding, endpoint should be <componentURI>/<serviceName>
+ unless the component has just a single service in which case its just <componentURI>
+ so for this composite: http://localhost:8085/HelloWorldService
+ -->
+
+ <component name="HelloWorldService">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
+ <service name="HelloWorldOM">
+ <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
+ <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld"
+ wsdlElement="http://helloworld-om#wsdl.binding(HelloWorldSoapBinding)"/>
+ </service>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
+ <reference name="helloWorldWS">
+ <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
+ <binding.ws wsdlElement="http://helloworld-om#wsdl.binding(HelloWorldSoapBinding)"
+ uri="http://localhost:8085/HelloWorldService/helloWorld"/>
+ </reference>
+ </component>
+
+
+
+</composite>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURI.composite b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURI.composite
index 990093bc8c..d72d0b4239 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURI.composite
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLExplicitURI.composite
@@ -1,50 +1,50 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="endpoint3">
-
- <!--
- exposing a component with a WS binding using a WSDL port with an explicit URL
- so for this composite the service is: http://localhost:8085/myExplicitURI
- -->
-
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- <service name="HelloWorldOM">
- <interface.wsdl interface="http://helloworld-om-uri#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld-om-uri#wsdl.port(HelloWorldService/HelloWorldSoapPort)" />
- </service>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS">
- <interface.wsdl interface="http://helloworld-om-uri#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld-om-uri#wsdl.binding(HelloWorldSoapBinding)"
- uri="http://localhost:8085/myExplicitURI"/>
- </reference>
- </component>
-
-
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
+ name="endpoint3">
+
+ <!--
+ exposing a component with a WS binding using a WSDL port with an explicit URL
+ so for this composite the service is: http://localhost:8085/myExplicitURI
+ -->
+
+
+ <component name="HelloWorldService">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
+ <service name="HelloWorldOM">
+ <interface.wsdl interface="http://helloworld-om-uri#wsdl.interface(HelloWorld)" />
+ <binding.ws wsdlElement="http://helloworld-om-uri#wsdl.port(HelloWorldService/HelloWorldSoapPort)" />
+ </service>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
+ <reference name="helloWorldWS">
+ <interface.wsdl interface="http://helloworld-om-uri#wsdl.interface(HelloWorld)" />
+ <binding.ws wsdlElement="http://helloworld-om-uri#wsdl.binding(HelloWorldSoapBinding)"
+ uri="http://localhost:8085/myExplicitURI"/>
+ </reference>
+ </component>
+
+
+
+</composite>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURI.composite b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURI.composite
index ea598f8e23..aefe1b41a1 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURI.composite
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/endpoints/WSDLRelativeURI.composite
@@ -1,51 +1,51 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="endpoint4">
-
- <!--
- exposing a component with a WS binding using a WSDL port with a relative URL
- so for this composite the service is: http://localhost:8085/HelloWorldService/myRelativeURI
- -->
-
-
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- <service name="HelloWorldOM">
- <interface.wsdl interface="http://helloworld-om-relative-uri#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld-om-relative-uri#wsdl.port(HelloWorldService/HelloWorldSoapPort)" />
- </service>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS">
- <interface.wsdl interface="http://helloworld-om-relative-uri#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld-om-relative-uri#wsdl.binding(HelloWorldSoapBinding)"
- uri="http://localhost:8085/HelloWorldService/helloWorld/myRelativeURI"/>
- </reference>
- </component>
-
-
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
+ name="endpoint4">
+
+ <!--
+ exposing a component with a WS binding using a WSDL port with a relative URL
+ so for this composite the service is: http://localhost:8085/HelloWorldService/myRelativeURI
+ -->
+
+
+
+ <component name="HelloWorldService">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
+ <service name="HelloWorldOM">
+ <interface.wsdl interface="http://helloworld-om-relative-uri#wsdl.interface(HelloWorld)" />
+ <binding.ws wsdlElement="http://helloworld-om-relative-uri#wsdl.port(HelloWorldService/HelloWorldSoapPort)" />
+ </service>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
+ <reference name="helloWorldWS">
+ <interface.wsdl interface="http://helloworld-om-relative-uri#wsdl.interface(HelloWorld)" />
+ <binding.ws wsdlElement="http://helloworld-om-relative-uri#wsdl.binding(HelloWorldSoapBinding)"
+ uri="http://localhost:8085/HelloWorldService/helloWorld/myRelativeURI"/>
+ </reference>
+ </component>
+
+
+
+</composite>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorld.composite b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorld.composite
index ef012f1803..8727227e6b 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorld.composite
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/epr/HelloWorld.composite
@@ -1,48 +1,48 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="HelloWorld">
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldService"/>
- <service name="HelloWorld">
- <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
- <binding.ws>
- <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
- <wsa:Address>http://localhost:8085/myService</wsa:Address>
- </wsa:EndpointReference>
- </binding.ws>
- </service>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldComponent"/>
- <reference name="helloWorldWS">
- <binding.ws>
- <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
- <wsa:Address>http://localhost:8085/myService</wsa:Address>
- </wsa:EndpointReference>
- </binding.ws>
- </reference>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
+ name="HelloWorld">
+
+ <component name="HelloWorldService">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldService"/>
+ <service name="HelloWorld">
+ <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
+ <binding.ws>
+ <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
+ <wsa:Address>http://localhost:8085/myService</wsa:Address>
+ </wsa:EndpointReference>
+ </binding.ws>
+ </service>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldComponent"/>
+ <reference name="helloWorldWS">
+ <binding.ws>
+ <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
+ <wsa:Address>http://localhost:8085/myService</wsa:Address>
+ </wsa:EndpointReference>
+ </binding.ws>
+ </reference>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.composite b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.composite
index 023f392085..4367e2d88d 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.composite
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-merged.composite
@@ -1,43 +1,43 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="HelloWorldOM-Merged">
-
-
- <component name="HelloWorldMergedService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- <service name="HelloWorldOM">
- <interface.wsdl interface="http://helloworld-om-merged#wsdl.interface(HelloWorld)" />
- <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld"/>
- </service>
- </component>
-
- <component name="HelloWorldWSDLMergedComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS">
- <interface.wsdl interface="http://helloworld-om-merged#wsdl.interface(HelloWorld)" />
- <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld" />
- </reference>
- </component>
-
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
+ name="HelloWorldOM-Merged">
+
+
+ <component name="HelloWorldMergedService">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
+ <service name="HelloWorldOM">
+ <interface.wsdl interface="http://helloworld-om-merged#wsdl.interface(HelloWorld)" />
+ <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld"/>
+ </service>
+ </component>
+
+ <component name="HelloWorldWSDLMergedComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
+ <reference name="helloWorldWS">
+ <interface.wsdl interface="http://helloworld-om-merged#wsdl.interface(HelloWorld)" />
+ <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld" />
+ </reference>
+ </component>
+
+
+</composite>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-porttype.wsdl b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-porttype.wsdl
index c66fa51c34..29be66fb71 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-porttype.wsdl
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om-porttype.wsdl
@@ -1,59 +1,59 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<wsdl:definitions targetNamespace="http://helloworld-om-merged" xmlns:tns="http://helloworld-om-merged" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- name="helloworld-om-porttype">
-
- <wsdl:types>
- <schema elementFormDefault="qualified" targetNamespace="http://helloworld-om-merged" xmlns="http://www.w3.org/2001/XMLSchema">
-
- <element name="getGreetings">
- <complexType>
- <sequence>
- <element name="name" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
-
- <element name="getGreetingsResponse">
- <complexType>
- <sequence>
- <element name="getGreetingsReturn" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
- </schema>
- </wsdl:types>
-
- <wsdl:message name="getGreetingsRequest">
- <wsdl:part element="tns:getGreetings" name="parameters"/>
- </wsdl:message>
-
- <wsdl:message name="getGreetingsResponse">
- <wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
- </wsdl:message>
-
- <wsdl:portType name="HelloWorld">
- <wsdl:operation name="getGreetings">
- <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
- <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
- </wsdl:operation>
- </wsdl:portType>
-
-</wsdl:definitions>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions targetNamespace="http://helloworld-om-merged" xmlns:tns="http://helloworld-om-merged" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ name="helloworld-om-porttype">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified" targetNamespace="http://helloworld-om-merged" xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <element name="getGreetings">
+ <complexType>
+ <sequence>
+ <element name="name" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="getGreetingsResponse">
+ <complexType>
+ <sequence>
+ <element name="getGreetingsReturn" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetingsRequest">
+ <wsdl:part element="tns:getGreetings" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:message name="getGreetingsResponse">
+ <wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloWorld">
+ <wsdl:operation name="getGreetings">
+ <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
+ <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+</wsdl:definitions>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.composite b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.composite
index ccd3082f88..24a66ccbca 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.composite
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-om.composite
@@ -1,42 +1,42 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="HelloWorldOM">
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- <service name="HelloWorldOM">
- <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
- <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld"/>
- </service>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS">
- <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
- <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld" />
- </reference>
- </component>
-
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
+ name="HelloWorldOM">
+
+ <component name="HelloWorldService">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
+ <service name="HelloWorldOM">
+ <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
+ <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld"/>
+ </service>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
+ <reference name="helloWorldWS">
+ <interface.wsdl interface="http://helloworld-om#wsdl.interface(HelloWorld)" />
+ <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld" />
+ </reference>
+ </component>
+
+
+</composite>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.composite b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.composite
index 91175c476c..4d605a2012 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.composite
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/helloworld-prec.composite
@@ -1,46 +1,46 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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$ -->
-
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="HelloWorldPrec">
-
-
- <component name="HelloWorldService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
- <service name="HelloWorldOM">
- <interface.wsdl interface="http://helloworld-prec#wsdl.interface(HelloWorld)" />
- <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld"/>
- </service>
- </component>
-
- <component name="HelloWorldComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
- <reference name="helloWorldWS">
- <interface.wsdl interface="http://helloworld-prec#wsdl.interface(HelloWorld)" />
- <binding.ws wsdlElement="http://helloworld-prec#wsdl.port(HelloWorldService/HelloWorldSoapPort)"
- uri="http://INVALID.END.POINT" />
- </reference>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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$ -->
+
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
+ name="HelloWorldPrec">
+
+
+ <component name="HelloWorldService">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMService"/>
+ <service name="HelloWorldOM">
+ <interface.wsdl interface="http://helloworld-prec#wsdl.interface(HelloWorld)" />
+ <binding.ws uri="http://localhost:8085/HelloWorldService/helloWorld"/>
+ </service>
+ </component>
+
+ <component name="HelloWorldComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.HelloWorldOMComponent"/>
+ <reference name="helloWorldWS">
+ <interface.wsdl interface="http://helloworld-prec#wsdl.interface(HelloWorld)" />
+ <binding.ws wsdlElement="http://helloworld-prec#wsdl.port(HelloWorldService/HelloWorldSoapPort)"
+ uri="http://INVALID.END.POINT" />
+ </reference>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransfer.wsdl b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransfer.wsdl
index 1c67a1b26a..8887b3452f 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransfer.wsdl
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/filetransfer.wsdl
@@ -1,84 +1,84 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<wsdl:definitions
- targetNamespace="http://filetransfer"
- xmlns:tns="http://filetransfer"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- name="filetransfer">
-
- <wsdl:types>
- <schema elementFormDefault="qualified" targetNamespace="http://filetransfer" xmlns="http://www.w3.org/2001/XMLSchema">
-
- <element name="uploadFile">
- <complexType>
- <sequence>
- <element name="attachment" type="xsd:base64Binary"/>
- </sequence>
- </complexType>
- </element>
-
- <element name="uploadFileResponse">
- <complexType>
- <sequence>
- <element name="uploadFileReturn" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
-
- </schema>
- </wsdl:types>
-
- <wsdl:message name="uploadFileRequest">
- <wsdl:part element="tns:uploadFile" name="parameters"/>
- </wsdl:message>
-
- <wsdl:message name="uploadFileResponse">
- <wsdl:part element="tns:uploadFileResponse" name="parameters"/>
- </wsdl:message>
-
- <wsdl:portType name="FileTransfer">
- <wsdl:operation name="uploadFile">
- <wsdl:input message="tns:uploadFileRequest" name="uploadFileRequest"/>
- <wsdl:output message="tns:uploadFileResponse" name="uploadFileResponse"/>
- </wsdl:operation>
- </wsdl:portType>
-
- <wsdl:binding name="FileTransferSoapBinding" type="tns:FileTransfer">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="uploadFile">
- <wsdlsoap:operation soapAction=""/>
- <wsdl:input name="uploadFileRequest">
- <wsdlsoap:body use="literal"/>
- </wsdl:input>
- <wsdl:output name="uploadFileResponse">
- <wsdlsoap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="FileTransferService">
- <wsdl:port binding="tns:FileTransferSoapBinding" name="FileTransferSoapPort">
- <wsdlsoap:address location="http://localhost:8085/FileTransferServiceComponent"/>
- </wsdl:port>
- </wsdl:service>
-
-</wsdl:definitions>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions
+ targetNamespace="http://filetransfer"
+ xmlns:tns="http://filetransfer"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ name="filetransfer">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified" targetNamespace="http://filetransfer" xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <element name="uploadFile">
+ <complexType>
+ <sequence>
+ <element name="attachment" type="xsd:base64Binary"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="uploadFileResponse">
+ <complexType>
+ <sequence>
+ <element name="uploadFileReturn" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="uploadFileRequest">
+ <wsdl:part element="tns:uploadFile" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:message name="uploadFileResponse">
+ <wsdl:part element="tns:uploadFileResponse" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:portType name="FileTransfer">
+ <wsdl:operation name="uploadFile">
+ <wsdl:input message="tns:uploadFileRequest" name="uploadFileRequest"/>
+ <wsdl:output message="tns:uploadFileResponse" name="uploadFileResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="FileTransferSoapBinding" type="tns:FileTransfer">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="uploadFile">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="uploadFileRequest">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="uploadFileResponse">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="FileTransferService">
+ <wsdl:port binding="tns:FileTransferSoapBinding" name="FileTransferSoapPort">
+ <wsdlsoap:address location="http://localhost:8085/FileTransferServiceComponent"/>
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite
index d1f0cc1ff5..74aff65651 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/pojo/test.composite
@@ -1,32 +1,32 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://test"
- xmlns:hw="http://helloworld"
- name="test">
- <component name="TestServiceComponent">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.pojo.TestServiceImpl" />
- <service name="TestService">
- <interface.java interface="org.apache.tuscany.sca.binding.ws.axis2.itests.pojo.TestService" />
- <binding.ws uri="http://localhost:8085/testService"/>
- </service>
- </component>
-</composite>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://test"
+ xmlns:hw="http://helloworld"
+ name="test">
+ <component name="TestServiceComponent">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.pojo.TestServiceImpl" />
+ <service name="TestService">
+ <interface.java interface="org.apache.tuscany.sca.binding.ws.axis2.itests.pojo.TestService" />
+ <binding.ws uri="http://localhost:8085/testService"/>
+ </service>
+ </component>
+</composite>
+
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/definitions.xml b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/definitions.xml
index 1eadd01b81..e46345bdbc 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/definitions.xml
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/definitions.xml
@@ -1,101 +1,101 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<sca:definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
-
- <!-- WS Security POLICY SETS -->
- <sca:policySet name="wsAuthenticationPolicy"
- provides="sca:authentication"
- appliesTo="//sca:binding.ws"
- >
- <tuscany:wsConfigParam>
- <parameter name="InflowSecurity">
- <action>
- <items>UsernameToken</items>
- <passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams.ServerPWCBHandler</passwordCallbackClass>
- </action>
- </parameter>
- </tuscany:wsConfigParam>
- </sca:policySet>
-
- <sca:policySet name="wsClientAuthenticationPolicy"
- provides="tuscany:wsAuthentication"
- appliesTo="//sca:binding.ws">
- <tuscany:wsConfigParam>
- <parameter name="OutflowSecurity">
- <action>
- <items>UsernameToken</items>
- <user>TuscanyWsUser</user>
- <passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams.ClientPWCBHandler</passwordCallbackClass>" +
- <passwordType>PasswordText</passwordType>
- </action>
- </parameter>
- </tuscany:wsConfigParam>
- </sca:policySet>
-
- <sca:policySet name="wsIntegrityPolicy"
- provides="sca:integrity"
- appliesTo="//sca:binding.ws">
- <tuscany:wsConfigParam>
- <parameter name="InflowSecurity">
- <action>
- <items>Timestamp Signature</items>
- <signaturePropFile>org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties</signaturePropFile>
- </action>
- </parameter>
- <parameter name="OutflowSecurity">
- <action>
- <items>Timestamp Signature</items>
- <user>TuscanyWsUser</user>
- <signaturePropFile>org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties</signaturePropFile>
- <passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams.IntegrityPWCBHandler</passwordCallbackClass>" +
- <signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
- </action>
- </parameter>
- </tuscany:wsConfigParam>
- </sca:policySet>
-
- <sca:policySet name="wsConfidentialityPolicy"
- provides="sca:confidentiality"
- appliesTo="//sca:binding.ws">
- <tuscany:wsConfigParam>
- <parameter name="InflowSecurity">
- <action>
- <items>Timestamp Signature Encrypt</items>
- <passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams.IntegrityPWCBHandler</passwordCallbackClass>
- <signaturePropFile>org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties</signaturePropFile>
- </action>
- </parameter>
- <parameter name="OutflowSecurity">
- <action>
- <items>Timestamp Signature Encrypt</items>
- <user>TuscanyWsUser</user>
- <encryptionUser>TuscanyWsUser</encryptionUser>
- <passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams.IntegrityPWCBHandler</passwordCallbackClass>
- <signaturePropFile>org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties</signaturePropFile>
- <signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
- <encryptionKeyIdentifier>SKIKeyIdentifier</encryptionKeyIdentifier>
- </action>
- </parameter>
- </tuscany:wsConfigParam>
- </sca:policySet>
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<sca:definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
+
+ <!-- WS Security POLICY SETS -->
+ <sca:policySet name="wsAuthenticationPolicy"
+ provides="sca:authentication"
+ appliesTo="//sca:binding.ws"
+ >
+ <tuscany:wsConfigParam>
+ <parameter name="InflowSecurity">
+ <action>
+ <items>UsernameToken</items>
+ <passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams.ServerPWCBHandler</passwordCallbackClass>
+ </action>
+ </parameter>
+ </tuscany:wsConfigParam>
+ </sca:policySet>
+
+ <sca:policySet name="wsClientAuthenticationPolicy"
+ provides="tuscany:wsAuthentication"
+ appliesTo="//sca:binding.ws">
+ <tuscany:wsConfigParam>
+ <parameter name="OutflowSecurity">
+ <action>
+ <items>UsernameToken</items>
+ <user>TuscanyWsUser</user>
+ <passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams.ClientPWCBHandler</passwordCallbackClass>" +
+ <passwordType>PasswordText</passwordType>
+ </action>
+ </parameter>
+ </tuscany:wsConfigParam>
+ </sca:policySet>
+
+ <sca:policySet name="wsIntegrityPolicy"
+ provides="sca:integrity"
+ appliesTo="//sca:binding.ws">
+ <tuscany:wsConfigParam>
+ <parameter name="InflowSecurity">
+ <action>
+ <items>Timestamp Signature</items>
+ <signaturePropFile>org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties</signaturePropFile>
+ </action>
+ </parameter>
+ <parameter name="OutflowSecurity">
+ <action>
+ <items>Timestamp Signature</items>
+ <user>TuscanyWsUser</user>
+ <signaturePropFile>org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties</signaturePropFile>
+ <passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams.IntegrityPWCBHandler</passwordCallbackClass>" +
+ <signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
+ </action>
+ </parameter>
+ </tuscany:wsConfigParam>
+ </sca:policySet>
+
+ <sca:policySet name="wsConfidentialityPolicy"
+ provides="sca:confidentiality"
+ appliesTo="//sca:binding.ws">
+ <tuscany:wsConfigParam>
+ <parameter name="InflowSecurity">
+ <action>
+ <items>Timestamp Signature Encrypt</items>
+ <passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams.IntegrityPWCBHandler</passwordCallbackClass>
+ <signaturePropFile>org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties</signaturePropFile>
+ </action>
+ </parameter>
+ <parameter name="OutflowSecurity">
+ <action>
+ <items>Timestamp Signature Encrypt</items>
+ <user>TuscanyWsUser</user>
+ <encryptionUser>TuscanyWsUser</encryptionUser>
+ <passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.configparams.IntegrityPWCBHandler</passwordCallbackClass>
+ <signaturePropFile>org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties</signaturePropFile>
+ <signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
+ <encryptionKeyIdentifier>SKIKeyIdentifier</encryptionKeyIdentifier>
+ </action>
+ </parameter>
+ </tuscany:wsConfigParam>
+ </sca:policySet>
</sca:definitions> \ No newline at end of file
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties
index 592edf183b..cb188e6676 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/security.properties
@@ -1,20 +1,20 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements. See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License. You may obtain a copy of the License at
-##
-## http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
-org.apache.ws.security.crypto.merlin.keystore.type=jks
-org.apache.ws.security.crypto.merlin.keystore.password=TuscanyWsUserPasswd
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=TuscanyWsUserPasswd
org.apache.ws.security.crypto.merlin.file=org/apache/tuscany/sca/binding/ws/axis2/itests/policy/configparams/tuscanyKeys.jks \ No newline at end of file
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/intent/definitions.xml b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/intent/definitions.xml
index 778fb96128..19a8521f61 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/intent/definitions.xml
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/intent/definitions.xml
@@ -1,32 +1,32 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<sca:definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
-
- <sca:intent name="wsAuthentication"
- constrains="sca:binding.ws">
- <description>
- Communitcation thro this binding required Authentication.
- </description>
- </sca:intent>
-
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<sca:definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
+
+ <sca:intent name="wsAuthentication"
+ constrains="sca:binding.ws">
+ <description>
+ Communitcation thro this binding required Authentication.
+ </description>
+ </sca:intent>
+
</sca:definitions> \ No newline at end of file
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/definitions.xml b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/definitions.xml
index 12f4a6febd..8a5aacf916 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/definitions.xml
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/definitions.xml
@@ -1,203 +1,203 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<sca:definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
-
- <!-- WS Security POLICY SETS -->
- <!-- A policyset that uses WS Policy -->
- <sca:policySet name="wsSecurityPolicyForAuthentication"
- provides="sca:authentication"
- appliesTo="sca:binding.ws">
- <wsp:Policy wsu:Id="UTOverTransport"
- xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:ExactlyOne>
- <wsp:All>
- <sp:SignedSupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
- <wsp:Policy>
- <sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient" />
- </wsp:Policy>
- </sp:SignedSupportingTokens>
-
- <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
- <ramp:user>TuscanyWsUser</ramp:user>
- <ramp:passwordType>PasswordText</ramp:passwordType>
- <ramp:passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy.ClientPWCBHandler</ramp:passwordCallbackClass>
- </ramp:RampartConfig>
- </wsp:All>
- </wsp:ExactlyOne>
- </wsp:Policy>
- </sca:policySet>
-
- <!-- A policyset that uses WS Policy -->
- <sca:policySet name="wsSecurityPolicyForIntegrity"
- provides="sca:integrity"
- appliesTo="sca:binding.ws">
- <wsp:Policy wsu:Id="SignOnly"
- xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:ExactlyOne>
- <wsp:All>
- <sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
- <wsp:Policy>
- <sp:InitiatorToken>
- <wsp:Policy>
- <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
- <wsp:Policy>
- <sp:WssX509V3Token10/>
- </wsp:Policy>
- </sp:X509Token>
- </wsp:Policy>
- </sp:InitiatorToken>
- <sp:RecipientToken>
- <wsp:Policy>
- <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
- <wsp:Policy>
- <sp:WssX509V3Token10/>
- </wsp:Policy>
- </sp:X509Token>
- </wsp:Policy>
- </sp:RecipientToken>
- <sp:AlgorithmSuite>
- <wsp:Policy>
- <sp:TripleDesRsa15/>
- </wsp:Policy>
- </sp:AlgorithmSuite>
- <sp:Layout>
- <wsp:Policy>
- <sp:Strict/>
- </wsp:Policy>
- </sp:Layout>
- <sp:IncludeTimestamp/>
- <sp:OnlySignEntireHeadersAndBody/>
- </wsp:Policy>
- </sp:AsymmetricBinding>
- <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
- <wsp:Policy>
- <sp:MustSupportRefKeyIdentifier/>
- <sp:MustSupportRefIssuerSerial/>
- </wsp:Policy>
- </sp:Wss10>
- <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
- <sp:Body/>
- </sp:SignedParts>
-
- <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
- <ramp:user>TuscanyWsUser</ramp:user>
- <ramp:encryptionUser>TuscanyWsUser</ramp:encryptionUser>
- <ramp:passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy.IntegrityPWCBHandler</ramp:passwordCallbackClass>
-
- <ramp:signatureCrypto>
- <ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
- <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
- <ramp:property name="org.apache.ws.security.crypto.merlin.file">org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks</ramp:property>
- <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">TuscanyWsUserPasswd</ramp:property>
- </ramp:crypto>
- </ramp:signatureCrypto>
- </ramp:RampartConfig>
-
- </wsp:All>
- </wsp:ExactlyOne>
- </wsp:Policy>
- </sca:policySet>
-
- <!-- A policyset that uses WS Policy -->
- <sca:policySet name="wsSecurityPolicyForConfidentiality"
- provides="sca:confidentiality"
- appliesTo="sca:binding.ws">
- <wsp:Policy wsu:Id="SigEncr" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:ExactlyOne>
- <wsp:All>
- <sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
- <wsp:Policy>
- <sp:InitiatorToken>
- <wsp:Policy>
- <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
- <wsp:Policy>
- <sp:WssX509V3Token10/>
- </wsp:Policy>
- </sp:X509Token>
- </wsp:Policy>
- </sp:InitiatorToken>
- <sp:RecipientToken>
- <wsp:Policy>
- <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
- <wsp:Policy>
- <sp:WssX509V3Token10/>
- </wsp:Policy>
- </sp:X509Token>
- </wsp:Policy>
- </sp:RecipientToken>
- <sp:AlgorithmSuite>
- <wsp:Policy>
- <sp:TripleDesRsa15/>
- </wsp:Policy>
- </sp:AlgorithmSuite>
- <sp:Layout>
- <wsp:Policy>
- <sp:Strict/>
- </wsp:Policy>
- </sp:Layout>
- <sp:IncludeTimestamp/>
- <sp:OnlySignEntireHeadersAndBody/>
- </wsp:Policy>
- </sp:AsymmetricBinding>
- <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
- <wsp:Policy>
- <sp:MustSupportRefKeyIdentifier/>
- <sp:MustSupportRefIssuerSerial/>
- </wsp:Policy>
- </sp:Wss10>
- <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
- <sp:Body/>
- </sp:SignedParts>
- <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
- <sp:Body/>
- </sp:EncryptedParts>
-
- <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
- <ramp:user>TuscanyWsUser</ramp:user>
- <ramp:encryptionUser>TuscanyWsUser</ramp:encryptionUser>
- <ramp:passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy.IntegrityPWCBHandler</ramp:passwordCallbackClass>
- <ramp:signatureCrypto>
- <ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
- <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
- <ramp:property name="org.apache.ws.security.crypto.merlin.file">org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks</ramp:property>
- <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">TuscanyWsUserPasswd</ramp:property>
- </ramp:crypto>
- </ramp:signatureCrypto>
-
- <ramp:encryptionCypto>
- <ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
- <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
- <ramp:property name="org.apache.ws.security.crypto.merlin.file">org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks</ramp:property>
- <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">TuscanyWsUserPasswd</ramp:property>
- </ramp:crypto>
- </ramp:encryptionCypto>
- </ramp:RampartConfig>
-
- </wsp:All>
- </wsp:ExactlyOne>
-</wsp:Policy>
- </sca:policySet>
-
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<sca:definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
+
+ <!-- WS Security POLICY SETS -->
+ <!-- A policyset that uses WS Policy -->
+ <sca:policySet name="wsSecurityPolicyForAuthentication"
+ provides="sca:authentication"
+ appliesTo="sca:binding.ws">
+ <wsp:Policy wsu:Id="UTOverTransport"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SignedSupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient" />
+ </wsp:Policy>
+ </sp:SignedSupportingTokens>
+
+ <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
+ <ramp:user>TuscanyWsUser</ramp:user>
+ <ramp:passwordType>PasswordText</ramp:passwordType>
+ <ramp:passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy.ClientPWCBHandler</ramp:passwordCallbackClass>
+ </ramp:RampartConfig>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ </sca:policySet>
+
+ <!-- A policyset that uses WS Policy -->
+ <sca:policySet name="wsSecurityPolicyForIntegrity"
+ provides="sca:integrity"
+ appliesTo="sca:binding.ws">
+ <wsp:Policy wsu:Id="SignOnly"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:InitiatorToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+ <wsp:Policy>
+ <sp:WssX509V3Token10/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:InitiatorToken>
+ <sp:RecipientToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:WssX509V3Token10/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:RecipientToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:TripleDesRsa15/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ </wsp:Policy>
+ </sp:Wss10>
+ <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ </sp:SignedParts>
+
+ <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
+ <ramp:user>TuscanyWsUser</ramp:user>
+ <ramp:encryptionUser>TuscanyWsUser</ramp:encryptionUser>
+ <ramp:passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy.IntegrityPWCBHandler</ramp:passwordCallbackClass>
+
+ <ramp:signatureCrypto>
+ <ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
+ <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
+ <ramp:property name="org.apache.ws.security.crypto.merlin.file">org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks</ramp:property>
+ <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">TuscanyWsUserPasswd</ramp:property>
+ </ramp:crypto>
+ </ramp:signatureCrypto>
+ </ramp:RampartConfig>
+
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ </sca:policySet>
+
+ <!-- A policyset that uses WS Policy -->
+ <sca:policySet name="wsSecurityPolicyForConfidentiality"
+ provides="sca:confidentiality"
+ appliesTo="sca:binding.ws">
+ <wsp:Policy wsu:Id="SigEncr" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:InitiatorToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+ <wsp:Policy>
+ <sp:WssX509V3Token10/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:InitiatorToken>
+ <sp:RecipientToken>
+ <wsp:Policy>
+ <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:WssX509V3Token10/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:RecipientToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:TripleDesRsa15/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ </wsp:Policy>
+ </sp:Wss10>
+ <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ </sp:SignedParts>
+ <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <sp:Body/>
+ </sp:EncryptedParts>
+
+ <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
+ <ramp:user>TuscanyWsUser</ramp:user>
+ <ramp:encryptionUser>TuscanyWsUser</ramp:encryptionUser>
+ <ramp:passwordCallbackClass>org.apache.tuscany.sca.binding.ws.axis2.itests.policy.wspolicy.IntegrityPWCBHandler</ramp:passwordCallbackClass>
+ <ramp:signatureCrypto>
+ <ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
+ <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
+ <ramp:property name="org.apache.ws.security.crypto.merlin.file">org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks</ramp:property>
+ <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">TuscanyWsUserPasswd</ramp:property>
+ </ramp:crypto>
+ </ramp:signatureCrypto>
+
+ <ramp:encryptionCypto>
+ <ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
+ <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
+ <ramp:property name="org.apache.ws.security.crypto.merlin.file">org/apache/tuscany/sca/binding/ws/axis2/itests/policy/wspolicy/tuscanyKeys.jks</ramp:property>
+ <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">TuscanyWsUserPasswd</ramp:property>
+ </ramp:crypto>
+ </ramp:encryptionCypto>
+ </ramp:RampartConfig>
+
+ </wsp:All>
+ </wsp:ExactlyOne>
+</wsp:Policy>
+ </sca:policySet>
+
</sca:definitions> \ No newline at end of file
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import-nested.wsdl b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import-nested.wsdl
index 41a491361f..686b08a1d4 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import-nested.wsdl
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-import-nested.wsdl
@@ -1,70 +1,70 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<wsdl:definitions targetNamespace="http://account3"
- xmlns:tns="http://account3"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- name="questionmark-import-nested">
-
- <wsdl:types>
- <xsd:schema elementFormDefault="qualified"
- targetNamespace="http://account3"
- xmlns:account="http://accounts"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:import namespace="http://accounts" schemaLocation="customerdefs.xsd" />
-
- <xsd:element name="getCustomerProfile">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="loginID" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="getCustomerProfileResponse">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="customerProfile"
- type="account:CustomerProfileData" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- </xsd:schema>
- </wsdl:types>
-
- <wsdl:message name="getCustomerProfileRequest">
- <wsdl:part element="tns:getCustomerProfile" name="parameters" />
- </wsdl:message>
-
- <wsdl:message name="getCustomerProfileResponse">
- <wsdl:part element="tns:getCustomerProfileResponse" name="parameters" />
- </wsdl:message>
-
- <wsdl:portType name="Account">
- <wsdl:operation name="getCustomerProfile">
- <wsdl:input message="tns:getCustomerProfileRequest" name="getCustomerProfileRequest" />
- <wsdl:output message="tns:getCustomerProfileResponse" name="getCustomerProfileResponse" />
- </wsdl:operation>
- </wsdl:portType>
-
-</wsdl:definitions>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions targetNamespace="http://account3"
+ xmlns:tns="http://account3"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ name="questionmark-import-nested">
+
+ <wsdl:types>
+ <xsd:schema elementFormDefault="qualified"
+ targetNamespace="http://account3"
+ xmlns:account="http://accounts"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <xsd:import namespace="http://accounts" schemaLocation="customerdefs.xsd" />
+
+ <xsd:element name="getCustomerProfile">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="loginID" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="getCustomerProfileResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="customerProfile"
+ type="account:CustomerProfileData" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ </xsd:schema>
+ </wsdl:types>
+
+ <wsdl:message name="getCustomerProfileRequest">
+ <wsdl:part element="tns:getCustomerProfile" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:message name="getCustomerProfileResponse">
+ <wsdl:part element="tns:getCustomerProfileResponse" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:portType name="Account">
+ <wsdl:operation name="getCustomerProfile">
+ <wsdl:input message="tns:getCustomerProfileRequest" name="getCustomerProfileRequest" />
+ <wsdl:output message="tns:getCustomerProfileResponse" name="getCustomerProfileResponse" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+</wsdl:definitions>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-import.composite b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-import.composite
index a8fd8d4d5d..95e93419da 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-import.composite
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-import.composite
@@ -1,31 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="QuestionMarkWSDLImport">
-
- <component name="AccountService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.AccountService" />
- <service name="Account">
- <binding.ws wsdlElement="http://account2#wsdl.port(AccountService/AccountSoapPort)" />
- </service>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
+ name="QuestionMarkWSDLImport">
+
+ <component name="AccountService">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.AccountService" />
+ <service name="Account">
+ <binding.ws wsdlElement="http://account2#wsdl.port(AccountService/AccountSoapPort)" />
+ </service>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-include.composite b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-include.composite
index d795329db0..7faa96cad4 100644
--- a/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-include.composite
+++ b/java/sca/modules/binding-ws-axis2/src/test/resources/org/apache/tuscany/sca/binding/ws/axis2/itests/questionmark-wsdl-include.composite
@@ -1,31 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
- name="QuestionMarkWSDLInclude">
-
- <component name="AccountService">
- <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.AccountService" />
- <service name="Account" promote="AccountService">
- <binding.ws wsdlElement="http://accounts#wsdl.port(AccountService/AccountSoapPort)" />
- </service>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://www.tuscany.apache.org/tests/binding/ws/axis2"
+ name="QuestionMarkWSDLInclude">
+
+ <component name="AccountService">
+ <implementation.java class="org.apache.tuscany.sca.binding.ws.axis2.itests.AccountService" />
+ <service name="Account" promote="AccountService">
+ <binding.ws wsdlElement="http://accounts#wsdl.port(AccountService/AccountSoapPort)" />
+ </service>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/binding-ws-wsdlgen/pom.xml b/java/sca/modules/binding-ws-wsdlgen/pom.xml
index 04c3104884..49132954f1 100644
--- a/java/sca/modules/binding-ws-wsdlgen/pom.xml
+++ b/java/sca/modules/binding-ws-wsdlgen/pom.xml
@@ -1,84 +1,84 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
- <name>Apache Tuscany SCA Web Service binding WSDL Generator</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java-jaxws</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-xsd</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-ws-axis2-policy</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-databinding</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-binding-ws-wsdlgen</artifactId>
+ <name>Apache Tuscany SCA Web Service binding WSDL Generator</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-wsdl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-java</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-java-jaxws</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-xsd</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-ws-axis2-policy</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-databinding</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java b/java/sca/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
index 93c393914f..ec22ec0073 100644
--- a/java/sca/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
+++ b/java/sca/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
@@ -79,7 +79,7 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
- * @version $Rev: 670103 $ $Date: 2008-06-21 01:35:00 +0100 (Sat, 21 Jun 2008) $
+ * @version $Rev$ $Date$
*/
public class Interface2WSDLGenerator {
private static final Logger logger = Logger.getLogger(Interface2WSDLGenerator.class.getName());
diff --git a/java/sca/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java b/java/sca/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java
index d0b79f9b0e..56fd02a611 100644
--- a/java/sca/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java
+++ b/java/sca/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java
@@ -55,7 +55,7 @@ import org.w3c.dom.Element;
/**
*
- * @version $Rev: 668025 $ $Date: 2008-06-16 01:06:34 +0100 (Mon, 16 Jun 2008) $
+ * @version $Rev$ $Date$
*/
public class WSDLDefinitionGenerator {
private static final String SOAP_NS = "http://schemas.xmlsoap.org/wsdl/soap/";
diff --git a/java/sca/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator-bad-wsdlElement.composite b/java/sca/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator-bad-wsdlElement.composite
index 5019278210..558365b05e 100644
--- a/java/sca/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator-bad-wsdlElement.composite
+++ b/java/sca/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/Calculator-bad-wsdlElement.composite
@@ -1,59 +1,59 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:calc="http://sample.calculator"
- targetNamespace="http://calc"
- xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
- name="Calculator-bad-wsdlElement">
-
- <service name="CalculatorService" promote="CalculatorServiceComponent">
- <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)"/>
- <binding.ws wsdlElement="http://sample/calculator#wsdl.port(CalculatorService/CalculatorPort)">
- <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
- <wsa:Address>http://localhost:8085/Calculator</wsa:Address>
- </wsa:EndpointReference>
- </binding.ws>
- </service>
-
- <component name="CalculatorServiceComponent">
- <implementation.java class="calculator.CalculatorServiceImpl"/>
- <reference name="addService" target="AddServiceComponent"/>
- <reference name="subtractService" target="SubtractServiceComponent"/>
- <reference name="multiplyService" target="MultiplyServiceComponent"/>
- <reference name="divideService" target="DivideServiceComponent"/>
- </component>
-
- <component name="AddServiceComponent">
- <implementation.java class="calculator.AddServiceImpl"/>
- </component>
-
- <component name="SubtractServiceComponent">
- <implementation.java class="calculator.SubtractServiceImpl"/>
- </component>
-
- <component name="MultiplyServiceComponent">
- <implementation.java class="calculator.MultiplyServiceImpl"/>
- </component>
-
- <component name="DivideServiceComponent">
- <implementation.java class="calculator.DivideServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:calc="http://sample.calculator"
+ targetNamespace="http://calc"
+ xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
+ name="Calculator-bad-wsdlElement">
+
+ <service name="CalculatorService" promote="CalculatorServiceComponent">
+ <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)"/>
+ <binding.ws wsdlElement="http://sample/calculator#wsdl.port(CalculatorService/CalculatorPort)">
+ <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
+ <wsa:Address>http://localhost:8085/Calculator</wsa:Address>
+ </wsa:EndpointReference>
+ </binding.ws>
+ </service>
+
+ <component name="CalculatorServiceComponent">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <reference name="addService" target="AddServiceComponent"/>
+ <reference name="subtractService" target="SubtractServiceComponent"/>
+ <reference name="multiplyService" target="MultiplyServiceComponent"/>
+ <reference name="divideService" target="DivideServiceComponent"/>
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/PoliciedCalculator.composite b/java/sca/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/PoliciedCalculator.composite
index b1e3b11e99..036b5f0d1a 100644
--- a/java/sca/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/PoliciedCalculator.composite
+++ b/java/sca/modules/binding-ws-xml/src/test/resources/org/apache/tuscany/sca/binding/ws/xml/PoliciedCalculator.composite
@@ -1,60 +1,60 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:calc="http://sample.calculator"
- targetNamespace="http://calc"
- xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
- name="Calculator">
-
- <service name="CalculatorService" promote="CalculatorServiceComponent">
- <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)"/>
- <binding.ws uri="http://localhost:8085/Calculator" wsdlElement="http://sample/calculator#wsdl.service(CalculatorService)">
- <operation name="add" requires="IntentOne IntentTwo"/>
- </binding.ws>
- <binding.ws wsdli:wsdlLocation="http://tempuri.org" wsdlElement="http://sample/calculator#wsdl.binding(CalculatorBinding)"/>
- <binding.ws wsdlElement="http://sample/calculator#wsdl.port(CalculatorService/CalculatorPort)"/>
- <binding.ws wsdlElement="http://sample/calculator#wsdl.endpoint(CalculatorService/CalculatorEndpoint)"/>
- </service>
-
- <component name="CalculatorServiceComponent">
- <implementation.java class="calculator.CalculatorServiceImpl"/>
- <reference name="addService" target="AddServiceComponent"/>
- <reference name="subtractService" target="SubtractServiceComponent"/>
- <reference name="multiplyService" target="MultiplyServiceComponent"/>
- <reference name="divideService" target="DivideServiceComponent"/>
- </component>
-
- <component name="AddServiceComponent">
- <implementation.java class="calculator.AddServiceImpl"/>
- </component>
-
- <component name="SubtractServiceComponent">
- <implementation.java class="calculator.SubtractServiceImpl"/>
- </component>
-
- <component name="MultiplyServiceComponent">
- <implementation.java class="calculator.MultiplyServiceImpl"/>
- </component>
-
- <component name="DivideServiceComponent">
- <implementation.java class="calculator.DivideServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:calc="http://sample.calculator"
+ targetNamespace="http://calc"
+ xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
+ name="Calculator">
+
+ <service name="CalculatorService" promote="CalculatorServiceComponent">
+ <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)"/>
+ <binding.ws uri="http://localhost:8085/Calculator" wsdlElement="http://sample/calculator#wsdl.service(CalculatorService)">
+ <operation name="add" requires="IntentOne IntentTwo"/>
+ </binding.ws>
+ <binding.ws wsdli:wsdlLocation="http://tempuri.org" wsdlElement="http://sample/calculator#wsdl.binding(CalculatorBinding)"/>
+ <binding.ws wsdlElement="http://sample/calculator#wsdl.port(CalculatorService/CalculatorPort)"/>
+ <binding.ws wsdlElement="http://sample/calculator#wsdl.endpoint(CalculatorService/CalculatorEndpoint)"/>
+ </service>
+
+ <component name="CalculatorServiceComponent">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <reference name="addService" target="AddServiceComponent"/>
+ <reference name="subtractService" target="SubtractServiceComponent"/>
+ <reference name="multiplyService" target="MultiplyServiceComponent"/>
+ <reference name="divideService" target="DivideServiceComponent"/>
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleContributionScanner.java b/java/sca/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleContributionScanner.java
index a8bec24dab..de29eb17fe 100644
--- a/java/sca/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleContributionScanner.java
+++ b/java/sca/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleContributionScanner.java
@@ -1,193 +1,193 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.osgi.impl;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.jar.JarEntry;
-import java.util.jar.JarInputStream;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.PackageType;
-import org.apache.tuscany.sca.contribution.processor.ContributionException;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.scanner.ContributionScanner;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Constants;
-
-/**
- * Bundle Contribution package processor.
- *
- * @version $Rev$ $Date$
- */
-public class OSGiBundleContributionScanner implements ContributionScanner {
-
- public OSGiBundleContributionScanner() {
- }
-
- public String getContributionType() {
- return PackageType.BUNDLE;
- }
-
- public URL getArtifactURL(Contribution contribution, String artifact) throws ContributionReadException {
- Bundle bundle = null;
- try {
- bundle = OSGiBundleActivator.findBundle(contribution.getLocation());
- if (bundle != null) {
- URL url = bundle.getResource(artifact);
- return url;
- }
- } catch (Exception e) {
- }
- return null;
- }
-
- public List<String> getJarArtifacts(URL packageSourceURL, InputStream inputStream) throws ContributionException,
- IOException {
- if (packageSourceURL == null) {
- throw new IllegalArgumentException("Invalid null package source URL.");
- }
-
- if (inputStream == null) {
- throw new IllegalArgumentException("Invalid null source inputstream.");
- }
-
- // Assume the root is a jar file
- JarInputStream jar = new JarInputStream(inputStream);
- try {
- Set<String> names = new HashSet<String>();
- while (true) {
- JarEntry entry = jar.getNextJarEntry();
- if (entry == null) {
- // EOF
- break;
- }
-
- // FIXME: Maybe we should externalize the filter as a property
- String name = entry.getName();
- if (!name.startsWith(".") && !entry.isDirectory()) {
-
- // Trim trailing /
- if (name.endsWith("/")) {
- name = name.substring(0, name.length() - 1);
- }
-
- // Add the entry name
- if (!names.contains(name) && name.length() > 0) {
- names.add(name);
-
- }
- }
- }
-
- // Return list of URIs
- List<String> artifacts = new ArrayList<String>();
- for (String name : names) {
- artifacts.add(name);
- }
- return artifacts;
-
- } finally {
- jar.close();
- }
- }
-
- public List<String> scan(Contribution contribution) throws ContributionReadException {
- Bundle bundle = OSGiBundleActivator.findBundle(contribution.getLocation());
-
- if (bundle == null) {
- throw new IllegalArgumentException("Could not find OSGi bundle " + contribution.getLocation());
- }
-
- List<String> artifacts = new ArrayList<String>();
- Set<String> bundleClassPath = new HashSet<String>();
- String cp = (String)bundle.getHeaders().get(Constants.BUNDLE_CLASSPATH);
- if (cp != null) {
- String[] paths = cp.split(",");
- for (String path : paths) {
- bundleClassPath.add(path.trim());
- }
- }
-
- try {
- Enumeration<?> entries = bundle.findEntries("/", "*", true);
- while (entries.hasMoreElements()) {
- URL entry = (URL)entries.nextElement();
- String entryName = entry.getPath();
- if (entryName.contains("/.svn/")) {
- // Ignore .svn files
- continue;
- }
- if (entryName.startsWith("/")) {
- entryName = entryName.substring(1);
- }
- artifacts.add(entryName);
-
- if (entryName.endsWith(".jar") && bundleClassPath.contains(entryName)) {
- artifacts.addAll(getJarArtifacts(entry, entry.openStream()));
- }
-
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- contribution.getExtensions().add(bundle);
- contribution.getTypes().add(getContributionType());
- contribution.setClassLoader(new BundleClassLoader(bundle));
- return artifacts;
- }
-
- private static class BundleClassLoader extends ClassLoader {
- private Bundle bundle;
- public BundleClassLoader(Bundle bundle) {
- super(null);
- this.bundle = bundle;
- }
-
- @Override
- protected Class<?> findClass(String name) throws ClassNotFoundException {
- return bundle.loadClass(name);
- }
-
- @Override
- protected URL findResource(String name) {
- return bundle.getResource(name);
- }
-
- @Override
- protected Enumeration<URL> findResources(String name) throws IOException {
- Enumeration<URL> urls = bundle.getResources(name);
- if (urls == null) {
- List<URL> list = Collections.emptyList();
- return Collections.enumeration(list);
- } else {
- return urls;
- }
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.contribution.osgi.impl;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.PackageType;
+import org.apache.tuscany.sca.contribution.processor.ContributionException;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.scanner.ContributionScanner;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
+
+/**
+ * Bundle Contribution package processor.
+ *
+ * @version $Rev$ $Date$
+ */
+public class OSGiBundleContributionScanner implements ContributionScanner {
+
+ public OSGiBundleContributionScanner() {
+ }
+
+ public String getContributionType() {
+ return PackageType.BUNDLE;
+ }
+
+ public URL getArtifactURL(Contribution contribution, String artifact) throws ContributionReadException {
+ Bundle bundle = null;
+ try {
+ bundle = OSGiBundleActivator.findBundle(contribution.getLocation());
+ if (bundle != null) {
+ URL url = bundle.getResource(artifact);
+ return url;
+ }
+ } catch (Exception e) {
+ }
+ return null;
+ }
+
+ public List<String> getJarArtifacts(URL packageSourceURL, InputStream inputStream) throws ContributionException,
+ IOException {
+ if (packageSourceURL == null) {
+ throw new IllegalArgumentException("Invalid null package source URL.");
+ }
+
+ if (inputStream == null) {
+ throw new IllegalArgumentException("Invalid null source inputstream.");
+ }
+
+ // Assume the root is a jar file
+ JarInputStream jar = new JarInputStream(inputStream);
+ try {
+ Set<String> names = new HashSet<String>();
+ while (true) {
+ JarEntry entry = jar.getNextJarEntry();
+ if (entry == null) {
+ // EOF
+ break;
+ }
+
+ // FIXME: Maybe we should externalize the filter as a property
+ String name = entry.getName();
+ if (!name.startsWith(".") && !entry.isDirectory()) {
+
+ // Trim trailing /
+ if (name.endsWith("/")) {
+ name = name.substring(0, name.length() - 1);
+ }
+
+ // Add the entry name
+ if (!names.contains(name) && name.length() > 0) {
+ names.add(name);
+
+ }
+ }
+ }
+
+ // Return list of URIs
+ List<String> artifacts = new ArrayList<String>();
+ for (String name : names) {
+ artifacts.add(name);
+ }
+ return artifacts;
+
+ } finally {
+ jar.close();
+ }
+ }
+
+ public List<String> scan(Contribution contribution) throws ContributionReadException {
+ Bundle bundle = OSGiBundleActivator.findBundle(contribution.getLocation());
+
+ if (bundle == null) {
+ throw new IllegalArgumentException("Could not find OSGi bundle " + contribution.getLocation());
+ }
+
+ List<String> artifacts = new ArrayList<String>();
+ Set<String> bundleClassPath = new HashSet<String>();
+ String cp = (String)bundle.getHeaders().get(Constants.BUNDLE_CLASSPATH);
+ if (cp != null) {
+ String[] paths = cp.split(",");
+ for (String path : paths) {
+ bundleClassPath.add(path.trim());
+ }
+ }
+
+ try {
+ Enumeration<?> entries = bundle.findEntries("/", "*", true);
+ while (entries.hasMoreElements()) {
+ URL entry = (URL)entries.nextElement();
+ String entryName = entry.getPath();
+ if (entryName.contains("/.svn/")) {
+ // Ignore .svn files
+ continue;
+ }
+ if (entryName.startsWith("/")) {
+ entryName = entryName.substring(1);
+ }
+ artifacts.add(entryName);
+
+ if (entryName.endsWith(".jar") && bundleClassPath.contains(entryName)) {
+ artifacts.addAll(getJarArtifacts(entry, entry.openStream()));
+ }
+
+ }
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ contribution.getExtensions().add(bundle);
+ contribution.getTypes().add(getContributionType());
+ contribution.setClassLoader(new BundleClassLoader(bundle));
+ return artifacts;
+ }
+
+ private static class BundleClassLoader extends ClassLoader {
+ private Bundle bundle;
+ public BundleClassLoader(Bundle bundle) {
+ super(null);
+ this.bundle = bundle;
+ }
+
+ @Override
+ protected Class<?> findClass(String name) throws ClassNotFoundException {
+ return bundle.loadClass(name);
+ }
+
+ @Override
+ protected URL findResource(String name) {
+ return bundle.getResource(name);
+ }
+
+ @Override
+ protected Enumeration<URL> findResources(String name) throws IOException {
+ Enumeration<URL> urls = bundle.getResources(name);
+ if (urls == null) {
+ List<URL> list = Collections.emptyList();
+ return Collections.enumeration(list);
+ } else {
+ return urls;
+ }
+ }
+ }
+
+}
diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImportExportFactory.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImportExportFactory.java
index af2ca9cd57..ee94d889ad 100644
--- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImportExportFactory.java
+++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/JavaImportExportFactory.java
@@ -1,42 +1,42 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java;
-
-/**
- * Base Java Import/Export model factory
- *
- * @version $Rev$ $Date$
- */
-public interface JavaImportExportFactory {
-
- /**
- * Create a java import model object
- *
- * @return The new JavaImport model object
- */
- JavaImport createJavaImport();
-
- /**
- * Create a java export model object
- *
- * @return The new JavaExport model object
- */
- JavaExport createJavaExport();
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.contribution.java;
+
+/**
+ * Base Java Import/Export model factory
+ *
+ * @version $Rev$ $Date$
+ */
+public interface JavaImportExportFactory {
+
+ /**
+ * Create a java import model object
+ *
+ * @return The new JavaImport model object
+ */
+ JavaImport createJavaImport();
+
+ /**
+ * Create a java export model object
+ *
+ * @return The new JavaExport model object
+ */
+ JavaExport createJavaExport();
+}
diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceModelResolver.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceModelResolver.java
index 11e13ced11..811c5b7010 100644
--- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceModelResolver.java
+++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceModelResolver.java
@@ -1,159 +1,159 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java.impl;
-
-import java.lang.ref.WeakReference;
-import java.lang.reflect.Constructor;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.resolver.ClassReference;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-
-/**
- * A Model Resolver for ClassReferences.
- * @deprecated Use ClassLoaderModelResolver instead
- * @version $Rev: 557916 $ $Date: 2007-07-20 01:04:40 -0700 (Fri, 20 Jul 2007) $
- */
-@Deprecated()
-public class ClassReferenceModelResolver implements ModelResolver {
- private Contribution contribution;
- private WeakReference<ClassLoader> classLoader;
- private Map<String, ClassReference> map = new HashMap<String, ClassReference>();
-
- private ModelResolver osgiResolver;
-
- public ClassReferenceModelResolver(final Contribution contribution, FactoryExtensionPoint modelFactories) {
- this.contribution = contribution;
- if (this.contribution != null) {
- // Allow privileged access to get ClassLoader. Requires RuntimePermission in security policy.
- // ClassLoader cl = contribution.getClassLoader();
- ClassLoader cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
- public ClassLoader run() {
- return contribution.getClassLoader();
- }
- });
-
- if (cl == null) {
- // Allow privileged access to get ClassLoader. Requires RuntimePermission in security policy.
- //ClassLoader contextClassLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
- // public ClassLoader run() {
- // return Thread.currentThread().getContextClassLoader();
- // }
- //});
- ClassLoader contextClassLoader = ServiceDiscovery.getInstance().getServiceDiscoverer().getClass().getClassLoader();
- cl = new ContributionClassLoader(contribution, contextClassLoader);
- contribution.setClassLoader(cl);
- }
- this.classLoader = new WeakReference<ClassLoader>(cl);
- } else {
- // This path should be used only for unit testing.
- // Allow privileged access to get ClassLoader. Requires RuntimePermission in security policy.
- // this.classLoader = new WeakReference<ClassLoader>(this.getClass().getClassLoader());
- ClassLoader cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
- public ClassLoader run() {
- return this.getClass().getClassLoader();
- }
- });
- this.classLoader = new WeakReference<ClassLoader>( cl );
- }
-
- try {
- Class<?> osgiResolverClass =
- Class.forName("org.apache.tuscany.sca.contribution.osgi.impl.OSGiClassReferenceModelResolver");
- if (osgiResolverClass != null) {
- Constructor<?> constructor =
- osgiResolverClass.getConstructor(Contribution.class, FactoryExtensionPoint.class);
- this.osgiResolver = (ModelResolver)constructor.newInstance(contribution, modelFactories);
- }
- } catch (Throwable e) {
- // Ignore error, non-OSGi classloading is used in this case
- }
- }
-
- public void addModel(Object resolved) {
- ClassReference clazz = (ClassReference)resolved;
- map.put(clazz.getClassName(), clazz);
- }
-
- public Object removeModel(Object resolved) {
- return map.remove(((ClassReference)resolved).getClassName());
- }
-
-
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
- if (!(unresolved instanceof ClassReference)) {
- return unresolved;
- }
- Object resolved = map.get(((ClassReference)unresolved).getClassName());
-
- if (resolved != null) {
- return modelClass.cast(resolved);
- }
-
- //Load a class on demand
- Class<?> clazz = null;
-
- if (osgiResolver != null) {
- resolved = osgiResolver.resolveModel(modelClass, unresolved);
- clazz = ((ClassReference)resolved).getJavaClass();
- }
-
- if (clazz == null) {
- try {
- // Search contribution ClassLoader (which has visibility of classes in the contribution
- // as well as explicitly imported packages from other contributions)
- clazz = Class.forName(((ClassReference)unresolved).getClassName(), true, classLoader.get());
- } catch (ClassNotFoundException e) {
- } catch (NoClassDefFoundError e) {
- }
- }
-
- if (clazz != null) {
- //if we load the class
- // Store a new ClassReference wrapping the loaded class
- ClassReference classReference = new ClassReference(clazz);
- map.put(clazz.getName(), classReference);
-
- // Return the resolved ClassReference
- return modelClass.cast(classReference);
- } else {
- return unresolved;
- }
-
- }
-
-
- /***************
- * Helper methods
- ***************/
-
- private String getPackageName(ClassReference clazz) {
- int pos = clazz.getClassName().lastIndexOf(".");
- return clazz.getClassName().substring(0, pos);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.contribution.java.impl;
+
+import java.lang.ref.WeakReference;
+import java.lang.reflect.Constructor;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.resolver.ClassReference;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
+
+/**
+ * A Model Resolver for ClassReferences.
+ * @deprecated Use ClassLoaderModelResolver instead
+ * @version $Rev$ $Date$
+ */
+@Deprecated()
+public class ClassReferenceModelResolver implements ModelResolver {
+ private Contribution contribution;
+ private WeakReference<ClassLoader> classLoader;
+ private Map<String, ClassReference> map = new HashMap<String, ClassReference>();
+
+ private ModelResolver osgiResolver;
+
+ public ClassReferenceModelResolver(final Contribution contribution, FactoryExtensionPoint modelFactories) {
+ this.contribution = contribution;
+ if (this.contribution != null) {
+ // Allow privileged access to get ClassLoader. Requires RuntimePermission in security policy.
+ // ClassLoader cl = contribution.getClassLoader();
+ ClassLoader cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run() {
+ return contribution.getClassLoader();
+ }
+ });
+
+ if (cl == null) {
+ // Allow privileged access to get ClassLoader. Requires RuntimePermission in security policy.
+ //ClassLoader contextClassLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ // public ClassLoader run() {
+ // return Thread.currentThread().getContextClassLoader();
+ // }
+ //});
+ ClassLoader contextClassLoader = ServiceDiscovery.getInstance().getServiceDiscoverer().getClass().getClassLoader();
+ cl = new ContributionClassLoader(contribution, contextClassLoader);
+ contribution.setClassLoader(cl);
+ }
+ this.classLoader = new WeakReference<ClassLoader>(cl);
+ } else {
+ // This path should be used only for unit testing.
+ // Allow privileged access to get ClassLoader. Requires RuntimePermission in security policy.
+ // this.classLoader = new WeakReference<ClassLoader>(this.getClass().getClassLoader());
+ ClassLoader cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run() {
+ return this.getClass().getClassLoader();
+ }
+ });
+ this.classLoader = new WeakReference<ClassLoader>( cl );
+ }
+
+ try {
+ Class<?> osgiResolverClass =
+ Class.forName("org.apache.tuscany.sca.contribution.osgi.impl.OSGiClassReferenceModelResolver");
+ if (osgiResolverClass != null) {
+ Constructor<?> constructor =
+ osgiResolverClass.getConstructor(Contribution.class, FactoryExtensionPoint.class);
+ this.osgiResolver = (ModelResolver)constructor.newInstance(contribution, modelFactories);
+ }
+ } catch (Throwable e) {
+ // Ignore error, non-OSGi classloading is used in this case
+ }
+ }
+
+ public void addModel(Object resolved) {
+ ClassReference clazz = (ClassReference)resolved;
+ map.put(clazz.getClassName(), clazz);
+ }
+
+ public Object removeModel(Object resolved) {
+ return map.remove(((ClassReference)resolved).getClassName());
+ }
+
+
+
+ public <T> T resolveModel(Class<T> modelClass, T unresolved) {
+ if (!(unresolved instanceof ClassReference)) {
+ return unresolved;
+ }
+ Object resolved = map.get(((ClassReference)unresolved).getClassName());
+
+ if (resolved != null) {
+ return modelClass.cast(resolved);
+ }
+
+ //Load a class on demand
+ Class<?> clazz = null;
+
+ if (osgiResolver != null) {
+ resolved = osgiResolver.resolveModel(modelClass, unresolved);
+ clazz = ((ClassReference)resolved).getJavaClass();
+ }
+
+ if (clazz == null) {
+ try {
+ // Search contribution ClassLoader (which has visibility of classes in the contribution
+ // as well as explicitly imported packages from other contributions)
+ clazz = Class.forName(((ClassReference)unresolved).getClassName(), true, classLoader.get());
+ } catch (ClassNotFoundException e) {
+ } catch (NoClassDefFoundError e) {
+ }
+ }
+
+ if (clazz != null) {
+ //if we load the class
+ // Store a new ClassReference wrapping the loaded class
+ ClassReference classReference = new ClassReference(clazz);
+ map.put(clazz.getName(), classReference);
+
+ // Return the resolved ClassReference
+ return modelClass.cast(classReference);
+ } else {
+ return unresolved;
+ }
+
+ }
+
+
+ /***************
+ * Helper methods
+ ***************/
+
+ private String getPackageName(ClassReference clazz) {
+ int pos = clazz.getClassName().lastIndexOf(".");
+ return clazz.getClassName().substring(0, pos);
+ }
+
+}
diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoader.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoader.java
index 97d8dcff73..25b3eae350 100644
--- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoader.java
+++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoader.java
@@ -1,386 +1,386 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java.impl;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashSet;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.Export;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.java.JavaImport;
-
-
-public class ContributionClassLoader extends URLClassLoader {
-// public class ContributionClassLoader {
-
- private Contribution contribution;
- // private b urlClassLoader;
-
- /**
- * Constructor for contribution ClassLoader
- *
- * @param contribution
- * @param parent
- * @throws MalformedURLException
- */
- public ContributionClassLoader(Contribution contribution, final ClassLoader parent) {
- super(new URL[0], parent);
- // Note that privileged use of getContextClassLoader have been promoted to callers.
- // super(new URL[0], parent == null?Thread.currentThread().getContextClassLoader(): null);
- this.contribution = contribution;
- if (contribution.getLocation() != null) {
- try {
- this.addURL(new URL(contribution.getLocation()));
- for (URL url : ContributionHelper.getNestedJarUrls(contribution)) {
- this.addURL(url);
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
-
- /*
- * Return the ClassLoader corresponding to a contribution providing an export
- * Create a new ClassLoader for the contribution if one does not exist
- */
- private ClassLoader getExportClassLoader(Contribution exportingContribution) {
- ClassLoader cl = exportingContribution.getClassLoader();
- if (!(cl instanceof ContributionClassLoader)) {
- if (cl == null) {
- cl = getParent();
- }
-
- cl = new ContributionClassLoader(exportingContribution, cl);
- exportingContribution.setClassLoader(cl);
- }
- return cl;
- }
-
- /* (non-Javadoc)
- * @see java.net.URLClassLoader#findClass(java.lang.String)
- *
- * Search path for class:
- * This contribution
- * Imported contributions
- */
- @Override
- protected Class<?> findClass(String className) throws ClassNotFoundException {
-
- Class<?> clazz = null;
- try {
- clazz = findClassFromContribution(className);
- } catch (ClassNotFoundException e) {
-
- for (Import import_ : this.contribution.getImports()) {
- if (classNameMatchesImport(className, import_)) {
- // Delegate the resolution to the imported contribution
- for (Contribution exportingContribution : ((JavaImportModelResolver)import_.getModelResolver()).getExportContributions()) {
-
- ClassLoader exportClassLoader = getExportClassLoader(exportingContribution);
- if (exportClassLoader instanceof ContributionClassLoader) {
-
- for (Export export : exportingContribution.getExports()) {
- try {
- if (import_.match(export)) {
- clazz = ((ContributionClassLoader)exportClassLoader).findClassFromContribution(className);
- break;
- }
- } catch (ClassNotFoundException e1) {
- continue;
- }
-
- }
- if (clazz != null) break;
- }
- }
- if (clazz != null) break;
- }
- }
-
- if (clazz == null) throw e;
- }
- return clazz;
- }
-
-
- /* (non-Javadoc)
- * @see java.lang.ClassLoader#loadClass(java.lang.String, boolean)
- *
- * Search path for class:
- * Parent ClassLoader
- * This contribution
- * Imported contributions
- *
- */
- @Override
- protected synchronized Class<?> loadClass(String className, boolean resolveClass)
- throws ClassNotFoundException {
-
- Class<?> clazz = null;
- try {
-
- if (this.getParent() != null)
- clazz = this.getParent().loadClass(className);
-
- } catch (ClassNotFoundException e) {
- }
-
- if (clazz == null)
- clazz = findClass(className);
-
-
- if (resolveClass)
- this.resolveClass(clazz);
- return clazz;
-
- }
-
-
-
- /*
- * (non-Javadoc)
- *
- * @see java.net.URLClassLoader#findResource(java.lang.String)
- */
- @Override
- public URL findResource(String name) {
-
- URL url = findResourceFromContribution(name);
-
- if (url == null) {
- for (Import import_ : this.contribution.getImports()) {
- if (resourceNameMatchesImport(name, import_)) {
- // Delegate the resolution to the imported contribution
- for (Contribution exportingContribution : ((JavaImportModelResolver)import_.getModelResolver()).getExportContributions()) {
-
- ClassLoader exportClassLoader = getExportClassLoader(exportingContribution);
- if (exportClassLoader instanceof ContributionClassLoader) {
-
- for (Export export : exportingContribution.getExports()) {
- if (import_.match(export)) {
- url = ((ContributionClassLoader)exportClassLoader).findResourceFromContribution(name);
- if (url != null) break;
- }
- }
- if (url != null) break;
- }
- }
- if (url != null) break;
- }
- }
-
- }
- return url;
- }
-
-
- /* (non-Javadoc)
- * @see java.net.URLClassLoader#findResources(java.lang.String)
- */
- @Override
- public Enumeration<URL> findResources(String name) throws IOException {
-
- return Collections.enumeration(findResourceSet(name));
- }
-
-
-
-
- /* (non-Javadoc)
- * @see java.lang.ClassLoader#getResource(java.lang.String)
- *
- * Find a resource.
- * Search path for resource:
- * Parent ClassLoader
- * This contribution
- * Imported contributions
- */
- @Override
- public URL getResource(String resName) {
-
- URL resource = null;
-
- if (this.getParent() != null) {
- resource = this.getParent().getResource(resName);
- }
- if (resource == null)
- resource = findResource(resName);
-
- return resource;
- }
-
-
-
- /* (non-Javadoc)
- * @see java.lang.ClassLoader#getResources(java.lang.String)
- *
- * Return list of resources from this contribution, resources
- * imported through imported contributions and resources from parent
- * ClassLoader.
- */
- @Override
- public Enumeration<URL> getResources(String resName) throws IOException {
-
- HashSet<URL> resourceSet = findResourceSet(resName);
- addEnumerationToCollection(resourceSet, super.getResources(resName));
-
- return Collections.enumeration(resourceSet);
- }
-
-
- /*
- * Find set of resources
- */
- private HashSet<URL> findResourceSet(String name) throws IOException {
-
- HashSet<URL> resources = new HashSet<URL>();
-
- addEnumerationToCollection(resources, super.findResources(name));
-
- for (Import import_ : this.contribution.getImports()) {
- if (!(import_ instanceof JavaImport)) {
- continue;
- }
- if (resourceNameMatchesImport(name, import_)) {
- // Delegate the resolution to the imported contribution
- for (Contribution exportingContribution : ((JavaImportModelResolver)import_.getModelResolver()).getExportContributions()) {
-
- ClassLoader exportClassLoader = getExportClassLoader(exportingContribution);
- if (exportClassLoader instanceof ContributionClassLoader) {
-
- for (Export export : exportingContribution.getExports()) {
- if (import_.match(export)) {
- addEnumerationToCollection(resources,
- ((ContributionClassLoader)exportClassLoader).findResources(name));
- }
- }
- }
- }
- }
- }
-
- return resources;
- }
-
-
- /*
- * Find class from contribution. If class has already been loaded, return loaded class.
- */
- private Class<?> findClassFromContribution(String className) throws ClassNotFoundException {
-
- Class<?> clazz = findLoadedClass(className);
- if (clazz == null)
- clazz = super.findClass(className);
- return clazz;
-
- }
-
- /*
- * Find resource from contribution.
- */
- private URL findResourceFromContribution(String name) {
-
- return super.findResource(name);
- }
-
- /**
- * Check if a class name matches an import statement.
- * Class matches if the package name used in <import.java/> matches
- *
- * @param name Name of class
- * @param import_ SCA contribution import
- * @return true if this is a matching import
- */
- private boolean classNameMatchesImport(String name, Import import_) {
-
- if (import_ instanceof JavaImport && name != null && name.lastIndexOf('.') > 0) {
- JavaImport javaImport = (JavaImport) import_;
-
- String packageName = name.substring(0, name.lastIndexOf('.'));
- if (javaImport.getPackage().endsWith(".*")) {
- String prefix = javaImport.getPackage().substring(0, javaImport.getPackage().length() -1);
- if (packageName.startsWith(prefix)) {
- return true;
- }
- } else {
- return packageName.equals(javaImport.getPackage());
- }
- }
-
- return false;
- }
-
- /**
- * Check if a resource name matches an import statement.
- * Resource matches if package/namespace match the directory of resource.
- *
- * @param name Name of resource
- * @param import_ SCA contribution import
- * @return true if this is a matching import
- */
- private boolean resourceNameMatchesImport(String name, Import import_) {
-
-
- if (name == null || name.lastIndexOf('/') <= 0)
- return false;
- else if (import_ instanceof JavaImport) {
- JavaImport javaImport = (JavaImport) import_;
-
- if (javaImport.getPackage().endsWith(".*")) {
- String packageName = name.substring(0, name.lastIndexOf('/')).replace('/', '.');
- String prefix = javaImport.getPackage().substring(0, javaImport.getPackage().length() -1);
- if (packageName.startsWith(prefix)) {
- return true;
- }
- } else {
- // 'name' is a resource : contains "/" as separators
- // Get package name from resource name
- String packageName = name.substring(0, name.lastIndexOf('/'));
- return packageName.equals(javaImport.getPackage().replaceAll("\\.", "/"));
- }
- }
- return false;
- }
-
- /*
- * Add an enumeration to a Collection
- */
- private <T extends Object> void addEnumerationToCollection(Collection<T> collection, Enumeration<T> enumeration) {
-
- while (enumeration.hasMoreElements())
- collection.add(enumeration.nextElement());
- }
-
-
- @Override
- public String toString() {
- return "SCA Contribution ClassLoader location: " + contribution.getLocation() + " parent ClassLoader: " + getParent();
- }
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.contribution.java.impl;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashSet;
+
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.Export;
+import org.apache.tuscany.sca.contribution.Import;
+import org.apache.tuscany.sca.contribution.java.JavaImport;
+
+
+public class ContributionClassLoader extends URLClassLoader {
+// public class ContributionClassLoader {
+
+ private Contribution contribution;
+ // private b urlClassLoader;
+
+ /**
+ * Constructor for contribution ClassLoader
+ *
+ * @param contribution
+ * @param parent
+ * @throws MalformedURLException
+ */
+ public ContributionClassLoader(Contribution contribution, final ClassLoader parent) {
+ super(new URL[0], parent);
+ // Note that privileged use of getContextClassLoader have been promoted to callers.
+ // super(new URL[0], parent == null?Thread.currentThread().getContextClassLoader(): null);
+ this.contribution = contribution;
+ if (contribution.getLocation() != null) {
+ try {
+ this.addURL(new URL(contribution.getLocation()));
+ for (URL url : ContributionHelper.getNestedJarUrls(contribution)) {
+ this.addURL(url);
+ }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ /*
+ * Return the ClassLoader corresponding to a contribution providing an export
+ * Create a new ClassLoader for the contribution if one does not exist
+ */
+ private ClassLoader getExportClassLoader(Contribution exportingContribution) {
+ ClassLoader cl = exportingContribution.getClassLoader();
+ if (!(cl instanceof ContributionClassLoader)) {
+ if (cl == null) {
+ cl = getParent();
+ }
+
+ cl = new ContributionClassLoader(exportingContribution, cl);
+ exportingContribution.setClassLoader(cl);
+ }
+ return cl;
+ }
+
+ /* (non-Javadoc)
+ * @see java.net.URLClassLoader#findClass(java.lang.String)
+ *
+ * Search path for class:
+ * This contribution
+ * Imported contributions
+ */
+ @Override
+ protected Class<?> findClass(String className) throws ClassNotFoundException {
+
+ Class<?> clazz = null;
+ try {
+ clazz = findClassFromContribution(className);
+ } catch (ClassNotFoundException e) {
+
+ for (Import import_ : this.contribution.getImports()) {
+ if (classNameMatchesImport(className, import_)) {
+ // Delegate the resolution to the imported contribution
+ for (Contribution exportingContribution : ((JavaImportModelResolver)import_.getModelResolver()).getExportContributions()) {
+
+ ClassLoader exportClassLoader = getExportClassLoader(exportingContribution);
+ if (exportClassLoader instanceof ContributionClassLoader) {
+
+ for (Export export : exportingContribution.getExports()) {
+ try {
+ if (import_.match(export)) {
+ clazz = ((ContributionClassLoader)exportClassLoader).findClassFromContribution(className);
+ break;
+ }
+ } catch (ClassNotFoundException e1) {
+ continue;
+ }
+
+ }
+ if (clazz != null) break;
+ }
+ }
+ if (clazz != null) break;
+ }
+ }
+
+ if (clazz == null) throw e;
+ }
+ return clazz;
+ }
+
+
+ /* (non-Javadoc)
+ * @see java.lang.ClassLoader#loadClass(java.lang.String, boolean)
+ *
+ * Search path for class:
+ * Parent ClassLoader
+ * This contribution
+ * Imported contributions
+ *
+ */
+ @Override
+ protected synchronized Class<?> loadClass(String className, boolean resolveClass)
+ throws ClassNotFoundException {
+
+ Class<?> clazz = null;
+ try {
+
+ if (this.getParent() != null)
+ clazz = this.getParent().loadClass(className);
+
+ } catch (ClassNotFoundException e) {
+ }
+
+ if (clazz == null)
+ clazz = findClass(className);
+
+
+ if (resolveClass)
+ this.resolveClass(clazz);
+ return clazz;
+
+ }
+
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.net.URLClassLoader#findResource(java.lang.String)
+ */
+ @Override
+ public URL findResource(String name) {
+
+ URL url = findResourceFromContribution(name);
+
+ if (url == null) {
+ for (Import import_ : this.contribution.getImports()) {
+ if (resourceNameMatchesImport(name, import_)) {
+ // Delegate the resolution to the imported contribution
+ for (Contribution exportingContribution : ((JavaImportModelResolver)import_.getModelResolver()).getExportContributions()) {
+
+ ClassLoader exportClassLoader = getExportClassLoader(exportingContribution);
+ if (exportClassLoader instanceof ContributionClassLoader) {
+
+ for (Export export : exportingContribution.getExports()) {
+ if (import_.match(export)) {
+ url = ((ContributionClassLoader)exportClassLoader).findResourceFromContribution(name);
+ if (url != null) break;
+ }
+ }
+ if (url != null) break;
+ }
+ }
+ if (url != null) break;
+ }
+ }
+
+ }
+ return url;
+ }
+
+
+ /* (non-Javadoc)
+ * @see java.net.URLClassLoader#findResources(java.lang.String)
+ */
+ @Override
+ public Enumeration<URL> findResources(String name) throws IOException {
+
+ return Collections.enumeration(findResourceSet(name));
+ }
+
+
+
+
+ /* (non-Javadoc)
+ * @see java.lang.ClassLoader#getResource(java.lang.String)
+ *
+ * Find a resource.
+ * Search path for resource:
+ * Parent ClassLoader
+ * This contribution
+ * Imported contributions
+ */
+ @Override
+ public URL getResource(String resName) {
+
+ URL resource = null;
+
+ if (this.getParent() != null) {
+ resource = this.getParent().getResource(resName);
+ }
+ if (resource == null)
+ resource = findResource(resName);
+
+ return resource;
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see java.lang.ClassLoader#getResources(java.lang.String)
+ *
+ * Return list of resources from this contribution, resources
+ * imported through imported contributions and resources from parent
+ * ClassLoader.
+ */
+ @Override
+ public Enumeration<URL> getResources(String resName) throws IOException {
+
+ HashSet<URL> resourceSet = findResourceSet(resName);
+ addEnumerationToCollection(resourceSet, super.getResources(resName));
+
+ return Collections.enumeration(resourceSet);
+ }
+
+
+ /*
+ * Find set of resources
+ */
+ private HashSet<URL> findResourceSet(String name) throws IOException {
+
+ HashSet<URL> resources = new HashSet<URL>();
+
+ addEnumerationToCollection(resources, super.findResources(name));
+
+ for (Import import_ : this.contribution.getImports()) {
+ if (!(import_ instanceof JavaImport)) {
+ continue;
+ }
+ if (resourceNameMatchesImport(name, import_)) {
+ // Delegate the resolution to the imported contribution
+ for (Contribution exportingContribution : ((JavaImportModelResolver)import_.getModelResolver()).getExportContributions()) {
+
+ ClassLoader exportClassLoader = getExportClassLoader(exportingContribution);
+ if (exportClassLoader instanceof ContributionClassLoader) {
+
+ for (Export export : exportingContribution.getExports()) {
+ if (import_.match(export)) {
+ addEnumerationToCollection(resources,
+ ((ContributionClassLoader)exportClassLoader).findResources(name));
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return resources;
+ }
+
+
+ /*
+ * Find class from contribution. If class has already been loaded, return loaded class.
+ */
+ private Class<?> findClassFromContribution(String className) throws ClassNotFoundException {
+
+ Class<?> clazz = findLoadedClass(className);
+ if (clazz == null)
+ clazz = super.findClass(className);
+ return clazz;
+
+ }
+
+ /*
+ * Find resource from contribution.
+ */
+ private URL findResourceFromContribution(String name) {
+
+ return super.findResource(name);
+ }
+
+ /**
+ * Check if a class name matches an import statement.
+ * Class matches if the package name used in <import.java/> matches
+ *
+ * @param name Name of class
+ * @param import_ SCA contribution import
+ * @return true if this is a matching import
+ */
+ private boolean classNameMatchesImport(String name, Import import_) {
+
+ if (import_ instanceof JavaImport && name != null && name.lastIndexOf('.') > 0) {
+ JavaImport javaImport = (JavaImport) import_;
+
+ String packageName = name.substring(0, name.lastIndexOf('.'));
+ if (javaImport.getPackage().endsWith(".*")) {
+ String prefix = javaImport.getPackage().substring(0, javaImport.getPackage().length() -1);
+ if (packageName.startsWith(prefix)) {
+ return true;
+ }
+ } else {
+ return packageName.equals(javaImport.getPackage());
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Check if a resource name matches an import statement.
+ * Resource matches if package/namespace match the directory of resource.
+ *
+ * @param name Name of resource
+ * @param import_ SCA contribution import
+ * @return true if this is a matching import
+ */
+ private boolean resourceNameMatchesImport(String name, Import import_) {
+
+
+ if (name == null || name.lastIndexOf('/') <= 0)
+ return false;
+ else if (import_ instanceof JavaImport) {
+ JavaImport javaImport = (JavaImport) import_;
+
+ if (javaImport.getPackage().endsWith(".*")) {
+ String packageName = name.substring(0, name.lastIndexOf('/')).replace('/', '.');
+ String prefix = javaImport.getPackage().substring(0, javaImport.getPackage().length() -1);
+ if (packageName.startsWith(prefix)) {
+ return true;
+ }
+ } else {
+ // 'name' is a resource : contains "/" as separators
+ // Get package name from resource name
+ String packageName = name.substring(0, name.lastIndexOf('/'));
+ return packageName.equals(javaImport.getPackage().replaceAll("\\.", "/"));
+ }
+ }
+ return false;
+ }
+
+ /*
+ * Add an enumeration to a Collection
+ */
+ private <T extends Object> void addEnumerationToCollection(Collection<T> collection, Enumeration<T> enumeration) {
+
+ while (enumeration.hasMoreElements())
+ collection.add(enumeration.nextElement());
+ }
+
+
+ @Override
+ public String toString() {
+ return "SCA Contribution ClassLoader location: " + contribution.getLocation() + " parent ClassLoader: " + getParent();
+ }
+
+
+}
diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportExportFactoryImpl.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportExportFactoryImpl.java
index e5dc397f4e..3bf9e54774 100644
--- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportExportFactoryImpl.java
+++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/java/impl/JavaImportExportFactoryImpl.java
@@ -1,41 +1,41 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java.impl;
-
-import org.apache.tuscany.sca.contribution.java.JavaExport;
-import org.apache.tuscany.sca.contribution.java.JavaImport;
-import org.apache.tuscany.sca.contribution.java.JavaImportExportFactory;
-
-/**
- * Java Import/Export Factory implementation
- *
- * @version $Rev$ $Date$
- */
-public class JavaImportExportFactoryImpl implements JavaImportExportFactory {
-
- public JavaImport createJavaImport() {
- return new JavaImportImpl();
- }
-
- public JavaExport createJavaExport() {
- return new JavaExportImpl();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.contribution.java.impl;
+
+import org.apache.tuscany.sca.contribution.java.JavaExport;
+import org.apache.tuscany.sca.contribution.java.JavaImport;
+import org.apache.tuscany.sca.contribution.java.JavaImportExportFactory;
+
+/**
+ * Java Import/Export Factory implementation
+ *
+ * @version $Rev$ $Date$
+ */
+public class JavaImportExportFactoryImpl implements JavaImportExportFactory {
+
+ public JavaImport createJavaImport() {
+ return new JavaImportImpl();
+ }
+
+ public JavaExport createJavaExport() {
+ return new JavaExportImpl();
+ }
+
+}
diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtendedArtifactProcessor.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtendedArtifactProcessor.java
index 98d3fcca88..952adbc4e3 100644
--- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtendedArtifactProcessor.java
+++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtendedArtifactProcessor.java
@@ -1,40 +1,40 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.contribution.processor;
-
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * Interface for extended Artifact Processors which require a pre-resolve phase prior to the resolve phase
- *
- * @version $Rev: 704156 $ $Date: 2008-10-13 17:31:59 +0100 (Mon, 13 Oct 2008) $
- */
-public interface ExtendedArtifactProcessor<M> extends ArtifactProcessor<M> {
-
- /**
- * Pre-resolve references from this model to other models. Used for models where initial setup of
- * the resolve phase is required. An example is Contribution models with imports and exports which must
- * be set up prior to the main resolve phase
- *
- * @param model The model to resolve
- * @param resolver The resolver to use to resolve referenced models
- */
- void preResolve(M model, ModelResolver resolver) throws ContributionResolveException;
-
-} // end interface
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.contribution.processor;
+
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+
+/**
+ * Interface for extended Artifact Processors which require a pre-resolve phase prior to the resolve phase
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ExtendedArtifactProcessor<M> extends ArtifactProcessor<M> {
+
+ /**
+ * Pre-resolve references from this model to other models. Used for models where initial setup of
+ * the resolve phase is required. An example is Contribution models with imports and exports which must
+ * be set up prior to the main resolve phase
+ *
+ * @param model The model to resolve
+ * @param resolver The resolver to use to resolve referenced models
+ */
+ void preResolve(M model, ModelResolver resolver) throws ContributionResolveException;
+
+} // end interface
diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtendedURLArtifactProcessor.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtendedURLArtifactProcessor.java
index 872b9804ce..2639a21e41 100644
--- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtendedURLArtifactProcessor.java
+++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/ExtendedURLArtifactProcessor.java
@@ -1,30 +1,30 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.processor;
-
-
-/**
- * An extended artifact processor that can read models from a URL.
- *
- * @version $Rev: 704156 $ $Date: 2008-10-13 17:31:59 +0100 (Mon, 13 Oct 2008) $
- */
-public interface ExtendedURLArtifactProcessor<M> extends ExtendedArtifactProcessor<M>, URLArtifactProcessor<M> {
-
-} // end interface
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.contribution.processor;
+
+
+/**
+ * An extended artifact processor that can read models from a URL.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ExtendedURLArtifactProcessor<M> extends ExtendedArtifactProcessor<M>, URLArtifactProcessor<M> {
+
+} // end interface
diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLDocumentStreamReader.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLDocumentStreamReader.java
index 7e8b3a9d9e..634563ebd7 100644
--- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLDocumentStreamReader.java
+++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/processor/xml/XMLDocumentStreamReader.java
@@ -33,7 +33,7 @@ import javax.xml.stream.XMLStreamReader;
* create a XMLStreamReader representing a document and it will produce
* START_DOCUMENT, END_DOCUMENT events.
*
- * @version $Rev: 659153 $ $Date: 2008-05-22 09:43:58 -0700 (Thu, 22 May 2008) $
+ * @version $Rev$ $Date$
*/
public class XMLDocumentStreamReader implements XMLStreamReader {
private static final int STATE_COMPLETE_AT_NEXT = 2; // The wrapper
diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultImportAllModelResolver.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultImportAllModelResolver.java
index c6facd2b02..5cbf37cf70 100644
--- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultImportAllModelResolver.java
+++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/DefaultImportAllModelResolver.java
@@ -1,80 +1,80 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.resolver;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Base;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.Export;
-import org.apache.tuscany.sca.contribution.Import;
-
-/**
- * A model resolver implementation that considers Exports in a list of contributions.
- *
- * @version $Rev: 560435 $ $Date: 2007-07-27 18:26:55 -0700 (Fri, 27 Jul 2007) $
- */
-public class DefaultImportAllModelResolver implements ModelResolver {
-
- private Import import_;
- private List<Contribution> contributions;
-
- public DefaultImportAllModelResolver(Import import_, List<Contribution> contributions) {
- this.import_ = import_;
- this.contributions = contributions;
- }
-
- public void addModel(Object resolved) {
- throw new IllegalStateException();
- }
-
- public Object removeModel(Object resolved) {
- throw new IllegalStateException();
- }
-
- public <T> T resolveModel(Class<T> modelClass, T unresolved) {
-
- //TODO optimize and cache results of the resolution later
-
- // Go over all available contributions
- for (Contribution contribution : contributions) {
-
- // Go over all exports in the contribution
- for (Export export : contribution.getExports()) {
-
- // If the export matches the export, try to resolve the model object
- if (import_.match(export)) {
- Object resolved = export.getModelResolver().resolveModel(modelClass, unresolved);
-
- // Return the resolved model object
- if (resolved instanceof Base) {
- if (!((Base)resolved).isUnresolved()) {
- return modelClass.cast(resolved);
- }
- }
- }
- }
- }
-
- // Model object was not resolved
- return unresolved;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.contribution.resolver;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.Base;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.Export;
+import org.apache.tuscany.sca.contribution.Import;
+
+/**
+ * A model resolver implementation that considers Exports in a list of contributions.
+ *
+ * @version $Rev$ $Date$
+ */
+public class DefaultImportAllModelResolver implements ModelResolver {
+
+ private Import import_;
+ private List<Contribution> contributions;
+
+ public DefaultImportAllModelResolver(Import import_, List<Contribution> contributions) {
+ this.import_ = import_;
+ this.contributions = contributions;
+ }
+
+ public void addModel(Object resolved) {
+ throw new IllegalStateException();
+ }
+
+ public Object removeModel(Object resolved) {
+ throw new IllegalStateException();
+ }
+
+ public <T> T resolveModel(Class<T> modelClass, T unresolved) {
+
+ //TODO optimize and cache results of the resolution later
+
+ // Go over all available contributions
+ for (Contribution contribution : contributions) {
+
+ // Go over all exports in the contribution
+ for (Export export : contribution.getExports()) {
+
+ // If the export matches the export, try to resolve the model object
+ if (import_.match(export)) {
+ Object resolved = export.getModelResolver().resolveModel(modelClass, unresolved);
+
+ // Return the resolved model object
+ if (resolved instanceof Base) {
+ if (!((Base)resolved).isUnresolved()) {
+ return modelClass.cast(resolved);
+ }
+ }
+ }
+ }
+ }
+
+ // Model object was not resolved
+ return unresolved;
+ }
+
+}
diff --git a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ResourceReference.java b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ResourceReference.java
index 2394f4510b..dfe8f08719 100644
--- a/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ResourceReference.java
+++ b/java/sca/modules/contribution/src/main/java/org/apache/tuscany/sca/contribution/resolver/ResourceReference.java
@@ -1,103 +1,103 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.resolver;
-
-import java.net.URL;
-
-/**
- * A resource URL, which should be used to register resources
- * with an ArtifactResolver and resolve these resources later.
- *
- * FIXME Don't use as its deprecated, use Artifact instead.
- *
- * @version $Rev$ $Date$
- */
-@Deprecated
-public class ResourceReference {
-
- private URL resourceURL;
- private String resourceName;
-
- /**
- * Constructs a new ResourceReference.
- *
- * @param resourceName Name of resource
- * @param resourceURL The resource URL
- */
- public ResourceReference(String resourceName, URL resourceURL) {
- this.resourceURL = resourceURL;
- this.resourceName = resourceName;
- }
-
- /**
- * Constructs a new ResourceReference.
- *
- * @param resourceName Name of resource
- */
- public ResourceReference(String resourceName) {
- this.resourceName = resourceName;
- }
-
- /**
- * Get the resource URL.
- *
- * @return The resource URL
- */
- public URL getResource() {
- return resourceURL;
- }
-
- /**
- * Get the resource name.
- *
- * @return The resource name
- */
- public String getResourceName() {
- return resourceName;
- }
-
- /**
- * Returns true if the resource reference is unresolved.
- *
- * @return Whether or not the resource has been resolved
- */
- public boolean isUnresolved() {
- return resourceURL == null;
- }
-
- @Override
- public int hashCode() {
- return resourceName.hashCode();
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- } else {
- if (obj instanceof ResourceReference) {
- return resourceName.equals(((ResourceReference)obj).resourceName);
- } else {
- return false;
- }
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.contribution.resolver;
+
+import java.net.URL;
+
+/**
+ * A resource URL, which should be used to register resources
+ * with an ArtifactResolver and resolve these resources later.
+ *
+ * FIXME Don't use as its deprecated, use Artifact instead.
+ *
+ * @version $Rev$ $Date$
+ */
+@Deprecated
+public class ResourceReference {
+
+ private URL resourceURL;
+ private String resourceName;
+
+ /**
+ * Constructs a new ResourceReference.
+ *
+ * @param resourceName Name of resource
+ * @param resourceURL The resource URL
+ */
+ public ResourceReference(String resourceName, URL resourceURL) {
+ this.resourceURL = resourceURL;
+ this.resourceName = resourceName;
+ }
+
+ /**
+ * Constructs a new ResourceReference.
+ *
+ * @param resourceName Name of resource
+ */
+ public ResourceReference(String resourceName) {
+ this.resourceName = resourceName;
+ }
+
+ /**
+ * Get the resource URL.
+ *
+ * @return The resource URL
+ */
+ public URL getResource() {
+ return resourceURL;
+ }
+
+ /**
+ * Get the resource name.
+ *
+ * @return The resource name
+ */
+ public String getResourceName() {
+ return resourceName;
+ }
+
+ /**
+ * Returns true if the resource reference is unresolved.
+ *
+ * @return Whether or not the resource has been resolved
+ */
+ public boolean isUnresolved() {
+ return resourceURL == null;
+ }
+
+ @Override
+ public int hashCode() {
+ return resourceName.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ } else {
+ if (obj instanceof ResourceReference) {
+ return resourceName.equals(((ResourceReference)obj).resourceName);
+ } else {
+ return false;
+ }
+ }
+ }
+
+}
diff --git a/java/sca/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceArtifactResolverTestCase.java b/java/sca/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceArtifactResolverTestCase.java
index 68a2c771cf..b101c2f1b6 100644
--- a/java/sca/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceArtifactResolverTestCase.java
+++ b/java/sca/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ClassReferenceArtifactResolverTestCase.java
@@ -1,75 +1,75 @@
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java.impl;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.apache.tuscany.sca.contribution.resolver.ClassReference;
-import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test ClassReferenceArtifactResolver.
- *
- * @version $Rev: 560435 $ $Date: 2007-07-27 18:26:55 -0700 (Fri, 27 Jul 2007) $
- */
-public class ClassReferenceArtifactResolverTestCase {
- private static ExtensibleModelResolver resolver;
-
- @BeforeClass
- public static void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
-
- ModelResolverExtensionPoint resolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
- resolvers.addResolver(ClassReference.class, ClassReferenceModelResolver.class);
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- resolver = new ExtensibleModelResolver(null, resolvers, modelFactories);
- }
-
- /**
- * Test ClassReference resolution
- *
- */
- @Test
- public void testResolveClass() {
- ClassReference ref = new ClassReference(getClass().getName());
- ClassReference clazz = resolver.resolveModel(ClassReference.class, ref);
- assertFalse(clazz.isUnresolved());
- assertTrue(clazz.getJavaClass() == getClass());
- }
-
- /**
- * Test ClassReference resolution of inexistent class
- *
- */
- @Test
- public void testUnresolvedClass() {
- ClassReference ref = new ClassReference("NonExistentClass");
- ClassReference clazz = resolver.resolveModel(ClassReference.class, ref);
- assertTrue(clazz.isUnresolved());
- assertTrue(clazz.getJavaClass() == null);
- }
-}
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.contribution.java.impl;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.tuscany.sca.contribution.resolver.ClassReference;
+import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Test ClassReferenceArtifactResolver.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ClassReferenceArtifactResolverTestCase {
+ private static ExtensibleModelResolver resolver;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+
+ ModelResolverExtensionPoint resolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
+ resolvers.addResolver(ClassReference.class, ClassReferenceModelResolver.class);
+ FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
+ resolver = new ExtensibleModelResolver(null, resolvers, modelFactories);
+ }
+
+ /**
+ * Test ClassReference resolution
+ *
+ */
+ @Test
+ public void testResolveClass() {
+ ClassReference ref = new ClassReference(getClass().getName());
+ ClassReference clazz = resolver.resolveModel(ClassReference.class, ref);
+ assertFalse(clazz.isUnresolved());
+ assertTrue(clazz.getJavaClass() == getClass());
+ }
+
+ /**
+ * Test ClassReference resolution of inexistent class
+ *
+ */
+ @Test
+ public void testUnresolvedClass() {
+ ClassReference ref = new ClassReference("NonExistentClass");
+ ClassReference clazz = resolver.resolveModel(ClassReference.class, ref);
+ assertTrue(clazz.isUnresolved());
+ assertTrue(clazz.getJavaClass() == null);
+ }
+}
diff --git a/java/sca/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoaderTestCase.java b/java/sca/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoaderTestCase.java
index 779c00f71c..8409dd9491 100644
--- a/java/sca/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoaderTestCase.java
+++ b/java/sca/modules/contribution/src/test/java/org/apache/tuscany/sca/contribution/java/impl/ContributionClassLoaderTestCase.java
@@ -1,262 +1,262 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.contribution.java.impl;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.ArrayList;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.java.JavaExport;
-import org.apache.tuscany.sca.contribution.java.JavaImport;
-import org.apache.tuscany.sca.contribution.java.JavaImportExportFactory;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-
-/**
- * Test ContributionClassLoader.
- *
- */
-public class ContributionClassLoaderTestCase {
-
- private static ContributionFactory contributionFactory;
- private static JavaImportExportFactory javaImportExportFactory;
-
- @BeforeClass
- public static void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- javaImportExportFactory = modelFactories.getFactory(JavaImportExportFactory.class);
- }
-
- private Contribution createContribution(String fileName) throws MalformedURLException {
- Contribution contrib = contributionFactory.createContribution();
- File contribDir = new File(fileName);
- contrib.setLocation(contribDir.toURI().toURL().toString());
- ClassLoader contextClassLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
- public ClassLoader run() {
- return Thread.currentThread().getContextClassLoader();
- }
- });
- contrib.setClassLoader(new ContributionClassLoader(contrib, contextClassLoader));
- return contrib;
- }
-
-
- @Test
- public void testClassLoadingFromContribution() throws ClassNotFoundException, MalformedURLException {
-
- Contribution contribA = createContribution("target/test-classes");
- Contribution contribB = createContribution("target");
- Contribution contribC = createContribution("target/test-classes/deployables/sample-calculator.jar");
-
- // Class present in contribution, also in parent. Class is loaded from parent
- Class<?> testClassA = contribA.getClassLoader().loadClass(this.getClass().getName());
- Assert.assertNotNull(testClassA);
- Assert.assertSame(this.getClass(), testClassA);
-
- // Class not present in contribution, but present in parent ClassLoader
- Class<?> testClassB = contribB.getClassLoader().loadClass(this.getClass().getName());
- Assert.assertNotNull(testClassB);
- Assert.assertSame(this.getClass(), testClassB);
-
- // Class present in contribution, but not in parent
- Class<?> testClassC = contribC.getClassLoader().loadClass("calculator.AddService");
- Assert.assertNotNull(testClassC);
-
- // Class not present in contribution or in parent
- try {
- contribA.getClassLoader().loadClass("NonExistent");
-
- Assert.assertTrue("ClassNotFoundException not thrown as expected", false);
-
- } catch (ClassNotFoundException e) {
- }
-
-
-
- }
-
- @Test
- public void testResourceLoadingFromContribution() throws ClassNotFoundException, MalformedURLException {
-
- Contribution contribA = createContribution("target/test-classes");
- Contribution contribB = createContribution("target");
- Contribution contribC = createContribution("target/test-classes/deployables/sample-calculator.jar");
-
- // Resource present in contribution, and in parent
- URL resA = contribA.getClassLoader().getResource("deployables/sample-calculator.jar");
- Assert.assertNotNull(resA);
-
- // Resource not present in contribution, but present in parent ClassLoader
- URL resB = contribB.getClassLoader().getResource("deployables/sample-calculator.jar");
- Assert.assertNotNull(resB);
-
- // Resource present in contribution, but not in parent
- URL resC = contribC.getClassLoader().getResource("calculator/AddService.class");
- Assert.assertNotNull(resC);
-
- // Load Java class as resource from parent
- String classResName = this.getClass().getName().replaceAll("\\.", "/") + ".class";
- URL classResA = contribA.getClassLoader().getResource(classResName);
- Assert.assertNotNull(classResA);
-
- // Non-existent resource
- URL res = contribA.getClassLoader().getResource("deployables/NonExistent");
- Assert.assertNull(res);
-
- }
-
- private static String getPackageName(Class<?> cls) {
- String name = cls.getName();
- int index = name.lastIndexOf('.');
- return index == -1 ? "" : name.substring(0, index);
- }
-
- @Test
- public void testClassLoadingFromImportedContribution() throws ClassNotFoundException, MalformedURLException {
-
- Contribution contribA = createContribution("target/test-classes");
- Contribution contribB = createContribution("target");
- Contribution contribC = createContribution("target/test-classes/deployables/sample-calculator.jar");
- ArrayList<Contribution> exportContribList = new ArrayList<Contribution>();
- exportContribList.add(contribA);
- exportContribList.add(contribC);
-
- JavaImport import_ = javaImportExportFactory.createJavaImport();
- import_.setPackage(getPackageName(getClass()));
- import_.setModelResolver(new JavaImportModelResolver(exportContribList, null));
- contribB.getImports().add(import_);
- import_ = javaImportExportFactory.createJavaImport();
- import_.setPackage("calculator");
- import_.setModelResolver(new JavaImportModelResolver(exportContribList, null));
- contribB.getImports().add(import_);
-
- JavaExport export = javaImportExportFactory.createJavaExport();
- export.setPackage(getPackageName(getClass()));
- contribA.getExports().add(export);
- export = javaImportExportFactory.createJavaExport();
- export.setPackage("calculator");
- contribC.getExports().add(export);
-
- // Load class from parent, class is also present in imported contribution. Class should
- // be loaded from parent
- Class<?> testClassB = contribB.getClassLoader().loadClass(this.getClass().getName());
- Assert.assertNotNull(testClassB);
- Assert.assertSame(this.getClass(), testClassB);
-
- // Load class from parent, class is also present in parent. Class should be loaded
- // from parent.
- Class<?> testClassA = contribA.getClassLoader().loadClass(this.getClass().getName());
- Assert.assertNotNull(testClassA);
- Assert.assertSame(this.getClass(), testClassA);
-
- // Imported class should be the same as the one loaded by the exporting contribution
- Assert.assertSame(testClassA, testClassB);
-
- // Load class from imported contribution, class is not present in parent
- Class<?> testClassB1 = contribB.getClassLoader().loadClass("calculator.AddService");
- Assert.assertNotNull(testClassB1);
-
- // Imported class should be the same as the one loaded by the exporting contribution
- Class<?> testClassC = contribC.getClassLoader().loadClass("calculator.AddService");
- Assert.assertNotNull(testClassC);
- Assert.assertSame(testClassC, testClassB1);
-
-
- // Try to load class from package which is not explicitly imported - should throw ClassNotFoundException
- try {
- contribA.getClassLoader().loadClass("calculator.AddService");
-
- Assert.assertTrue("ClassNotFoundException not thrown as expected", false);
-
- } catch (ClassNotFoundException e) {
- }
-
- // Try to load non-existent class from imported package - should throw ClassNotFoundException
- try {
- contribB.getClassLoader().loadClass(getPackageName(getClass()) + ".NonExistentClass");
-
- Assert.assertTrue("ClassNotFoundException not thrown as expected", false);
-
- } catch (ClassNotFoundException e) {
- }
-
- }
-
- @Test
- public void testResourceLoadingFromImportedContribution() throws ClassNotFoundException, MalformedURLException {
-
- Contribution contribA = createContribution("target/test-classes");
- Contribution contribB = createContribution("target");
- Contribution contribC = createContribution("target/test-classes/deployables/sample-calculator.jar");
-
- ArrayList<Contribution> exportContribList = new ArrayList<Contribution>();
- exportContribList.add(contribA);
- exportContribList.add(contribC);
-
- JavaImport import_ = javaImportExportFactory.createJavaImport();
- import_.setPackage(getPackageName(getClass()));
- import_.setModelResolver(new JavaImportModelResolver(exportContribList, null));
- contribB.getImports().add(import_);
- JavaImport import1_ = javaImportExportFactory.createJavaImport();
- import1_.setPackage("calculator");
- import1_.setModelResolver(new JavaImportModelResolver(exportContribList, null));
- contribB.getImports().add(import1_);
-
- JavaExport export = javaImportExportFactory.createJavaExport();
- export.setPackage(getPackageName(getClass()));
- contribA.getExports().add(export);
- JavaExport export1 = javaImportExportFactory.createJavaExport();
- export1.setPackage("calculator");
- contribC.getExports().add(export1);
-
-
- // Load resource from parent
- URL resB = contribB.getClassLoader().getResource("deployables/sample-calculator.jar");
- Assert.assertNotNull(resB);
-
- // Load Java class as resource from imported contribution with JavaImport
- String classResName = this.getClass().getName().replaceAll("\\.", "/") + ".class";
- URL classResB = contribB.getClassLoader().getResource(classResName);
- Assert.assertNotNull(classResB);
-
- // Load Java class as resource from imported contribution with JavaImport
- URL classResB1 = contribB.getClassLoader().getResource("calculator/AddService.class");
- Assert.assertNotNull(classResB1);
-
- // Try to load resource not explicitly imported by contribution
- URL classResA1 = contribA.getClassLoader().getResource("calculator/AddService.class");
- Assert.assertNull(classResA1);
-
-
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.contribution.java.impl;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.ContributionFactory;
+import org.apache.tuscany.sca.contribution.java.JavaExport;
+import org.apache.tuscany.sca.contribution.java.JavaImport;
+import org.apache.tuscany.sca.contribution.java.JavaImportExportFactory;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+/**
+ * Test ContributionClassLoader.
+ *
+ */
+public class ContributionClassLoaderTestCase {
+
+ private static ContributionFactory contributionFactory;
+ private static JavaImportExportFactory javaImportExportFactory;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+ FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
+ contributionFactory = modelFactories.getFactory(ContributionFactory.class);
+ javaImportExportFactory = modelFactories.getFactory(JavaImportExportFactory.class);
+ }
+
+ private Contribution createContribution(String fileName) throws MalformedURLException {
+ Contribution contrib = contributionFactory.createContribution();
+ File contribDir = new File(fileName);
+ contrib.setLocation(contribDir.toURI().toURL().toString());
+ ClassLoader contextClassLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run() {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ contrib.setClassLoader(new ContributionClassLoader(contrib, contextClassLoader));
+ return contrib;
+ }
+
+
+ @Test
+ public void testClassLoadingFromContribution() throws ClassNotFoundException, MalformedURLException {
+
+ Contribution contribA = createContribution("target/test-classes");
+ Contribution contribB = createContribution("target");
+ Contribution contribC = createContribution("target/test-classes/deployables/sample-calculator.jar");
+
+ // Class present in contribution, also in parent. Class is loaded from parent
+ Class<?> testClassA = contribA.getClassLoader().loadClass(this.getClass().getName());
+ Assert.assertNotNull(testClassA);
+ Assert.assertSame(this.getClass(), testClassA);
+
+ // Class not present in contribution, but present in parent ClassLoader
+ Class<?> testClassB = contribB.getClassLoader().loadClass(this.getClass().getName());
+ Assert.assertNotNull(testClassB);
+ Assert.assertSame(this.getClass(), testClassB);
+
+ // Class present in contribution, but not in parent
+ Class<?> testClassC = contribC.getClassLoader().loadClass("calculator.AddService");
+ Assert.assertNotNull(testClassC);
+
+ // Class not present in contribution or in parent
+ try {
+ contribA.getClassLoader().loadClass("NonExistent");
+
+ Assert.assertTrue("ClassNotFoundException not thrown as expected", false);
+
+ } catch (ClassNotFoundException e) {
+ }
+
+
+
+ }
+
+ @Test
+ public void testResourceLoadingFromContribution() throws ClassNotFoundException, MalformedURLException {
+
+ Contribution contribA = createContribution("target/test-classes");
+ Contribution contribB = createContribution("target");
+ Contribution contribC = createContribution("target/test-classes/deployables/sample-calculator.jar");
+
+ // Resource present in contribution, and in parent
+ URL resA = contribA.getClassLoader().getResource("deployables/sample-calculator.jar");
+ Assert.assertNotNull(resA);
+
+ // Resource not present in contribution, but present in parent ClassLoader
+ URL resB = contribB.getClassLoader().getResource("deployables/sample-calculator.jar");
+ Assert.assertNotNull(resB);
+
+ // Resource present in contribution, but not in parent
+ URL resC = contribC.getClassLoader().getResource("calculator/AddService.class");
+ Assert.assertNotNull(resC);
+
+ // Load Java class as resource from parent
+ String classResName = this.getClass().getName().replaceAll("\\.", "/") + ".class";
+ URL classResA = contribA.getClassLoader().getResource(classResName);
+ Assert.assertNotNull(classResA);
+
+ // Non-existent resource
+ URL res = contribA.getClassLoader().getResource("deployables/NonExistent");
+ Assert.assertNull(res);
+
+ }
+
+ private static String getPackageName(Class<?> cls) {
+ String name = cls.getName();
+ int index = name.lastIndexOf('.');
+ return index == -1 ? "" : name.substring(0, index);
+ }
+
+ @Test
+ public void testClassLoadingFromImportedContribution() throws ClassNotFoundException, MalformedURLException {
+
+ Contribution contribA = createContribution("target/test-classes");
+ Contribution contribB = createContribution("target");
+ Contribution contribC = createContribution("target/test-classes/deployables/sample-calculator.jar");
+ ArrayList<Contribution> exportContribList = new ArrayList<Contribution>();
+ exportContribList.add(contribA);
+ exportContribList.add(contribC);
+
+ JavaImport import_ = javaImportExportFactory.createJavaImport();
+ import_.setPackage(getPackageName(getClass()));
+ import_.setModelResolver(new JavaImportModelResolver(exportContribList, null));
+ contribB.getImports().add(import_);
+ import_ = javaImportExportFactory.createJavaImport();
+ import_.setPackage("calculator");
+ import_.setModelResolver(new JavaImportModelResolver(exportContribList, null));
+ contribB.getImports().add(import_);
+
+ JavaExport export = javaImportExportFactory.createJavaExport();
+ export.setPackage(getPackageName(getClass()));
+ contribA.getExports().add(export);
+ export = javaImportExportFactory.createJavaExport();
+ export.setPackage("calculator");
+ contribC.getExports().add(export);
+
+ // Load class from parent, class is also present in imported contribution. Class should
+ // be loaded from parent
+ Class<?> testClassB = contribB.getClassLoader().loadClass(this.getClass().getName());
+ Assert.assertNotNull(testClassB);
+ Assert.assertSame(this.getClass(), testClassB);
+
+ // Load class from parent, class is also present in parent. Class should be loaded
+ // from parent.
+ Class<?> testClassA = contribA.getClassLoader().loadClass(this.getClass().getName());
+ Assert.assertNotNull(testClassA);
+ Assert.assertSame(this.getClass(), testClassA);
+
+ // Imported class should be the same as the one loaded by the exporting contribution
+ Assert.assertSame(testClassA, testClassB);
+
+ // Load class from imported contribution, class is not present in parent
+ Class<?> testClassB1 = contribB.getClassLoader().loadClass("calculator.AddService");
+ Assert.assertNotNull(testClassB1);
+
+ // Imported class should be the same as the one loaded by the exporting contribution
+ Class<?> testClassC = contribC.getClassLoader().loadClass("calculator.AddService");
+ Assert.assertNotNull(testClassC);
+ Assert.assertSame(testClassC, testClassB1);
+
+
+ // Try to load class from package which is not explicitly imported - should throw ClassNotFoundException
+ try {
+ contribA.getClassLoader().loadClass("calculator.AddService");
+
+ Assert.assertTrue("ClassNotFoundException not thrown as expected", false);
+
+ } catch (ClassNotFoundException e) {
+ }
+
+ // Try to load non-existent class from imported package - should throw ClassNotFoundException
+ try {
+ contribB.getClassLoader().loadClass(getPackageName(getClass()) + ".NonExistentClass");
+
+ Assert.assertTrue("ClassNotFoundException not thrown as expected", false);
+
+ } catch (ClassNotFoundException e) {
+ }
+
+ }
+
+ @Test
+ public void testResourceLoadingFromImportedContribution() throws ClassNotFoundException, MalformedURLException {
+
+ Contribution contribA = createContribution("target/test-classes");
+ Contribution contribB = createContribution("target");
+ Contribution contribC = createContribution("target/test-classes/deployables/sample-calculator.jar");
+
+ ArrayList<Contribution> exportContribList = new ArrayList<Contribution>();
+ exportContribList.add(contribA);
+ exportContribList.add(contribC);
+
+ JavaImport import_ = javaImportExportFactory.createJavaImport();
+ import_.setPackage(getPackageName(getClass()));
+ import_.setModelResolver(new JavaImportModelResolver(exportContribList, null));
+ contribB.getImports().add(import_);
+ JavaImport import1_ = javaImportExportFactory.createJavaImport();
+ import1_.setPackage("calculator");
+ import1_.setModelResolver(new JavaImportModelResolver(exportContribList, null));
+ contribB.getImports().add(import1_);
+
+ JavaExport export = javaImportExportFactory.createJavaExport();
+ export.setPackage(getPackageName(getClass()));
+ contribA.getExports().add(export);
+ JavaExport export1 = javaImportExportFactory.createJavaExport();
+ export1.setPackage("calculator");
+ contribC.getExports().add(export1);
+
+
+ // Load resource from parent
+ URL resB = contribB.getClassLoader().getResource("deployables/sample-calculator.jar");
+ Assert.assertNotNull(resB);
+
+ // Load Java class as resource from imported contribution with JavaImport
+ String classResName = this.getClass().getName().replaceAll("\\.", "/") + ".class";
+ URL classResB = contribB.getClassLoader().getResource(classResName);
+ Assert.assertNotNull(classResB);
+
+ // Load Java class as resource from imported contribution with JavaImport
+ URL classResB1 = contribB.getClassLoader().getResource("calculator/AddService.class");
+ Assert.assertNotNull(classResB1);
+
+ // Try to load resource not explicitly imported by contribution
+ URL classResA1 = contribA.getClassLoader().getResource("calculator/AddService.class");
+ Assert.assertNull(classResA1);
+
+
+ }
+
+}
diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/PhasedInterceptor.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/PhasedInterceptor.java
index f5390f7460..4482eaa0bb 100644
--- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/PhasedInterceptor.java
+++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/invocation/PhasedInterceptor.java
@@ -1,31 +1,31 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.invocation;
-
-/**
- * An interceptor that is designated to be a given phase
- */
-public interface PhasedInterceptor extends Interceptor {
- /**
- * Get the name of the phase that this interceptor is positioned
- * @return
- */
- String getPhase();
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.invocation;
+
+/**
+ * An interceptor that is designated to be a given phase
+ */
+public interface PhasedInterceptor extends Interceptor {
+ /**
+ * Get the name of the phase that this interceptor is positioned
+ * @return
+ */
+ String getPhase();
+}
diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BasePolicyProvider.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BasePolicyProvider.java
index 37192104e8..785ac70271 100644
--- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BasePolicyProvider.java
+++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/provider/BasePolicyProvider.java
@@ -1,169 +1,169 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.provider;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.EndpointReference;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.InvocationChain;
-import org.apache.tuscany.sca.invocation.PhasedInterceptor;
-import org.apache.tuscany.sca.policy.PolicyExpression;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySubject;
-import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-
-/**
- * Abstract base class for policy providers
- */
-public abstract class BasePolicyProvider<T> implements PolicyProvider {
- protected Class<T> policyType;
- protected PolicySubject subject;
-
- protected BasePolicyProvider(Class<T> policyType, PolicySubject subject) {
- this.policyType = policyType;
- this.subject = subject;
- }
-
- protected List<T> findPolicies() {
- List<T> policies = new ArrayList<T>();
- List<PolicySet> policySets = subject.getPolicySets();
- for (PolicySet ps : policySets) {
- for (Object p : ps.getPolicies()) {
- if (policyType.isInstance(p)) {
- policies.add(policyType.cast(p));
- }
- if (p instanceof PolicyExpression) {
- PolicyExpression exp = (PolicyExpression)p;
- if (policyType.isInstance(exp.getPolicy())) {
- policies.add(policyType.cast(exp.getPolicy()));
- }
- }
-
- }
- }
- return policies;
- }
-
- protected List<PolicySet> findPolicySets() {
- List<PolicySet> policies = new ArrayList<PolicySet>();
- List<PolicySet> policySets = subject.getPolicySets();
- for (PolicySet ps : policySets) {
- for (Object p : ps.getPolicies()) {
- if (policyType.isInstance(p)) {
- policies.add(ps);
- }
- if (p instanceof PolicyExpression) {
- PolicyExpression exp = (PolicyExpression)p;
- if (policyType.isInstance(exp.getPolicy())) {
- policies.add(ps);
- }
- }
- }
- }
- return policies;
- }
-
- protected PolicySet findPolicySet() {
- List<PolicySet> policySets = subject.getPolicySets();
- for (PolicySet ps : policySets) {
- for (Object p : ps.getPolicies()) {
- if (policyType.isInstance(p)) {
- return ps;
- }
- if (p instanceof PolicyExpression) {
- PolicyExpression exp = (PolicyExpression)p;
- if (policyType.isInstance(exp.getPolicy())) {
- return ps;
- }
- }
- }
- }
- return null;
- }
-
- protected String getContext() {
- if (subject instanceof Endpoint) {
- Endpoint endpoint = (Endpoint)subject;
- return endpoint.getURI();
- } else if (subject instanceof EndpointReference) {
- EndpointReference endpointReference = (EndpointReference)subject;
- return endpointReference.getURI();
- } else if (subject instanceof Component) {
- Component component = (Component)subject;
- return component.getURI();
- }
- return null;
- }
-
- public void start() {
- }
-
- public void stop() {
- }
-
- public PhasedInterceptor createInterceptor(Operation operation) {
- return null;
- }
-
- private InvocationChain getInvocationChain() {
- if (subject instanceof Endpoint) {
- Endpoint endpoint = (Endpoint)subject;
- RuntimeComponentService service = (RuntimeComponentService)endpoint.getService();
- RuntimeWire wire = service.getRuntimeWire(endpoint.getBinding());
- List<InvocationChain> chains = wire.getInvocationChains();
- for (InvocationChain chain : chains) {
- configure(chain, chain.getTargetOperation());
- }
-
- } else if (subject instanceof EndpointReference) {
- EndpointReference endpointReference = (EndpointReference)subject;
- RuntimeComponentReference reference = (RuntimeComponentReference)endpointReference.getReference();
- RuntimeWire wire = reference.getRuntimeWire(endpointReference.getBinding());
- List<InvocationChain> chains = wire.getInvocationChains();
- for (InvocationChain chain : chains) {
- configure(chain, chain.getSourceOperation());
- }
- } else if (subject instanceof Component) {
- Component component = (Component)subject;
- for (ComponentService s : component.getServices()) {
- RuntimeComponentService service = (RuntimeComponentService)s;
- for (RuntimeWire wire : service.getRuntimeWires()) {
- List<InvocationChain> chains = wire.getInvocationChains();
- for (InvocationChain chain : chains) {
- configure(chain, chain.getTargetOperation());
- }
- }
-
- }
- }
- return null;
- }
-
- protected void configure(InvocationChain invocationChain, Operation operation) {
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.provider;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.InvocationChain;
+import org.apache.tuscany.sca.invocation.PhasedInterceptor;
+import org.apache.tuscany.sca.policy.PolicyExpression;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.PolicySubject;
+import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+import org.apache.tuscany.sca.runtime.RuntimeWire;
+
+/**
+ * Abstract base class for policy providers
+ */
+public abstract class BasePolicyProvider<T> implements PolicyProvider {
+ protected Class<T> policyType;
+ protected PolicySubject subject;
+
+ protected BasePolicyProvider(Class<T> policyType, PolicySubject subject) {
+ this.policyType = policyType;
+ this.subject = subject;
+ }
+
+ protected List<T> findPolicies() {
+ List<T> policies = new ArrayList<T>();
+ List<PolicySet> policySets = subject.getPolicySets();
+ for (PolicySet ps : policySets) {
+ for (Object p : ps.getPolicies()) {
+ if (policyType.isInstance(p)) {
+ policies.add(policyType.cast(p));
+ }
+ if (p instanceof PolicyExpression) {
+ PolicyExpression exp = (PolicyExpression)p;
+ if (policyType.isInstance(exp.getPolicy())) {
+ policies.add(policyType.cast(exp.getPolicy()));
+ }
+ }
+
+ }
+ }
+ return policies;
+ }
+
+ protected List<PolicySet> findPolicySets() {
+ List<PolicySet> policies = new ArrayList<PolicySet>();
+ List<PolicySet> policySets = subject.getPolicySets();
+ for (PolicySet ps : policySets) {
+ for (Object p : ps.getPolicies()) {
+ if (policyType.isInstance(p)) {
+ policies.add(ps);
+ }
+ if (p instanceof PolicyExpression) {
+ PolicyExpression exp = (PolicyExpression)p;
+ if (policyType.isInstance(exp.getPolicy())) {
+ policies.add(ps);
+ }
+ }
+ }
+ }
+ return policies;
+ }
+
+ protected PolicySet findPolicySet() {
+ List<PolicySet> policySets = subject.getPolicySets();
+ for (PolicySet ps : policySets) {
+ for (Object p : ps.getPolicies()) {
+ if (policyType.isInstance(p)) {
+ return ps;
+ }
+ if (p instanceof PolicyExpression) {
+ PolicyExpression exp = (PolicyExpression)p;
+ if (policyType.isInstance(exp.getPolicy())) {
+ return ps;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ protected String getContext() {
+ if (subject instanceof Endpoint) {
+ Endpoint endpoint = (Endpoint)subject;
+ return endpoint.getURI();
+ } else if (subject instanceof EndpointReference) {
+ EndpointReference endpointReference = (EndpointReference)subject;
+ return endpointReference.getURI();
+ } else if (subject instanceof Component) {
+ Component component = (Component)subject;
+ return component.getURI();
+ }
+ return null;
+ }
+
+ public void start() {
+ }
+
+ public void stop() {
+ }
+
+ public PhasedInterceptor createInterceptor(Operation operation) {
+ return null;
+ }
+
+ private InvocationChain getInvocationChain() {
+ if (subject instanceof Endpoint) {
+ Endpoint endpoint = (Endpoint)subject;
+ RuntimeComponentService service = (RuntimeComponentService)endpoint.getService();
+ RuntimeWire wire = service.getRuntimeWire(endpoint.getBinding());
+ List<InvocationChain> chains = wire.getInvocationChains();
+ for (InvocationChain chain : chains) {
+ configure(chain, chain.getTargetOperation());
+ }
+
+ } else if (subject instanceof EndpointReference) {
+ EndpointReference endpointReference = (EndpointReference)subject;
+ RuntimeComponentReference reference = (RuntimeComponentReference)endpointReference.getReference();
+ RuntimeWire wire = reference.getRuntimeWire(endpointReference.getBinding());
+ List<InvocationChain> chains = wire.getInvocationChains();
+ for (InvocationChain chain : chains) {
+ configure(chain, chain.getSourceOperation());
+ }
+ } else if (subject instanceof Component) {
+ Component component = (Component)subject;
+ for (ComponentService s : component.getServices()) {
+ RuntimeComponentService service = (RuntimeComponentService)s;
+ for (RuntimeWire wire : service.getRuntimeWires()) {
+ List<InvocationChain> chains = wire.getInvocationChains();
+ for (InvocationChain chain : chains) {
+ configure(chain, chain.getTargetOperation());
+ }
+ }
+
+ }
+ }
+ return null;
+ }
+
+ protected void configure(InvocationChain invocationChain, Operation operation) {
+ }
+
+}
diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointListener.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointListener.java
index 4fa0fbd85f..13d193c464 100644
--- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointListener.java
+++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointListener.java
@@ -1,46 +1,46 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.runtime;
-
-import java.util.EventListener;
-
-import org.apache.tuscany.sca.assembly.Endpoint;
-
-/**
- * A listener for endpoint events
- */
-public interface EndpointListener extends EventListener {
- /**
- * The method is invoked when a new endpoint is added to the registry
- * @param endpoint
- */
- void endpointAdded(Endpoint endpoint);
- /**
- * The method is invoked when an endpoint is removed the registry
- * @param endpoint
- */
- void endpointRemoved(Endpoint endpoint);
- /**
- * The method is invoked when an endpoint is updated in the registry
- * @param oldEndpoint
- * @param newEndpoint
- */
- void endpointUpdated(Endpoint oldEndpoint, Endpoint newEndpoint);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.runtime;
+
+import java.util.EventListener;
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+
+/**
+ * A listener for endpoint events
+ */
+public interface EndpointListener extends EventListener {
+ /**
+ * The method is invoked when a new endpoint is added to the registry
+ * @param endpoint
+ */
+ void endpointAdded(Endpoint endpoint);
+ /**
+ * The method is invoked when an endpoint is removed the registry
+ * @param endpoint
+ */
+ void endpointRemoved(Endpoint endpoint);
+ /**
+ * The method is invoked when an endpoint is updated in the registry
+ * @param oldEndpoint
+ * @param newEndpoint
+ */
+ void endpointUpdated(Endpoint oldEndpoint, Endpoint newEndpoint);
+}
diff --git a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java
index f449fefa9c..09f4a4d78d 100644
--- a/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java
+++ b/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java
@@ -1,48 +1,48 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.runtime;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.EndpointReference;
-
-/**
- * The EndpointRegistry holds the active service endpoints for the SCA domain
- */
-public interface EndpointRegistry {
- void addEndpoint(Endpoint endpoint);
- void removeEndpoint(Endpoint endpoint);
-
- Endpoint getEndpoint(String uri);
- void updateEndpoint(String uri, Endpoint endpoint);
- List<Endpoint> findEndpoint(EndpointReference endpointReference);
- List<Endpoint> getEndpoints();
-
- void addEndpointReference(EndpointReference endpointReference);
- void removeEndpointReference(EndpointReference endpointReference);
- List<EndpointReference> findEndpointReference(Endpoint endpoint);
- List<EndpointReference> getEndpointRefereneces();
-
- void addListener(EndpointListener listener);
- void removeListener(EndpointListener listener);
- List<EndpointListener> getListeners();
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.runtime;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.EndpointReference;
+
+/**
+ * The EndpointRegistry holds the active service endpoints for the SCA domain
+ */
+public interface EndpointRegistry {
+ void addEndpoint(Endpoint endpoint);
+ void removeEndpoint(Endpoint endpoint);
+
+ Endpoint getEndpoint(String uri);
+ void updateEndpoint(String uri, Endpoint endpoint);
+ List<Endpoint> findEndpoint(EndpointReference endpointReference);
+ List<Endpoint> getEndpoints();
+
+ void addEndpointReference(EndpointReference endpointReference);
+ void removeEndpointReference(EndpointReference endpointReference);
+ List<EndpointReference> findEndpointReference(Endpoint endpoint);
+ List<EndpointReference> getEndpointRefereneces();
+
+ void addListener(EndpointListener listener);
+ void removeListener(EndpointListener listener);
+ List<EndpointListener> getListeners();
+
+}
diff --git a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/EndpointSerializer.java b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/EndpointSerializer.java
index 4617901c5b..b9c9c7032b 100644
--- a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/EndpointSerializer.java
+++ b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/EndpointSerializer.java
@@ -1,38 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.assembly;
-
-import java.io.IOException;
-
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.EndpointReference;
-
-/**
- * A utility to seralize/deserialize Endpoint/EndpointReference objects
- */
-public interface EndpointSerializer {
- void read(Endpoint endpoint, String xml) throws IOException;
-
- String write(Endpoint endpoint) throws IOException;
-
- void read(EndpointReference endpointReference, String xml) throws IOException;
-
- String write(EndpointReference endpointReference) throws IOException;
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.core.assembly;
+
+import java.io.IOException;
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.EndpointReference;
+
+/**
+ * A utility to seralize/deserialize Endpoint/EndpointReference objects
+ */
+public interface EndpointSerializer {
+ void read(Endpoint endpoint, String xml) throws IOException;
+
+ String write(Endpoint endpoint) throws IOException;
+
+ void read(EndpointReference endpointReference, String xml) throws IOException;
+
+ String write(EndpointReference endpointReference) throws IOException;
+}
diff --git a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointSerializerImpl.java b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointSerializerImpl.java
index b9eb6c117b..f4cc957f26 100644
--- a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointSerializerImpl.java
+++ b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/EndpointSerializerImpl.java
@@ -1,108 +1,108 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.assembly.impl;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.io.StringWriter;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.EndpointReference;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.core.assembly.EndpointSerializer;
-
-public class EndpointSerializerImpl implements EndpointSerializer {
- private XMLInputFactory inputFactory;
- private XMLOutputFactory outputFactory;
- private StAXArtifactProcessor<Endpoint> processor;
- private StAXArtifactProcessor<EndpointReference> refProcessor;
-
- public EndpointSerializerImpl(ExtensionPointRegistry registry) {
- FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
- inputFactory = factories.getFactory(XMLInputFactory.class);
- outputFactory = factories.getFactory(XMLOutputFactory.class);
- StAXArtifactProcessorExtensionPoint processors =
- registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- processor = processors.getProcessor(Endpoint.class);
- refProcessor = processors.getProcessor(EndpointReference.class);
- }
-
- public void read(Endpoint endpoint, String xml) throws IOException {
- try {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(xml));
- Endpoint result = processor.read(reader);
- endpoint.setComponent(result.getComponent());
- endpoint.setService(result.getService());
- endpoint.setBinding(result.getBinding());
- endpoint.setInterfaceContract(result.getService().getInterfaceContract());
- } catch (Exception e) {
- throw new IOException(e.getMessage());
- }
-
- }
-
- public String write(Endpoint endpoint) throws IOException {
- StringWriter sw = new StringWriter();
- try {
- XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
- processor.write(endpoint, writer);
- writer.flush();
- writer.close();
- return sw.toString();
- } catch (Exception e) {
- throw new IOException(e.getMessage());
- }
- }
-
- public void read(EndpointReference endpointReference, String xml) throws IOException {
- try {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(xml));
- EndpointReference result = refProcessor.read(reader);
- reader.close();
- endpointReference.setComponent(result.getComponent());
- endpointReference.setReference(result.getReference());
- endpointReference.setBinding(result.getBinding());
- endpointReference.setInterfaceContract(result.getReference().getInterfaceContract());
- } catch (Exception e) {
- throw new IOException(e.getMessage());
- }
- }
-
- public String write(EndpointReference endpointReference) throws IOException {
- StringWriter sw = new StringWriter();
- try {
- XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
- refProcessor.write(endpointReference, writer);
- writer.flush();
- writer.close();
- return sw.toString();
- } catch (Exception e) {
- throw new IOException(e.getMessage());
- }
- }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.core.assembly.impl;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.core.assembly.EndpointSerializer;
+
+public class EndpointSerializerImpl implements EndpointSerializer {
+ private XMLInputFactory inputFactory;
+ private XMLOutputFactory outputFactory;
+ private StAXArtifactProcessor<Endpoint> processor;
+ private StAXArtifactProcessor<EndpointReference> refProcessor;
+
+ public EndpointSerializerImpl(ExtensionPointRegistry registry) {
+ FactoryExtensionPoint factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
+ inputFactory = factories.getFactory(XMLInputFactory.class);
+ outputFactory = factories.getFactory(XMLOutputFactory.class);
+ StAXArtifactProcessorExtensionPoint processors =
+ registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+ processor = processors.getProcessor(Endpoint.class);
+ refProcessor = processors.getProcessor(EndpointReference.class);
+ }
+
+ public void read(Endpoint endpoint, String xml) throws IOException {
+ try {
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(xml));
+ Endpoint result = processor.read(reader);
+ endpoint.setComponent(result.getComponent());
+ endpoint.setService(result.getService());
+ endpoint.setBinding(result.getBinding());
+ endpoint.setInterfaceContract(result.getService().getInterfaceContract());
+ } catch (Exception e) {
+ throw new IOException(e.getMessage());
+ }
+
+ }
+
+ public String write(Endpoint endpoint) throws IOException {
+ StringWriter sw = new StringWriter();
+ try {
+ XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
+ processor.write(endpoint, writer);
+ writer.flush();
+ writer.close();
+ return sw.toString();
+ } catch (Exception e) {
+ throw new IOException(e.getMessage());
+ }
+ }
+
+ public void read(EndpointReference endpointReference, String xml) throws IOException {
+ try {
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(xml));
+ EndpointReference result = refProcessor.read(reader);
+ reader.close();
+ endpointReference.setComponent(result.getComponent());
+ endpointReference.setReference(result.getReference());
+ endpointReference.setBinding(result.getBinding());
+ endpointReference.setInterfaceContract(result.getReference().getInterfaceContract());
+ } catch (Exception e) {
+ throw new IOException(e.getMessage());
+ }
+ }
+
+ public String write(EndpointReference endpointReference) throws IOException {
+ StringWriter sw = new StringWriter();
+ try {
+ XMLStreamWriter writer = outputFactory.createXMLStreamWriter(sw);
+ refProcessor.write(endpointReference, writer);
+ writer.flush();
+ writer.close();
+ return sw.toString();
+ } catch (Exception e) {
+ throw new IOException(e.getMessage());
+ }
+ }
} \ No newline at end of file
diff --git a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java
index f2ec7f8019..d37d62c5cd 100644
--- a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java
+++ b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointImpl.java
@@ -1,100 +1,100 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.assembly.impl;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-import org.apache.tuscany.sca.assembly.impl.EndpointImpl;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.core.assembly.EndpointSerializer;
-
-/**
- * Runtime model for Endpoint that supports java serialization
- */
-public class RuntimeEndpointImpl extends EndpointImpl implements Externalizable {
- private EndpointSerializer serializer;
- private String xml;
-
- /**
- * No-arg constructor for Java serilization
- */
- public RuntimeEndpointImpl() {
- super(null);
- }
-
- public RuntimeEndpointImpl(ExtensionPointRegistry registry) {
- super(registry);
- }
-
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- this.uri = in.readUTF();
- this.xml = in.readUTF();
- // Defer the loading to resolve();
- }
-
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeUTF(getURI());
- out.writeUTF(getSerializer().write(this));
- }
-
- private synchronized EndpointSerializer getSerializer() {
- if (serializer == null) {
- if (registry != null) {
- serializer =
- registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(EndpointSerializer.class);
- } else {
- throw new IllegalStateException("No extension registry is set");
- }
- }
- return serializer;
- }
-
- @Override
- protected void reset() {
- super.reset();
- this.xml = null;
- }
-
- @Override
- protected void resolve() {
- if (component == null && xml != null) {
- try {
- getSerializer().read(this, xml);
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
- }
- super.resolve();
- }
-
- @Override
- public void setExtensionPointRegistry(ExtensionPointRegistry registry) {
- if (this.registry != registry) {
- super.setExtensionPointRegistry(registry);
- serializer = null;
- }
- // resolve();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.core.assembly.impl;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import org.apache.tuscany.sca.assembly.impl.EndpointImpl;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.core.assembly.EndpointSerializer;
+
+/**
+ * Runtime model for Endpoint that supports java serialization
+ */
+public class RuntimeEndpointImpl extends EndpointImpl implements Externalizable {
+ private EndpointSerializer serializer;
+ private String xml;
+
+ /**
+ * No-arg constructor for Java serilization
+ */
+ public RuntimeEndpointImpl() {
+ super(null);
+ }
+
+ public RuntimeEndpointImpl(ExtensionPointRegistry registry) {
+ super(registry);
+ }
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ this.uri = in.readUTF();
+ this.xml = in.readUTF();
+ // Defer the loading to resolve();
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException {
+ out.writeUTF(getURI());
+ out.writeUTF(getSerializer().write(this));
+ }
+
+ private synchronized EndpointSerializer getSerializer() {
+ if (serializer == null) {
+ if (registry != null) {
+ serializer =
+ registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(EndpointSerializer.class);
+ } else {
+ throw new IllegalStateException("No extension registry is set");
+ }
+ }
+ return serializer;
+ }
+
+ @Override
+ protected void reset() {
+ super.reset();
+ this.xml = null;
+ }
+
+ @Override
+ protected void resolve() {
+ if (component == null && xml != null) {
+ try {
+ getSerializer().read(this, xml);
+ } catch (IOException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+ super.resolve();
+ }
+
+ @Override
+ public void setExtensionPointRegistry(ExtensionPointRegistry registry) {
+ if (this.registry != registry) {
+ super.setExtensionPointRegistry(registry);
+ serializer = null;
+ }
+ // resolve();
+ }
+
+}
diff --git a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java
index 36f49eac5e..5543ec1225 100644
--- a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java
+++ b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeEndpointReferenceImpl.java
@@ -1,100 +1,100 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.assembly.impl;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-import org.apache.tuscany.sca.assembly.impl.EndpointReferenceImpl;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.core.assembly.EndpointSerializer;
-
-/**
- * Runtime model for Endpoint that supports java serialization
- */
-public class RuntimeEndpointReferenceImpl extends EndpointReferenceImpl implements Externalizable {
- private EndpointSerializer serializer;
- private String xml;
-
- /**
- * No-arg constructor for Java serilization
- */
- public RuntimeEndpointReferenceImpl() {
- super(null);
- }
-
- public RuntimeEndpointReferenceImpl(ExtensionPointRegistry registry) {
- super(registry);
- }
-
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- this.uri = in.readUTF();
- this.xml = in.readUTF();
- // Defer the loading to resolve();
- }
-
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeUTF(getURI());
- out.writeUTF(getSerializer().write(this));
- }
-
- private synchronized EndpointSerializer getSerializer() {
- if (serializer == null) {
- if (registry != null) {
- serializer =
- registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(EndpointSerializer.class);
- } else {
- throw new IllegalStateException("No extension registry is set");
- }
- }
- return serializer;
- }
-
- @Override
- protected void reset() {
- super.reset();
- this.xml = null;
- }
-
- @Override
- protected void resolve() {
- if (component == null && xml != null) {
- try {
- getSerializer().read(this, xml);
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
- }
- super.resolve();
- }
-
- @Override
- public void setExtensionPointRegistry(ExtensionPointRegistry registry) {
- if (this.registry != registry) {
- super.setExtensionPointRegistry(registry);
- serializer = null;
- }
- // resolve();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.core.assembly.impl;
+
+import java.io.Externalizable;
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
+
+import org.apache.tuscany.sca.assembly.impl.EndpointReferenceImpl;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.core.assembly.EndpointSerializer;
+
+/**
+ * Runtime model for Endpoint that supports java serialization
+ */
+public class RuntimeEndpointReferenceImpl extends EndpointReferenceImpl implements Externalizable {
+ private EndpointSerializer serializer;
+ private String xml;
+
+ /**
+ * No-arg constructor for Java serilization
+ */
+ public RuntimeEndpointReferenceImpl() {
+ super(null);
+ }
+
+ public RuntimeEndpointReferenceImpl(ExtensionPointRegistry registry) {
+ super(registry);
+ }
+
+ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ this.uri = in.readUTF();
+ this.xml = in.readUTF();
+ // Defer the loading to resolve();
+ }
+
+ public void writeExternal(ObjectOutput out) throws IOException {
+ out.writeUTF(getURI());
+ out.writeUTF(getSerializer().write(this));
+ }
+
+ private synchronized EndpointSerializer getSerializer() {
+ if (serializer == null) {
+ if (registry != null) {
+ serializer =
+ registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(EndpointSerializer.class);
+ } else {
+ throw new IllegalStateException("No extension registry is set");
+ }
+ }
+ return serializer;
+ }
+
+ @Override
+ protected void reset() {
+ super.reset();
+ this.xml = null;
+ }
+
+ @Override
+ protected void resolve() {
+ if (component == null && xml != null) {
+ try {
+ getSerializer().read(this, xml);
+ } catch (IOException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+ super.resolve();
+ }
+
+ @Override
+ public void setExtensionPointRegistry(ExtensionPointRegistry registry) {
+ if (this.registry != registry) {
+ super.setExtensionPointRegistry(registry);
+ serializer = null;
+ }
+ // resolve();
+ }
+
+}
diff --git a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CachedProxy.java b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CachedProxy.java
index 8c8f001eb9..e2467d2e5c 100644
--- a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CachedProxy.java
+++ b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CachedProxy.java
@@ -1,70 +1,70 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Proxy;
-import java.util.WeakHashMap;
-
-public class CachedProxy extends Proxy {
- private static final long serialVersionUID = 783519311852563060L;
-
- protected CachedProxy(InvocationHandler handler) {
- super(handler);
- }
-
- // This is a cache containing the proxy class constructor for each business interface.
- // This improves performance compared to calling Proxy.newProxyInstance()
- // every time that a proxy is needed.
- private final static WeakHashMap<Class<?>, Constructor<?>> cache = new WeakHashMap<Class<?>, Constructor<?>>();
-
- public static Object newProxyInstance(ClassLoader classloader, Class<?> aclass[], InvocationHandler invocationhandler)
- throws IllegalArgumentException {
- try {
- if (invocationhandler == null)
- throw new NullPointerException();
- // Lookup cached constructor. aclass[0] is the reference's business interface.
- Constructor<?> proxyCTOR;
- synchronized (cache) {
- proxyCTOR = cache.get(aclass[0]);
- }
- if (proxyCTOR == null) {
- Class<?> proxyClass = getProxyClass(classloader, aclass);
- proxyCTOR = proxyClass.getConstructor(constructorParams);
- synchronized (cache) {
- cache.put(aclass[0], proxyCTOR);
- }
- }
- return proxyCTOR.newInstance(new Object[] {invocationhandler});
- } catch (NoSuchMethodException e) {
- throw new InternalError(e.toString());
- } catch (IllegalAccessException e) {
- throw new InternalError(e.toString());
- } catch (InstantiationException e) {
- throw new InternalError(e.toString());
- } catch (InvocationTargetException e) {
- throw new InternalError(e.toString());
- }
- }
-
- private static final Class<?> constructorParams[] = {InvocationHandler.class};
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.core.invocation;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Proxy;
+import java.util.WeakHashMap;
+
+public class CachedProxy extends Proxy {
+ private static final long serialVersionUID = 783519311852563060L;
+
+ protected CachedProxy(InvocationHandler handler) {
+ super(handler);
+ }
+
+ // This is a cache containing the proxy class constructor for each business interface.
+ // This improves performance compared to calling Proxy.newProxyInstance()
+ // every time that a proxy is needed.
+ private final static WeakHashMap<Class<?>, Constructor<?>> cache = new WeakHashMap<Class<?>, Constructor<?>>();
+
+ public static Object newProxyInstance(ClassLoader classloader, Class<?> aclass[], InvocationHandler invocationhandler)
+ throws IllegalArgumentException {
+ try {
+ if (invocationhandler == null)
+ throw new NullPointerException();
+ // Lookup cached constructor. aclass[0] is the reference's business interface.
+ Constructor<?> proxyCTOR;
+ synchronized (cache) {
+ proxyCTOR = cache.get(aclass[0]);
+ }
+ if (proxyCTOR == null) {
+ Class<?> proxyClass = getProxyClass(classloader, aclass);
+ proxyCTOR = proxyClass.getConstructor(constructorParams);
+ synchronized (cache) {
+ cache.put(aclass[0], proxyCTOR);
+ }
+ }
+ return proxyCTOR.newInstance(new Object[] {invocationhandler});
+ } catch (NoSuchMethodException e) {
+ throw new InternalError(e.toString());
+ } catch (IllegalAccessException e) {
+ throw new InternalError(e.toString());
+ } catch (InstantiationException e) {
+ throw new InternalError(e.toString());
+ } catch (InvocationTargetException e) {
+ throw new InternalError(e.toString());
+ }
+ }
+
+ private static final Class<?> constructorParams[] = {InvocationHandler.class};
+
+}
diff --git a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackReferenceObjectFactory.java b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackReferenceObjectFactory.java
index 2ca94a659d..866e62abde 100644
--- a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackReferenceObjectFactory.java
+++ b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/CallbackReferenceObjectFactory.java
@@ -1,49 +1,49 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.core.invocation;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.core.context.impl.ServiceReferenceImpl;
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.runtime.RuntimeWire;
-import org.oasisopen.sca.ServiceReference;
-
-/**
- * Uses a wire to return a CallableReference
- *
- * @version $Rev: 574648 $ $Date: 2007-09-11 18:45:36 +0100 (Tue, 11 Sep 2007) $
- */
-public class CallbackReferenceObjectFactory implements ObjectFactory<ServiceReference<?>> {
- private Class<?> businessInterface;
- private ProxyFactory proxyFactory;
- private List<RuntimeWire> wires;
-
- public CallbackReferenceObjectFactory(Class<?> interfaze, ProxyFactory proxyFactory, List<RuntimeWire> wires) {
- this.businessInterface = interfaze;
- this.proxyFactory = proxyFactory;
- this.wires = wires;
- }
-
- public ServiceReference<?> getInstance() throws ObjectCreationException {
- return new ServiceReferenceImpl(businessInterface, wires.get(0), proxyFactory);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.core.invocation;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.core.context.impl.ServiceReferenceImpl;
+import org.apache.tuscany.sca.core.factory.ObjectCreationException;
+import org.apache.tuscany.sca.core.factory.ObjectFactory;
+import org.apache.tuscany.sca.runtime.RuntimeWire;
+import org.oasisopen.sca.ServiceReference;
+
+/**
+ * Uses a wire to return a CallableReference
+ *
+ * @version $Rev$ $Date$
+ */
+public class CallbackReferenceObjectFactory implements ObjectFactory<ServiceReference<?>> {
+ private Class<?> businessInterface;
+ private ProxyFactory proxyFactory;
+ private List<RuntimeWire> wires;
+
+ public CallbackReferenceObjectFactory(Class<?> interfaze, ProxyFactory proxyFactory, List<RuntimeWire> wires) {
+ this.businessInterface = interfaze;
+ this.proxyFactory = proxyFactory;
+ this.wires = wires;
+ }
+
+ public ServiceReference<?> getInstance() throws ObjectCreationException {
+ return new ServiceReferenceImpl(businessInterface, wires.get(0), proxyFactory);
+ }
+
+}
diff --git a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkListener.java b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkListener.java
index facb2dfe56..38bbaeebe0 100644
--- a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkListener.java
+++ b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/work/impl/WorkListener.java
@@ -1,32 +1,32 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core.work.impl;
-
-public interface WorkListener {
-
- long IMMEDIATE = 0;
- long INDEFINITE = java.lang.Long.MAX_VALUE;
-
- void workAccepted(WorkEvent event);
- void workCompleted(WorkEvent event);
- void workRejected(WorkEvent event);
- void workStarted(WorkEvent event);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.core.work.impl;
+
+public interface WorkListener {
+
+ long IMMEDIATE = 0;
+ long INDEFINITE = java.lang.Long.MAX_VALUE;
+
+ void workAccepted(WorkEvent event);
+ void workCompleted(WorkEvent event);
+ void workRejected(WorkEvent event);
+ void workStarted(WorkEvent event);
+
+}
diff --git a/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java b/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java
index 142229f4f6..a2e6abbf19 100644
--- a/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java
+++ b/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomDataBinding.java
@@ -1,62 +1,62 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.axiom;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.databinding.WrapperHandler;
-import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-
-/**
- * DataBinding for AXIOM
- *
- * @version $Rev$ $Date$
- */
-public class AxiomDataBinding extends BaseDataBinding {
-
- public static final String NAME = OMElement.class.getName();
-
- public AxiomDataBinding() {
- super(NAME, OMElement.class);
- }
-
- /**
- * @see org.apache.tuscany.sca.databinding.impl.BaseDataBinding#getWrapperHandler()
- */
- @Override
- public WrapperHandler getWrapperHandler() {
- return new OMElementWrapperHandler();
- }
-
- @Override
- public Object copy(Object source, DataType dataType, Operation operation) {
- 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, dataType, operation);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.databinding.axiom;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.tuscany.sca.databinding.WrapperHandler;
+import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
+import org.apache.tuscany.sca.interfacedef.DataType;
+import org.apache.tuscany.sca.interfacedef.Operation;
+
+/**
+ * DataBinding for AXIOM
+ *
+ * @version $Rev$ $Date$
+ */
+public class AxiomDataBinding extends BaseDataBinding {
+
+ public static final String NAME = OMElement.class.getName();
+
+ public AxiomDataBinding() {
+ super(NAME, OMElement.class);
+ }
+
+ /**
+ * @see org.apache.tuscany.sca.databinding.impl.BaseDataBinding#getWrapperHandler()
+ */
+ @Override
+ public WrapperHandler getWrapperHandler() {
+ return new OMElementWrapperHandler();
+ }
+
+ @Override
+ public Object copy(Object source, DataType dataType, Operation operation) {
+ 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, dataType, operation);
+ }
+
+}
diff --git a/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Exception2OMElement.java b/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Exception2OMElement.java
index 429a6dbe5d..f44297edb7 100644
--- a/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Exception2OMElement.java
+++ b/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Exception2OMElement.java
@@ -1,95 +1,95 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.axiom;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMAttribute;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.javabeans.Java2XMLMapperException;
-import org.apache.tuscany.sca.databinding.javabeans.JavaBean2XMLTransformer;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class Exception2OMElement extends JavaBean2XMLTransformer<OMElement> {
-
- public static final String GETCAUSE = "getCause";
- public static final String GETLOCALIZEDMESSAGE = "getLocalizedMessage";
- public static final String GETSTACKTRACE = "getStackTrace";
- public static final String GETCLASS = "getClass";
-
- private OMFactory factory;
-
- public Exception2OMElement() {
- super();
- factory = OMAbstractFactory.getOMFactory();
- }
-
- @Override
- public OMElement transform(Object source, TransformationContext context) {
- OMElement element = super.transform(source, context);
- AxiomHelper.adjustElementName(context, element);
- return element;
- }
-
- @Override
- protected boolean isMappedGetter(String methodName) {
- if (GETCAUSE.equals(methodName)
- || GETLOCALIZEDMESSAGE.equals(methodName)
- || GETSTACKTRACE.equals(methodName)
- || GETCLASS.equals(methodName)) {
- return false;
- } else {
- return true;
- }
- }
-
- @Override
- public void appendChild(OMElement parentElement, OMElement childElement) throws Java2XMLMapperException {
- parentElement.addChild(childElement);
- }
-
- @Override
- public OMElement createElement(QName qName) throws Java2XMLMapperException {
- return factory.createOMElement(qName);
- }
-
- @Override
- public void appendText(OMElement parentElement, String textData) throws Java2XMLMapperException {
- if (textData == null) {
- OMNamespace xsi = factory.createOMNamespace("http://www.w3.org/2001/XMLSchema-instance", "xsi");
- OMAttribute nil = factory.createOMAttribute("nil", xsi, "true");
- parentElement.addAttribute(nil);
- } else {
- factory.createOMText(parentElement, textData);
- }
- }
-
- @Override
- public Class getTargetType() {
- return OMElement.class;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.databinding.axiom;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.tuscany.sca.databinding.TransformationContext;
+import org.apache.tuscany.sca.databinding.javabeans.Java2XMLMapperException;
+import org.apache.tuscany.sca.databinding.javabeans.JavaBean2XMLTransformer;
+
+/**
+ *
+ * @version $Rev$ $Date$
+ */
+public class Exception2OMElement extends JavaBean2XMLTransformer<OMElement> {
+
+ public static final String GETCAUSE = "getCause";
+ public static final String GETLOCALIZEDMESSAGE = "getLocalizedMessage";
+ public static final String GETSTACKTRACE = "getStackTrace";
+ public static final String GETCLASS = "getClass";
+
+ private OMFactory factory;
+
+ public Exception2OMElement() {
+ super();
+ factory = OMAbstractFactory.getOMFactory();
+ }
+
+ @Override
+ public OMElement transform(Object source, TransformationContext context) {
+ OMElement element = super.transform(source, context);
+ AxiomHelper.adjustElementName(context, element);
+ return element;
+ }
+
+ @Override
+ protected boolean isMappedGetter(String methodName) {
+ if (GETCAUSE.equals(methodName)
+ || GETLOCALIZEDMESSAGE.equals(methodName)
+ || GETSTACKTRACE.equals(methodName)
+ || GETCLASS.equals(methodName)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ @Override
+ public void appendChild(OMElement parentElement, OMElement childElement) throws Java2XMLMapperException {
+ parentElement.addChild(childElement);
+ }
+
+ @Override
+ public OMElement createElement(QName qName) throws Java2XMLMapperException {
+ return factory.createOMElement(qName);
+ }
+
+ @Override
+ public void appendText(OMElement parentElement, String textData) throws Java2XMLMapperException {
+ if (textData == null) {
+ OMNamespace xsi = factory.createOMNamespace("http://www.w3.org/2001/XMLSchema-instance", "xsi");
+ OMAttribute nil = factory.createOMAttribute("nil", xsi, "true");
+ parentElement.addAttribute(nil);
+ } else {
+ factory.createOMText(parentElement, textData);
+ }
+ }
+
+ @Override
+ public Class getTargetType() {
+ return OMElement.class;
+ }
+
+}
diff --git a/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Externalizable2OMElement.java b/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Externalizable2OMElement.java
index e23d89327c..d2a7f861e8 100644
--- a/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Externalizable2OMElement.java
+++ b/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/Externalizable2OMElement.java
@@ -1,77 +1,77 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.axiom;
-
-import java.io.ByteArrayOutputStream;
-import java.io.Externalizable;
-import java.io.ObjectOutputStream;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.databinding.impl.XSDDataTypeConverter.Base64Binary;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class Externalizable2OMElement extends BaseTransformer<Externalizable, OMElement> implements
- PullTransformer<Externalizable, OMElement> {
-
- @Override
- protected Class<Externalizable> getSourceType() {
- return Externalizable.class;
- }
-
- @Override
- protected Class<OMElement> getTargetType() {
- return OMElement.class;
- }
-
- public OMElement transform(Externalizable source, TransformationContext context) {
- OMElement element = null;
-
- try {
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- ObjectOutputStream out = new ObjectOutputStream(bos);
- out.writeObject(source);
- out.close();
- OMFactory factory = OMAbstractFactory.getOMFactory();
- OMNamespace ns = AxiomHelper.createOMNamespace(factory, new QName("http://callable"));
- element = factory.createOMElement("reference",ns);
- element.setText(Base64Binary.encode(bos.toByteArray()));
- return element;
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- public int getWeight() {
- return 10;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.databinding.axiom;
+
+import java.io.ByteArrayOutputStream;
+import java.io.Externalizable;
+import java.io.ObjectOutputStream;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.tuscany.sca.databinding.PullTransformer;
+import org.apache.tuscany.sca.databinding.TransformationContext;
+import org.apache.tuscany.sca.databinding.TransformationException;
+import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
+import org.apache.tuscany.sca.databinding.impl.XSDDataTypeConverter.Base64Binary;
+
+/**
+ *
+ * @version $Rev$ $Date$
+ */
+public class Externalizable2OMElement extends BaseTransformer<Externalizable, OMElement> implements
+ PullTransformer<Externalizable, OMElement> {
+
+ @Override
+ protected Class<Externalizable> getSourceType() {
+ return Externalizable.class;
+ }
+
+ @Override
+ protected Class<OMElement> getTargetType() {
+ return OMElement.class;
+ }
+
+ public OMElement transform(Externalizable source, TransformationContext context) {
+ OMElement element = null;
+
+ try {
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bos);
+ out.writeObject(source);
+ out.close();
+ OMFactory factory = OMAbstractFactory.getOMFactory();
+ OMNamespace ns = AxiomHelper.createOMNamespace(factory, new QName("http://callable"));
+ element = factory.createOMElement("reference",ns);
+ element.setText(Base64Binary.encode(bos.toByteArray()));
+ return element;
+ } catch (Exception e) {
+ throw new TransformationException(e);
+ }
+ }
+
+ @Override
+ public int getWeight() {
+ return 10;
+ }
+
+}
diff --git a/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Exception.java b/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Exception.java
index 3dc73c89cb..947cd99a19 100644
--- a/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Exception.java
+++ b/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Exception.java
@@ -1,79 +1,79 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.axiom;
-
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMNode;
-import org.apache.axiom.om.OMText;
-import org.apache.tuscany.sca.databinding.javabeans.XML2JavaBeanTransformer;
-import org.apache.tuscany.sca.databinding.javabeans.XML2JavaMapperException;
-
-/**
- * Transformer to convert data from an OMElement to a Java Exception
- *
- * @version $Rev$ $Date$
- */
-public class OMElement2Exception extends XML2JavaBeanTransformer<OMElement> {
-
- @Override
- public OMElement getRootElement(OMElement element) throws XML2JavaMapperException {
- return element;
- }
-
- @Override
- public Iterator<OMElement> getChildElements(OMElement parent) throws XML2JavaMapperException {
- return parent.getChildElements();
- }
-
- @Override
- public String getElementName(OMElement element) throws XML2JavaMapperException {
- return element.getLocalName();
- }
-
- @Override
- public String getText(OMElement element) throws XML2JavaMapperException {
- return element.getText();
- }
-
- @Override
- public boolean isTextElement(OMElement element) throws XML2JavaMapperException {
- return false;
- }
-
- @Override
- public boolean isTextOnly(OMElement element) throws XML2JavaMapperException {
- OMNode firstChild = element.getFirstOMChild();
- return firstChild instanceof OMText && firstChild.getNextOMSibling() == null;
- }
-
- @Override
- public OMElement getFirstChildWithName(OMElement element, QName name) throws XML2JavaMapperException {
- return element.getFirstChildWithName(name);
- }
-
- @Override
- public Class getSourceType() {
- return OMElement.class;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.databinding.axiom;
+
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMNode;
+import org.apache.axiom.om.OMText;
+import org.apache.tuscany.sca.databinding.javabeans.XML2JavaBeanTransformer;
+import org.apache.tuscany.sca.databinding.javabeans.XML2JavaMapperException;
+
+/**
+ * Transformer to convert data from an OMElement to a Java Exception
+ *
+ * @version $Rev$ $Date$
+ */
+public class OMElement2Exception extends XML2JavaBeanTransformer<OMElement> {
+
+ @Override
+ public OMElement getRootElement(OMElement element) throws XML2JavaMapperException {
+ return element;
+ }
+
+ @Override
+ public Iterator<OMElement> getChildElements(OMElement parent) throws XML2JavaMapperException {
+ return parent.getChildElements();
+ }
+
+ @Override
+ public String getElementName(OMElement element) throws XML2JavaMapperException {
+ return element.getLocalName();
+ }
+
+ @Override
+ public String getText(OMElement element) throws XML2JavaMapperException {
+ return element.getText();
+ }
+
+ @Override
+ public boolean isTextElement(OMElement element) throws XML2JavaMapperException {
+ return false;
+ }
+
+ @Override
+ public boolean isTextOnly(OMElement element) throws XML2JavaMapperException {
+ OMNode firstChild = element.getFirstOMChild();
+ return firstChild instanceof OMText && firstChild.getNextOMSibling() == null;
+ }
+
+ @Override
+ public OMElement getFirstChildWithName(OMElement element, QName name) throws XML2JavaMapperException {
+ return element.getFirstChildWithName(name);
+ }
+
+ @Override
+ public Class getSourceType() {
+ return OMElement.class;
+ }
+
+}
diff --git a/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Externalizable.java b/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Externalizable.java
index ef7359fbcd..6d8d4dce99 100644
--- a/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Externalizable.java
+++ b/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/OMElement2Externalizable.java
@@ -1,69 +1,69 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.axiom;
-
-import java.io.ByteArrayInputStream;
-import java.io.Externalizable;
-import java.io.ObjectInputStream;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.TransformationException;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.databinding.impl.XSDDataTypeConverter.Base64Binary;
-
-/**
- * Transformer to convert data from an OMElement to XML String
- *
- * @version $Rev$ $Date$
- */
-public class OMElement2Externalizable extends BaseTransformer<OMElement, Externalizable> implements PullTransformer<OMElement, Externalizable> {
- // private XmlOptions options;
-
- public Externalizable transform(OMElement source, TransformationContext context) {
- try {
- String value = source.getText();
- ByteArrayInputStream bis = new ByteArrayInputStream(Base64Binary.decode(value));
- ObjectInputStream ois = new ObjectInputStream(bis);
- Object obj = ois.readObject();
- ois.close();
- Externalizable aReference = (Externalizable) obj;
- return aReference;
- } catch (Exception e) {
- throw new TransformationException(e);
- }
- }
-
- @Override
- protected Class<OMElement> getSourceType() {
- return OMElement.class;
- }
-
- @Override
- protected Class<Externalizable> getTargetType() {
- return Externalizable.class;
- }
-
- @Override
- public int getWeight() {
- return 10;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.databinding.axiom;
+
+import java.io.ByteArrayInputStream;
+import java.io.Externalizable;
+import java.io.ObjectInputStream;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.tuscany.sca.databinding.PullTransformer;
+import org.apache.tuscany.sca.databinding.TransformationContext;
+import org.apache.tuscany.sca.databinding.TransformationException;
+import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
+import org.apache.tuscany.sca.databinding.impl.XSDDataTypeConverter.Base64Binary;
+
+/**
+ * Transformer to convert data from an OMElement to XML String
+ *
+ * @version $Rev$ $Date$
+ */
+public class OMElement2Externalizable extends BaseTransformer<OMElement, Externalizable> implements PullTransformer<OMElement, Externalizable> {
+ // private XmlOptions options;
+
+ public Externalizable transform(OMElement source, TransformationContext context) {
+ try {
+ String value = source.getText();
+ ByteArrayInputStream bis = new ByteArrayInputStream(Base64Binary.decode(value));
+ ObjectInputStream ois = new ObjectInputStream(bis);
+ Object obj = ois.readObject();
+ ois.close();
+ Externalizable aReference = (Externalizable) obj;
+ return aReference;
+ } catch (Exception e) {
+ throw new TransformationException(e);
+ }
+ }
+
+ @Override
+ protected Class<OMElement> getSourceType() {
+ return OMElement.class;
+ }
+
+ @Override
+ protected Class<Externalizable> getTargetType() {
+ return Externalizable.class;
+ }
+
+ @Override
+ public int getWeight() {
+ return 10;
+ }
+
+}
diff --git a/java/sca/modules/databinding-axiom/src/test/resources/order.wsdl b/java/sca/modules/databinding-axiom/src/test/resources/order.wsdl
index a5ead60382..913d9e4928 100644
--- a/java/sca/modules/databinding-axiom/src/test/resources/order.wsdl
+++ b/java/sca/modules/databinding-axiom/src/test/resources/order.wsdl
@@ -1,76 +1,76 @@
-<?xml version="1.0"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<definitions name="StockQuote" targetNamespace="http://example.com/order.wsdl" xmlns:tns="http://example.com/order.wsdl"
- xmlns:xsd1="http://example.com/order.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
- <schema targetNamespace="http://example.com/order.xsd" xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ipo="http://www.example.com/IPO">
- <import namespace="http://www.example.com/IPO" schemaLocation="ipo.xsd"/>
- <element name="checkOrderStatus">
- <complexType>
- <sequence>
- <element name="customerId" type="string" />
- <element name="order" type="ipo:PurchaseOrderType" />
- <element name="flag" type="int" />
- </sequence>
- </complexType>
- </element>
- <element name="checkOrderStatusResponse">
- <complexType>
- <sequence>
- <element name="status" type="string" />
- </sequence>
- </complexType>
- </element>
- <element name="note" type="string" />
- </schema>
- </types>
-
- <message name="CheckOrderStatusInput1">
- <part name="body" element="xsd1:checkOrderStatus" />
- </message>
-
- <message name="CheckOrderStatusOutput1">
- <part name="body" element="xsd1:checkOrderStatusResponse" />
- </message>
-
- <message name="CheckOrderStatusInput2">
- <part name="p1" element="xsd1:checkOrderStatus" />
- <part name="p2" element="xsd1:note" />
- </message>
-
- <message name="CheckOrderStatusOutput2">
- <part name="p1" element="xsd1:checkOrderStatusResponse" />
- </message>
-
- <portType name="OrderPortType">
- <operation name="checkOrderStatus">
- <input message="tns:CheckOrderStatusInput1" />
- <output message="tns:CheckOrderStatusOutput1" />
- </operation>
- <operation name="checkOrderStatus2">
- <input message="tns:CheckOrderStatusInput2" />
- <output message="tns:CheckOrderStatusOutput2" />
- </operation>
- </portType>
-
+<?xml version="1.0"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<definitions name="StockQuote" targetNamespace="http://example.com/order.wsdl" xmlns:tns="http://example.com/order.wsdl"
+ xmlns:xsd1="http://example.com/order.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema targetNamespace="http://example.com/order.xsd" xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ipo="http://www.example.com/IPO">
+ <import namespace="http://www.example.com/IPO" schemaLocation="ipo.xsd"/>
+ <element name="checkOrderStatus">
+ <complexType>
+ <sequence>
+ <element name="customerId" type="string" />
+ <element name="order" type="ipo:PurchaseOrderType" />
+ <element name="flag" type="int" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="checkOrderStatusResponse">
+ <complexType>
+ <sequence>
+ <element name="status" type="string" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="note" type="string" />
+ </schema>
+ </types>
+
+ <message name="CheckOrderStatusInput1">
+ <part name="body" element="xsd1:checkOrderStatus" />
+ </message>
+
+ <message name="CheckOrderStatusOutput1">
+ <part name="body" element="xsd1:checkOrderStatusResponse" />
+ </message>
+
+ <message name="CheckOrderStatusInput2">
+ <part name="p1" element="xsd1:checkOrderStatus" />
+ <part name="p2" element="xsd1:note" />
+ </message>
+
+ <message name="CheckOrderStatusOutput2">
+ <part name="p1" element="xsd1:checkOrderStatusResponse" />
+ </message>
+
+ <portType name="OrderPortType">
+ <operation name="checkOrderStatus">
+ <input message="tns:CheckOrderStatusInput1" />
+ <output message="tns:CheckOrderStatusOutput1" />
+ </operation>
+ <operation name="checkOrderStatus2">
+ <input message="tns:CheckOrderStatusInput2" />
+ <output message="tns:CheckOrderStatusOutput2" />
+ </operation>
+ </portType>
+
</definitions> \ No newline at end of file
diff --git a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/externalizable/ExternalizableDataBinding.java b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/externalizable/ExternalizableDataBinding.java
index 6f3456fdf0..51ca792171 100644
--- a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/externalizable/ExternalizableDataBinding.java
+++ b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/externalizable/ExternalizableDataBinding.java
@@ -1,39 +1,39 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.externalizable;
-
-import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
-
-/**
- * DataNinding for Externalizable objects.
- *
- * @version $Rev$ $Date$
- */
-public class ExternalizableDataBinding extends BaseDataBinding {
-
- public static final String NAME = java.io.Externalizable.class.getName();
-
- public ExternalizableDataBinding() {
- super(NAME, java.io.Externalizable.class);
- }
-
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.databinding.externalizable;
+
+import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
+
+/**
+ * DataNinding for Externalizable objects.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ExternalizableDataBinding extends BaseDataBinding {
+
+ public static final String NAME = java.io.Externalizable.class.getName();
+
+ public ExternalizableDataBinding() {
+ super(NAME, java.io.Externalizable.class);
+ }
+
+
+
+}
diff --git a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/DOMNode2JavaBeanTransformer.java b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/DOMNode2JavaBeanTransformer.java
index f86d1b29e0..fbca9b0444 100644
--- a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/DOMNode2JavaBeanTransformer.java
+++ b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/DOMNode2JavaBeanTransformer.java
@@ -1,98 +1,98 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.javabeans;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Transformer to convert data from DOM Node to JavaBean
- *
- * @version $Rev$ $Date$
- */
-public class DOMNode2JavaBeanTransformer extends XML2JavaBeanTransformer<Node> {
-
- @Override
- public Node getRootElement(Node element) throws XML2JavaMapperException {
- if (element instanceof Document) {
- return ((Document)element).getDocumentElement();
- } else {
- return element;
- }
-
- }
-
- @Override
- public Iterator<Node> getChildElements(Node parent) throws XML2JavaMapperException {
- NodeList nodeList = parent.getChildNodes();
- List<Node> nodeArrayList = new ArrayList<Node>(nodeList.getLength());
- for (int count = 0; count < nodeList.getLength(); ++count) {
- nodeArrayList.add(nodeList.item(count));
- }
-
- return nodeArrayList.iterator();
- }
-
- @Override
- public String getElementName(Node element) throws XML2JavaMapperException {
- return element.getLocalName();
- }
-
- @Override
- public String getText(Node element) throws XML2JavaMapperException {
- if (element instanceof Document) {
- element = ((Document)element).getDocumentElement();
- }
- return element.getTextContent();
- }
-
- @Override
- public boolean isTextElement(Node element) throws XML2JavaMapperException {
- return element.getNodeType() == Node.TEXT_NODE;
- }
-
- @Override
- public boolean isTextOnly(Node element) throws XML2JavaMapperException {
- NodeList childNodes = element.getChildNodes();
- return childNodes.getLength() == 1 && isTextElement(childNodes.item(0));
- }
-
- @Override
- public Node getFirstChildWithName(Node element, QName name) throws XML2JavaMapperException {
- Node child;
- for (child = element.getFirstChild();
- child != null && !(child.getNodeName() == name.getLocalPart()
- && child.getNamespaceURI() == name.getNamespaceURI()) ;
- child = child.getNextSibling()) {
- }
- return child;
- }
-
- @Override
- public Class getSourceType() {
- return Node.class;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.databinding.javabeans;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Transformer to convert data from DOM Node to JavaBean
+ *
+ * @version $Rev$ $Date$
+ */
+public class DOMNode2JavaBeanTransformer extends XML2JavaBeanTransformer<Node> {
+
+ @Override
+ public Node getRootElement(Node element) throws XML2JavaMapperException {
+ if (element instanceof Document) {
+ return ((Document)element).getDocumentElement();
+ } else {
+ return element;
+ }
+
+ }
+
+ @Override
+ public Iterator<Node> getChildElements(Node parent) throws XML2JavaMapperException {
+ NodeList nodeList = parent.getChildNodes();
+ List<Node> nodeArrayList = new ArrayList<Node>(nodeList.getLength());
+ for (int count = 0; count < nodeList.getLength(); ++count) {
+ nodeArrayList.add(nodeList.item(count));
+ }
+
+ return nodeArrayList.iterator();
+ }
+
+ @Override
+ public String getElementName(Node element) throws XML2JavaMapperException {
+ return element.getLocalName();
+ }
+
+ @Override
+ public String getText(Node element) throws XML2JavaMapperException {
+ if (element instanceof Document) {
+ element = ((Document)element).getDocumentElement();
+ }
+ return element.getTextContent();
+ }
+
+ @Override
+ public boolean isTextElement(Node element) throws XML2JavaMapperException {
+ return element.getNodeType() == Node.TEXT_NODE;
+ }
+
+ @Override
+ public boolean isTextOnly(Node element) throws XML2JavaMapperException {
+ NodeList childNodes = element.getChildNodes();
+ return childNodes.getLength() == 1 && isTextElement(childNodes.item(0));
+ }
+
+ @Override
+ public Node getFirstChildWithName(Node element, QName name) throws XML2JavaMapperException {
+ Node child;
+ for (child = element.getFirstChild();
+ child != null && !(child.getNodeName() == name.getLocalPart()
+ && child.getNamespaceURI() == name.getNamespaceURI()) ;
+ child = child.getNextSibling()) {
+ }
+ return child;
+ }
+
+ @Override
+ public Class getSourceType() {
+ return Node.class;
+ }
+}
diff --git a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/Java2XMLMapperException.java b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/Java2XMLMapperException.java
index 9615f43572..5dc13bd60b 100644
--- a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/Java2XMLMapperException.java
+++ b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/Java2XMLMapperException.java
@@ -1,69 +1,69 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.javabeans;
-
-import javax.xml.namespace.QName;
-
-/**
- * This exception is used to encapsulate and rethrow exceptions that arise out
- * of converting JavaBean objects to XML
- *
- * @version $Rev$ $Date$
- */
-public class Java2XMLMapperException extends RuntimeException {
- private static final long serialVersionUID = 6811924384399578686L;
-
- private QName xmlElementName;
- private String javaFieldName;
- private Class javaType;
-
- public Java2XMLMapperException(String message) {
- super(message);
- }
-
- public Java2XMLMapperException(Throwable cause) {
- super(cause);
- }
-
- public String getJavaFieldName() {
- return javaFieldName;
- }
-
- public void setJavaFieldName(String javaFieldName) {
- this.javaFieldName = javaFieldName;
- }
-
- public Class getJavaType() {
- return javaType;
- }
-
- public void setJavaType(Class javaType) {
- this.javaType = javaType;
- }
-
- public QName getXmlElementName() {
- return xmlElementName;
- }
-
- public void setXmlElementName(QName xmlElementName) {
- this.xmlElementName = xmlElementName;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.databinding.javabeans;
+
+import javax.xml.namespace.QName;
+
+/**
+ * This exception is used to encapsulate and rethrow exceptions that arise out
+ * of converting JavaBean objects to XML
+ *
+ * @version $Rev$ $Date$
+ */
+public class Java2XMLMapperException extends RuntimeException {
+ private static final long serialVersionUID = 6811924384399578686L;
+
+ private QName xmlElementName;
+ private String javaFieldName;
+ private Class javaType;
+
+ public Java2XMLMapperException(String message) {
+ super(message);
+ }
+
+ public Java2XMLMapperException(Throwable cause) {
+ super(cause);
+ }
+
+ public String getJavaFieldName() {
+ return javaFieldName;
+ }
+
+ public void setJavaFieldName(String javaFieldName) {
+ this.javaFieldName = javaFieldName;
+ }
+
+ public Class getJavaType() {
+ return javaType;
+ }
+
+ public void setJavaType(Class javaType) {
+ this.javaType = javaType;
+ }
+
+ public QName getXmlElementName() {
+ return xmlElementName;
+ }
+
+ public void setXmlElementName(QName xmlElementName) {
+ this.xmlElementName = xmlElementName;
+ }
+
+}
diff --git a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2DOMNodeTransformer.java b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2DOMNodeTransformer.java
index 58f594751a..b29fdf4c55 100644
--- a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2DOMNodeTransformer.java
+++ b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2DOMNodeTransformer.java
@@ -1,79 +1,79 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.javabeans;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.tuscany.sca.databinding.impl.DOMHelper;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Transformer to convert data from a JavaBean object to DOM Node
- *
- * @version $Rev$ $Date$
- */
-public class JavaBean2DOMNodeTransformer extends JavaBean2XMLTransformer<Node> {
-
- public static final String COLON = ":";
- private Document factory;
-
- public JavaBean2DOMNodeTransformer() {
- super();
- try {
- factory = DOMHelper.newDocument();
- } catch (ParserConfigurationException e) {
- throw new Java2XMLMapperException(e);
- }
- }
-
- @Override
- public void appendChild(Node parentElement, Node childElement) throws Java2XMLMapperException {
- parentElement.appendChild(childElement);
- }
-
- @Override
- public Node createElement(QName qName) throws Java2XMLMapperException {
- String qualifedName =
- (qName.getPrefix() == null || qName.getPrefix().length() <= 0) ? qName.getLocalPart()
- : qName.getPrefix() + COLON + qName.getLocalPart();
- return factory.createElementNS(qName.getNamespaceURI(), qualifedName);
- }
-
- @Override
- public void appendText(Node parentElement, String textData) throws Java2XMLMapperException {
- Node textNode;
- if (textData != null) {
- textNode = factory.createTextNode(textData);
- } else {
- Attr nil = factory.createAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:nil");
- nil.setValue("true");
- textNode = nil;
- }
- appendChild(parentElement, textNode);
- }
-
- @Override
- public Class getTargetType() {
- return Node.class;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.databinding.javabeans;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.tuscany.sca.databinding.impl.DOMHelper;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+/**
+ * Transformer to convert data from a JavaBean object to DOM Node
+ *
+ * @version $Rev$ $Date$
+ */
+public class JavaBean2DOMNodeTransformer extends JavaBean2XMLTransformer<Node> {
+
+ public static final String COLON = ":";
+ private Document factory;
+
+ public JavaBean2DOMNodeTransformer() {
+ super();
+ try {
+ factory = DOMHelper.newDocument();
+ } catch (ParserConfigurationException e) {
+ throw new Java2XMLMapperException(e);
+ }
+ }
+
+ @Override
+ public void appendChild(Node parentElement, Node childElement) throws Java2XMLMapperException {
+ parentElement.appendChild(childElement);
+ }
+
+ @Override
+ public Node createElement(QName qName) throws Java2XMLMapperException {
+ String qualifedName =
+ (qName.getPrefix() == null || qName.getPrefix().length() <= 0) ? qName.getLocalPart()
+ : qName.getPrefix() + COLON + qName.getLocalPart();
+ return factory.createElementNS(qName.getNamespaceURI(), qualifedName);
+ }
+
+ @Override
+ public void appendText(Node parentElement, String textData) throws Java2XMLMapperException {
+ Node textNode;
+ if (textData != null) {
+ textNode = factory.createTextNode(textData);
+ } else {
+ Attr nil = factory.createAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:nil");
+ nil.setValue("true");
+ textNode = nil;
+ }
+ appendChild(parentElement, textNode);
+ }
+
+ @Override
+ public Class getTargetType() {
+ return Node.class;
+ }
+
+}
diff --git a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLTransformer.java b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLTransformer.java
index b96b394bb8..b94b944a98 100644
--- a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLTransformer.java
+++ b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBean2XMLTransformer.java
@@ -1,262 +1,262 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.javabeans;
-
-import java.lang.reflect.Array;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Date;
-import java.util.GregorianCalendar;
-
-import javax.xml.datatype.XMLGregorianCalendar;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- * Transformer to convert data from a JavaBean object to xml
- *
- * @version $Rev$ $Date$
- */
-public abstract class JavaBean2XMLTransformer<T> extends BaseTransformer<Object, T> implements
- PullTransformer<Object, T> {
-
- public static final String GET = "get";
- public static final String PREFIX = "n";
- public static final String PERIOD = ".";
- public static final String FWD_SLASH = "/";
- public static final String HTTP = "http://";
- private static int prefixCount = 1;
-
- protected SimpleTypeMapperImpl mapper;
-
- public JavaBean2XMLTransformer() {
- this.mapper = new SimpleTypeMapperImpl();
- }
-
- public T transform(Object source, TransformationContext context) {
- QName rootElement = null;
- if (context != null) {
- DataType<?> type = context.getTargetDataType();
- if (type != null) {
- Object logical = type.getLogical();
- if (logical instanceof XMLType) {
- rootElement = ((XMLType)logical).getElementName();
- }
- }
- }
- //FIXME See how/if we still need to get the metadata here
- //QName rootElementName = (QName)context.getTargetDataType().getMetadata("RootElementName");
- //if (rootElementName == null) {
- QName rootElementName = new QName(resolveRootElementName(source.getClass()));
- //}
-
- T root = createElement(rootElementName);
- appendChildElements(root, resolveElementName(source.getClass()), source.getClass(), source, context);
- return root;
- }
-
- private void appendChildElements(T parent,
- QName elementName,
- Class javaType,
- Object javaObject,
- TransformationContext context) {
- T element = null;
- if (javaObject != null) {
- if (javaType.isPrimitive() || isSimpleJavaType(javaObject)) {
- appendText(parent, mapper.toXMLLiteral(null, javaObject, context));
- } else if (javaType.isArray()) {
- int size = Array.getLength(javaObject);
- for (int count = 0; count < size; ++count) {
- Object item = Array.get(javaObject, count);
- element = createElement(elementName);
- appendChild(parent, element);
- appendChildElements(element, elementName, javaType.getComponentType(), item, context);
- }
- } else {
- Field[] javaFields = javaType.getFields();
- for (Field aField : javaFields) {
- try {
- QName fieldElementName = new QName(aField.getName());
- if (!aField.getType().isArray()) {
- element = createElement(fieldElementName);
- appendChild(parent, element);
- appendChildElements(element,
- fieldElementName,
- aField.getType(),
- aField.get(javaObject),
- context);
- } else {
- appendChildElements(parent,
- fieldElementName,
- aField.getType(),
- aField.get(javaObject),
- context);
- }
- } catch (IllegalAccessException e) {
- Java2XMLMapperException java2xmlEx = new Java2XMLMapperException(e);
- java2xmlEx.setJavaFieldName(aField.getName());
- java2xmlEx.setJavaType(javaType);
- throw java2xmlEx;
- }
- }
-
- Method[] methods = javaType.getMethods();
- String fieldName = null;
- for (Method aMethod : methods) {
- try {
- if (Modifier.isPublic(aMethod.getModifiers()) && aMethod.getName().startsWith(GET)
- && aMethod.getParameterTypes().length == 0
- && isMappedGetter(aMethod.getName())) {
- fieldName = resolveFieldFromMethod(aMethod.getName());
- try {
- javaType.getField(fieldName);
- } catch (NoSuchFieldException e) {
- QName fieldElementName = new QName(fieldName);
- if (aMethod.getReturnType().isArray()) {
- appendChildElements(parent, fieldElementName, aMethod.getReturnType(), aMethod
- .invoke(javaObject, new Object[0]), context);
- } else {
- element = createElement(fieldElementName);
- appendChild(parent, element);
- appendChildElements(element, fieldElementName, aMethod.getReturnType(), aMethod
- .invoke(javaObject, new Object[0]), context);
- }
- }
- }
- } catch (IllegalAccessException e) {
- Java2XMLMapperException java2xmlEx = new Java2XMLMapperException(e);
- java2xmlEx.setJavaFieldName(fieldName);
- java2xmlEx.setJavaType(javaType);
- throw java2xmlEx;
- } catch (InvocationTargetException e) {
- Java2XMLMapperException java2xmlEx = new Java2XMLMapperException(e);
- java2xmlEx.setJavaFieldName(fieldName);
- java2xmlEx.setJavaType(javaType);
- throw java2xmlEx;
- }
- }
- }
- }
- }
-
- /*
- * Subclasses can override this method to prevent some getter methods
- * from being mapped. The default implementation provided by this class
- * maps all getter methods.
- */
- protected boolean isMappedGetter(String methodName) {
- return true;
- }
-
- @Override
- public String getSourceDataBinding() {
- return JavaBeansDataBinding.NAME;
- }
-
- @Override
- public Class<Object> getSourceType() {
- return Object.class;
- }
-
- private boolean isSimpleJavaType(Object javaObject) {
- if (javaObject instanceof String) {
- return true;
- }
- if (javaObject instanceof Byte || javaObject instanceof Character
- || javaObject instanceof Short
- || javaObject instanceof Integer
- || javaObject instanceof Long
- || javaObject instanceof Float
- || javaObject instanceof Double
- || javaObject instanceof Boolean) {
- return true;
- }
- if (javaObject instanceof GregorianCalendar || javaObject instanceof Date
- || javaObject instanceof XMLGregorianCalendar
- || javaObject instanceof byte[]
- || javaObject instanceof QName) {
- return true;
- }
- return false;
- }
-
- private String resolveRootElementName(Class javaType) {
- if (javaType.isArray()) {
- return javaType.getComponentType().getSimpleName() + "_collection";
- } else {
- return javaType.getSimpleName() + "_instance";
- }
- }
-
- private QName resolveElementName(Class javaType) {
- if (javaType.isArray()) {
- return new QName(javaType.getComponentType().getSimpleName());
- } else {
- return new QName(javaType.getSimpleName());
- }
- }
-
- private String resolveFieldFromMethod(String methodName) {
- StringBuffer fieldName = new StringBuffer();
- fieldName.append(Character.toLowerCase(methodName.charAt(GET.length())));
- fieldName.append(methodName.substring(GET.length() + 1));
- return fieldName.toString();
- }
-
- public String getNexPrefix() {
- return PREFIX + prefixCount++;
- }
-
- @Override
- public int getWeight() {
- return JavaBeansDataBinding.HEAVY_WEIGHT;
- }
-
- /**
- * Create an element with the given name
- * @param qName
- * @return
- * @throws Java2XMLMapperException
- */
- public abstract T createElement(QName qName) throws Java2XMLMapperException;
-
- /**
- * Create a text node and add it to the parent
- * @param parentElement
- * @param textData
- * @throws Java2XMLMapperException
- */
- public abstract void appendText(T parentElement, String textData) throws Java2XMLMapperException;
-
- /**
- * Add the child element to the parent
- * @param parentElement
- * @param childElement
- * @throws Java2XMLMapperException
- */
- public abstract void appendChild(T parentElement, T childElement) throws Java2XMLMapperException;
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.databinding.javabeans;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+import javax.xml.datatype.XMLGregorianCalendar;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.databinding.PullTransformer;
+import org.apache.tuscany.sca.databinding.TransformationContext;
+import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
+import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
+import org.apache.tuscany.sca.interfacedef.DataType;
+import org.apache.tuscany.sca.interfacedef.util.XMLType;
+
+/**
+ * Transformer to convert data from a JavaBean object to xml
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class JavaBean2XMLTransformer<T> extends BaseTransformer<Object, T> implements
+ PullTransformer<Object, T> {
+
+ public static final String GET = "get";
+ public static final String PREFIX = "n";
+ public static final String PERIOD = ".";
+ public static final String FWD_SLASH = "/";
+ public static final String HTTP = "http://";
+ private static int prefixCount = 1;
+
+ protected SimpleTypeMapperImpl mapper;
+
+ public JavaBean2XMLTransformer() {
+ this.mapper = new SimpleTypeMapperImpl();
+ }
+
+ public T transform(Object source, TransformationContext context) {
+ QName rootElement = null;
+ if (context != null) {
+ DataType<?> type = context.getTargetDataType();
+ if (type != null) {
+ Object logical = type.getLogical();
+ if (logical instanceof XMLType) {
+ rootElement = ((XMLType)logical).getElementName();
+ }
+ }
+ }
+ //FIXME See how/if we still need to get the metadata here
+ //QName rootElementName = (QName)context.getTargetDataType().getMetadata("RootElementName");
+ //if (rootElementName == null) {
+ QName rootElementName = new QName(resolveRootElementName(source.getClass()));
+ //}
+
+ T root = createElement(rootElementName);
+ appendChildElements(root, resolveElementName(source.getClass()), source.getClass(), source, context);
+ return root;
+ }
+
+ private void appendChildElements(T parent,
+ QName elementName,
+ Class javaType,
+ Object javaObject,
+ TransformationContext context) {
+ T element = null;
+ if (javaObject != null) {
+ if (javaType.isPrimitive() || isSimpleJavaType(javaObject)) {
+ appendText(parent, mapper.toXMLLiteral(null, javaObject, context));
+ } else if (javaType.isArray()) {
+ int size = Array.getLength(javaObject);
+ for (int count = 0; count < size; ++count) {
+ Object item = Array.get(javaObject, count);
+ element = createElement(elementName);
+ appendChild(parent, element);
+ appendChildElements(element, elementName, javaType.getComponentType(), item, context);
+ }
+ } else {
+ Field[] javaFields = javaType.getFields();
+ for (Field aField : javaFields) {
+ try {
+ QName fieldElementName = new QName(aField.getName());
+ if (!aField.getType().isArray()) {
+ element = createElement(fieldElementName);
+ appendChild(parent, element);
+ appendChildElements(element,
+ fieldElementName,
+ aField.getType(),
+ aField.get(javaObject),
+ context);
+ } else {
+ appendChildElements(parent,
+ fieldElementName,
+ aField.getType(),
+ aField.get(javaObject),
+ context);
+ }
+ } catch (IllegalAccessException e) {
+ Java2XMLMapperException java2xmlEx = new Java2XMLMapperException(e);
+ java2xmlEx.setJavaFieldName(aField.getName());
+ java2xmlEx.setJavaType(javaType);
+ throw java2xmlEx;
+ }
+ }
+
+ Method[] methods = javaType.getMethods();
+ String fieldName = null;
+ for (Method aMethod : methods) {
+ try {
+ if (Modifier.isPublic(aMethod.getModifiers()) && aMethod.getName().startsWith(GET)
+ && aMethod.getParameterTypes().length == 0
+ && isMappedGetter(aMethod.getName())) {
+ fieldName = resolveFieldFromMethod(aMethod.getName());
+ try {
+ javaType.getField(fieldName);
+ } catch (NoSuchFieldException e) {
+ QName fieldElementName = new QName(fieldName);
+ if (aMethod.getReturnType().isArray()) {
+ appendChildElements(parent, fieldElementName, aMethod.getReturnType(), aMethod
+ .invoke(javaObject, new Object[0]), context);
+ } else {
+ element = createElement(fieldElementName);
+ appendChild(parent, element);
+ appendChildElements(element, fieldElementName, aMethod.getReturnType(), aMethod
+ .invoke(javaObject, new Object[0]), context);
+ }
+ }
+ }
+ } catch (IllegalAccessException e) {
+ Java2XMLMapperException java2xmlEx = new Java2XMLMapperException(e);
+ java2xmlEx.setJavaFieldName(fieldName);
+ java2xmlEx.setJavaType(javaType);
+ throw java2xmlEx;
+ } catch (InvocationTargetException e) {
+ Java2XMLMapperException java2xmlEx = new Java2XMLMapperException(e);
+ java2xmlEx.setJavaFieldName(fieldName);
+ java2xmlEx.setJavaType(javaType);
+ throw java2xmlEx;
+ }
+ }
+ }
+ }
+ }
+
+ /*
+ * Subclasses can override this method to prevent some getter methods
+ * from being mapped. The default implementation provided by this class
+ * maps all getter methods.
+ */
+ protected boolean isMappedGetter(String methodName) {
+ return true;
+ }
+
+ @Override
+ public String getSourceDataBinding() {
+ return JavaBeansDataBinding.NAME;
+ }
+
+ @Override
+ public Class<Object> getSourceType() {
+ return Object.class;
+ }
+
+ private boolean isSimpleJavaType(Object javaObject) {
+ if (javaObject instanceof String) {
+ return true;
+ }
+ if (javaObject instanceof Byte || javaObject instanceof Character
+ || javaObject instanceof Short
+ || javaObject instanceof Integer
+ || javaObject instanceof Long
+ || javaObject instanceof Float
+ || javaObject instanceof Double
+ || javaObject instanceof Boolean) {
+ return true;
+ }
+ if (javaObject instanceof GregorianCalendar || javaObject instanceof Date
+ || javaObject instanceof XMLGregorianCalendar
+ || javaObject instanceof byte[]
+ || javaObject instanceof QName) {
+ return true;
+ }
+ return false;
+ }
+
+ private String resolveRootElementName(Class javaType) {
+ if (javaType.isArray()) {
+ return javaType.getComponentType().getSimpleName() + "_collection";
+ } else {
+ return javaType.getSimpleName() + "_instance";
+ }
+ }
+
+ private QName resolveElementName(Class javaType) {
+ if (javaType.isArray()) {
+ return new QName(javaType.getComponentType().getSimpleName());
+ } else {
+ return new QName(javaType.getSimpleName());
+ }
+ }
+
+ private String resolveFieldFromMethod(String methodName) {
+ StringBuffer fieldName = new StringBuffer();
+ fieldName.append(Character.toLowerCase(methodName.charAt(GET.length())));
+ fieldName.append(methodName.substring(GET.length() + 1));
+ return fieldName.toString();
+ }
+
+ public String getNexPrefix() {
+ return PREFIX + prefixCount++;
+ }
+
+ @Override
+ public int getWeight() {
+ return JavaBeansDataBinding.HEAVY_WEIGHT;
+ }
+
+ /**
+ * Create an element with the given name
+ * @param qName
+ * @return
+ * @throws Java2XMLMapperException
+ */
+ public abstract T createElement(QName qName) throws Java2XMLMapperException;
+
+ /**
+ * Create a text node and add it to the parent
+ * @param parentElement
+ * @param textData
+ * @throws Java2XMLMapperException
+ */
+ public abstract void appendText(T parentElement, String textData) throws Java2XMLMapperException;
+
+ /**
+ * Add the child element to the parent
+ * @param parentElement
+ * @param childElement
+ * @throws Java2XMLMapperException
+ */
+ public abstract void appendChild(T parentElement, T childElement) throws Java2XMLMapperException;
+}
diff --git a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java
index 2234aa07c2..4981699792 100644
--- a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java
+++ b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaBeansDataBinding.java
@@ -1,162 +1,162 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.javabeans;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamClass;
-import java.io.OutputStream;
-import java.io.Serializable;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.Operation;
-
-/**
- * DataBinding for JavaBeans
- *
- * @version $Rev$ $Date$
- */
-public class JavaBeansDataBinding extends BaseDataBinding {
- private final static Logger logger = Logger.getLogger(JavaBeansDataBinding.class.getName());
- /**
- * Defining a weight to a very high number so that the transformer won't be picked
- * up by other paths unless it's the only available path
- */
- public static final int HEAVY_WEIGHT = 10000;
- public static final String NAME = "java:complexType";
-
- public JavaBeansDataBinding() {
- super(NAME, Object.class);
- }
-
- protected JavaBeansDataBinding(String name, Class<?> baseType) {
- super(name, baseType);
- }
-
- @Override
- public Object copy(Object arg, DataType dataType, Operation operation) {
- if (arg == null) {
- return null;
- }
- final Class<?> clazz = arg.getClass();
- if (String.class == clazz || clazz.isPrimitive()
- || Number.class.isAssignableFrom(clazz)
- || Boolean.class.isAssignableFrom(clazz)
- || Character.class.isAssignableFrom(clazz)
- || Byte.class.isAssignableFrom(clazz)) {
- // Immutable classes
- return arg;
- }
- try {
- if (arg instanceof Serializable) {
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- ObjectOutputStream oos = getObjectOutputStream(bos);
- oos.writeObject(arg);
- oos.close();
- bos.close();
-
- // Work out which ClassLoader to use for deserializing arg
- // We want to use:
- // * The ClassLoader of arg if it is not the System ClassLoader
- // * The ThreadContext ClassLoader if the ClassLoader of arg is the System ClassLoader
- // because Collection classes are loaded by the System ClassLoader but their contents
- // may be loaded from another ClassLoader
- //
- ClassLoader classLoaderToUse = clazz.getClassLoader();
- if (classLoaderToUse == null)
- {
- // ClassLoader of arg is the System ClassLoader so we will use the ThreadContext ClassLoader
- // instead
- classLoaderToUse = Thread.currentThread().getContextClassLoader();
- }
-
- ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
- ObjectInputStream ois = getObjectInputStream(bis, classLoaderToUse);
- Object objectCopy = ois.readObject();
- ois.close();
- bis.close();
- return objectCopy;
- } else if (arg instanceof Cloneable) {
- Method clone;
- try {
- clone = arg.getClass().getMethod("clone");
- try {
- return clone.invoke(arg, (Object[])null);
- } catch (InvocationTargetException e) {
- if (e.getTargetException() instanceof CloneNotSupportedException) {
- // Ignore
- } else {
- throw new IllegalArgumentException(e);
- }
- } catch (Exception e) {
- throw new IllegalArgumentException(e);
- }
- } catch (NoSuchMethodException e) {
- // Ignore it
- }
- }
- // return arg;
- logger.warning("Argument type '" + arg.getClass().getName()
- + "' is not Serializable or Cloneable. Pass-by-value is skipped.");
- return arg;
- } catch (Exception e) {
- throw new IllegalArgumentException("Pass-by-value is not supported for the given object: " + arg.getClass()
- .getName(), e);
- }
- }
-
- protected ObjectOutputStream getObjectOutputStream(OutputStream os) throws IOException {
- return new ObjectOutputStream(os);
- }
-
- protected ObjectInputStream getObjectInputStream(InputStream is, final ClassLoader cl) throws IOException {
- ObjectInputStream ois = new ObjectInputStream(is) {
- @Override
- protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
- try {
- return Class.forName(desc.getName(), false, cl);
- } catch (ClassNotFoundException e) {
- try {
- // For OSGi, use context ClassLoader if the bundle ClassLoader cannot load the class
- if (cl != Thread.currentThread().getContextClassLoader()) {
- return Class.forName(desc.getName(), false, Thread.currentThread().getContextClassLoader());
- }
- } catch (ClassNotFoundException e1) {
- // ignore
- } catch (NoClassDefFoundError e1) {
- // ignore
- }
- return super.resolveClass(desc);
- }
- }
-
- };
- return ois;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.databinding.javabeans;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.ObjectStreamClass;
+import java.io.OutputStream;
+import java.io.Serializable;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.logging.Logger;
+
+import org.apache.tuscany.sca.databinding.impl.BaseDataBinding;
+import org.apache.tuscany.sca.interfacedef.DataType;
+import org.apache.tuscany.sca.interfacedef.Operation;
+
+/**
+ * DataBinding for JavaBeans
+ *
+ * @version $Rev$ $Date$
+ */
+public class JavaBeansDataBinding extends BaseDataBinding {
+ private final static Logger logger = Logger.getLogger(JavaBeansDataBinding.class.getName());
+ /**
+ * Defining a weight to a very high number so that the transformer won't be picked
+ * up by other paths unless it's the only available path
+ */
+ public static final int HEAVY_WEIGHT = 10000;
+ public static final String NAME = "java:complexType";
+
+ public JavaBeansDataBinding() {
+ super(NAME, Object.class);
+ }
+
+ protected JavaBeansDataBinding(String name, Class<?> baseType) {
+ super(name, baseType);
+ }
+
+ @Override
+ public Object copy(Object arg, DataType dataType, Operation operation) {
+ if (arg == null) {
+ return null;
+ }
+ final Class<?> clazz = arg.getClass();
+ if (String.class == clazz || clazz.isPrimitive()
+ || Number.class.isAssignableFrom(clazz)
+ || Boolean.class.isAssignableFrom(clazz)
+ || Character.class.isAssignableFrom(clazz)
+ || Byte.class.isAssignableFrom(clazz)) {
+ // Immutable classes
+ return arg;
+ }
+ try {
+ if (arg instanceof Serializable) {
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = getObjectOutputStream(bos);
+ oos.writeObject(arg);
+ oos.close();
+ bos.close();
+
+ // Work out which ClassLoader to use for deserializing arg
+ // We want to use:
+ // * The ClassLoader of arg if it is not the System ClassLoader
+ // * The ThreadContext ClassLoader if the ClassLoader of arg is the System ClassLoader
+ // because Collection classes are loaded by the System ClassLoader but their contents
+ // may be loaded from another ClassLoader
+ //
+ ClassLoader classLoaderToUse = clazz.getClassLoader();
+ if (classLoaderToUse == null)
+ {
+ // ClassLoader of arg is the System ClassLoader so we will use the ThreadContext ClassLoader
+ // instead
+ classLoaderToUse = Thread.currentThread().getContextClassLoader();
+ }
+
+ ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
+ ObjectInputStream ois = getObjectInputStream(bis, classLoaderToUse);
+ Object objectCopy = ois.readObject();
+ ois.close();
+ bis.close();
+ return objectCopy;
+ } else if (arg instanceof Cloneable) {
+ Method clone;
+ try {
+ clone = arg.getClass().getMethod("clone");
+ try {
+ return clone.invoke(arg, (Object[])null);
+ } catch (InvocationTargetException e) {
+ if (e.getTargetException() instanceof CloneNotSupportedException) {
+ // Ignore
+ } else {
+ throw new IllegalArgumentException(e);
+ }
+ } catch (Exception e) {
+ throw new IllegalArgumentException(e);
+ }
+ } catch (NoSuchMethodException e) {
+ // Ignore it
+ }
+ }
+ // return arg;
+ logger.warning("Argument type '" + arg.getClass().getName()
+ + "' is not Serializable or Cloneable. Pass-by-value is skipped.");
+ return arg;
+ } catch (Exception e) {
+ throw new IllegalArgumentException("Pass-by-value is not supported for the given object: " + arg.getClass()
+ .getName(), e);
+ }
+ }
+
+ protected ObjectOutputStream getObjectOutputStream(OutputStream os) throws IOException {
+ return new ObjectOutputStream(os);
+ }
+
+ protected ObjectInputStream getObjectInputStream(InputStream is, final ClassLoader cl) throws IOException {
+ ObjectInputStream ois = new ObjectInputStream(is) {
+ @Override
+ protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
+ try {
+ return Class.forName(desc.getName(), false, cl);
+ } catch (ClassNotFoundException e) {
+ try {
+ // For OSGi, use context ClassLoader if the bundle ClassLoader cannot load the class
+ if (cl != Thread.currentThread().getContextClassLoader()) {
+ return Class.forName(desc.getName(), false, Thread.currentThread().getContextClassLoader());
+ }
+ } catch (ClassNotFoundException e1) {
+ // ignore
+ } catch (NoClassDefFoundError e1) {
+ // ignore
+ }
+ return super.resolveClass(desc);
+ }
+ }
+
+ };
+ return ois;
+ }
+
+}
diff --git a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaExceptionDataBinding.java b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaExceptionDataBinding.java
index 7ae64c6a27..6886462ac8 100644
--- a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaExceptionDataBinding.java
+++ b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/JavaExceptionDataBinding.java
@@ -1,35 +1,35 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.javabeans;
-
-
-/**
- * DataBinding for Java Exceptions
- *
- * @version $Rev$ $Date$
- */
-public class JavaExceptionDataBinding extends JavaBeansDataBinding {
-
- public static final String NAME = "java:exception";
-
- public JavaExceptionDataBinding() {
- super(NAME, null);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.databinding.javabeans;
+
+
+/**
+ * DataBinding for Java Exceptions
+ *
+ * @version $Rev$ $Date$
+ */
+public class JavaExceptionDataBinding extends JavaBeansDataBinding {
+
+ public static final String NAME = "java:exception";
+
+ public JavaExceptionDataBinding() {
+ super(NAME, null);
+ }
+}
diff --git a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaBeanTransformer.java b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaBeanTransformer.java
index b441340c38..6a30605f0f 100644
--- a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaBeanTransformer.java
+++ b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaBeanTransformer.java
@@ -1,329 +1,329 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.databinding.javabeans;
-
-import java.lang.reflect.Array;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.databinding.PullTransformer;
-import org.apache.tuscany.sca.databinding.TransformationContext;
-import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
-import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-
-/**
- * Transformer to convert data from XML to JavaBean
- *
- * @version $Rev$ $Date$
- */
-public abstract class XML2JavaBeanTransformer<T> extends BaseTransformer<T, Object> implements
- PullTransformer<T, Object> {
-
- public static final String SET = "set";
- public static final QName QNAME_MESSAGE = new QName("message");
-
- protected SimpleTypeMapperImpl mapper;
-
- public XML2JavaBeanTransformer() {
- this.mapper = new SimpleTypeMapperImpl();
- }
-
- @Override
- public int getWeight() {
- return JavaBeansDataBinding.HEAVY_WEIGHT;
- }
-
- public Object transform(T source, TransformationContext context) {
- //FIXME why is the logical type sometimes a Class instead of an XMLType?
- if (context.getSourceDataType().getLogical() instanceof XMLType) {
- XMLType xmlType = (XMLType) context.getSourceDataType().getLogical();
- return toJavaObject(xmlType.getTypeName(), getRootElement(source), context);
- } else {
- return toJavaObject(null, getRootElement(source), context);
- }
- }
-
- public Object toJavaObject(QName xmlType, T xmlElement, TransformationContext context) {
- if (xmlType != null && mapper.isSimpleXSDType(xmlType)) {
- return mapper.toJavaObject(xmlType, getText(xmlElement), context);
- } else {
- Class<?> javaType = (Class<?>)context.getTargetDataType().getPhysical();
- return createJavaObject(xmlElement, javaType, context);
- }
- }
-
- @SuppressWarnings("unchecked")
- private <L> L createJavaObject(T element, Class<L> javaType, TransformationContext context)
- throws XML2JavaMapperException {
- if (isTextOnly(element)) {
- return (L) mapper.toJavaObject(mapper.getXMLType(javaType).getQName(),
- getText(element),
- context);
- } else {
- String fieldName = null;
- try {
- L javaInstance;
- T detailMsg = null;
- if (Throwable.class.isAssignableFrom(javaType)) {
- T msgElement = getFirstChildWithName(element, QNAME_MESSAGE);
- if (msgElement != null && isTextOnly(msgElement)) {
- detailMsg = msgElement; // skip this when handling child elements
- Constructor constructor = javaType.getConstructor(new Class[] {String.class});
- javaInstance = (L)constructor.newInstance(new Object[] {getText(detailMsg)});
- } else {
- javaInstance = javaType.newInstance();
- }
- } else {
- javaInstance = javaType.newInstance();
- }
- Map<Field, List<Object>> arrayFields = new Hashtable<Field, List<Object>>();
- Map<Method, List<Object>> arraySetters = new Hashtable<Method, List<Object>>();
-
- for (Iterator<T> childElements = getChildElements(element); childElements.hasNext(); ) {
- T childElement = childElements.next();
- if (!isTextElement(childElement) && childElement != detailMsg) {
- fieldName = getElementName(childElement);
- try {
- Field javaField = javaType.getField(fieldName);
- setFieldValue(javaInstance,
- javaField,
- childElement,
- arrayFields,
- context);
-
- } catch (NoSuchFieldException e1) {
- setFieldValueUsingSetter(javaType,
- javaInstance,
- fieldName,
- childElement,
- arraySetters,
- context);
- }
- }
- }
-
- setArrayValues(javaInstance, arrayFields, arraySetters);
- return javaInstance;
- } catch (Exception e2) {
- XML2JavaMapperException xml2JavaEx = new XML2JavaMapperException(e2);
- xml2JavaEx.setJavaType(javaType);
- xml2JavaEx.setJavaFieldName(fieldName);
- throw xml2JavaEx;
- }
- }
- }
-
- private void setFieldValue(Object javaInstance,
- Field javaField,
- T fieldValue,
- Map<Field, List<Object>> arrayFields,
- TransformationContext context) throws IllegalAccessException {
- Class<?> javaFieldType = (Class<?>) javaField.getType();
-
- if (javaFieldType.isArray()) {
- Class<?> componentType = javaFieldType.getComponentType();
- List<Object> fldValueArray = arrayFields.get(javaField);
- if (fldValueArray == null) {
- fldValueArray = new ArrayList<Object>();
- arrayFields.put(javaField, fldValueArray);
- }
- fldValueArray.add(createJavaObject(fieldValue, componentType, context));
- } else {
- javaField.setAccessible(true);
- javaField.set(javaInstance, createJavaObject(fieldValue, javaFieldType, context));
- }
- }
-
- private void setFieldValueUsingSetter(Class javaType,
- Object javaInstance,
- String fieldName,
- T fieldValue,
- Map<Method, List<Object>> arraySetters,
- TransformationContext context) throws IllegalAccessException,
- InvocationTargetException {
- char firstChar = Character.toUpperCase(fieldName.charAt(0));
- StringBuilder methodName = new StringBuilder(SET + fieldName);
- methodName.setCharAt(SET.length(), firstChar);
- boolean methodNotFound = true;
-
- for (int methodCount = 0; methodNotFound && methodCount < javaType.getMethods().length; ++methodCount) {
- Method aMethod = javaType.getMethods()[methodCount];
- if (aMethod.getName().equals(methodName.toString())
- && aMethod.getParameterTypes().length == 1) {
- Class<?> paramType = aMethod.getParameterTypes()[0];
-
- if (paramType.isArray()) {
- Class<?> componentType = paramType.getComponentType();
- List<Object> setterValueArray = arraySetters.get(aMethod);
- if (setterValueArray == null) {
- setterValueArray = new ArrayList<Object>();
- arraySetters.put(aMethod, setterValueArray);
- }
- setterValueArray.add(createJavaObject(fieldValue, componentType, context));
- } else {
- aMethod.invoke(javaInstance, new Object[] {createJavaObject(fieldValue,
- paramType,
- context)});
- }
- methodNotFound = false;
- }
- }
-
- if (methodNotFound) {
- XML2JavaMapperException xml2JavaEx =
- new XML2JavaMapperException("No field or setter method to configure xml data");
- xml2JavaEx.setJavaFieldName(fieldName);
- xml2JavaEx.setJavaType(javaType);
- throw xml2JavaEx;
- }
- }
-
- private void setArrayValues(Object javaInstance,
- Map<Field, List<Object>> arrayFields,
- Map<Method, List<Object>> arraySetters) throws IllegalAccessException,
- InvocationTargetException {
- if (arrayFields.size() > 0) {
- for (Field javaField : arrayFields.keySet()) {
- javaField.setAccessible(true);
-
- if (javaField.getType().getComponentType().isPrimitive()) {
- javaField.set(javaInstance, createPrimitiveArray(javaField.getType()
- .getComponentType(),
- arrayFields.get(javaField)));
- } else {
- javaField.set(javaInstance,
- createNonPrimitiveArray(javaField.getType().getComponentType(),
- arrayFields.get(javaField)));
- }
- }
- }
-
- if (arraySetters.size() > 0) {
- for (Method aMethod : arraySetters.keySet()) {
- Class<?> paramType = aMethod.getParameterTypes()[0];
- if (paramType.getComponentType().isPrimitive()) {
- aMethod.invoke(javaInstance,
- new Object[] {createPrimitiveArray(paramType.getComponentType(),
- arraySetters.get(aMethod))});
- } else {
- aMethod.invoke(javaInstance,
- new Object[] {createNonPrimitiveArray(paramType.getComponentType(),
- arraySetters.get(aMethod))});
- }
- }
- }
- }
-
- private Object createNonPrimitiveArray(Class fieldType, List values) {
- Object objectArray = Array.newInstance(fieldType, values.size());
- for (int count = 0; count < values.size(); ++count) {
- Array.set(objectArray, count, values.get(count));
- }
- return objectArray;
- }
-
- private Object createPrimitiveArray(Class fieldType, List values) {
- if (fieldType.isPrimitive()) {
- if (fieldType.getName().equals("int")) {
- int[] primitiveValues = new int[values.size()];
- for (int count = 0; count < values.size(); ++count) {
- primitiveValues[count] = ((Integer) values.get(count)).intValue();
- }
- return primitiveValues;
- } else if (fieldType.getName().equals("float")) {
- float[] primitiveValues = new float[values.size()];
- for (int count = 0; count < values.size(); ++count) {
- primitiveValues[count] = ((Float) values.get(count)).floatValue();
- }
- return primitiveValues;
- } else if (fieldType.getName().equals("boolean")) {
- boolean[] primitiveValues = new boolean[values.size()];
- for (int count = 0; count < values.size(); ++count) {
- primitiveValues[count] = ((Boolean) values.get(count)).booleanValue();
- }
- return primitiveValues;
- } else if (fieldType.getName().equals("char")) {
- char[] primitiveValues = new char[values.size()];
- for (int count = 0; count < values.size(); ++count) {
- primitiveValues[count] = ((Character) values.get(count)).charValue();
- }
- return primitiveValues;
- } else if (fieldType.getName().equals("byte")) {
- byte[] primitiveValues = new byte[values.size()];
- for (int count = 0; count < values.size(); ++count) {
- primitiveValues[count] = ((Byte) values.get(count)).byteValue();
- }
- return primitiveValues;
- } else if (fieldType.getName().equals("short")) {
- short[] primitiveValues = new short[values.size()];
- for (int count = 0; count < values.size(); ++count) {
- primitiveValues[count] = ((Short) values.get(count)).shortValue();
- }
- return primitiveValues;
- } else if (fieldType.getName().equals("long")) {
- long[] primitiveValues = new long[values.size()];
- for (int count = 0; count < values.size(); ++count) {
- primitiveValues[count] = ((Long) values.get(count)).longValue();
- }
- return primitiveValues;
- } else if (fieldType.getName().equals("double")) {
- double[] primitiveValues = new double[values.size()];
- for (int count = 0; count < values.size(); ++count) {
- primitiveValues[count] = ((Double) values.get(count)).doubleValue();
- }
- return primitiveValues;
- }
- }
- return values;
- }
-
- public abstract String getText(T source) throws XML2JavaMapperException;
-
- public abstract Iterator<T> getChildElements(T parent) throws XML2JavaMapperException;
-
- public abstract String getElementName(T element) throws XML2JavaMapperException;
-
- public abstract boolean isTextElement(T element) throws XML2JavaMapperException;
-
- public abstract boolean isTextOnly(T element) throws XML2JavaMapperException;
-
- public abstract T getFirstChildWithName(T element, QName name) throws XML2JavaMapperException;
-
- public abstract T getRootElement(T element) throws XML2JavaMapperException;
-
- @Override
- public Class<Object> getTargetType() {
- return Object.class;
- }
-
- @Override
- public String getTargetDataBinding() {
- return JavaBeansDataBinding.NAME;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.databinding.javabeans;
+
+import java.lang.reflect.Array;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.databinding.PullTransformer;
+import org.apache.tuscany.sca.databinding.TransformationContext;
+import org.apache.tuscany.sca.databinding.impl.BaseTransformer;
+import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
+import org.apache.tuscany.sca.interfacedef.util.XMLType;
+
+/**
+ * Transformer to convert data from XML to JavaBean
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class XML2JavaBeanTransformer<T> extends BaseTransformer<T, Object> implements
+ PullTransformer<T, Object> {
+
+ public static final String SET = "set";
+ public static final QName QNAME_MESSAGE = new QName("message");
+
+ protected SimpleTypeMapperImpl mapper;
+
+ public XML2JavaBeanTransformer() {
+ this.mapper = new SimpleTypeMapperImpl();
+ }
+
+ @Override
+ public int getWeight() {
+ return JavaBeansDataBinding.HEAVY_WEIGHT;
+ }
+
+ public Object transform(T source, TransformationContext context) {
+ //FIXME why is the logical type sometimes a Class instead of an XMLType?
+ if (context.getSourceDataType().getLogical() instanceof XMLType) {
+ XMLType xmlType = (XMLType) context.getSourceDataType().getLogical();
+ return toJavaObject(xmlType.getTypeName(), getRootElement(source), context);
+ } else {
+ return toJavaObject(null, getRootElement(source), context);
+ }
+ }
+
+ public Object toJavaObject(QName xmlType, T xmlElement, TransformationContext context) {
+ if (xmlType != null && mapper.isSimpleXSDType(xmlType)) {
+ return mapper.toJavaObject(xmlType, getText(xmlElement), context);
+ } else {
+ Class<?> javaType = (Class<?>)context.getTargetDataType().getPhysical();
+ return createJavaObject(xmlElement, javaType, context);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private <L> L createJavaObject(T element, Class<L> javaType, TransformationContext context)
+ throws XML2JavaMapperException {
+ if (isTextOnly(element)) {
+ return (L) mapper.toJavaObject(mapper.getXMLType(javaType).getQName(),
+ getText(element),
+ context);
+ } else {
+ String fieldName = null;
+ try {
+ L javaInstance;
+ T detailMsg = null;
+ if (Throwable.class.isAssignableFrom(javaType)) {
+ T msgElement = getFirstChildWithName(element, QNAME_MESSAGE);
+ if (msgElement != null && isTextOnly(msgElement)) {
+ detailMsg = msgElement; // skip this when handling child elements
+ Constructor constructor = javaType.getConstructor(new Class[] {String.class});
+ javaInstance = (L)constructor.newInstance(new Object[] {getText(detailMsg)});
+ } else {
+ javaInstance = javaType.newInstance();
+ }
+ } else {
+ javaInstance = javaType.newInstance();
+ }
+ Map<Field, List<Object>> arrayFields = new Hashtable<Field, List<Object>>();
+ Map<Method, List<Object>> arraySetters = new Hashtable<Method, List<Object>>();
+
+ for (Iterator<T> childElements = getChildElements(element); childElements.hasNext(); ) {
+ T childElement = childElements.next();
+ if (!isTextElement(childElement) && childElement != detailMsg) {
+ fieldName = getElementName(childElement);
+ try {
+ Field javaField = javaType.getField(fieldName);
+ setFieldValue(javaInstance,
+ javaField,
+ childElement,
+ arrayFields,
+ context);
+
+ } catch (NoSuchFieldException e1) {
+ setFieldValueUsingSetter(javaType,
+ javaInstance,
+ fieldName,
+ childElement,
+ arraySetters,
+ context);
+ }
+ }
+ }
+
+ setArrayValues(javaInstance, arrayFields, arraySetters);
+ return javaInstance;
+ } catch (Exception e2) {
+ XML2JavaMapperException xml2JavaEx = new XML2JavaMapperException(e2);
+ xml2JavaEx.setJavaType(javaType);
+ xml2JavaEx.setJavaFieldName(fieldName);
+ throw xml2JavaEx;
+ }
+ }
+ }
+
+ private void setFieldValue(Object javaInstance,
+ Field javaField,
+ T fieldValue,
+ Map<Field, List<Object>> arrayFields,
+ TransformationContext context) throws IllegalAccessException {
+ Class<?> javaFieldType = (Class<?>) javaField.getType();
+
+ if (javaFieldType.isArray()) {
+ Class<?> componentType = javaFieldType.getComponentType();
+ List<Object> fldValueArray = arrayFields.get(javaField);
+ if (fldValueArray == null) {
+ fldValueArray = new ArrayList<Object>();
+ arrayFields.put(javaField, fldValueArray);
+ }
+ fldValueArray.add(createJavaObject(fieldValue, componentType, context));
+ } else {
+ javaField.setAccessible(true);
+ javaField.set(javaInstance, createJavaObject(fieldValue, javaFieldType, context));
+ }
+ }
+
+ private void setFieldValueUsingSetter(Class javaType,
+ Object javaInstance,
+ String fieldName,
+ T fieldValue,
+ Map<Method, List<Object>> arraySetters,
+ TransformationContext context) throws IllegalAccessException,
+ InvocationTargetException {
+ char firstChar = Character.toUpperCase(fieldName.charAt(0));
+ StringBuilder methodName = new StringBuilder(SET + fieldName);
+ methodName.setCharAt(SET.length(), firstChar);
+ boolean methodNotFound = true;
+
+ for (int methodCount = 0; methodNotFound && methodCount < javaType.getMethods().length; ++methodCount) {
+ Method aMethod = javaType.getMethods()[methodCount];
+ if (aMethod.getName().equals(methodName.toString())
+ && aMethod.getParameterTypes().length == 1) {
+ Class<?> paramType = aMethod.getParameterTypes()[0];
+
+ if (paramType.isArray()) {
+ Class<?> componentType = paramType.getComponentType();
+ List<Object> setterValueArray = arraySetters.get(aMethod);
+ if (setterValueArray == null) {
+ setterValueArray = new ArrayList<Object>();
+ arraySetters.put(aMethod, setterValueArray);
+ }
+ setterValueArray.add(createJavaObject(fieldValue, componentType, context));
+ } else {
+ aMethod.invoke(javaInstance, new Object[] {createJavaObject(fieldValue,
+ paramType,
+ context)});
+ }
+ methodNotFound = false;
+ }
+ }
+
+ if (methodNotFound) {
+ XML2JavaMapperException xml2JavaEx =
+ new XML2JavaMapperException("No field or setter method to configure xml data");
+ xml2JavaEx.setJavaFieldName(fieldName);
+ xml2JavaEx.setJavaType(javaType);
+ throw xml2JavaEx;
+ }
+ }
+
+ private void setArrayValues(Object javaInstance,
+ Map<Field, List<Object>> arrayFields,
+ Map<Method, List<Object>> arraySetters) throws IllegalAccessException,
+ InvocationTargetException {
+ if (arrayFields.size() > 0) {
+ for (Field javaField : arrayFields.keySet()) {
+ javaField.setAccessible(true);
+
+ if (javaField.getType().getComponentType().isPrimitive()) {
+ javaField.set(javaInstance, createPrimitiveArray(javaField.getType()
+ .getComponentType(),
+ arrayFields.get(javaField)));
+ } else {
+ javaField.set(javaInstance,
+ createNonPrimitiveArray(javaField.getType().getComponentType(),
+ arrayFields.get(javaField)));
+ }
+ }
+ }
+
+ if (arraySetters.size() > 0) {
+ for (Method aMethod : arraySetters.keySet()) {
+ Class<?> paramType = aMethod.getParameterTypes()[0];
+ if (paramType.getComponentType().isPrimitive()) {
+ aMethod.invoke(javaInstance,
+ new Object[] {createPrimitiveArray(paramType.getComponentType(),
+ arraySetters.get(aMethod))});
+ } else {
+ aMethod.invoke(javaInstance,
+ new Object[] {createNonPrimitiveArray(paramType.getComponentType(),
+ arraySetters.get(aMethod))});
+ }
+ }
+ }
+ }
+
+ private Object createNonPrimitiveArray(Class fieldType, List values) {
+ Object objectArray = Array.newInstance(fieldType, values.size());
+ for (int count = 0; count < values.size(); ++count) {
+ Array.set(objectArray, count, values.get(count));
+ }
+ return objectArray;
+ }
+
+ private Object createPrimitiveArray(Class fieldType, List values) {
+ if (fieldType.isPrimitive()) {
+ if (fieldType.getName().equals("int")) {
+ int[] primitiveValues = new int[values.size()];
+ for (int count = 0; count < values.size(); ++count) {
+ primitiveValues[count] = ((Integer) values.get(count)).intValue();
+ }
+ return primitiveValues;
+ } else if (fieldType.getName().equals("float")) {
+ float[] primitiveValues = new float[values.size()];
+ for (int count = 0; count < values.size(); ++count) {
+ primitiveValues[count] = ((Float) values.get(count)).floatValue();
+ }
+ return primitiveValues;
+ } else if (fieldType.getName().equals("boolean")) {
+ boolean[] primitiveValues = new boolean[values.size()];
+ for (int count = 0; count < values.size(); ++count) {
+ primitiveValues[count] = ((Boolean) values.get(count)).booleanValue();
+ }
+ return primitiveValues;
+ } else if (fieldType.getName().equals("char")) {
+ char[] primitiveValues = new char[values.size()];
+ for (int count = 0; count < values.size(); ++count) {
+ primitiveValues[count] = ((Character) values.get(count)).charValue();
+ }
+ return primitiveValues;
+ } else if (fieldType.getName().equals("byte")) {
+ byte[] primitiveValues = new byte[values.size()];
+ for (int count = 0; count < values.size(); ++count) {
+ primitiveValues[count] = ((Byte) values.get(count)).byteValue();
+ }
+ return primitiveValues;
+ } else if (fieldType.getName().equals("short")) {
+ short[] primitiveValues = new short[values.size()];
+ for (int count = 0; count < values.size(); ++count) {
+ primitiveValues[count] = ((Short) values.get(count)).shortValue();
+ }
+ return primitiveValues;
+ } else if (fieldType.getName().equals("long")) {
+ long[] primitiveValues = new long[values.size()];
+ for (int count = 0; count < values.size(); ++count) {
+ primitiveValues[count] = ((Long) values.get(count)).longValue();
+ }
+ return primitiveValues;
+ } else if (fieldType.getName().equals("double")) {
+ double[] primitiveValues = new double[values.size()];
+ for (int count = 0; count < values.size(); ++count) {
+ primitiveValues[count] = ((Double) values.get(count)).doubleValue();
+ }
+ return primitiveValues;
+ }
+ }
+ return values;
+ }
+
+ public abstract String getText(T source) throws XML2JavaMapperException;
+
+ public abstract Iterator<T> getChildElements(T parent) throws XML2JavaMapperException;
+
+ public abstract String getElementName(T element) throws XML2JavaMapperException;
+
+ public abstract boolean isTextElement(T element) throws XML2JavaMapperException;
+
+ public abstract boolean isTextOnly(T element) throws XML2JavaMapperException;
+
+ public abstract T getFirstChildWithName(T element, QName name) throws XML2JavaMapperException;
+
+ public abstract T getRootElement(T element) throws XML2JavaMapperException;
+
+ @Override
+ public Class<Object> getTargetType() {
+ return Object.class;
+ }
+
+ @Override
+ public String getTargetDataBinding() {
+ return JavaBeansDataBinding.NAME;
+ }
+}
diff --git a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaMapperException.java b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaMapperException.java
index a723fd445c..ae06d68e67 100644
--- a/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaMapperException.java
+++ b/java/sca/modules/databinding/src/main/java/org/apache/tuscany/sca/databinding/javabeans/XML2JavaMapperException.java
@@ -1,76 +1,76 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.databinding.javabeans;
-
-import javax.xml.namespace.QName;
-
-/**
- * This exception is used to encapsulate and rethrow exceptions that arise out
- * of converting XML Data to Java Objects.
- *
- * @version $Rev$ $Date$
- */
-public class XML2JavaMapperException extends RuntimeException {
- private static final long serialVersionUID = 6596530102591630642L;
-
- private QName xmlElementName;
- private String javaFieldName;
- private Class javaType;
-
- public XML2JavaMapperException(String message) {
- super(message);
- }
-
- public XML2JavaMapperException(Throwable cause) {
- super(cause);
- }
-
- public QName getXmlElementName() {
- return xmlElementName;
- }
-
- public void setXmlElementName(QName xmlElementName) {
- this.xmlElementName = xmlElementName;
- }
-
- public String getJavaFieldName() {
- return javaFieldName;
- }
-
- public void setJavaFieldName(String javaFieldName) {
- this.javaFieldName = javaFieldName;
- }
-
- public Class getJavaType() {
- return javaType;
- }
-
- public void setJavaType(Class javaType) {
- this.javaType = javaType;
- }
-
- @Override
- public String getMessage() {
- return super.getMessage() + " <" + getJavaFieldName() + "> " + " in <" + getJavaType() + ">";
- }
-
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.databinding.javabeans;
+
+import javax.xml.namespace.QName;
+
+/**
+ * This exception is used to encapsulate and rethrow exceptions that arise out
+ * of converting XML Data to Java Objects.
+ *
+ * @version $Rev$ $Date$
+ */
+public class XML2JavaMapperException extends RuntimeException {
+ private static final long serialVersionUID = 6596530102591630642L;
+
+ private QName xmlElementName;
+ private String javaFieldName;
+ private Class javaType;
+
+ public XML2JavaMapperException(String message) {
+ super(message);
+ }
+
+ public XML2JavaMapperException(Throwable cause) {
+ super(cause);
+ }
+
+ public QName getXmlElementName() {
+ return xmlElementName;
+ }
+
+ public void setXmlElementName(QName xmlElementName) {
+ this.xmlElementName = xmlElementName;
+ }
+
+ public String getJavaFieldName() {
+ return javaFieldName;
+ }
+
+ public void setJavaFieldName(String javaFieldName) {
+ this.javaFieldName = javaFieldName;
+ }
+
+ public Class getJavaType() {
+ return javaType;
+ }
+
+ public void setJavaType(Class javaType) {
+ this.javaType = javaType;
+ }
+
+ @Override
+ public String getMessage() {
+ return super.getMessage() + " <" + getJavaFieldName() + "> " + " in <" + getJavaType() + ">";
+ }
+
+
+
+}
diff --git a/java/sca/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/impl/order.wsdl b/java/sca/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/impl/order.wsdl
index 100890e10b..f011ca9f32 100644
--- a/java/sca/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/impl/order.wsdl
+++ b/java/sca/modules/databinding/src/test/resources/org/apache/tuscany/sca/databinding/impl/order.wsdl
@@ -1,76 +1,76 @@
-<?xml version="1.0"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<definitions name="StockQuote" targetNamespace="http://example.com/order.wsdl" xmlns:tns="http://example.com/order.wsdl"
- xmlns:xsd1="http://example.com/order.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
- <schema targetNamespace="http://example.com/order.xsd" xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ipo="http://www.example.com/IPO">
- <import namespace="http://www.example.com/IPO" schemaLocation="ipo.xsd"/>
- <element name="checkOrderStatus">
- <complexType>
- <sequence>
- <element name="customerId" type="string" />
- <element name="order" type="ipo:PurchaseOrderType" />
- <element name="flag" type="int" />
- </sequence>
- </complexType>
- </element>
- <element name="checkOrderStatusResponse">
- <complexType>
- <sequence>
- <element name="status" type="string" />
- </sequence>
- </complexType>
- </element>
- <element name="note" type="string" />
- </schema>
- </types>
-
- <message name="CheckOrderStatusInput1">
- <part name="body" element="xsd1:checkOrderStatus" />
- </message>
-
- <message name="CheckOrderStatusOutput1">
- <part name="body" element="xsd1:checkOrderStatusResponse" />
- </message>
-
- <message name="CheckOrderStatusInput2">
- <part name="p1" element="xsd1:checkOrderStatus" />
- <part name="p2" element="xsd1:note" />
- </message>
-
- <message name="CheckOrderStatusOutput2">
- <part name="p1" element="xsd1:checkOrderStatusResponse" />
- </message>
-
- <portType name="OrderPortType">
- <operation name="checkOrderStatus">
- <input message="tns:CheckOrderStatusInput1" />
- <output message="tns:CheckOrderStatusOutput1" />
- </operation>
- <operation name="checkOrderStatus2">
- <input message="tns:CheckOrderStatusInput2" />
- <output message="tns:CheckOrderStatusOutput2" />
- </operation>
- </portType>
-
+<?xml version="1.0"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<definitions name="StockQuote" targetNamespace="http://example.com/order.wsdl" xmlns:tns="http://example.com/order.wsdl"
+ xmlns:xsd1="http://example.com/order.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema targetNamespace="http://example.com/order.xsd" xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ipo="http://www.example.com/IPO">
+ <import namespace="http://www.example.com/IPO" schemaLocation="ipo.xsd"/>
+ <element name="checkOrderStatus">
+ <complexType>
+ <sequence>
+ <element name="customerId" type="string" />
+ <element name="order" type="ipo:PurchaseOrderType" />
+ <element name="flag" type="int" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="checkOrderStatusResponse">
+ <complexType>
+ <sequence>
+ <element name="status" type="string" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="note" type="string" />
+ </schema>
+ </types>
+
+ <message name="CheckOrderStatusInput1">
+ <part name="body" element="xsd1:checkOrderStatus" />
+ </message>
+
+ <message name="CheckOrderStatusOutput1">
+ <part name="body" element="xsd1:checkOrderStatusResponse" />
+ </message>
+
+ <message name="CheckOrderStatusInput2">
+ <part name="p1" element="xsd1:checkOrderStatus" />
+ <part name="p2" element="xsd1:note" />
+ </message>
+
+ <message name="CheckOrderStatusOutput2">
+ <part name="p1" element="xsd1:checkOrderStatusResponse" />
+ </message>
+
+ <portType name="OrderPortType">
+ <operation name="checkOrderStatus">
+ <input message="tns:CheckOrderStatusInput1" />
+ <output message="tns:CheckOrderStatusOutput1" />
+ </operation>
+ <operation name="checkOrderStatus2">
+ <input message="tns:CheckOrderStatusInput2" />
+ <output message="tns:CheckOrderStatusOutput2" />
+ </operation>
+ </portType>
+
</definitions> \ No newline at end of file
diff --git a/java/sca/modules/definitions-xml/pom.xml b/java/sca/modules/definitions-xml/pom.xml
index 9ba6587631..f52515e7b9 100644
--- a/java/sca/modules/definitions-xml/pom.xml
+++ b/java/sca/modules/definitions-xml/pom.xml
@@ -1,65 +1,65 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-definitions-xml</artifactId>
- <name>Apache Tuscany SCA Definitions XML Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy-xml</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-definitions</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xsd</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-definitions-xml</artifactId>
+ <name>Apache Tuscany SCA Definitions XML Model</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy-xml</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-definitions</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xsd</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefaultDefinitionsExtensionPoint.java b/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefaultDefinitionsExtensionPoint.java
index aa244ba274..01bf8ceb2c 100644
--- a/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefaultDefinitionsExtensionPoint.java
+++ b/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefaultDefinitionsExtensionPoint.java
@@ -1,121 +1,121 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.definitions.xml;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
-
-/**
- * Default implementation of an extension point for XML definitionss.
- *
- * @version $Rev: 758911 $ $Date: 2009-03-26 15:52:27 -0700 (Thu, 26 Mar 2009) $
- */
-public class DefaultDefinitionsExtensionPoint implements DefinitionsExtensionPoint {
- private static final Logger logger = Logger.getLogger(DefaultDefinitionsExtensionPoint.class.getName());
- private static final URI DEFINITIONS_URI = URI.create("META-INF/definitions.xml");
- private ExtensionPointRegistry registry;
- private List<URL> documents = new ArrayList<URL>();
- private List<Definitions> definitions = new ArrayList<Definitions>();
- private boolean documentsLoaded;
- private boolean loaded;
-
- public DefaultDefinitionsExtensionPoint(ExtensionPointRegistry registry) {
- this.registry = registry;
- }
-
- public void addDefinitionsDocument(URL url) {
- documents.add(url);
- }
-
- public void removeDefinitionsDocument(URL url) {
- documents.remove(url);
- }
-
- /**
- * Load definitions declarations from META-INF/services/
- * org.apache.tuscany.sca.contribution.processor.Definitions files
- */
- private synchronized void loadDefinitionsDocuments() {
- if (documentsLoaded)
- return;
-
- // Get the definitions declarations
- Collection<ServiceDeclaration> definitionsDeclarations;
- try {
- definitionsDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(DEFINITIONS_FILE);
- } catch (IOException e) {
- throw new IllegalStateException(e);
- }
-
- // Find each definitions
- for (ServiceDeclaration definitionsDeclaration : definitionsDeclarations) {
- URL url = definitionsDeclaration.getResource(definitionsDeclaration.getClassName());
- if (url == null) {
- throw new IllegalArgumentException(new FileNotFoundException(definitionsDeclaration.getClassName()));
- }
- documents.add(url);
- }
-
- documentsLoaded = true;
- }
-
- public synchronized List<Definitions> getDefinitions() {
- if (!loaded) {
- loadDefinitionsDocuments();
- URLArtifactProcessorExtensionPoint processors =
- registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- URLArtifactProcessor<Definitions> processor = processors.getProcessor(Definitions.class);
- for (URL url : documents) {
- Definitions def;
- try {
- def = processor.read(null, DEFINITIONS_URI, url);
- definitions.add(def);
- } catch (ContributionReadException e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
- }
- }
- loaded = true;
- }
- return definitions;
- }
-
- public void addDefinitions(Definitions def) {
- this.definitions.add(def);
- }
-
- public void removeDefinitions(Definitions def) {
- this.definitions.remove(def);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.definitions.xml;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.definitions.Definitions;
+import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
+import org.apache.tuscany.sca.extensibility.ServiceDiscovery;
+
+/**
+ * Default implementation of an extension point for XML definitionss.
+ *
+ * @version $Rev$ $Date$
+ */
+public class DefaultDefinitionsExtensionPoint implements DefinitionsExtensionPoint {
+ private static final Logger logger = Logger.getLogger(DefaultDefinitionsExtensionPoint.class.getName());
+ private static final URI DEFINITIONS_URI = URI.create("META-INF/definitions.xml");
+ private ExtensionPointRegistry registry;
+ private List<URL> documents = new ArrayList<URL>();
+ private List<Definitions> definitions = new ArrayList<Definitions>();
+ private boolean documentsLoaded;
+ private boolean loaded;
+
+ public DefaultDefinitionsExtensionPoint(ExtensionPointRegistry registry) {
+ this.registry = registry;
+ }
+
+ public void addDefinitionsDocument(URL url) {
+ documents.add(url);
+ }
+
+ public void removeDefinitionsDocument(URL url) {
+ documents.remove(url);
+ }
+
+ /**
+ * Load definitions declarations from META-INF/services/
+ * org.apache.tuscany.sca.contribution.processor.Definitions files
+ */
+ private synchronized void loadDefinitionsDocuments() {
+ if (documentsLoaded)
+ return;
+
+ // Get the definitions declarations
+ Collection<ServiceDeclaration> definitionsDeclarations;
+ try {
+ definitionsDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(DEFINITIONS_FILE);
+ } catch (IOException e) {
+ throw new IllegalStateException(e);
+ }
+
+ // Find each definitions
+ for (ServiceDeclaration definitionsDeclaration : definitionsDeclarations) {
+ URL url = definitionsDeclaration.getResource(definitionsDeclaration.getClassName());
+ if (url == null) {
+ throw new IllegalArgumentException(new FileNotFoundException(definitionsDeclaration.getClassName()));
+ }
+ documents.add(url);
+ }
+
+ documentsLoaded = true;
+ }
+
+ public synchronized List<Definitions> getDefinitions() {
+ if (!loaded) {
+ loadDefinitionsDocuments();
+ URLArtifactProcessorExtensionPoint processors =
+ registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
+ URLArtifactProcessor<Definitions> processor = processors.getProcessor(Definitions.class);
+ for (URL url : documents) {
+ Definitions def;
+ try {
+ def = processor.read(null, DEFINITIONS_URI, url);
+ definitions.add(def);
+ } catch (ContributionReadException e) {
+ logger.log(Level.SEVERE, e.getMessage(), e);
+ }
+ }
+ loaded = true;
+ }
+ return definitions;
+ }
+
+ public void addDefinitions(Definitions def) {
+ this.definitions.add(def);
+ }
+
+ public void removeDefinitions(Definitions def) {
+ this.definitions.remove(def);
+ }
+}
diff --git a/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsExtensionPoint.java b/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsExtensionPoint.java
index 61b815577f..3058b1f5b6 100644
--- a/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsExtensionPoint.java
+++ b/java/sca/modules/definitions-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsExtensionPoint.java
@@ -1,64 +1,64 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.definitions.xml;
-
-import java.net.URL;
-import java.util.List;
-
-import org.apache.tuscany.sca.definitions.Definitions;
-
-/**
- * An extension point for built-in SCA intent/policySet definition files
- *
- * @version $Rev: 758911 $ $Date: 2009-03-26 15:52:27 -0700 (Thu, 26 Mar 2009) $
- */
-public interface DefinitionsExtensionPoint {
- String DEFINITIONS_FILE = "org.apache.tuscany.sca.definitions.xml.Definitions";
-
- /**
- * Add a definitions document
- *
- * @param url the URL of the definitions
- */
- void addDefinitionsDocument(URL url);
-
- /**
- * Remove a definitions document
- *
- * @param url the URL of the definitions
- */
- void removeDefinitionsDocument(URL url);
-
- /**
- * @param definitions
- */
- void addDefinitions(Definitions definitions);
- /**
- * @param definitions
- */
- void removeDefinitions(Definitions definitions);
-
- /**
- * Get the list of definitions
- * @return A list of definitions
- */
- List<Definitions> getDefinitions();
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.definitions.xml;
+
+import java.net.URL;
+import java.util.List;
+
+import org.apache.tuscany.sca.definitions.Definitions;
+
+/**
+ * An extension point for built-in SCA intent/policySet definition files
+ *
+ * @version $Rev$ $Date$
+ */
+public interface DefinitionsExtensionPoint {
+ String DEFINITIONS_FILE = "org.apache.tuscany.sca.definitions.xml.Definitions";
+
+ /**
+ * Add a definitions document
+ *
+ * @param url the URL of the definitions
+ */
+ void addDefinitionsDocument(URL url);
+
+ /**
+ * Remove a definitions document
+ *
+ * @param url the URL of the definitions
+ */
+ void removeDefinitionsDocument(URL url);
+
+ /**
+ * @param definitions
+ */
+ void addDefinitions(Definitions definitions);
+ /**
+ * @param definitions
+ */
+ void removeDefinitions(Definitions definitions);
+
+ /**
+ * Get the list of definitions
+ * @return A list of definitions
+ */
+ List<Definitions> getDefinitions();
+
+}
diff --git a/java/sca/modules/definitions-xml/src/main/resources/META-INF/sca-policy-1.1-intents-definitions-cd02.xml b/java/sca/modules/definitions-xml/src/main/resources/META-INF/sca-policy-1.1-intents-definitions-cd02.xml
index 491c3e486a..ade57b1ec0 100644
--- a/java/sca/modules/definitions-xml/src/main/resources/META-INF/sca-policy-1.1-intents-definitions-cd02.xml
+++ b/java/sca/modules/definitions-xml/src/main/resources/META-INF/sca-policy-1.1-intents-definitions-cd02.xml
@@ -1,242 +1,242 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
- OASIS trademark, IPR and other policies apply. -->
-<sca:definitions xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200903">
-
- <!-- Security related intents -->
- <sca:intent name="serverAuthentication" constrains="sca:binding"
- intentType="interaction">
- <sca:description>
- Communication through the binding requires that the
- server is authenticated by the client
- </sca:description>
- <sca:qualifier name="transport" default="true"/>
- <sca:qualifier name="message"/>
- </sca:intent>
-
- <sca:intent name="clientAuthentication" constrains="sca:binding"
- intentType="interaction">
- <sca:description>
- Communication through the binding requires that the
- client is authenticated by the server
- </sca:description>
- <sca:qualifier name="transport" default="true"/>
- <sca:qualifier name="message"/>
- </sca:intent>
-
- <sca:intent name="authentication" requires="sca:clientAuthentication">
- <sca:description>
- A convenience intent to help migration
- </sca:description>
- </sca:intent>
-
- <sca:intent name="mutualAuthentication"
- requires="sca:clientAuthentication sca:serverAuthentication">
- <sca:description>
- Communication through the binding requires that the
- client and server to authenticate each other
- </sca:description>
- </sca:intent>
-
- <sca:intent name="confidentiality" constrains="sca:binding"
- intentType="interaction">
- <sca:description>
- Communication through the binding prevents unauthorized
- users from reading the messages
- </sca:description>
- <sca:qualifier name="transport" default="true"/>
- <sca:qualifier name="message"/>
- </sca:intent>
-
- <sca:intent name="integrity" constrains="sca:binding"
- intentType="interaction">
- <sca:description>
- Communication through the binding prevents tampering
- with the messages sent between the client and the service.
- </sca:description>
- <sca:qualifier name="transport" default="true"/>
- <sca:qualifier name="message"/>
- </sca:intent>
-
- <sca:intent name="authorization" constrains="sca:implementation"
- intentType="implementation">
- <sca:description>
- Ensures clients are authorized to use services.
- </sca:description>
- <sca:qualifier name="fineGrain" default="true"/>
- </sca:intent>
-
-
- <!-- Reliable messaging related intents -->
- <sca:intent name="atLeastOnce" constrains="sca:binding"
- intentType="interaction">
- <sca:description>
- This intent is used to indicate that a message sent
- by a client is always delivered to the component.
- </sca:description>
- </sca:intent>
-
- <sca:intent name="atMostOnce" constrains="sca:binding"
- intentType="interaction">
- <sca:description>
- This intent is used to indicate that a message that was
- successfully sent by a client is not delivered more than
- once to the component.
- </sca:description>
- </sca:intent>
-
- <sca:intent name="exactlyOnce" requires="sca:atLeastOnce sca:atMostOnce"
- constrains="sca:binding" intentType="interaction">
- <sca:description>
- This profile intent is used to indicate that a message sent
- by a client is always delivered to the component. It also
- indicates that duplicate messages are not delivered to the
- component.
- </sca:description>
- </sca:intent>
-
- <sca:intent name="ordered" appliesTo="sca:binding"
- intentType="interaction">
- <sca:description>
- This intent is used to indicate that all the messages are
- delivered to the component in the order they were sent by
- the client.
- </sca:description>
- </sca:intent>
-
- <!-- Transaction related intents -->
- <sca:intent name="managedTransaction" excludes="sca:noManagedTransaction"
- mutuallyExclusive="true" constrains="sca:implementation"
- intentType="implementation">
- <sca:description>
- A managed transaction environment is necessary in order to
- run the component. The specific type of managed transaction
- needed is not constrained.
- </sca:description>
- <sca:qualifier name="global" default="true">
- <sca:description>
- For a component marked with managedTransaction.global
- a global transaction needs to be present before dispatching
- any method on the component - using any transaction
- propagated from the client or else beginning and completing
- a new transaction.
- </sca:description>
- </sca:qualifier>
- <sca:qualifier name="local">
- <sca:description>
- A component marked with managedTransaction.local needs to
- run within a local transaction containment (LTC) that
- is started and ended by the SCA runtime.
- </sca:description>
- </sca:qualifier>
- </sca:intent>
-
- <sca:intent name="noManagedTransaction" excludes="sca:managedTransaction"
- constrains="sca:implementation" intentType="implementation">
- <sca:description>
- A component marked with noManagedTransaction needs to run without
- a managed transaction, under neither a global transaction nor
- an LTC. A transaction propagated to the hosting SCA runtime
- is not joined by the hosting runtime on behalf of a
- component marked with noManagedtransaction.
- </sca:description>
- </sca:intent>
-
- <sca:intent name="transactedOneWay" excludes="sca:immediateOneWay"
- constrains="sca:binding" intentType="implementation">
- <sca:description>
- For a reference marked as transactedOneWay any OneWay invocation
- messages are transacted as part of a client global
- transaction.
- For a service marked as transactedOneWay any OneWay invocation
- message are received from the transport binding in a
- transacted fashion, under the service’s global transaction.
- </sca:description>
- </sca:intent>
-
- <sca:intent name="immediateOneWay" excludes="sca:transactedOneWay"
- constrains="sca:binding" intentType="implementation">
- <sca:description>
- For a reference indicates that any OneWay invocation messages
- are sent immediately regardless of any client transaction.
- For a service indicates that any OneWay invocation is
- received immediately regardless of any target service
- transaction.
- </sca:description>
- </sca:intent>
-
- <sca:intent name="propagatesTransaction" excludes="sca:suspendsTransaction"
- constrains="sca:binding" intentType="interaction">
- <sca:description>
- A service marked with propagatesTransaction is dispatched
- under any propagated (client) transaction and the service binding
- needs to be capable of receiving a transaction context.
- A reference marked with propagatesTransaction propagates any
- transaction context under which the client runs when the
- reference is used for a request-response interaction and the
- binding of a reference marked with propagatesTransaction needs to
- be capable of propagating a transaction context.
- </sca:description>
- </sca:intent>
-
- <sca:intent name="suspendsTransaction" excludes="sca:propagatesTransaction"
- constrains="sca:binding" intentType="interaction">
- <sca:description>
- A service marked with suspendsTransaction is not dispatched
- under any propagated (client) transaction.
- A reference marked with suspendsTransaction does not propagate
- any transaction context under which the client runs when the
- reference is used.
- </sca:description>
- </sca:intent>
-
- <sca:intent name="managedSharedTransaction"
- requires="sca:managedTransaction.global sca:propagatesTransaction">
- <sca:description>
- Used to indicate that the component requires both the
- managedTransaction.global and the propagatesTransactions
- intents
- </sca:description>
- </sca:intent>
-
- <!-- Miscellaneous intents -->
- <sca:intent name="asyncInvocation" constrains="sca:binding"
- intentType="interaction">
- <sca:description>
- Indicates that request/response operations for the
- interface of this wire are "long running" and must be
- treated as two separate message transmissions
- </sca:description>
- </sca:intent>
-
- <sca:intent name="SOAP" constrains="sca:binding" intentType="interaction">
- <sca:description>
- Specifies that the SOAP messaging model is used for delivering
- messages.
- </sca:description>
- <sca:qualifier name="1_1" default="true"/>
- <sca:qualifier name="1_2"/>
- </sca:intent>
-
- <sca:intent name="JMS" constrains="sca:binding" intentType="interaction">
- <sca:description>
- Requires that the messages are delivered and received via the
- JMS API.
- </sca:description>
- </sca:intent>
-
- <sca:intent name="noListener" constrains="sca:binding"
- intentType="interaction">
- <sca:description>
- This intent can only be used on a reference. Indicates that the
- client is not able to handle new inbound connections. The binding
- and callback binding are configured so that any
- response or callback comes either through a back channel of the
- connection from the client to the server or by having the client
- poll the server for messages.
- </sca:description>
- </sca:intent>
-
-</sca:definitions>
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
+ OASIS trademark, IPR and other policies apply. -->
+<sca:definitions xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ targetNamespace="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+
+ <!-- Security related intents -->
+ <sca:intent name="serverAuthentication" constrains="sca:binding"
+ intentType="interaction">
+ <sca:description>
+ Communication through the binding requires that the
+ server is authenticated by the client
+ </sca:description>
+ <sca:qualifier name="transport" default="true"/>
+ <sca:qualifier name="message"/>
+ </sca:intent>
+
+ <sca:intent name="clientAuthentication" constrains="sca:binding"
+ intentType="interaction">
+ <sca:description>
+ Communication through the binding requires that the
+ client is authenticated by the server
+ </sca:description>
+ <sca:qualifier name="transport" default="true"/>
+ <sca:qualifier name="message"/>
+ </sca:intent>
+
+ <sca:intent name="authentication" requires="sca:clientAuthentication">
+ <sca:description>
+ A convenience intent to help migration
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="mutualAuthentication"
+ requires="sca:clientAuthentication sca:serverAuthentication">
+ <sca:description>
+ Communication through the binding requires that the
+ client and server to authenticate each other
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="confidentiality" constrains="sca:binding"
+ intentType="interaction">
+ <sca:description>
+ Communication through the binding prevents unauthorized
+ users from reading the messages
+ </sca:description>
+ <sca:qualifier name="transport" default="true"/>
+ <sca:qualifier name="message"/>
+ </sca:intent>
+
+ <sca:intent name="integrity" constrains="sca:binding"
+ intentType="interaction">
+ <sca:description>
+ Communication through the binding prevents tampering
+ with the messages sent between the client and the service.
+ </sca:description>
+ <sca:qualifier name="transport" default="true"/>
+ <sca:qualifier name="message"/>
+ </sca:intent>
+
+ <sca:intent name="authorization" constrains="sca:implementation"
+ intentType="implementation">
+ <sca:description>
+ Ensures clients are authorized to use services.
+ </sca:description>
+ <sca:qualifier name="fineGrain" default="true"/>
+ </sca:intent>
+
+
+ <!-- Reliable messaging related intents -->
+ <sca:intent name="atLeastOnce" constrains="sca:binding"
+ intentType="interaction">
+ <sca:description>
+ This intent is used to indicate that a message sent
+ by a client is always delivered to the component.
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="atMostOnce" constrains="sca:binding"
+ intentType="interaction">
+ <sca:description>
+ This intent is used to indicate that a message that was
+ successfully sent by a client is not delivered more than
+ once to the component.
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="exactlyOnce" requires="sca:atLeastOnce sca:atMostOnce"
+ constrains="sca:binding" intentType="interaction">
+ <sca:description>
+ This profile intent is used to indicate that a message sent
+ by a client is always delivered to the component. It also
+ indicates that duplicate messages are not delivered to the
+ component.
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="ordered" appliesTo="sca:binding"
+ intentType="interaction">
+ <sca:description>
+ This intent is used to indicate that all the messages are
+ delivered to the component in the order they were sent by
+ the client.
+ </sca:description>
+ </sca:intent>
+
+ <!-- Transaction related intents -->
+ <sca:intent name="managedTransaction" excludes="sca:noManagedTransaction"
+ mutuallyExclusive="true" constrains="sca:implementation"
+ intentType="implementation">
+ <sca:description>
+ A managed transaction environment is necessary in order to
+ run the component. The specific type of managed transaction
+ needed is not constrained.
+ </sca:description>
+ <sca:qualifier name="global" default="true">
+ <sca:description>
+ For a component marked with managedTransaction.global
+ a global transaction needs to be present before dispatching
+ any method on the component - using any transaction
+ propagated from the client or else beginning and completing
+ a new transaction.
+ </sca:description>
+ </sca:qualifier>
+ <sca:qualifier name="local">
+ <sca:description>
+ A component marked with managedTransaction.local needs to
+ run within a local transaction containment (LTC) that
+ is started and ended by the SCA runtime.
+ </sca:description>
+ </sca:qualifier>
+ </sca:intent>
+
+ <sca:intent name="noManagedTransaction" excludes="sca:managedTransaction"
+ constrains="sca:implementation" intentType="implementation">
+ <sca:description>
+ A component marked with noManagedTransaction needs to run without
+ a managed transaction, under neither a global transaction nor
+ an LTC. A transaction propagated to the hosting SCA runtime
+ is not joined by the hosting runtime on behalf of a
+ component marked with noManagedtransaction.
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="transactedOneWay" excludes="sca:immediateOneWay"
+ constrains="sca:binding" intentType="implementation">
+ <sca:description>
+ For a reference marked as transactedOneWay any OneWay invocation
+ messages are transacted as part of a client global
+ transaction.
+ For a service marked as transactedOneWay any OneWay invocation
+ message are received from the transport binding in a
+ transacted fashion, under the service’s global transaction.
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="immediateOneWay" excludes="sca:transactedOneWay"
+ constrains="sca:binding" intentType="implementation">
+ <sca:description>
+ For a reference indicates that any OneWay invocation messages
+ are sent immediately regardless of any client transaction.
+ For a service indicates that any OneWay invocation is
+ received immediately regardless of any target service
+ transaction.
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="propagatesTransaction" excludes="sca:suspendsTransaction"
+ constrains="sca:binding" intentType="interaction">
+ <sca:description>
+ A service marked with propagatesTransaction is dispatched
+ under any propagated (client) transaction and the service binding
+ needs to be capable of receiving a transaction context.
+ A reference marked with propagatesTransaction propagates any
+ transaction context under which the client runs when the
+ reference is used for a request-response interaction and the
+ binding of a reference marked with propagatesTransaction needs to
+ be capable of propagating a transaction context.
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="suspendsTransaction" excludes="sca:propagatesTransaction"
+ constrains="sca:binding" intentType="interaction">
+ <sca:description>
+ A service marked with suspendsTransaction is not dispatched
+ under any propagated (client) transaction.
+ A reference marked with suspendsTransaction does not propagate
+ any transaction context under which the client runs when the
+ reference is used.
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="managedSharedTransaction"
+ requires="sca:managedTransaction.global sca:propagatesTransaction">
+ <sca:description>
+ Used to indicate that the component requires both the
+ managedTransaction.global and the propagatesTransactions
+ intents
+ </sca:description>
+ </sca:intent>
+
+ <!-- Miscellaneous intents -->
+ <sca:intent name="asyncInvocation" constrains="sca:binding"
+ intentType="interaction">
+ <sca:description>
+ Indicates that request/response operations for the
+ interface of this wire are "long running" and must be
+ treated as two separate message transmissions
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="SOAP" constrains="sca:binding" intentType="interaction">
+ <sca:description>
+ Specifies that the SOAP messaging model is used for delivering
+ messages.
+ </sca:description>
+ <sca:qualifier name="1_1" default="true"/>
+ <sca:qualifier name="1_2"/>
+ </sca:intent>
+
+ <sca:intent name="JMS" constrains="sca:binding" intentType="interaction">
+ <sca:description>
+ Requires that the messages are delivered and received via the
+ JMS API.
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="noListener" constrains="sca:binding"
+ intentType="interaction">
+ <sca:description>
+ This intent can only be used on a reference. Indicates that the
+ client is not able to handle new inbound connections. The binding
+ and callback binding are configured so that any
+ response or callback comes either through a back channel of the
+ connection from the client to the server or by having the client
+ poll the server for messages.
+ </sca:description>
+ </sca:intent>
+
+</sca:definitions>
diff --git a/java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/ReadDocumentTestCase.java b/java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/ReadDocumentTestCase.java
index cc36cd69ec..8ed836a5c1 100644
--- a/java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/ReadDocumentTestCase.java
+++ b/java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/ReadDocumentTestCase.java
@@ -1,226 +1,226 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.definitions;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.net.URI;
-import java.net.URL;
-import java.util.Hashtable;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.resolver.DefaultModelResolver;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.policy.BindingType;
-import org.apache.tuscany.sca.policy.ImplementationType;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentMap;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.Qualifier;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test reading SCA XML assembly documents.
- *
- * @version $Rev: 551296 $ $Date: 2007-06-28 01:18:35 +0530 (Thu, 28 Jun 2007) $
- */
-public class ReadDocumentTestCase {
-
- private static URLArtifactProcessor<Definitions> policyDefinitionsProcessor = null;
- private static Definitions definitions;
- private static Map<QName, Intent> intentTable = new Hashtable<QName, Intent>();
- private static Map<QName, PolicySet> policySetTable = new Hashtable<QName, PolicySet>();
- private static Map<QName, BindingType> bindingTypesTable = new Hashtable<QName, BindingType>();
- private static Map<QName, ImplementationType> implTypesTable = new Hashtable<QName, ImplementationType>();
- public static final String scaNamespace = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
- public static final String namespace = "http://test";
-
- private static final QName secureWsPolicy = new QName(namespace, "SecureWSPolicy");
- private static final QName confidentiality = new QName(namespace, "confidentiality");
- private static final QName integrity = new QName(namespace, "integrity");
- private static final QName messageProtection = new QName(namespace, "messageProtection");
- private static final QName confidentiality_transport = new QName(namespace, "confidentiality.transport");
- private static final QName confidentiality_message = new QName(namespace, "confidentiality.message");
- private static final QName secureReliablePolicy = new QName(namespace, "SecureReliablePolicy");
- private static final QName secureMessagingPolicies = new QName(namespace, "SecureMessagingPolicies");
- private static final QName securityPolicy = new QName(namespace, "SecurityPolicy");
- private static final QName basicAuthMsgProtSecurity = new QName(namespace, "BasicAuthMsgProtSecurity");
- private static final QName wsBinding = new QName(scaNamespace, "binding.ws");
- private static final QName javaImpl = new QName(scaNamespace, "implementation.java");
-
- @BeforeClass
- public static void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
-
- // Create StAX processors
- StAXArtifactProcessorExtensionPoint staxProcessors =
- extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- staxProcessors.addArtifactProcessor(new TestPolicyProcessor());
-
- URLArtifactProcessorExtensionPoint documentProcessors =
- extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- policyDefinitionsProcessor = documentProcessors.getProcessor(Definitions.class);
-
- URL url = ReadDocumentTestCase.class.getResource("test_definitions.xml");
- URI uri = URI.create("test_definitions.xml");
- definitions = policyDefinitionsProcessor.read(null, uri, url);
-
- for (Intent intent : definitions.getIntents()) {
- intentTable.put(intent.getName(), intent);
- for (Intent i : intent.getQualifiedIntents()) {
- intentTable.put(i.getName(), i);
- }
- }
-
- for (PolicySet policySet : definitions.getPolicySets()) {
- policySetTable.put(policySet.getName(), policySet);
- }
-
- for (BindingType bindingType : definitions.getBindingTypes()) {
- bindingTypesTable.put(bindingType.getType(), bindingType);
- }
-
- for (ImplementationType implType : definitions.getImplementationTypes()) {
- implTypesTable.put(implType.getType(), implType);
- }
- }
-
- @Test
- public void testReadSCADefinitions() throws Exception {
- assertNotNull(definitions);
-
- assertNotNull(intentTable.get(confidentiality));
- assertNotNull(intentTable.get(messageProtection));
- assertNotNull(intentTable.get(confidentiality_transport));
- assertTrue(intentTable.get(confidentiality).getDescription().length() > 0);
-
- assertNotNull(policySetTable.get(secureReliablePolicy));
- assertTrue(policySetTable.get(secureReliablePolicy).getProvidedIntents().size() == 2);
- assertTrue(policySetTable.get(secureReliablePolicy).getPolicies().size() == 2);
-
- assertNotNull(policySetTable.get(secureMessagingPolicies));
- assertEquals(2, policySetTable.get(secureMessagingPolicies).getIntentMaps().get(0).getQualifiers().size());
- //assertTrue(policySetTable.get(secureWsPolicy).getPolicies().get(0) instanceof org.apache.neethi.Policy);
-
- assertEquals(bindingTypesTable.size(), 1);
- assertNotNull(bindingTypesTable.get(wsBinding));
- assertEquals(implTypesTable.size(), 1);
- assertNotNull(implTypesTable.get(javaImpl));
- }
-
- private boolean isRealizedBy(PolicySet policySet, Intent intent) {
- if (intent.getName().getLocalPart().indexOf('.') == -1) {
- return policySet.getProvidedIntents().contains(intent);
- }
- for (IntentMap map : policySet.getIntentMaps()) {
- for (Qualifier q : map.getQualifiers()) {
- if (q.getIntent().equals(intent)) {
- return true;
- }
- }
- }
- return false;
- }
-
- private int getNumberOfQualifiedPolicies(PolicySet policySet) {
- int count = 0;
- for(IntentMap intentMap: policySet.getIntentMaps()) {
- for(Qualifier q: intentMap.getQualifiers()) {
- count += q.getPolicies().size();
- }
- }
- return count;
- }
-
- @Test
- public void testResolveSCADefinitions() throws Exception {
- Intent i1 = intentTable.get(messageProtection);
- assertTrue(!i1.getRequiredIntents().isEmpty());
- assertNull(i1.getRequiredIntents().get(0).getDescription());
-
- QName confidentiality_transport = new QName(namespace, "confidentiality.transport");
- Intent i2 = intentTable.get(confidentiality_transport);
- assertNotNull(i2.getQualifiableIntent());
-
- PolicySet secureReliablePolicySet = policySetTable.get(secureReliablePolicy);
- PolicySet secureMessagingPolicySet = policySetTable.get(secureMessagingPolicies);
- PolicySet securityPolicySet = policySetTable.get(securityPolicy);
-
- assertEquals(secureReliablePolicySet.getProvidedIntents().get(1).getName(), integrity);
- assertNull(secureReliablePolicySet.getProvidedIntents().get(1).getDescription());
- assertTrue(secureMessagingPolicySet.isUnresolved());
- assertEquals(3, getNumberOfQualifiedPolicies(securityPolicySet));
-
- //testing to ensure that inclusion of referred policy sets has not happened
- PolicySet basicAuthMsgProtSecurityPolicySet = policySetTable.get(basicAuthMsgProtSecurity);
- assertTrue(basicAuthMsgProtSecurityPolicySet.getPolicies().isEmpty());
- assertTrue(basicAuthMsgProtSecurityPolicySet.getIntentMaps().isEmpty());
-
- BindingType wsBindingType = bindingTypesTable.get(wsBinding);
- assertNull(wsBindingType.getAlwaysProvidedIntents().get(0).getDescription());
- assertNull(wsBindingType.getMayProvidedIntents().get(0).getDescription());
-
- ImplementationType javaImplType = implTypesTable.get(javaImpl);
- assertNull(javaImplType.getAlwaysProvidedIntents().get(0).getDescription());
- assertNull(javaImplType.getMayProvidedIntents().get(0).getDescription());
-
- ModelResolver resolver = new DefaultModelResolver();
- policyDefinitionsProcessor.resolve(definitions, resolver);
- //builder.build(scaDefinitions);
-
- //testing if policy intents have been linked have property been linked up
- assertNotNull(i1.getRequiredIntents().get(0).getDescription());
- // assertNotNull(i2.getQualifiableIntent().getDescription());
- assertEquals(secureReliablePolicySet.getProvidedIntents().get(1).getName(), integrity);
- assertNotNull(secureReliablePolicySet.getProvidedIntents().get(1).getDescription());
-
- //testing if policysets have been properly linked up with intents
- assertFalse(secureMessagingPolicySet.isUnresolved());
- assertTrue(isRealizedBy(secureMessagingPolicySet, intentTable.get(confidentiality)));
- assertTrue(isRealizedBy(secureMessagingPolicySet, intentTable.get(confidentiality_transport)));
-
- //testing if intent maps have been properly mapped to policies
- assertFalse(securityPolicySet.isUnresolved());
- assertTrue(isRealizedBy(securityPolicySet, intentTable.get(confidentiality)));
- assertTrue(isRealizedBy(securityPolicySet, intentTable.get(confidentiality_message)));
-
- //testing for inclusion of referred policysets
- assertFalse(basicAuthMsgProtSecurityPolicySet.getPolicies().isEmpty());
- assertFalse(basicAuthMsgProtSecurityPolicySet.getIntentMaps().get(0).getQualifiers().isEmpty());
- assertTrue(isRealizedBy(basicAuthMsgProtSecurityPolicySet, intentTable.get(confidentiality_transport)));
-
- assertNotNull(wsBindingType.getAlwaysProvidedIntents().get(0).getDescription());
- assertNotNull(wsBindingType.getMayProvidedIntents().get(0).getDescription());
-
- assertNotNull(javaImplType.getAlwaysProvidedIntents().get(0).getDescription());
- assertNotNull(javaImplType.getMayProvidedIntents().get(0).getDescription());
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.definitions;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.net.URI;
+import java.net.URL;
+import java.util.Hashtable;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.resolver.DefaultModelResolver;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.policy.BindingType;
+import org.apache.tuscany.sca.policy.ImplementationType;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.IntentMap;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.Qualifier;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Test reading SCA XML assembly documents.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ReadDocumentTestCase {
+
+ private static URLArtifactProcessor<Definitions> policyDefinitionsProcessor = null;
+ private static Definitions definitions;
+ private static Map<QName, Intent> intentTable = new Hashtable<QName, Intent>();
+ private static Map<QName, PolicySet> policySetTable = new Hashtable<QName, PolicySet>();
+ private static Map<QName, BindingType> bindingTypesTable = new Hashtable<QName, BindingType>();
+ private static Map<QName, ImplementationType> implTypesTable = new Hashtable<QName, ImplementationType>();
+ public static final String scaNamespace = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
+ public static final String namespace = "http://test";
+
+ private static final QName secureWsPolicy = new QName(namespace, "SecureWSPolicy");
+ private static final QName confidentiality = new QName(namespace, "confidentiality");
+ private static final QName integrity = new QName(namespace, "integrity");
+ private static final QName messageProtection = new QName(namespace, "messageProtection");
+ private static final QName confidentiality_transport = new QName(namespace, "confidentiality.transport");
+ private static final QName confidentiality_message = new QName(namespace, "confidentiality.message");
+ private static final QName secureReliablePolicy = new QName(namespace, "SecureReliablePolicy");
+ private static final QName secureMessagingPolicies = new QName(namespace, "SecureMessagingPolicies");
+ private static final QName securityPolicy = new QName(namespace, "SecurityPolicy");
+ private static final QName basicAuthMsgProtSecurity = new QName(namespace, "BasicAuthMsgProtSecurity");
+ private static final QName wsBinding = new QName(scaNamespace, "binding.ws");
+ private static final QName javaImpl = new QName(scaNamespace, "implementation.java");
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+
+ // Create StAX processors
+ StAXArtifactProcessorExtensionPoint staxProcessors =
+ extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+ staxProcessors.addArtifactProcessor(new TestPolicyProcessor());
+
+ URLArtifactProcessorExtensionPoint documentProcessors =
+ extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
+ policyDefinitionsProcessor = documentProcessors.getProcessor(Definitions.class);
+
+ URL url = ReadDocumentTestCase.class.getResource("test_definitions.xml");
+ URI uri = URI.create("test_definitions.xml");
+ definitions = policyDefinitionsProcessor.read(null, uri, url);
+
+ for (Intent intent : definitions.getIntents()) {
+ intentTable.put(intent.getName(), intent);
+ for (Intent i : intent.getQualifiedIntents()) {
+ intentTable.put(i.getName(), i);
+ }
+ }
+
+ for (PolicySet policySet : definitions.getPolicySets()) {
+ policySetTable.put(policySet.getName(), policySet);
+ }
+
+ for (BindingType bindingType : definitions.getBindingTypes()) {
+ bindingTypesTable.put(bindingType.getType(), bindingType);
+ }
+
+ for (ImplementationType implType : definitions.getImplementationTypes()) {
+ implTypesTable.put(implType.getType(), implType);
+ }
+ }
+
+ @Test
+ public void testReadSCADefinitions() throws Exception {
+ assertNotNull(definitions);
+
+ assertNotNull(intentTable.get(confidentiality));
+ assertNotNull(intentTable.get(messageProtection));
+ assertNotNull(intentTable.get(confidentiality_transport));
+ assertTrue(intentTable.get(confidentiality).getDescription().length() > 0);
+
+ assertNotNull(policySetTable.get(secureReliablePolicy));
+ assertTrue(policySetTable.get(secureReliablePolicy).getProvidedIntents().size() == 2);
+ assertTrue(policySetTable.get(secureReliablePolicy).getPolicies().size() == 2);
+
+ assertNotNull(policySetTable.get(secureMessagingPolicies));
+ assertEquals(2, policySetTable.get(secureMessagingPolicies).getIntentMaps().get(0).getQualifiers().size());
+ //assertTrue(policySetTable.get(secureWsPolicy).getPolicies().get(0) instanceof org.apache.neethi.Policy);
+
+ assertEquals(bindingTypesTable.size(), 1);
+ assertNotNull(bindingTypesTable.get(wsBinding));
+ assertEquals(implTypesTable.size(), 1);
+ assertNotNull(implTypesTable.get(javaImpl));
+ }
+
+ private boolean isRealizedBy(PolicySet policySet, Intent intent) {
+ if (intent.getName().getLocalPart().indexOf('.') == -1) {
+ return policySet.getProvidedIntents().contains(intent);
+ }
+ for (IntentMap map : policySet.getIntentMaps()) {
+ for (Qualifier q : map.getQualifiers()) {
+ if (q.getIntent().equals(intent)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private int getNumberOfQualifiedPolicies(PolicySet policySet) {
+ int count = 0;
+ for(IntentMap intentMap: policySet.getIntentMaps()) {
+ for(Qualifier q: intentMap.getQualifiers()) {
+ count += q.getPolicies().size();
+ }
+ }
+ return count;
+ }
+
+ @Test
+ public void testResolveSCADefinitions() throws Exception {
+ Intent i1 = intentTable.get(messageProtection);
+ assertTrue(!i1.getRequiredIntents().isEmpty());
+ assertNull(i1.getRequiredIntents().get(0).getDescription());
+
+ QName confidentiality_transport = new QName(namespace, "confidentiality.transport");
+ Intent i2 = intentTable.get(confidentiality_transport);
+ assertNotNull(i2.getQualifiableIntent());
+
+ PolicySet secureReliablePolicySet = policySetTable.get(secureReliablePolicy);
+ PolicySet secureMessagingPolicySet = policySetTable.get(secureMessagingPolicies);
+ PolicySet securityPolicySet = policySetTable.get(securityPolicy);
+
+ assertEquals(secureReliablePolicySet.getProvidedIntents().get(1).getName(), integrity);
+ assertNull(secureReliablePolicySet.getProvidedIntents().get(1).getDescription());
+ assertTrue(secureMessagingPolicySet.isUnresolved());
+ assertEquals(3, getNumberOfQualifiedPolicies(securityPolicySet));
+
+ //testing to ensure that inclusion of referred policy sets has not happened
+ PolicySet basicAuthMsgProtSecurityPolicySet = policySetTable.get(basicAuthMsgProtSecurity);
+ assertTrue(basicAuthMsgProtSecurityPolicySet.getPolicies().isEmpty());
+ assertTrue(basicAuthMsgProtSecurityPolicySet.getIntentMaps().isEmpty());
+
+ BindingType wsBindingType = bindingTypesTable.get(wsBinding);
+ assertNull(wsBindingType.getAlwaysProvidedIntents().get(0).getDescription());
+ assertNull(wsBindingType.getMayProvidedIntents().get(0).getDescription());
+
+ ImplementationType javaImplType = implTypesTable.get(javaImpl);
+ assertNull(javaImplType.getAlwaysProvidedIntents().get(0).getDescription());
+ assertNull(javaImplType.getMayProvidedIntents().get(0).getDescription());
+
+ ModelResolver resolver = new DefaultModelResolver();
+ policyDefinitionsProcessor.resolve(definitions, resolver);
+ //builder.build(scaDefinitions);
+
+ //testing if policy intents have been linked have property been linked up
+ assertNotNull(i1.getRequiredIntents().get(0).getDescription());
+ // assertNotNull(i2.getQualifiableIntent().getDescription());
+ assertEquals(secureReliablePolicySet.getProvidedIntents().get(1).getName(), integrity);
+ assertNotNull(secureReliablePolicySet.getProvidedIntents().get(1).getDescription());
+
+ //testing if policysets have been properly linked up with intents
+ assertFalse(secureMessagingPolicySet.isUnresolved());
+ assertTrue(isRealizedBy(secureMessagingPolicySet, intentTable.get(confidentiality)));
+ assertTrue(isRealizedBy(secureMessagingPolicySet, intentTable.get(confidentiality_transport)));
+
+ //testing if intent maps have been properly mapped to policies
+ assertFalse(securityPolicySet.isUnresolved());
+ assertTrue(isRealizedBy(securityPolicySet, intentTable.get(confidentiality)));
+ assertTrue(isRealizedBy(securityPolicySet, intentTable.get(confidentiality_message)));
+
+ //testing for inclusion of referred policysets
+ assertFalse(basicAuthMsgProtSecurityPolicySet.getPolicies().isEmpty());
+ assertFalse(basicAuthMsgProtSecurityPolicySet.getIntentMaps().get(0).getQualifiers().isEmpty());
+ assertTrue(isRealizedBy(basicAuthMsgProtSecurityPolicySet, intentTable.get(confidentiality_transport)));
+
+ assertNotNull(wsBindingType.getAlwaysProvidedIntents().get(0).getDescription());
+ assertNotNull(wsBindingType.getMayProvidedIntents().get(0).getDescription());
+
+ assertNotNull(javaImplType.getAlwaysProvidedIntents().get(0).getDescription());
+ assertNotNull(javaImplType.getMayProvidedIntents().get(0).getDescription());
+ }
+}
diff --git a/java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/TestPolicyProcessor.java b/java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/TestPolicyProcessor.java
index 73a84f5354..4e5c62c8b2 100644
--- a/java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/TestPolicyProcessor.java
+++ b/java/sca/modules/definitions-xml/src/test/java/org/apache/tuscany/sca/definitions/TestPolicyProcessor.java
@@ -1,57 +1,57 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.definitions;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * A PolicyProcessor used for testing.
- *
- * @version $Rev$ $Date$
- */
-public class TestPolicyProcessor implements StAXArtifactProcessor<MockPolicy> {
- public QName getArtifactType() {
- return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
- }
-
- public MockPolicy read(XMLStreamReader arg0) throws ContributionReadException, XMLStreamException {
- return new MockPolicy();
- }
-
- public void write(MockPolicy arg0, XMLStreamWriter arg1) throws ContributionWriteException, XMLStreamException {
- }
-
- public Class<MockPolicy> getModelType() {
- return MockPolicy.class;
- }
-
- public void resolve(MockPolicy arg0, ModelResolver arg1) throws ContributionResolveException {
-
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.definitions;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+
+/**
+ * A PolicyProcessor used for testing.
+ *
+ * @version $Rev$ $Date$
+ */
+public class TestPolicyProcessor implements StAXArtifactProcessor<MockPolicy> {
+ public QName getArtifactType() {
+ return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
+ }
+
+ public MockPolicy read(XMLStreamReader arg0) throws ContributionReadException, XMLStreamException {
+ return new MockPolicy();
+ }
+
+ public void write(MockPolicy arg0, XMLStreamWriter arg1) throws ContributionWriteException, XMLStreamException {
+ }
+
+ public Class<MockPolicy> getModelType() {
+ return MockPolicy.class;
+ }
+
+ public void resolve(MockPolicy arg0, ModelResolver arg1) throws ContributionResolveException {
+
+ }
+
+}
diff --git a/java/sca/modules/definitions-xml/src/test/resources/org/apache/tuscany/sca/definitions/test_definitions.xml b/java/sca/modules/definitions-xml/src/test/resources/org/apache/tuscany/sca/definitions/test_definitions.xml
index c59fb3537b..9de5be3212 100644
--- a/java/sca/modules/definitions-xml/src/test/resources/org/apache/tuscany/sca/definitions/test_definitions.xml
+++ b/java/sca/modules/definitions-xml/src/test/resources/org/apache/tuscany/sca/definitions/test_definitions.xml
@@ -1,206 +1,206 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://test"
- xmlns:test="http://test" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
-
- <!-- Extension Types Metadata -->
- <implementationType type="sca:implementation.java" alwaysProvides="test:logging" mayProvide="test:tracing" />
- <bindingType type="sca:binding.ws" alwaysProvides="test:confidentiality" mayProvide="test:integrity" />
-
- <!-- Intents and Policysets to assume targetnamespace -->
- <intent name="TestIntentOne" constrains="sca:binding">
- <description>
- Test Intent
- </description>
- </intent>
-
- <intent name="TestIntentTwo" constrains="sca:binding" requires="test:TestIntentOne">
- <description>
- Protect messages from unauthorized reading or modification
- </description>
- </intent>
-
- <policySet name="TestPolicySetOne" provides="test:TestIntentOne" appliesTo="sca:binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for
- "basic authentication" -->
- </wsp:PolicyAttachment>
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for
- "reliability" -->
- </wsp:PolicyAttachment>
- </policySet>
-
- <!-- POLICY SETS -->
- <policySet name="SecureReliablePolicy" provides="test:confidentiality.transport test:integrity" appliesTo="sca:binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for
- "basic authentication" -->
- </wsp:PolicyAttachment>
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for
- "reliability" -->
- </wsp:PolicyAttachment>
- </policySet>
-
- <policySet name="SecureMessagingPolicies" provides="test:confidentiality" appliesTo="binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <intentMap provides="test:confidentiality" default="transport">
- <qualifier name="transport">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for "transport" alternative -->
- </wsp:PolicyAttachment>
- <wsp:PolicyAttachment>...</wsp:PolicyAttachment>
- </qualifier>
- <qualifier name="message">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for "message" alternative" -->
- </wsp:PolicyAttachment>
- </qualifier>
- </intentMap>
- </policySet>
-
- <policySet name="SecurityPolicy" provides="test:confidentiality" appliesTo="binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <intentMap provides="test:confidentiality" default="message">
- <qualifier name="message">
- <wsp:PolicyAttachment>
- <!-- policy attachment for body encryption -->
- </wsp:PolicyAttachment>
- <wsp:PolicyAttachment>
- <!-- policy attachment for whole message encryption -->
- </wsp:PolicyAttachment>
- </qualifier>
- <qualifier name="transport">
- <wsp:PolicyAttachment>
- <!-- policy attachment for transport encryption -->
- </wsp:PolicyAttachment>
- </qualifier>
- </intentMap>
- </policySet>
-
- <policySet name="BasicAuthMsgProtSecurity" provides="test:authentication test:confidentiality" appliesTo="binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903">
- <policySetReference name="test:AuthenticationPolicies" />
- <policySetReference name="test:ConfidentialityPolicies" />
- </policySet>
-
- <policySet name="AuthenticationPolicies" provides="test:authentication" appliesTo="binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for "basic
- authentication" -->
- </wsp:PolicyAttachment>
- </policySet>
-
- <policySet name="ConfidentialityPolicies" provides="test:confidentiality" appliesTo="binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <intentMap provides="test:confidentiality" default="transport">
- <qualifier name="transport">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for "transport"
- alternative -->
- </wsp:PolicyAttachment>
- <wsp:PolicyAttachment>...</wsp:PolicyAttachment>
- </qualifier>
- <qualifier name="message">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for "message"
- alternative" -->
- ...
- </wsp:PolicyAttachment>
- </qualifier>
- </intentMap>
- </policySet>
-
- <policySet name="SecureWSPolicy" provides="test:confidentiality" appliesTo="sca:binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:sp="http://schemas.xmlsoap.org/ws/2002/12/secext"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:Policy>
- <wsp:ExactlyOne>
- <wsp:All>
- <sp:SecurityToken>
- <sp:TokenType>sp:X509v3</sp:TokenType>
- </sp:SecurityToken>
- <sp:UsernameToken />
- <sp:SignedParts />
- <sp:EncryptedParts>
- <sp:Body />
- </sp:EncryptedParts>
- <sp:TransportBinding>
- <sp:IncludeTimeStamp />
- </sp:TransportBinding>
- </wsp:All>
- </wsp:ExactlyOne>
- </wsp:Policy>
- </policySet>
-
- <!-- profile intent -->
- <intent name="reliableMessageProtection" constrains="sca:binding" requires="test:messageProtection">
- <description>
- Protect messages from unauthorized reading or modification
- </description>
- </intent>
-
- <intent name="messageProtection" constrains="sca:binding" requires="test:confidentiality test:integrity">
- <description>
- Protect messages from unauthorized reading or modification
- </description>
- </intent>
-
- <!-- simple intent -->
- <intent name="confidentiality" constrains="sca:binding">
- <description>
- Communitcation thro this binding must prevent
- unauthorized users from reading the messages.
- </description>
- <qualifier name="transport" />
- <qualifier name="message" default="true" />
- </intent>
-
- <intent name="integrity" constrains="sca:binding">
- <description>
- Communitcation thro this binding must prevent
- unauthorized modification of the messages.
- </description>
- </intent>
-
- <intent name="authentication" constrains="sca:binding">
- <description>
- Communitcation thro this binding required
- Authentication.
- </description>
- </intent>
-
- <intent name="logging" constrains="sca:implementation">
- <description>
- All messages to and from this implementation must be logged
- </description>
- </intent>
-
- <intent name="tracing" constrains="sca:implementation.java">
- <description>
- Need to figure out some description for this
- </description>
- </intent>
-
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://test"
+ xmlns:test="http://test" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+
+ <!-- Extension Types Metadata -->
+ <implementationType type="sca:implementation.java" alwaysProvides="test:logging" mayProvide="test:tracing" />
+ <bindingType type="sca:binding.ws" alwaysProvides="test:confidentiality" mayProvide="test:integrity" />
+
+ <!-- Intents and Policysets to assume targetnamespace -->
+ <intent name="TestIntentOne" constrains="sca:binding">
+ <description>
+ Test Intent
+ </description>
+ </intent>
+
+ <intent name="TestIntentTwo" constrains="sca:binding" requires="test:TestIntentOne">
+ <description>
+ Protect messages from unauthorized reading or modification
+ </description>
+ </intent>
+
+ <policySet name="TestPolicySetOne" provides="test:TestIntentOne" appliesTo="sca:binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for
+ "basic authentication" -->
+ </wsp:PolicyAttachment>
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for
+ "reliability" -->
+ </wsp:PolicyAttachment>
+ </policySet>
+
+ <!-- POLICY SETS -->
+ <policySet name="SecureReliablePolicy" provides="test:confidentiality.transport test:integrity" appliesTo="sca:binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for
+ "basic authentication" -->
+ </wsp:PolicyAttachment>
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for
+ "reliability" -->
+ </wsp:PolicyAttachment>
+ </policySet>
+
+ <policySet name="SecureMessagingPolicies" provides="test:confidentiality" appliesTo="binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <intentMap provides="test:confidentiality" default="transport">
+ <qualifier name="transport">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for "transport" alternative -->
+ </wsp:PolicyAttachment>
+ <wsp:PolicyAttachment>...</wsp:PolicyAttachment>
+ </qualifier>
+ <qualifier name="message">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for "message" alternative" -->
+ </wsp:PolicyAttachment>
+ </qualifier>
+ </intentMap>
+ </policySet>
+
+ <policySet name="SecurityPolicy" provides="test:confidentiality" appliesTo="binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <intentMap provides="test:confidentiality" default="message">
+ <qualifier name="message">
+ <wsp:PolicyAttachment>
+ <!-- policy attachment for body encryption -->
+ </wsp:PolicyAttachment>
+ <wsp:PolicyAttachment>
+ <!-- policy attachment for whole message encryption -->
+ </wsp:PolicyAttachment>
+ </qualifier>
+ <qualifier name="transport">
+ <wsp:PolicyAttachment>
+ <!-- policy attachment for transport encryption -->
+ </wsp:PolicyAttachment>
+ </qualifier>
+ </intentMap>
+ </policySet>
+
+ <policySet name="BasicAuthMsgProtSecurity" provides="test:authentication test:confidentiality" appliesTo="binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+ <policySetReference name="test:AuthenticationPolicies" />
+ <policySetReference name="test:ConfidentialityPolicies" />
+ </policySet>
+
+ <policySet name="AuthenticationPolicies" provides="test:authentication" appliesTo="binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for "basic
+ authentication" -->
+ </wsp:PolicyAttachment>
+ </policySet>
+
+ <policySet name="ConfidentialityPolicies" provides="test:confidentiality" appliesTo="binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <intentMap provides="test:confidentiality" default="transport">
+ <qualifier name="transport">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for "transport"
+ alternative -->
+ </wsp:PolicyAttachment>
+ <wsp:PolicyAttachment>...</wsp:PolicyAttachment>
+ </qualifier>
+ <qualifier name="message">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for "message"
+ alternative" -->
+ ...
+ </wsp:PolicyAttachment>
+ </qualifier>
+ </intentMap>
+ </policySet>
+
+ <policySet name="SecureWSPolicy" provides="test:confidentiality" appliesTo="sca:binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:sp="http://schemas.xmlsoap.org/ws/2002/12/secext"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:Policy>
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SecurityToken>
+ <sp:TokenType>sp:X509v3</sp:TokenType>
+ </sp:SecurityToken>
+ <sp:UsernameToken />
+ <sp:SignedParts />
+ <sp:EncryptedParts>
+ <sp:Body />
+ </sp:EncryptedParts>
+ <sp:TransportBinding>
+ <sp:IncludeTimeStamp />
+ </sp:TransportBinding>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ </policySet>
+
+ <!-- profile intent -->
+ <intent name="reliableMessageProtection" constrains="sca:binding" requires="test:messageProtection">
+ <description>
+ Protect messages from unauthorized reading or modification
+ </description>
+ </intent>
+
+ <intent name="messageProtection" constrains="sca:binding" requires="test:confidentiality test:integrity">
+ <description>
+ Protect messages from unauthorized reading or modification
+ </description>
+ </intent>
+
+ <!-- simple intent -->
+ <intent name="confidentiality" constrains="sca:binding">
+ <description>
+ Communitcation thro this binding must prevent
+ unauthorized users from reading the messages.
+ </description>
+ <qualifier name="transport" />
+ <qualifier name="message" default="true" />
+ </intent>
+
+ <intent name="integrity" constrains="sca:binding">
+ <description>
+ Communitcation thro this binding must prevent
+ unauthorized modification of the messages.
+ </description>
+ </intent>
+
+ <intent name="authentication" constrains="sca:binding">
+ <description>
+ Communitcation thro this binding required
+ Authentication.
+ </description>
+ </intent>
+
+ <intent name="logging" constrains="sca:implementation">
+ <description>
+ All messages to and from this implementation must be logged
+ </description>
+ </intent>
+
+ <intent name="tracing" constrains="sca:implementation.java">
+ <description>
+ Need to figure out some description for this
+ </description>
+ </intent>
+
</definitions> \ No newline at end of file
diff --git a/java/sca/modules/definitions/pom.xml b/java/sca/modules/definitions/pom.xml
index 7e62830ede..e4daa3a9c9 100644
--- a/java/sca/modules/definitions/pom.xml
+++ b/java/sca/modules/definitions/pom.xml
@@ -1,52 +1,52 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-definitions</artifactId>
- <name>Apache Tuscany SCA Definitions</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-extensibility</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xsd</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-definitions</artifactId>
+ <name>Apache Tuscany SCA Definitions</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-extensibility</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xsd</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java b/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java
index 812ed9fa02..979ff7c187 100644
--- a/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java
+++ b/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/Definitions.java
@@ -1,83 +1,83 @@
- /*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.definitions;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.policy.BindingType;
-import org.apache.tuscany.sca.policy.ImplementationType;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-
-/**
- * Represents SCA Definitions.
- *
- * @version $Rev$ $Date$
- */
-public interface Definitions {
- /**
- * Returns the target namespace for this SCA Definition
- * @return the target namespace
- */
- String getTargetNamespace();
-
- /**
- * Sets the target names for this SCA Definition.
- *
- * @param ns the target namespace for this SCA Definition
- */
- void setTargetNamespace(String ns);
-
- /**
- * Returns a list of domain wide Policy Intents
- *
- * @return a list of domain wide Policy Intents
- */
- List<Intent> getIntents();
-
- /**
- * Returns a list of domain wide PolicySets
- *
- * @return a list of domain wide PolicySets
- */
- List<PolicySet> getPolicySets();
-
- /**
- * Returns a list of domain wide Binding Types
- *
- * @return a list of domain wide Binding Types
- */
- List<BindingType> getBindingTypes();
-
-
- /**
- * Returns a list of domain wide Implementation Types
- *
- * @return a list of domain wide Implementation Types
- */
- List<ImplementationType> getImplementationTypes();
-
- /**
- * Returns a list of domain wide binding definition objects
- *
- * @return a list of domain wide binding definition objects
- */
- List<Object> getBindings();
-}
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.definitions;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.policy.BindingType;
+import org.apache.tuscany.sca.policy.ImplementationType;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicySet;
+
+
+/**
+ * Represents SCA Definitions.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface Definitions {
+ /**
+ * Returns the target namespace for this SCA Definition
+ * @return the target namespace
+ */
+ String getTargetNamespace();
+
+ /**
+ * Sets the target names for this SCA Definition.
+ *
+ * @param ns the target namespace for this SCA Definition
+ */
+ void setTargetNamespace(String ns);
+
+ /**
+ * Returns a list of domain wide Policy Intents
+ *
+ * @return a list of domain wide Policy Intents
+ */
+ List<Intent> getIntents();
+
+ /**
+ * Returns a list of domain wide PolicySets
+ *
+ * @return a list of domain wide PolicySets
+ */
+ List<PolicySet> getPolicySets();
+
+ /**
+ * Returns a list of domain wide Binding Types
+ *
+ * @return a list of domain wide Binding Types
+ */
+ List<BindingType> getBindingTypes();
+
+
+ /**
+ * Returns a list of domain wide Implementation Types
+ *
+ * @return a list of domain wide Implementation Types
+ */
+ List<ImplementationType> getImplementationTypes();
+
+ /**
+ * Returns a list of domain wide binding definition objects
+ *
+ * @return a list of domain wide binding definition objects
+ */
+ List<Object> getBindings();
+}
diff --git a/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilder.java b/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilder.java
index 59cfa1e205..5c68c6cbff 100644
--- a/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilder.java
+++ b/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilder.java
@@ -1,34 +1,34 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.definitions;
-
-
-/**
- * Interface to abstract building of SCA Definitions for a Domain
- *
- * @version $Rev$ $Date$
- */
-public interface DefinitionsBuilder {
- /**
- * Builds the SCA definitions
- *
- * @param scaDefns
- */
- void build(Definitions scaDefns) throws DefinitionsBuilderException;
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.definitions;
+
+
+/**
+ * Interface to abstract building of SCA Definitions for a Domain
+ *
+ * @version $Rev$ $Date$
+ */
+public interface DefinitionsBuilder {
+ /**
+ * Builds the SCA definitions
+ *
+ * @param scaDefns
+ */
+ void build(Definitions scaDefns) throws DefinitionsBuilderException;
+}
diff --git a/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderException.java b/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderException.java
index e3a11d29aa..f45be80888 100644
--- a/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderException.java
+++ b/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/DefinitionsBuilderException.java
@@ -1,43 +1,43 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.definitions;
-
-/**
- * Builder Exception
- *
- * @version $Rev$ $Date$
- */
-public class DefinitionsBuilderException extends Exception {
- private static final long serialVersionUID = 2513219325230252783L;
-
- public DefinitionsBuilderException() {
- }
-
- public DefinitionsBuilderException(String message) {
- super(message);
- }
-
- public DefinitionsBuilderException(Throwable cause) {
- super(cause);
- }
-
- public DefinitionsBuilderException(String message, Throwable cause) {
- super(message, cause);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.definitions;
+
+/**
+ * Builder Exception
+ *
+ * @version $Rev$ $Date$
+ */
+public class DefinitionsBuilderException extends Exception {
+ private static final long serialVersionUID = 2513219325230252783L;
+
+ public DefinitionsBuilderException() {
+ }
+
+ public DefinitionsBuilderException(String message) {
+ super(message);
+ }
+
+ public DefinitionsBuilderException(Throwable cause) {
+ super(cause);
+ }
+
+ public DefinitionsBuilderException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsBuilderImpl.java b/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsBuilderImpl.java
index 3ef7a2f4ae..d87d45b27a 100644
--- a/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsBuilderImpl.java
+++ b/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsBuilderImpl.java
@@ -1,307 +1,307 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.definitions.impl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.definitions.DefinitionsBuilder;
-import org.apache.tuscany.sca.definitions.DefinitionsBuilderException;
-import org.apache.tuscany.sca.policy.BindingType;
-import org.apache.tuscany.sca.policy.ExtensionType;
-import org.apache.tuscany.sca.policy.ImplementationType;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.IntentMap;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.Qualifier;
-
-/**
- * Provides a concrete implementation for a SCADefinitionsBuilder
- *
- * @version $Rev$ $Date$
- */
-public class DefinitionsBuilderImpl implements DefinitionsBuilder {
-
- public void build(Definitions scaDefns) throws DefinitionsBuilderException {
- Map<QName, Intent> definedIntents = new HashMap<QName, Intent>();
- for (Intent intent : scaDefns.getIntents()) {
- definedIntents.put(intent.getName(), intent);
- }
-
- Map<QName, PolicySet> definedPolicySets = new HashMap<QName, PolicySet>();
- for (PolicySet policySet : scaDefns.getPolicySets()) {
- definedPolicySets.put(policySet.getName(), policySet);
- }
-
- Map<QName, BindingType> definedBindingTypes = new HashMap<QName, BindingType>();
- for (BindingType bindingType : scaDefns.getBindingTypes()) {
- definedBindingTypes.put(bindingType.getType(), bindingType);
- }
-
- Map<QName, ImplementationType> definedImplTypes = new HashMap<QName, ImplementationType>();
- for (ImplementationType implType : scaDefns.getImplementationTypes()) {
- definedImplTypes.put(implType.getType(), implType);
- }
-
- //filling up the maps removes all duplicate entries... so fill this unique lists
- //into the scaDefns.
- scaDefns.getIntents().clear();
- scaDefns.getPolicySets().clear();
- scaDefns.getBindingTypes().clear();
- scaDefns.getImplementationTypes().clear();
-
- scaDefns.getIntents().addAll(definedIntents.values());
- scaDefns.getPolicySets().addAll(definedPolicySets.values());
- scaDefns.getBindingTypes().addAll(definedBindingTypes.values());
- scaDefns.getImplementationTypes().addAll(definedImplTypes.values());
-
- buildPolicyIntents(scaDefns, definedIntents);
- buildPolicySets(scaDefns, definedPolicySets, definedIntents);
- buildBindingTypes(scaDefns, definedBindingTypes, definedIntents);
- buildImplementationTypes(scaDefns, definedImplTypes, definedIntents);
- }
-
- private void buildBindingTypes(Definitions scaDefns,
- Map<QName, BindingType> definedBindingTypes,
- Map<QName, Intent> definedIntents) throws DefinitionsBuilderException {
- for (BindingType bindingType : scaDefns.getBindingTypes()) {
- buildAlwaysProvidedIntents(bindingType, definedIntents);
- buildMayProvideIntents(bindingType, definedIntents);
- }
-
- }
-
- private void buildImplementationTypes(Definitions scaDefns,
- Map<QName, ImplementationType> definedImplTypes,
- Map<QName, Intent> definedIntents) throws DefinitionsBuilderException {
- for (ImplementationType implType : scaDefns.getImplementationTypes()) {
- buildAlwaysProvidedIntents(implType, definedIntents);
- buildMayProvideIntents(implType, definedIntents);
- }
- }
-
- private void buildPolicyIntents(Definitions scaDefns, Map<QName, Intent> definedIntents)
- throws DefinitionsBuilderException {
- for (Intent policyIntent : scaDefns.getIntents()) {
- if (!policyIntent.getRequiredIntents().isEmpty()) {
- buildProfileIntent(policyIntent, definedIntents);
- }
-
- if (!policyIntent.getQualifiedIntents().isEmpty()) {
- buildQualifiedIntent(policyIntent, definedIntents);
- }
- }
- }
-
- private void buildPolicySets(Definitions scaDefns,
- Map<QName, PolicySet> definedPolicySets,
- Map<QName, Intent> definedIntents) throws DefinitionsBuilderException {
-
- for (PolicySet policySet : scaDefns.getPolicySets()) {
- buildProvidedIntents(policySet, definedIntents);
- buildIntentsInMappedPolicies(policySet, definedIntents);
- buildReferredPolicySets(policySet, definedPolicySets);
- }
-
- for (PolicySet policySet : scaDefns.getPolicySets()) {
- for (PolicySet referredPolicySet : policySet.getReferencedPolicySets()) {
- includeReferredPolicySets(policySet, referredPolicySet);
- }
- }
- }
-
- private void buildProfileIntent(Intent policyIntent, Map<QName, Intent> definedIntents)
- throws DefinitionsBuilderException {
- //FIXME: Need to check for cyclic references first i.e an A requiring B and then B requiring A...
- if (policyIntent != null) {
- //resolve all required intents
- List<Intent> requiredIntents = new ArrayList<Intent>();
- for (Intent requiredIntent : policyIntent.getRequiredIntents()) {
- if (requiredIntent.isUnresolved()) {
- Intent resolvedRequiredIntent = definedIntents.get(requiredIntent.getName());
- if (resolvedRequiredIntent != null) {
- requiredIntents.add(resolvedRequiredIntent);
- } else {
- throw new DefinitionsBuilderException("Required Intent - " + requiredIntent
- + " not found for ProfileIntent "
- + policyIntent);
-
- }
- } else {
- requiredIntents.add(requiredIntent);
- }
- }
- policyIntent.getRequiredIntents().clear();
- policyIntent.getRequiredIntents().addAll(requiredIntents);
- }
- }
-
- private void buildQualifiedIntent(Intent policyIntent, Map<QName, Intent> definedIntents)
- throws DefinitionsBuilderException {
- /*
- if (policyIntent != null) {
- //resolve the qualifiable intent
- Intent qualifiableIntent = policyIntent.getQualifiableIntent();
- if (qualifiableIntent.isUnresolved()) {
- Intent resolvedQualifiableIntent = definedIntents.get(qualifiableIntent.getName());
-
- if (resolvedQualifiableIntent != null) {
- policyIntent.setQualifiableIntent(resolvedQualifiableIntent);
- } else {
- throw new DefinitionsBuilderException("Qualifiable Intent - " + qualifiableIntent
- + " not found for QualifiedIntent "
- + policyIntent);
- }
-
- }
- }
- */
- }
-
- private void buildAlwaysProvidedIntents(ExtensionType extensionType, Map<QName, Intent> definedIntents)
- throws DefinitionsBuilderException {
- if (extensionType != null) {
- // resolve all provided intents
- List<Intent> alwaysProvided = new ArrayList<Intent>();
- for (Intent providedIntent : extensionType.getAlwaysProvidedIntents()) {
- if (providedIntent.isUnresolved()) {
- Intent resolvedProvidedIntent = definedIntents.get(providedIntent.getName());
- if (resolvedProvidedIntent != null) {
- alwaysProvided.add(resolvedProvidedIntent);
- } else {
- throw new DefinitionsBuilderException("Always Provided Intent - " + providedIntent
- + " not found for ExtensionType "
- + extensionType);
-
- }
- } else {
- alwaysProvided.add(providedIntent);
- }
- }
- extensionType.getAlwaysProvidedIntents().clear();
- extensionType.getAlwaysProvidedIntents().addAll(alwaysProvided);
- }
- }
-
- private void buildMayProvideIntents(ExtensionType extensionType, Map<QName, Intent> definedIntents)
- throws DefinitionsBuilderException {
- if (extensionType != null) {
- // resolve all provided intents
- List<Intent> mayProvide = new ArrayList<Intent>();
- for (Intent providedIntent : extensionType.getMayProvidedIntents()) {
- if (providedIntent.isUnresolved()) {
- Intent resolvedProvidedIntent = definedIntents.get(providedIntent.getName());
- if (resolvedProvidedIntent != null) {
- mayProvide.add(resolvedProvidedIntent);
- } else {
- throw new DefinitionsBuilderException("May Provide Intent - " + providedIntent
- + " not found for ExtensionType "
- + extensionType);
-
- }
- } else {
- mayProvide.add(providedIntent);
- }
- }
- extensionType.getMayProvidedIntents().clear();
- extensionType.getMayProvidedIntents().addAll(mayProvide);
- }
- }
-
- private void buildProvidedIntents(PolicySet policySet, Map<QName, Intent> definedIntents)
- throws DefinitionsBuilderException {
- if (policySet != null) {
- //resolve all provided intents
- List<Intent> providedIntents = new ArrayList<Intent>();
- for (Intent providedIntent : policySet.getProvidedIntents()) {
- if (providedIntent.isUnresolved()) {
- Intent resolvedProvidedIntent = definedIntents.get(providedIntent.getName());
- if (resolvedProvidedIntent != null) {
- providedIntents.add(resolvedProvidedIntent);
- } else {
- throw new DefinitionsBuilderException("Provided Intent - " + providedIntent
- + " not found for PolicySet "
- + policySet);
-
- }
- } else {
- providedIntents.add(providedIntent);
- }
- }
- policySet.getProvidedIntents().clear();
- policySet.getProvidedIntents().addAll(providedIntents);
- }
- }
-
- private void buildIntentsInMappedPolicies(PolicySet policySet, Map<QName, Intent> definedIntents)
- throws DefinitionsBuilderException {
- for (IntentMap intentMap : policySet.getIntentMaps()) {
- for (Qualifier qualifier : intentMap.getQualifiers()) {
- Intent mappedIntent = qualifier.getIntent();
- if (mappedIntent.isUnresolved()) {
- Intent resolvedMappedIntent = definedIntents.get(mappedIntent.getName());
-
- if (resolvedMappedIntent != null) {
- qualifier.setIntent(resolvedMappedIntent);
- } else {
- throw new DefinitionsBuilderException("Mapped Intent - " + mappedIntent
- + " not found for PolicySet "
- + policySet);
-
- }
- }
- }
- }
- }
-
- private void buildReferredPolicySets(PolicySet policySet, Map<QName, PolicySet> definedPolicySets)
- throws DefinitionsBuilderException {
-
- List<PolicySet> referredPolicySets = new ArrayList<PolicySet>();
- for (PolicySet referredPolicySet : policySet.getReferencedPolicySets()) {
- if (referredPolicySet.isUnresolved()) {
- PolicySet resolvedReferredPolicySet = definedPolicySets.get(referredPolicySet.getName());
- if (resolvedReferredPolicySet != null) {
- referredPolicySets.add(resolvedReferredPolicySet);
- } else {
- throw new DefinitionsBuilderException("Referred PolicySet - " + referredPolicySet
- + "not found for PolicySet - "
- + policySet);
- }
- } else {
- referredPolicySets.add(referredPolicySet);
- }
- }
- policySet.getReferencedPolicySets().clear();
- policySet.getReferencedPolicySets().addAll(referredPolicySets);
- }
-
- private void includeReferredPolicySets(PolicySet policySet, PolicySet referredPolicySet) {
- for (PolicySet furtherReferredPolicySet : referredPolicySet.getReferencedPolicySets()) {
- includeReferredPolicySets(referredPolicySet, furtherReferredPolicySet);
- }
- policySet.getPolicies().addAll(referredPolicySet.getPolicies());
- policySet.getIntentMaps().addAll(referredPolicySet.getIntentMaps());
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.definitions.impl;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.definitions.Definitions;
+import org.apache.tuscany.sca.definitions.DefinitionsBuilder;
+import org.apache.tuscany.sca.definitions.DefinitionsBuilderException;
+import org.apache.tuscany.sca.policy.BindingType;
+import org.apache.tuscany.sca.policy.ExtensionType;
+import org.apache.tuscany.sca.policy.ImplementationType;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.IntentMap;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.Qualifier;
+
+/**
+ * Provides a concrete implementation for a SCADefinitionsBuilder
+ *
+ * @version $Rev$ $Date$
+ */
+public class DefinitionsBuilderImpl implements DefinitionsBuilder {
+
+ public void build(Definitions scaDefns) throws DefinitionsBuilderException {
+ Map<QName, Intent> definedIntents = new HashMap<QName, Intent>();
+ for (Intent intent : scaDefns.getIntents()) {
+ definedIntents.put(intent.getName(), intent);
+ }
+
+ Map<QName, PolicySet> definedPolicySets = new HashMap<QName, PolicySet>();
+ for (PolicySet policySet : scaDefns.getPolicySets()) {
+ definedPolicySets.put(policySet.getName(), policySet);
+ }
+
+ Map<QName, BindingType> definedBindingTypes = new HashMap<QName, BindingType>();
+ for (BindingType bindingType : scaDefns.getBindingTypes()) {
+ definedBindingTypes.put(bindingType.getType(), bindingType);
+ }
+
+ Map<QName, ImplementationType> definedImplTypes = new HashMap<QName, ImplementationType>();
+ for (ImplementationType implType : scaDefns.getImplementationTypes()) {
+ definedImplTypes.put(implType.getType(), implType);
+ }
+
+ //filling up the maps removes all duplicate entries... so fill this unique lists
+ //into the scaDefns.
+ scaDefns.getIntents().clear();
+ scaDefns.getPolicySets().clear();
+ scaDefns.getBindingTypes().clear();
+ scaDefns.getImplementationTypes().clear();
+
+ scaDefns.getIntents().addAll(definedIntents.values());
+ scaDefns.getPolicySets().addAll(definedPolicySets.values());
+ scaDefns.getBindingTypes().addAll(definedBindingTypes.values());
+ scaDefns.getImplementationTypes().addAll(definedImplTypes.values());
+
+ buildPolicyIntents(scaDefns, definedIntents);
+ buildPolicySets(scaDefns, definedPolicySets, definedIntents);
+ buildBindingTypes(scaDefns, definedBindingTypes, definedIntents);
+ buildImplementationTypes(scaDefns, definedImplTypes, definedIntents);
+ }
+
+ private void buildBindingTypes(Definitions scaDefns,
+ Map<QName, BindingType> definedBindingTypes,
+ Map<QName, Intent> definedIntents) throws DefinitionsBuilderException {
+ for (BindingType bindingType : scaDefns.getBindingTypes()) {
+ buildAlwaysProvidedIntents(bindingType, definedIntents);
+ buildMayProvideIntents(bindingType, definedIntents);
+ }
+
+ }
+
+ private void buildImplementationTypes(Definitions scaDefns,
+ Map<QName, ImplementationType> definedImplTypes,
+ Map<QName, Intent> definedIntents) throws DefinitionsBuilderException {
+ for (ImplementationType implType : scaDefns.getImplementationTypes()) {
+ buildAlwaysProvidedIntents(implType, definedIntents);
+ buildMayProvideIntents(implType, definedIntents);
+ }
+ }
+
+ private void buildPolicyIntents(Definitions scaDefns, Map<QName, Intent> definedIntents)
+ throws DefinitionsBuilderException {
+ for (Intent policyIntent : scaDefns.getIntents()) {
+ if (!policyIntent.getRequiredIntents().isEmpty()) {
+ buildProfileIntent(policyIntent, definedIntents);
+ }
+
+ if (!policyIntent.getQualifiedIntents().isEmpty()) {
+ buildQualifiedIntent(policyIntent, definedIntents);
+ }
+ }
+ }
+
+ private void buildPolicySets(Definitions scaDefns,
+ Map<QName, PolicySet> definedPolicySets,
+ Map<QName, Intent> definedIntents) throws DefinitionsBuilderException {
+
+ for (PolicySet policySet : scaDefns.getPolicySets()) {
+ buildProvidedIntents(policySet, definedIntents);
+ buildIntentsInMappedPolicies(policySet, definedIntents);
+ buildReferredPolicySets(policySet, definedPolicySets);
+ }
+
+ for (PolicySet policySet : scaDefns.getPolicySets()) {
+ for (PolicySet referredPolicySet : policySet.getReferencedPolicySets()) {
+ includeReferredPolicySets(policySet, referredPolicySet);
+ }
+ }
+ }
+
+ private void buildProfileIntent(Intent policyIntent, Map<QName, Intent> definedIntents)
+ throws DefinitionsBuilderException {
+ //FIXME: Need to check for cyclic references first i.e an A requiring B and then B requiring A...
+ if (policyIntent != null) {
+ //resolve all required intents
+ List<Intent> requiredIntents = new ArrayList<Intent>();
+ for (Intent requiredIntent : policyIntent.getRequiredIntents()) {
+ if (requiredIntent.isUnresolved()) {
+ Intent resolvedRequiredIntent = definedIntents.get(requiredIntent.getName());
+ if (resolvedRequiredIntent != null) {
+ requiredIntents.add(resolvedRequiredIntent);
+ } else {
+ throw new DefinitionsBuilderException("Required Intent - " + requiredIntent
+ + " not found for ProfileIntent "
+ + policyIntent);
+
+ }
+ } else {
+ requiredIntents.add(requiredIntent);
+ }
+ }
+ policyIntent.getRequiredIntents().clear();
+ policyIntent.getRequiredIntents().addAll(requiredIntents);
+ }
+ }
+
+ private void buildQualifiedIntent(Intent policyIntent, Map<QName, Intent> definedIntents)
+ throws DefinitionsBuilderException {
+ /*
+ if (policyIntent != null) {
+ //resolve the qualifiable intent
+ Intent qualifiableIntent = policyIntent.getQualifiableIntent();
+ if (qualifiableIntent.isUnresolved()) {
+ Intent resolvedQualifiableIntent = definedIntents.get(qualifiableIntent.getName());
+
+ if (resolvedQualifiableIntent != null) {
+ policyIntent.setQualifiableIntent(resolvedQualifiableIntent);
+ } else {
+ throw new DefinitionsBuilderException("Qualifiable Intent - " + qualifiableIntent
+ + " not found for QualifiedIntent "
+ + policyIntent);
+ }
+
+ }
+ }
+ */
+ }
+
+ private void buildAlwaysProvidedIntents(ExtensionType extensionType, Map<QName, Intent> definedIntents)
+ throws DefinitionsBuilderException {
+ if (extensionType != null) {
+ // resolve all provided intents
+ List<Intent> alwaysProvided = new ArrayList<Intent>();
+ for (Intent providedIntent : extensionType.getAlwaysProvidedIntents()) {
+ if (providedIntent.isUnresolved()) {
+ Intent resolvedProvidedIntent = definedIntents.get(providedIntent.getName());
+ if (resolvedProvidedIntent != null) {
+ alwaysProvided.add(resolvedProvidedIntent);
+ } else {
+ throw new DefinitionsBuilderException("Always Provided Intent - " + providedIntent
+ + " not found for ExtensionType "
+ + extensionType);
+
+ }
+ } else {
+ alwaysProvided.add(providedIntent);
+ }
+ }
+ extensionType.getAlwaysProvidedIntents().clear();
+ extensionType.getAlwaysProvidedIntents().addAll(alwaysProvided);
+ }
+ }
+
+ private void buildMayProvideIntents(ExtensionType extensionType, Map<QName, Intent> definedIntents)
+ throws DefinitionsBuilderException {
+ if (extensionType != null) {
+ // resolve all provided intents
+ List<Intent> mayProvide = new ArrayList<Intent>();
+ for (Intent providedIntent : extensionType.getMayProvidedIntents()) {
+ if (providedIntent.isUnresolved()) {
+ Intent resolvedProvidedIntent = definedIntents.get(providedIntent.getName());
+ if (resolvedProvidedIntent != null) {
+ mayProvide.add(resolvedProvidedIntent);
+ } else {
+ throw new DefinitionsBuilderException("May Provide Intent - " + providedIntent
+ + " not found for ExtensionType "
+ + extensionType);
+
+ }
+ } else {
+ mayProvide.add(providedIntent);
+ }
+ }
+ extensionType.getMayProvidedIntents().clear();
+ extensionType.getMayProvidedIntents().addAll(mayProvide);
+ }
+ }
+
+ private void buildProvidedIntents(PolicySet policySet, Map<QName, Intent> definedIntents)
+ throws DefinitionsBuilderException {
+ if (policySet != null) {
+ //resolve all provided intents
+ List<Intent> providedIntents = new ArrayList<Intent>();
+ for (Intent providedIntent : policySet.getProvidedIntents()) {
+ if (providedIntent.isUnresolved()) {
+ Intent resolvedProvidedIntent = definedIntents.get(providedIntent.getName());
+ if (resolvedProvidedIntent != null) {
+ providedIntents.add(resolvedProvidedIntent);
+ } else {
+ throw new DefinitionsBuilderException("Provided Intent - " + providedIntent
+ + " not found for PolicySet "
+ + policySet);
+
+ }
+ } else {
+ providedIntents.add(providedIntent);
+ }
+ }
+ policySet.getProvidedIntents().clear();
+ policySet.getProvidedIntents().addAll(providedIntents);
+ }
+ }
+
+ private void buildIntentsInMappedPolicies(PolicySet policySet, Map<QName, Intent> definedIntents)
+ throws DefinitionsBuilderException {
+ for (IntentMap intentMap : policySet.getIntentMaps()) {
+ for (Qualifier qualifier : intentMap.getQualifiers()) {
+ Intent mappedIntent = qualifier.getIntent();
+ if (mappedIntent.isUnresolved()) {
+ Intent resolvedMappedIntent = definedIntents.get(mappedIntent.getName());
+
+ if (resolvedMappedIntent != null) {
+ qualifier.setIntent(resolvedMappedIntent);
+ } else {
+ throw new DefinitionsBuilderException("Mapped Intent - " + mappedIntent
+ + " not found for PolicySet "
+ + policySet);
+
+ }
+ }
+ }
+ }
+ }
+
+ private void buildReferredPolicySets(PolicySet policySet, Map<QName, PolicySet> definedPolicySets)
+ throws DefinitionsBuilderException {
+
+ List<PolicySet> referredPolicySets = new ArrayList<PolicySet>();
+ for (PolicySet referredPolicySet : policySet.getReferencedPolicySets()) {
+ if (referredPolicySet.isUnresolved()) {
+ PolicySet resolvedReferredPolicySet = definedPolicySets.get(referredPolicySet.getName());
+ if (resolvedReferredPolicySet != null) {
+ referredPolicySets.add(resolvedReferredPolicySet);
+ } else {
+ throw new DefinitionsBuilderException("Referred PolicySet - " + referredPolicySet
+ + "not found for PolicySet - "
+ + policySet);
+ }
+ } else {
+ referredPolicySets.add(referredPolicySet);
+ }
+ }
+ policySet.getReferencedPolicySets().clear();
+ policySet.getReferencedPolicySets().addAll(referredPolicySets);
+ }
+
+ private void includeReferredPolicySets(PolicySet policySet, PolicySet referredPolicySet) {
+ for (PolicySet furtherReferredPolicySet : referredPolicySet.getReferencedPolicySets()) {
+ includeReferredPolicySets(referredPolicySet, furtherReferredPolicySet);
+ }
+ policySet.getPolicies().addAll(referredPolicySet.getPolicies());
+ policySet.getIntentMaps().addAll(referredPolicySet.getIntentMaps());
+ }
+}
diff --git a/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java b/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java
index 31cb68b9a9..1987b39abe 100644
--- a/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java
+++ b/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/impl/DefinitionsImpl.java
@@ -1,72 +1,72 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.definitions.impl;
-
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.apache.tuscany.sca.definitions.Definitions;
-import org.apache.tuscany.sca.policy.BindingType;
-import org.apache.tuscany.sca.policy.ImplementationType;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Provides a concrete implementation for SCADefinitions
- *
- * @version $Rev$ $Date$
- */
-public class DefinitionsImpl implements Definitions {
- private String targetNamespace = null;
- private List<Intent> intents = new CopyOnWriteArrayList<Intent>();
- private List<PolicySet> policySets = new CopyOnWriteArrayList<PolicySet>();
- private List<BindingType> bindingTypes = new CopyOnWriteArrayList<BindingType>();
- private List<ImplementationType> implementationTypes = new CopyOnWriteArrayList<ImplementationType>();
- private List<Object> bindings = new CopyOnWriteArrayList<Object>();
-
-
- public List<BindingType> getBindingTypes() {
- return bindingTypes;
- }
-
- public List<ImplementationType> getImplementationTypes() {
- return implementationTypes;
- }
-
- public List<Intent> getIntents() {
- return intents;
- }
-
- public List<PolicySet> getPolicySets() {
- return policySets;
- }
-
- public String getTargetNamespace() {
- return targetNamespace;
- }
-
- public void setTargetNamespace(String ns) {
- this.targetNamespace = ns;
- }
-
- public List<Object> getBindings() {
- return bindings;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.definitions.impl;
+
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import org.apache.tuscany.sca.definitions.Definitions;
+import org.apache.tuscany.sca.policy.BindingType;
+import org.apache.tuscany.sca.policy.ImplementationType;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicySet;
+
+/**
+ * Provides a concrete implementation for SCADefinitions
+ *
+ * @version $Rev$ $Date$
+ */
+public class DefinitionsImpl implements Definitions {
+ private String targetNamespace = null;
+ private List<Intent> intents = new CopyOnWriteArrayList<Intent>();
+ private List<PolicySet> policySets = new CopyOnWriteArrayList<PolicySet>();
+ private List<BindingType> bindingTypes = new CopyOnWriteArrayList<BindingType>();
+ private List<ImplementationType> implementationTypes = new CopyOnWriteArrayList<ImplementationType>();
+ private List<Object> bindings = new CopyOnWriteArrayList<Object>();
+
+
+ public List<BindingType> getBindingTypes() {
+ return bindingTypes;
+ }
+
+ public List<ImplementationType> getImplementationTypes() {
+ return implementationTypes;
+ }
+
+ public List<Intent> getIntents() {
+ return intents;
+ }
+
+ public List<PolicySet> getPolicySets() {
+ return policySets;
+ }
+
+ public String getTargetNamespace() {
+ return targetNamespace;
+ }
+
+ public void setTargetNamespace(String ns) {
+ this.targetNamespace = ns;
+ }
+
+ public List<Object> getBindings() {
+ return bindings;
+ }
+}
diff --git a/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.java b/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.java
index 0ff2f81a9a..2e9775e955 100644
--- a/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.java
+++ b/java/sca/modules/definitions/src/main/java/org/apache/tuscany/sca/definitions/util/DefinitionsUtil.java
@@ -1,39 +1,39 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.definitions.util;
-
-import org.apache.tuscany.sca.definitions.Definitions;
-
-/**
- * Some utility functions to deal with SCADefinitions
- *
- * @version $Rev$ $Date$
- */
-public class DefinitionsUtil {
-
- public static void aggregate(Definitions source, Definitions target) {
- target.getIntents().addAll(source.getIntents());
- target.getPolicySets().addAll(source.getPolicySets());
- target.getBindingTypes().addAll(source.getBindingTypes());
- target.getImplementationTypes().addAll(source.getImplementationTypes());
- target.getBindings().addAll(source.getBindings());
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.definitions.util;
+
+import org.apache.tuscany.sca.definitions.Definitions;
+
+/**
+ * Some utility functions to deal with SCADefinitions
+ *
+ * @version $Rev$ $Date$
+ */
+public class DefinitionsUtil {
+
+ public static void aggregate(Definitions source, Definitions target) {
+ target.getIntents().addAll(source.getIntents());
+ target.getPolicySets().addAll(source.getPolicySets());
+ target.getBindingTypes().addAll(source.getBindingTypes());
+ target.getImplementationTypes().addAll(source.getImplementationTypes());
+ target.getBindings().addAll(source.getBindings());
+ }
+
+}
diff --git a/java/sca/modules/endpoint-tribes/pom.xml b/java/sca/modules/endpoint-tribes/pom.xml
index 30827c3178..3242788e52 100644
--- a/java/sca/modules/endpoint-tribes/pom.xml
+++ b/java/sca/modules/endpoint-tribes/pom.xml
@@ -1,47 +1,47 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-endpoint-tribes</artifactId>
- <name>Apache Tuscany SCA Tomcat Tribes Based EndPoint Registry</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>tribes</artifactId>
- <!-- DO NOT upgrade to 6.0.20: https://issues.apache.org/bugzilla/show_bug.cgi?id=47419 -->
- <version>6.0.18</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-endpoint-tribes</artifactId>
+ <name>Apache Tuscany SCA Tomcat Tribes Based EndPoint Registry</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tribes</artifactId>
+ <!-- DO NOT upgrade to 6.0.20: https://issues.apache.org/bugzilla/show_bug.cgi?id=47419 -->
+ <version>6.0.18</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-spi</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/MapStore.java b/java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/MapStore.java
index d667f10c50..9e540743bf 100644
--- a/java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/MapStore.java
+++ b/java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/MapStore.java
@@ -1,83 +1,83 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.endpoint.tribes;
-
-import java.util.List;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-/**
- * The Map that can fire events on put/remove of entries
- */
-public abstract class MapStore extends ConcurrentHashMap<Object, Object> {
- private static final long serialVersionUID = -2127235547082144368L;
- private List<MapListener> listeners = new CopyOnWriteArrayList<MapListener>();
-
- protected MapStore(int initialCapacity, float loadFactor, int concurrencyLevel) {
- super(initialCapacity, loadFactor, concurrencyLevel);
- }
-
- @Override
- public Object put(Object key, Object value) {
- Object old = super.put(key, value);
- if (old != null) {
- for (MapListener listener : listeners) {
- listener.entryUpdated(key, old, value);
- }
- } else {
- for (MapListener listener : listeners) {
- listener.entryAdded(key, value);
- }
-
- }
- return old;
- }
-
- @Override
- public Object remove(Object key) {
- Object old = super.remove(key);
- if (old != null) {
- for (MapListener listener : listeners) {
- listener.entryRemoved(key, old);
- }
- }
- return old;
- }
-
- public void addListener(MapListener listener) {
- listeners.add(listener);
- }
-
- public List<MapListener> getListeners() {
- return listeners;
- }
-
- public boolean removeListener(MapListener listener) {
- return listeners.remove(listener);
- }
-
- public static interface MapListener {
- void entryAdded(Object key, Object value);
-
- void entryUpdated(Object key, Object oldValue, Object newValue);
-
- void entryRemoved(Object key, Object value);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.endpoint.tribes;
+
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+/**
+ * The Map that can fire events on put/remove of entries
+ */
+public abstract class MapStore extends ConcurrentHashMap<Object, Object> {
+ private static final long serialVersionUID = -2127235547082144368L;
+ private List<MapListener> listeners = new CopyOnWriteArrayList<MapListener>();
+
+ protected MapStore(int initialCapacity, float loadFactor, int concurrencyLevel) {
+ super(initialCapacity, loadFactor, concurrencyLevel);
+ }
+
+ @Override
+ public Object put(Object key, Object value) {
+ Object old = super.put(key, value);
+ if (old != null) {
+ for (MapListener listener : listeners) {
+ listener.entryUpdated(key, old, value);
+ }
+ } else {
+ for (MapListener listener : listeners) {
+ listener.entryAdded(key, value);
+ }
+
+ }
+ return old;
+ }
+
+ @Override
+ public Object remove(Object key) {
+ Object old = super.remove(key);
+ if (old != null) {
+ for (MapListener listener : listeners) {
+ listener.entryRemoved(key, old);
+ }
+ }
+ return old;
+ }
+
+ public void addListener(MapListener listener) {
+ listeners.add(listener);
+ }
+
+ public List<MapListener> getListeners() {
+ return listeners;
+ }
+
+ public boolean removeListener(MapListener listener) {
+ return listeners.remove(listener);
+ }
+
+ public static interface MapListener {
+ void entryAdded(Object key, Object value);
+
+ void entryUpdated(Object key, Object oldValue, Object newValue);
+
+ void entryRemoved(Object key, Object value);
+ }
+}
diff --git a/java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java b/java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java
index 61daa958e0..5348341b4e 100644
--- a/java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java
+++ b/java/sca/modules/endpoint-tribes/src/main/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistry.java
@@ -1,367 +1,367 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.endpoint.tribes;
-
-import java.net.InetAddress;
-import java.net.NetworkInterface;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.catalina.tribes.Channel;
-import org.apache.catalina.tribes.ChannelException;
-import org.apache.catalina.tribes.group.GroupChannel;
-import org.apache.catalina.tribes.membership.McastService;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.EndpointReference;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.LifeCycleListener;
-import org.apache.tuscany.sca.endpoint.tribes.AbstractReplicatedMap.MapEntry;
-import org.apache.tuscany.sca.endpoint.tribes.MapStore.MapListener;
-import org.apache.tuscany.sca.runtime.EndpointListener;
-import org.apache.tuscany.sca.runtime.EndpointRegistry;
-
-/**
- * A replicated EndpointRegistry based on Apache Tomcat Tribes
- */
-public class ReplicatedEndpointRegistry implements EndpointRegistry, LifeCycleListener, MapListener {
- private final static Logger logger = Logger.getLogger(ReplicatedEndpointRegistry.class.getName());
- private static final String MULTICAST_ADDRESS = "228.0.0.100";
- private static final int MULTICAST_PORT = 50000;
-
- private int port = MULTICAST_PORT;
- private String address = MULTICAST_ADDRESS;
- private String bind = null;
- private int timeout = 50;
-
- private final static String DEFAULT_DOMAIN_URI = "http://tuscany.apache.org/sca/1.1/domains/default";
- private String domainURI = DEFAULT_DOMAIN_URI;
- private List<EndpointReference> endpointreferences = new CopyOnWriteArrayList<EndpointReference>();
- private List<EndpointListener> listeners = new CopyOnWriteArrayList<EndpointListener>();
-
- private ExtensionPointRegistry registry;
- private ReplicatedMap map;
-
- private static final Channel createChannel(String address, int port, String bindAddress) {
-
- //create a channel
- GroupChannel channel = new GroupChannel();
- McastService mcastService = (McastService)channel.getMembershipService();
- mcastService.setPort(port);
- mcastService.setAddress(address);
-
- // REVIEW: In my case, there are multiple IP addresses
- // One for the WIFI and the other one for VPN. For some reason the VPN one doesn't support
- // Multicast
-
- if (bindAddress != null) {
- mcastService.setBind(bindAddress);
- } else {
- mcastService.setBind(getBindAddress());
- }
-
- return channel;
- }
-
- public ReplicatedEndpointRegistry(ExtensionPointRegistry registry, Map<String, String> attributes) {
- this.registry = registry;
- String portStr = attributes.get("port");
- if (portStr != null) {
- port = Integer.parseInt(portStr);
- }
- String address = attributes.get("address");
- if (address == null) {
- address = MULTICAST_ADDRESS;
- }
- bind = attributes.get("bind");
- String timeoutStr = attributes.get("timeout");
- if (timeoutStr != null) {
- timeout = Integer.parseInt(timeoutStr);
- }
- // start();
- }
-
- public ReplicatedEndpointRegistry(String domainURI) {
- this.domainURI = domainURI;
- // start();
- }
-
- public void start() {
- if (map != null) {
- throw new IllegalStateException("The registry has already been started");
- }
- map =
- new ReplicatedMap(null, createChannel(address, port, bind), timeout, this.domainURI,
- new ClassLoader[] {ReplicatedEndpointRegistry.class.getClassLoader()});
- map.addListener(this);
- try {
- map.getChannel().start(Channel.DEFAULT);
- } catch (ChannelException e) {
- throw new IllegalStateException(e);
- }
- }
-
- public void stop() {
- if (map != null) {
- map.removeListener(this);
- Channel channel = map.getChannel();
- map.breakdown();
- try {
- channel.stop(Channel.DEFAULT);
- } catch (ChannelException e) {
- throw new IllegalStateException(e);
- }
- map = null;
- }
- }
-
- public void addEndpoint(Endpoint endpoint) {
- map.put(endpoint.getURI(), endpoint);
- logger.info("Add endpoint - " + endpoint);
- }
-
- public void addEndpointReference(EndpointReference endpointReference) {
- endpointreferences.add(endpointReference);
- logger.info("Add endpoint reference - " + endpointReference);
- }
-
- public void addListener(EndpointListener listener) {
- listeners.add(listener);
- }
-
- /**
- * Parse the component/service/binding URI into an array of parts (componentURI, serviceName, bindingName)
- * @param uri
- * @return
- */
- private String[] parse(String uri) {
- String[] names = new String[3];
- int index = uri.lastIndexOf('#');
- if (index == -1) {
- names[0] = uri;
- } else {
- names[0] = uri.substring(0, index);
- String str = uri.substring(index + 1);
- if (str.startsWith("service-binding(") && str.endsWith(")")) {
- str = str.substring("service-binding(".length(), str.length() - 1);
- String[] parts = str.split("/");
- if (parts.length != 2) {
- throw new IllegalArgumentException("Invalid service-binding URI: " + uri);
- }
- names[1] = parts[0];
- names[2] = parts[1];
- } else if (str.startsWith("service(") && str.endsWith(")")) {
- str = str.substring("service(".length(), str.length() - 1);
- names[1] = str;
- } else {
- throw new IllegalArgumentException("Invalid component/service/binding URI: " + uri);
- }
- }
- return names;
- }
-
- private boolean matches(String target, String uri) {
- String[] parts1 = parse(target);
- String[] parts2 = parse(uri);
- for (int i = 0; i < parts1.length; i++) {
- if (parts1[i] == null || parts1[i].equals(parts2[i])) {
- continue;
- } else {
- return false;
- }
- }
- return true;
- }
-
- public List<Endpoint> findEndpoint(EndpointReference endpointReference) {
- List<Endpoint> foundEndpoints = new ArrayList<Endpoint>();
-
- logger.info("Find endpoint for reference - " + endpointReference);
-
- if (endpointReference.getReference() != null) {
- Endpoint targetEndpoint = endpointReference.getTargetEndpoint();
- for (Object v : map.values()) {
- Endpoint endpoint = (Endpoint)v;
- // TODO: implement more complete matching
- if (matches(targetEndpoint.getURI(), endpoint.getURI())) {
- MapEntry entry = map.getInternal(endpoint.getURI());
- if (!isLocal(entry)) {
- endpoint.setRemote(true);
- }
- // if (!entry.isPrimary()) {
- endpoint.setExtensionPointRegistry(registry);
- // }
- foundEndpoints.add(endpoint);
- logger.info("Found endpoint with matching service - " + endpoint);
- }
- // else the service name doesn't match
- }
- }
- return foundEndpoints;
- }
-
- private boolean isLocal(MapEntry entry) {
- return entry.getPrimary().equals(map.getChannel().getLocalMember(false));
- }
-
- public List<EndpointReference> findEndpointReference(Endpoint endpoint) {
- return endpointreferences;
- }
-
- public Endpoint getEndpoint(String uri) {
- return (Endpoint)map.get(uri);
- }
-
- public List<EndpointReference> getEndpointRefereneces() {
- return endpointreferences;
- }
-
- public List<Endpoint> getEndpoints() {
- return new ArrayList(map.values());
- }
-
- public List<EndpointListener> getListeners() {
- return listeners;
- }
-
- public void removeEndpoint(Endpoint endpoint) {
- map.remove(endpoint.getURI());
- logger.info("Remove endpoint - " + endpoint);
- }
-
- public void removeEndpointReference(EndpointReference endpointReference) {
- endpointreferences.remove(endpointReference);
- logger.info("Remove endpoint reference - " + endpointReference);
- }
-
- public void removeListener(EndpointListener listener) {
- listeners.remove(listener);
- }
-
- public void updateEndpoint(String uri, Endpoint endpoint) {
- Endpoint oldEndpoint = getEndpoint(uri);
- if (oldEndpoint == null) {
- throw new IllegalArgumentException("Endpoint is not found: " + uri);
- }
- map.put(endpoint.getURI(), endpoint);
- }
-
- public void entryAdded(Object key, Object value) {
- MapEntry entry = (MapEntry)value;
- if (!isLocal(entry)) {
- logger.info("Remote endpoint added: " + entry.getValue());
- }
- Endpoint newEp = (Endpoint)entry.getValue();
- for (EndpointListener listener : listeners) {
- listener.endpointAdded(newEp);
- }
- }
-
- public void entryRemoved(Object key, Object value) {
- MapEntry entry = (MapEntry)value;
- if (!isLocal(entry)) {
- logger.info("Remote endpoint removed: " + entry.getValue());
- }
- Endpoint oldEp = (Endpoint)entry.getValue();
- for (EndpointListener listener : listeners) {
- listener.endpointRemoved(oldEp);
- }
- }
-
- public void entryUpdated(Object key, Object oldValue, Object newValue) {
- MapEntry oldEntry = (MapEntry)oldValue;
- MapEntry newEntry = (MapEntry)newValue;
- if (!isLocal(newEntry)) {
- logger.info("Remote endpoint updated: " + newEntry.getValue());
- }
- Endpoint oldEp = (Endpoint)oldEntry.getValue();
- Endpoint newEp = (Endpoint)newEntry.getValue();
- for (EndpointListener listener : listeners) {
- listener.endpointUpdated(oldEp, newEp);
- }
- }
-
- public static void main(String[] args) throws Exception {
- //create a channel
- GroupChannel channel = new GroupChannel();
- McastService mcastService = (McastService)channel.getMembershipService();
- mcastService.setPort(MULTICAST_PORT);
- mcastService.setAddress(MULTICAST_ADDRESS);
-
- InetAddress localhost = InetAddress.getLocalHost();
-
- // REVIEW: In my case, there are multiple IP addresses
- // One for the WIFI and the other one for VPN. For some reason the VPN one doesn't support
- // Multicast
-
- // You can use "route add 228.0.0.0 mask 252.0.0.0 192.168.1.100"
- mcastService.setBind(getBindAddress());
- channel.start(Channel.DEFAULT);
- ReplicatedMap map = new ReplicatedMap(null, channel, 50, "01", null);
- map.put(UUID.randomUUID().toString(), localhost.getHostAddress());
- for (int i = 0; i < 4; i++) {
- Thread.sleep(3000);
- System.out.println(localhost + ": " + map.keySet());
- }
- for (Object e : map.entrySetFull()) {
- Map.Entry en = (Map.Entry)e;
- AbstractReplicatedMap.MapEntry entry = (AbstractReplicatedMap.MapEntry)en.getValue();
- System.out.println(entry);
- }
- map.breakdown();
- channel.stop(Channel.DEFAULT);
- }
-
- private static String getBindAddress() {
- try {
- Enumeration<NetworkInterface> nis = NetworkInterface.getNetworkInterfaces();
- while (nis.hasMoreElements()) {
- NetworkInterface ni = nis.nextElement();
- // The following APIs require JDK 1.6
- /*
- if (ni.isLoopback() || !ni.isUp() || !ni.supportsMulticast()) {
- continue;
- }
- */
- Enumeration<InetAddress> ips = ni.getInetAddresses();
- if (!ips.hasMoreElements()) {
- continue;
- }
- while (ips.hasMoreElements()) {
- InetAddress addr = ips.nextElement();
- if (addr.isLoopbackAddress()) {
- continue;
- }
- return addr.getHostAddress();
- }
- }
- return InetAddress.getLocalHost().getHostAddress();
- } catch (Exception e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
- return null;
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.endpoint.tribes;
+
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.catalina.tribes.Channel;
+import org.apache.catalina.tribes.ChannelException;
+import org.apache.catalina.tribes.group.GroupChannel;
+import org.apache.catalina.tribes.membership.McastService;
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.LifeCycleListener;
+import org.apache.tuscany.sca.endpoint.tribes.AbstractReplicatedMap.MapEntry;
+import org.apache.tuscany.sca.endpoint.tribes.MapStore.MapListener;
+import org.apache.tuscany.sca.runtime.EndpointListener;
+import org.apache.tuscany.sca.runtime.EndpointRegistry;
+
+/**
+ * A replicated EndpointRegistry based on Apache Tomcat Tribes
+ */
+public class ReplicatedEndpointRegistry implements EndpointRegistry, LifeCycleListener, MapListener {
+ private final static Logger logger = Logger.getLogger(ReplicatedEndpointRegistry.class.getName());
+ private static final String MULTICAST_ADDRESS = "228.0.0.100";
+ private static final int MULTICAST_PORT = 50000;
+
+ private int port = MULTICAST_PORT;
+ private String address = MULTICAST_ADDRESS;
+ private String bind = null;
+ private int timeout = 50;
+
+ private final static String DEFAULT_DOMAIN_URI = "http://tuscany.apache.org/sca/1.1/domains/default";
+ private String domainURI = DEFAULT_DOMAIN_URI;
+ private List<EndpointReference> endpointreferences = new CopyOnWriteArrayList<EndpointReference>();
+ private List<EndpointListener> listeners = new CopyOnWriteArrayList<EndpointListener>();
+
+ private ExtensionPointRegistry registry;
+ private ReplicatedMap map;
+
+ private static final Channel createChannel(String address, int port, String bindAddress) {
+
+ //create a channel
+ GroupChannel channel = new GroupChannel();
+ McastService mcastService = (McastService)channel.getMembershipService();
+ mcastService.setPort(port);
+ mcastService.setAddress(address);
+
+ // REVIEW: In my case, there are multiple IP addresses
+ // One for the WIFI and the other one for VPN. For some reason the VPN one doesn't support
+ // Multicast
+
+ if (bindAddress != null) {
+ mcastService.setBind(bindAddress);
+ } else {
+ mcastService.setBind(getBindAddress());
+ }
+
+ return channel;
+ }
+
+ public ReplicatedEndpointRegistry(ExtensionPointRegistry registry, Map<String, String> attributes) {
+ this.registry = registry;
+ String portStr = attributes.get("port");
+ if (portStr != null) {
+ port = Integer.parseInt(portStr);
+ }
+ String address = attributes.get("address");
+ if (address == null) {
+ address = MULTICAST_ADDRESS;
+ }
+ bind = attributes.get("bind");
+ String timeoutStr = attributes.get("timeout");
+ if (timeoutStr != null) {
+ timeout = Integer.parseInt(timeoutStr);
+ }
+ // start();
+ }
+
+ public ReplicatedEndpointRegistry(String domainURI) {
+ this.domainURI = domainURI;
+ // start();
+ }
+
+ public void start() {
+ if (map != null) {
+ throw new IllegalStateException("The registry has already been started");
+ }
+ map =
+ new ReplicatedMap(null, createChannel(address, port, bind), timeout, this.domainURI,
+ new ClassLoader[] {ReplicatedEndpointRegistry.class.getClassLoader()});
+ map.addListener(this);
+ try {
+ map.getChannel().start(Channel.DEFAULT);
+ } catch (ChannelException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ public void stop() {
+ if (map != null) {
+ map.removeListener(this);
+ Channel channel = map.getChannel();
+ map.breakdown();
+ try {
+ channel.stop(Channel.DEFAULT);
+ } catch (ChannelException e) {
+ throw new IllegalStateException(e);
+ }
+ map = null;
+ }
+ }
+
+ public void addEndpoint(Endpoint endpoint) {
+ map.put(endpoint.getURI(), endpoint);
+ logger.info("Add endpoint - " + endpoint);
+ }
+
+ public void addEndpointReference(EndpointReference endpointReference) {
+ endpointreferences.add(endpointReference);
+ logger.info("Add endpoint reference - " + endpointReference);
+ }
+
+ public void addListener(EndpointListener listener) {
+ listeners.add(listener);
+ }
+
+ /**
+ * Parse the component/service/binding URI into an array of parts (componentURI, serviceName, bindingName)
+ * @param uri
+ * @return
+ */
+ private String[] parse(String uri) {
+ String[] names = new String[3];
+ int index = uri.lastIndexOf('#');
+ if (index == -1) {
+ names[0] = uri;
+ } else {
+ names[0] = uri.substring(0, index);
+ String str = uri.substring(index + 1);
+ if (str.startsWith("service-binding(") && str.endsWith(")")) {
+ str = str.substring("service-binding(".length(), str.length() - 1);
+ String[] parts = str.split("/");
+ if (parts.length != 2) {
+ throw new IllegalArgumentException("Invalid service-binding URI: " + uri);
+ }
+ names[1] = parts[0];
+ names[2] = parts[1];
+ } else if (str.startsWith("service(") && str.endsWith(")")) {
+ str = str.substring("service(".length(), str.length() - 1);
+ names[1] = str;
+ } else {
+ throw new IllegalArgumentException("Invalid component/service/binding URI: " + uri);
+ }
+ }
+ return names;
+ }
+
+ private boolean matches(String target, String uri) {
+ String[] parts1 = parse(target);
+ String[] parts2 = parse(uri);
+ for (int i = 0; i < parts1.length; i++) {
+ if (parts1[i] == null || parts1[i].equals(parts2[i])) {
+ continue;
+ } else {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public List<Endpoint> findEndpoint(EndpointReference endpointReference) {
+ List<Endpoint> foundEndpoints = new ArrayList<Endpoint>();
+
+ logger.info("Find endpoint for reference - " + endpointReference);
+
+ if (endpointReference.getReference() != null) {
+ Endpoint targetEndpoint = endpointReference.getTargetEndpoint();
+ for (Object v : map.values()) {
+ Endpoint endpoint = (Endpoint)v;
+ // TODO: implement more complete matching
+ if (matches(targetEndpoint.getURI(), endpoint.getURI())) {
+ MapEntry entry = map.getInternal(endpoint.getURI());
+ if (!isLocal(entry)) {
+ endpoint.setRemote(true);
+ }
+ // if (!entry.isPrimary()) {
+ endpoint.setExtensionPointRegistry(registry);
+ // }
+ foundEndpoints.add(endpoint);
+ logger.info("Found endpoint with matching service - " + endpoint);
+ }
+ // else the service name doesn't match
+ }
+ }
+ return foundEndpoints;
+ }
+
+ private boolean isLocal(MapEntry entry) {
+ return entry.getPrimary().equals(map.getChannel().getLocalMember(false));
+ }
+
+ public List<EndpointReference> findEndpointReference(Endpoint endpoint) {
+ return endpointreferences;
+ }
+
+ public Endpoint getEndpoint(String uri) {
+ return (Endpoint)map.get(uri);
+ }
+
+ public List<EndpointReference> getEndpointRefereneces() {
+ return endpointreferences;
+ }
+
+ public List<Endpoint> getEndpoints() {
+ return new ArrayList(map.values());
+ }
+
+ public List<EndpointListener> getListeners() {
+ return listeners;
+ }
+
+ public void removeEndpoint(Endpoint endpoint) {
+ map.remove(endpoint.getURI());
+ logger.info("Remove endpoint - " + endpoint);
+ }
+
+ public void removeEndpointReference(EndpointReference endpointReference) {
+ endpointreferences.remove(endpointReference);
+ logger.info("Remove endpoint reference - " + endpointReference);
+ }
+
+ public void removeListener(EndpointListener listener) {
+ listeners.remove(listener);
+ }
+
+ public void updateEndpoint(String uri, Endpoint endpoint) {
+ Endpoint oldEndpoint = getEndpoint(uri);
+ if (oldEndpoint == null) {
+ throw new IllegalArgumentException("Endpoint is not found: " + uri);
+ }
+ map.put(endpoint.getURI(), endpoint);
+ }
+
+ public void entryAdded(Object key, Object value) {
+ MapEntry entry = (MapEntry)value;
+ if (!isLocal(entry)) {
+ logger.info("Remote endpoint added: " + entry.getValue());
+ }
+ Endpoint newEp = (Endpoint)entry.getValue();
+ for (EndpointListener listener : listeners) {
+ listener.endpointAdded(newEp);
+ }
+ }
+
+ public void entryRemoved(Object key, Object value) {
+ MapEntry entry = (MapEntry)value;
+ if (!isLocal(entry)) {
+ logger.info("Remote endpoint removed: " + entry.getValue());
+ }
+ Endpoint oldEp = (Endpoint)entry.getValue();
+ for (EndpointListener listener : listeners) {
+ listener.endpointRemoved(oldEp);
+ }
+ }
+
+ public void entryUpdated(Object key, Object oldValue, Object newValue) {
+ MapEntry oldEntry = (MapEntry)oldValue;
+ MapEntry newEntry = (MapEntry)newValue;
+ if (!isLocal(newEntry)) {
+ logger.info("Remote endpoint updated: " + newEntry.getValue());
+ }
+ Endpoint oldEp = (Endpoint)oldEntry.getValue();
+ Endpoint newEp = (Endpoint)newEntry.getValue();
+ for (EndpointListener listener : listeners) {
+ listener.endpointUpdated(oldEp, newEp);
+ }
+ }
+
+ public static void main(String[] args) throws Exception {
+ //create a channel
+ GroupChannel channel = new GroupChannel();
+ McastService mcastService = (McastService)channel.getMembershipService();
+ mcastService.setPort(MULTICAST_PORT);
+ mcastService.setAddress(MULTICAST_ADDRESS);
+
+ InetAddress localhost = InetAddress.getLocalHost();
+
+ // REVIEW: In my case, there are multiple IP addresses
+ // One for the WIFI and the other one for VPN. For some reason the VPN one doesn't support
+ // Multicast
+
+ // You can use "route add 228.0.0.0 mask 252.0.0.0 192.168.1.100"
+ mcastService.setBind(getBindAddress());
+ channel.start(Channel.DEFAULT);
+ ReplicatedMap map = new ReplicatedMap(null, channel, 50, "01", null);
+ map.put(UUID.randomUUID().toString(), localhost.getHostAddress());
+ for (int i = 0; i < 4; i++) {
+ Thread.sleep(3000);
+ System.out.println(localhost + ": " + map.keySet());
+ }
+ for (Object e : map.entrySetFull()) {
+ Map.Entry en = (Map.Entry)e;
+ AbstractReplicatedMap.MapEntry entry = (AbstractReplicatedMap.MapEntry)en.getValue();
+ System.out.println(entry);
+ }
+ map.breakdown();
+ channel.stop(Channel.DEFAULT);
+ }
+
+ private static String getBindAddress() {
+ try {
+ Enumeration<NetworkInterface> nis = NetworkInterface.getNetworkInterfaces();
+ while (nis.hasMoreElements()) {
+ NetworkInterface ni = nis.nextElement();
+ // The following APIs require JDK 1.6
+ /*
+ if (ni.isLoopback() || !ni.isUp() || !ni.supportsMulticast()) {
+ continue;
+ }
+ */
+ Enumeration<InetAddress> ips = ni.getInetAddresses();
+ if (!ips.hasMoreElements()) {
+ continue;
+ }
+ while (ips.hasMoreElements()) {
+ InetAddress addr = ips.nextElement();
+ if (addr.isLoopbackAddress()) {
+ continue;
+ }
+ return addr.getHostAddress();
+ }
+ }
+ return InetAddress.getLocalHost().getHostAddress();
+ } catch (Exception e) {
+ logger.log(Level.SEVERE, e.getMessage(), e);
+ return null;
+ }
+ }
+
+}
diff --git a/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/OSGiExtensionPointRegistry.java b/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/OSGiExtensionPointRegistry.java
index bf03bfdb88..3e7eb96798 100644
--- a/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/OSGiExtensionPointRegistry.java
+++ b/java/sca/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/OSGiExtensionPointRegistry.java
@@ -1,125 +1,125 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.extensibility.equinox;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.IdentityHashMap;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ModuleActivator;
-import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-
-/**
- *
- */
-public class OSGiExtensionPointRegistry extends DefaultExtensionPointRegistry {
- private Map<Class<?>, ServiceRegistration> services = new ConcurrentHashMap<Class<?>, ServiceRegistration>();
- private BundleContext bundleContext;
-
- public OSGiExtensionPointRegistry(BundleContext bundleContext) {
- super();
- this.bundleContext = bundleContext;
- }
-
- @Override
- protected <T> Object findExtensionPoint(Class<T> extensionPointType) {
- ServiceRegistration registration = services.get(extensionPointType);
- if (registration != null) {
- ServiceReference ref = registration.getReference();
- if (ref != null) {
- return ref.getBundle().getBundleContext().getService(ref);
- }
- }
- /*
- else {
- ServiceReference ref = bundleContext.getServiceReference(extensionPointType.getName());
- if (ref != null) {
- return bundleContext.getService(ref);
- }
- }
- */
- return null;
- }
-
- @Override
- protected void registerExtensionPoint(Class<?> i, Object extensionPoint, ServiceDeclaration declaration) {
- BundleContext context = bundleContext;
- if (declaration instanceof EquinoxServiceDiscoverer.ServiceDeclarationImpl) {
- EquinoxServiceDiscoverer.ServiceDeclarationImpl declarationImpl =
- (EquinoxServiceDiscoverer.ServiceDeclarationImpl)declaration;
- Bundle bundle = declarationImpl.getBundle();
- /**
- * If this bundle is not in the STARTING, ACTIVE, or STOPPING states or this bundle
- * is a fragment bundle, then this bundle has no valid BundleContext. This method will
- * return null if this bundle has no valid BundleContext
- */
- if ((bundle.getState() & (Bundle.ACTIVE | Bundle.STARTING)) == 0) {
- try {
- bundle.start();
- } catch (BundleException e) {
- throw new IllegalStateException(e);
- }
- }
- context = bundle.getBundleContext();
- }
- Dictionary<Object, Object> props = new Hashtable<Object, Object>();
- ServiceRegistration registration = context.registerService(i.getName(), extensionPoint, props);
- services.put(i, registration);
- }
-
- @Override
- protected void unregisterExtensionPoint(Class<?> i) {
- ServiceRegistration registration = services.get(i);
- if (registration != null) {
- registration.unregister();
- }
- services.remove(i);
- }
-
- @Override
- public void stop() {
- // Get a unique map as an extension point may exist in the map by different keys
- Map<ModuleActivator, ModuleActivator> map = new IdentityHashMap<ModuleActivator, ModuleActivator>();
- for (ServiceRegistration reg : services.values()) {
- ServiceReference ref = reg.getReference();
- if (ref != null) {
- Object service = bundleContext.getService(ref);
- if (service instanceof ModuleActivator) {
- ModuleActivator activator = (ModuleActivator)service;
- map.put(activator, activator);
- }
- reg.unregister();
- }
- }
- for (ModuleActivator activator : map.values()) {
- activator.stop(this);
- }
- services.clear();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.extensibility.equinox;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.IdentityHashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ModuleActivator;
+import org.apache.tuscany.sca.extensibility.ServiceDeclaration;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ *
+ */
+public class OSGiExtensionPointRegistry extends DefaultExtensionPointRegistry {
+ private Map<Class<?>, ServiceRegistration> services = new ConcurrentHashMap<Class<?>, ServiceRegistration>();
+ private BundleContext bundleContext;
+
+ public OSGiExtensionPointRegistry(BundleContext bundleContext) {
+ super();
+ this.bundleContext = bundleContext;
+ }
+
+ @Override
+ protected <T> Object findExtensionPoint(Class<T> extensionPointType) {
+ ServiceRegistration registration = services.get(extensionPointType);
+ if (registration != null) {
+ ServiceReference ref = registration.getReference();
+ if (ref != null) {
+ return ref.getBundle().getBundleContext().getService(ref);
+ }
+ }
+ /*
+ else {
+ ServiceReference ref = bundleContext.getServiceReference(extensionPointType.getName());
+ if (ref != null) {
+ return bundleContext.getService(ref);
+ }
+ }
+ */
+ return null;
+ }
+
+ @Override
+ protected void registerExtensionPoint(Class<?> i, Object extensionPoint, ServiceDeclaration declaration) {
+ BundleContext context = bundleContext;
+ if (declaration instanceof EquinoxServiceDiscoverer.ServiceDeclarationImpl) {
+ EquinoxServiceDiscoverer.ServiceDeclarationImpl declarationImpl =
+ (EquinoxServiceDiscoverer.ServiceDeclarationImpl)declaration;
+ Bundle bundle = declarationImpl.getBundle();
+ /**
+ * If this bundle is not in the STARTING, ACTIVE, or STOPPING states or this bundle
+ * is a fragment bundle, then this bundle has no valid BundleContext. This method will
+ * return null if this bundle has no valid BundleContext
+ */
+ if ((bundle.getState() & (Bundle.ACTIVE | Bundle.STARTING)) == 0) {
+ try {
+ bundle.start();
+ } catch (BundleException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+ context = bundle.getBundleContext();
+ }
+ Dictionary<Object, Object> props = new Hashtable<Object, Object>();
+ ServiceRegistration registration = context.registerService(i.getName(), extensionPoint, props);
+ services.put(i, registration);
+ }
+
+ @Override
+ protected void unregisterExtensionPoint(Class<?> i) {
+ ServiceRegistration registration = services.get(i);
+ if (registration != null) {
+ registration.unregister();
+ }
+ services.remove(i);
+ }
+
+ @Override
+ public void stop() {
+ // Get a unique map as an extension point may exist in the map by different keys
+ Map<ModuleActivator, ModuleActivator> map = new IdentityHashMap<ModuleActivator, ModuleActivator>();
+ for (ServiceRegistration reg : services.values()) {
+ ServiceReference ref = reg.getReference();
+ if (ref != null) {
+ Object service = bundleContext.getService(ref);
+ if (service instanceof ModuleActivator) {
+ ModuleActivator activator = (ModuleActivator)service;
+ map.put(activator, activator);
+ }
+ reg.unregister();
+ }
+ }
+ for (ModuleActivator activator : map.values()) {
+ activator.stop(this);
+ }
+ services.clear();
+ }
+
+}
diff --git a/java/sca/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHostTestCase.java b/java/sca/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHostTestCase.java
index 5743f7089a..aa9cd50abc 100644
--- a/java/sca/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHostTestCase.java
+++ b/java/sca/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxHostTestCase.java
@@ -30,7 +30,7 @@ import org.osgi.framework.BundleContext;
/**
* Test start/stop the Equinox runtime.
*
- * @version $Rev: $ $Date: $
+ * @version $Rev$ $Date$
*/
public class EquinoxHostTestCase {
@Test
diff --git a/java/sca/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/TestEquinoxHost.java b/java/sca/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/TestEquinoxHost.java
index 21f2993a6b..566cd6e1a5 100644
--- a/java/sca/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/TestEquinoxHost.java
+++ b/java/sca/modules/extensibility-equinox/src/test/java/org/apache/tuscany/sca/extensibility/equinox/TestEquinoxHost.java
@@ -32,7 +32,7 @@ import org.osgi.framework.launch.FrameworkFactory;
/**
* A test host that starts/stops Equinox.
*
- * @version $Rev: $ $Date: $
+ * @version $Rev$ $Date$
*/
public class TestEquinoxHost {
private Framework framework;
diff --git a/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/LifeCycleListener.java b/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/LifeCycleListener.java
index ff0ab113b2..7a461a5773 100644
--- a/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/LifeCycleListener.java
+++ b/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/core/LifeCycleListener.java
@@ -1,36 +1,36 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.core;
-
-/**
- * A listener that responds to the start/stop event of the ExtensionPointRegistry. Tuscany extension
- * points or extensions can implement this interface to receive callbacks when the registry is started
- * or stopped
- */
-public interface LifeCycleListener {
- /**
- * The method will be invoked when the extension point registry is started
- */
- void start();
- /**
- * The method will be invoked when the extension point registry is stopped
- */
- void stop();
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.core;
+
+/**
+ * A listener that responds to the start/stop event of the ExtensionPointRegistry. Tuscany extension
+ * points or extensions can implement this interface to receive callbacks when the registry is started
+ * or stopped
+ */
+public interface LifeCycleListener {
+ /**
+ * The method will be invoked when the extension point registry is started
+ */
+ void start();
+ /**
+ * The method will be invoked when the extension point registry is stopped
+ */
+ void stop();
+}
diff --git a/java/sca/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/DefaultUtilityExtensionPointTestCase.java b/java/sca/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/DefaultUtilityExtensionPointTestCase.java
index 7e66d44b43..e4abbb257d 100644
--- a/java/sca/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/DefaultUtilityExtensionPointTestCase.java
+++ b/java/sca/modules/extensibility/src/test/java/org/apache/tuscany/sca/extensibility/DefaultUtilityExtensionPointTestCase.java
@@ -1,111 +1,111 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.extensibility;
-
-
-import java.io.Serializable;
-
-import org.apache.tuscany.sca.core.DefaultUtilityExtensionPoint;
-import org.apache.tuscany.sca.core.LifeCycleListener;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- *
- */
-public class DefaultUtilityExtensionPointTestCase {
- private static UtilityExtensionPoint ep;
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- ep = new DefaultUtilityExtensionPoint(null);
- ep.start();
- }
-
- @Test
- public void testGet() {
- MyUtilityImpl my = new MyUtilityImpl();
- ep.addUtility(my);
- Assert.assertTrue(my.started);
- Utility1 u1 = ep.getUtility(Utility1.class);
- Assert.assertSame(my, u1);
- Utility2 u2 = ep.getUtility(Utility2.class);
- Assert.assertSame(my, u2);
- ep.removeUtility(my);
- Assert.assertFalse(my.started);
- u1 = ep.getUtility(Utility1.class);
- Assert.assertNull(u1);
-
- ep.addUtility("1", my);
- u1= ep.getUtility(Utility1.class);
- Assert.assertNull(u1);
- u1= ep.getUtility(Utility1.class, "1");
- Assert.assertNotNull(u1);
- ep.removeUtility(my);
- u1= ep.getUtility(Utility1.class, "1");
- Assert.assertNull(u1);
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- ep.stop();
- }
-
- public static interface Utility1 extends Serializable {
- void op1();
- }
-
- public static interface Utility2 extends Serializable {
- void op2();
- }
-
- public static class MyUtilityImpl implements Utility1, Utility2, LifeCycleListener {
- public boolean started;
-
- public void start() {
- System.out.println("start");
- started = true;
- }
-
- public void stop() {
- System.out.println("stop");
- started = false;
- }
-
- public void op1() {
- System.out.println("op1");
- }
-
- public void op2() {
- System.out.println("op2");
- }
-
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.extensibility;
+
+
+import java.io.Serializable;
+
+import org.apache.tuscany.sca.core.DefaultUtilityExtensionPoint;
+import org.apache.tuscany.sca.core.LifeCycleListener;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ */
+public class DefaultUtilityExtensionPointTestCase {
+ private static UtilityExtensionPoint ep;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ ep = new DefaultUtilityExtensionPoint(null);
+ ep.start();
+ }
+
+ @Test
+ public void testGet() {
+ MyUtilityImpl my = new MyUtilityImpl();
+ ep.addUtility(my);
+ Assert.assertTrue(my.started);
+ Utility1 u1 = ep.getUtility(Utility1.class);
+ Assert.assertSame(my, u1);
+ Utility2 u2 = ep.getUtility(Utility2.class);
+ Assert.assertSame(my, u2);
+ ep.removeUtility(my);
+ Assert.assertFalse(my.started);
+ u1 = ep.getUtility(Utility1.class);
+ Assert.assertNull(u1);
+
+ ep.addUtility("1", my);
+ u1= ep.getUtility(Utility1.class);
+ Assert.assertNull(u1);
+ u1= ep.getUtility(Utility1.class, "1");
+ Assert.assertNotNull(u1);
+ ep.removeUtility(my);
+ u1= ep.getUtility(Utility1.class, "1");
+ Assert.assertNull(u1);
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ ep.stop();
+ }
+
+ public static interface Utility1 extends Serializable {
+ void op1();
+ }
+
+ public static interface Utility2 extends Serializable {
+ void op2();
+ }
+
+ public static class MyUtilityImpl implements Utility1, Utility2, LifeCycleListener {
+ public boolean started;
+
+ public void start() {
+ System.out.println("start");
+ started = true;
+ }
+
+ public void stop() {
+ System.out.println("stop");
+ started = false;
+ }
+
+ public void op1() {
+ System.out.println("op1");
+ }
+
+ public void op2() {
+ System.out.println("op2");
+ }
+
+ }
+
+}
diff --git a/java/sca/modules/host-rmi/pom.xml b/java/sca/modules/host-rmi/pom.xml
index b1fd9e8588..b00e404696 100644
--- a/java/sca/modules/host-rmi/pom.xml
+++ b/java/sca/modules/host-rmi/pom.xml
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-host-rmi</artifactId>
- <name>Apache Tuscany SCA RMI Host Extension Point</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-host-rmi</artifactId>
+ <name>Apache Tuscany SCA RMI Host Extension Point</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-spi</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostException.java b/java/sca/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostException.java
index 959eb72f6e..5ea46b9e0b 100644
--- a/java/sca/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostException.java
+++ b/java/sca/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostException.java
@@ -1,45 +1,45 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.host.rmi;
-
-
-/**
- * This exception will relate to situations where the end applicaition's input is the cause of the exception
- *
- * @version $Rev: 486986 $ $Date: 2006-12-14 11:48:28 +0530 (Thu, 14 Dec 2006) $
- */
-public class RMIHostException extends RuntimeException {
-
- private static final long serialVersionUID = 3378300080918544410L;
-
- public RMIHostException() {
- }
-
- public RMIHostException(String message) {
- super(message);
- }
-
- public RMIHostException(Throwable e) {
- super(e);
- }
-
- public RMIHostException(String message, Throwable cause) {
- super(message, cause);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.host.rmi;
+
+
+/**
+ * This exception will relate to situations where the end applicaition's input is the cause of the exception
+ *
+ * @version $Rev$ $Date$
+ */
+public class RMIHostException extends RuntimeException {
+
+ private static final long serialVersionUID = 3378300080918544410L;
+
+ public RMIHostException() {
+ }
+
+ public RMIHostException(String message) {
+ super(message);
+ }
+
+ public RMIHostException(Throwable e) {
+ super(e);
+ }
+
+ public RMIHostException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/java/sca/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostRuntimeException.java b/java/sca/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostRuntimeException.java
index 998287f998..dfbcc62939 100644
--- a/java/sca/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostRuntimeException.java
+++ b/java/sca/modules/host-rmi/src/main/java/org/apache/tuscany/sca/host/rmi/RMIHostRuntimeException.java
@@ -1,46 +1,46 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.host.rmi;
-
-
-/**
- * This exception relates to cases where there is a problem with the
- * Host runtime
- *
- * @version $Rev$ $Date$
- */
-public class RMIHostRuntimeException extends RuntimeException {
-
- private static final long serialVersionUID = -2639598547028423686L;
-
- public RMIHostRuntimeException() {
- }
-
- public RMIHostRuntimeException(String message) {
- super(message);
- }
-
- public RMIHostRuntimeException(Throwable e) {
- super(e);
- }
-
- public RMIHostRuntimeException(String message, Throwable cause) {
- super(message, cause);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.host.rmi;
+
+
+/**
+ * This exception relates to cases where there is a problem with the
+ * Host runtime
+ *
+ * @version $Rev$ $Date$
+ */
+public class RMIHostRuntimeException extends RuntimeException {
+
+ private static final long serialVersionUID = -2639598547028423686L;
+
+ public RMIHostRuntimeException() {
+ }
+
+ public RMIHostRuntimeException(String message) {
+ super(message);
+ }
+
+ public RMIHostRuntimeException(Throwable e) {
+ super(e);
+ }
+
+ public RMIHostRuntimeException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/java/sca/modules/host-rmi/src/test/java/org/apache/tuscany/sca/host/rmi/RMIHostImplTestCase.java b/java/sca/modules/host-rmi/src/test/java/org/apache/tuscany/sca/host/rmi/RMIHostImplTestCase.java
index 88f3e89489..1164c33a16 100644
--- a/java/sca/modules/host-rmi/src/test/java/org/apache/tuscany/sca/host/rmi/RMIHostImplTestCase.java
+++ b/java/sca/modules/host-rmi/src/test/java/org/apache/tuscany/sca/host/rmi/RMIHostImplTestCase.java
@@ -1,90 +1,90 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.host.rmi;
-
-import java.io.Serializable;
-import java.rmi.Remote;
-
-import junit.framework.TestCase;
-
-/**
- * Test cases for the RMI Host.
- *
- * @version $Rev$ $Date$
- */
-public class RMIHostImplTestCase extends TestCase {
-
- public void testInit() {
- new DefaultRMIHost();
- }
-
- public void testFindServiceBadHost() throws RMIHostRuntimeException, RMIHostException {
- try {
- new DefaultRMIHost().findService("rmi://locahost:9994/$BAD$");
- fail();
- } catch (RMIHostRuntimeException e) {
- // expected
- }
- }
-
- public void testRegisterService1() throws RMIHostRuntimeException, RMIHostException {
- DefaultRMIHost host = new DefaultRMIHost();
- host.registerService("rmi://localhost:9996/foo1", new MockRemote());
- host.unregisterService("rmi://localhost:9996/foo1");
- }
-
- public void testExistingRegistry() throws RMIHostRuntimeException, RMIHostException {
- DefaultRMIHost host1 = new DefaultRMIHost();
- host1.registerService("rmi://localhost:9995/foo1", new MockRemote());
- DefaultRMIHost host2 = new DefaultRMIHost();
- host2.registerService("rmi://localhost:9995/foo2", new MockRemote());
- host2.unregisterService("rmi://localhost:9995/foo1");
- host2.unregisterService("rmi://localhost:9995/foo2");
- }
-
- public void testRegisterService2() throws RMIHostRuntimeException, RMIHostException {
- DefaultRMIHost host = new DefaultRMIHost();
- host.registerService("rmi://localhost:9999/bar1", new MockRemote());
- host.unregisterService("rmi://localhost:9999/bar1");
- }
-
- public void testRegisterServiceAlreadyBound() throws RMIHostRuntimeException, RMIHostException {
- DefaultRMIHost host = new DefaultRMIHost();
- host.registerService("rmi://localhost:9997/bar2", new MockRemote());
- try {
- host.registerService("rmi://localhost:9997/bar2", new MockRemote());
- } catch (RMIHostException e) {
- // expected
- host.unregisterService("rmi://localhost:9997/bar2");
- }
- }
-
- public void testUnRegisterService() throws RMIHostRuntimeException, RMIHostException {
- DefaultRMIHost host = new DefaultRMIHost();
- try {
- host.unregisterService("rmi://localhost:9998/bar3");
- fail();
- } catch (RMIHostRuntimeException e) {
- // expected
- }
- }
-
- private static class MockRemote implements Remote, Serializable {
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.host.rmi;
+
+import java.io.Serializable;
+import java.rmi.Remote;
+
+import junit.framework.TestCase;
+
+/**
+ * Test cases for the RMI Host.
+ *
+ * @version $Rev$ $Date$
+ */
+public class RMIHostImplTestCase extends TestCase {
+
+ public void testInit() {
+ new DefaultRMIHost();
+ }
+
+ public void testFindServiceBadHost() throws RMIHostRuntimeException, RMIHostException {
+ try {
+ new DefaultRMIHost().findService("rmi://locahost:9994/$BAD$");
+ fail();
+ } catch (RMIHostRuntimeException e) {
+ // expected
+ }
+ }
+
+ public void testRegisterService1() throws RMIHostRuntimeException, RMIHostException {
+ DefaultRMIHost host = new DefaultRMIHost();
+ host.registerService("rmi://localhost:9996/foo1", new MockRemote());
+ host.unregisterService("rmi://localhost:9996/foo1");
+ }
+
+ public void testExistingRegistry() throws RMIHostRuntimeException, RMIHostException {
+ DefaultRMIHost host1 = new DefaultRMIHost();
+ host1.registerService("rmi://localhost:9995/foo1", new MockRemote());
+ DefaultRMIHost host2 = new DefaultRMIHost();
+ host2.registerService("rmi://localhost:9995/foo2", new MockRemote());
+ host2.unregisterService("rmi://localhost:9995/foo1");
+ host2.unregisterService("rmi://localhost:9995/foo2");
+ }
+
+ public void testRegisterService2() throws RMIHostRuntimeException, RMIHostException {
+ DefaultRMIHost host = new DefaultRMIHost();
+ host.registerService("rmi://localhost:9999/bar1", new MockRemote());
+ host.unregisterService("rmi://localhost:9999/bar1");
+ }
+
+ public void testRegisterServiceAlreadyBound() throws RMIHostRuntimeException, RMIHostException {
+ DefaultRMIHost host = new DefaultRMIHost();
+ host.registerService("rmi://localhost:9997/bar2", new MockRemote());
+ try {
+ host.registerService("rmi://localhost:9997/bar2", new MockRemote());
+ } catch (RMIHostException e) {
+ // expected
+ host.unregisterService("rmi://localhost:9997/bar2");
+ }
+ }
+
+ public void testUnRegisterService() throws RMIHostRuntimeException, RMIHostException {
+ DefaultRMIHost host = new DefaultRMIHost();
+ try {
+ host.unregisterService("rmi://localhost:9998/bar3");
+ fail();
+ } catch (RMIHostRuntimeException e) {
+ // expected
+ }
+ }
+
+ private static class MockRemote implements Remote, Serializable {
+ }
+}
diff --git a/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/ServletHostHelper.java b/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/ServletHostHelper.java
index c85ce6f265..22bbde2a00 100644
--- a/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/ServletHostHelper.java
+++ b/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/ServletHostHelper.java
@@ -1,190 +1,190 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.host.webapp;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.List;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
-import org.apache.tuscany.sca.node.impl.NodeImpl;
-
-public class ServletHostHelper {
- public static final String DOMAIN_NAME_ATTR = "org.apache.tuscany.sca.domain.name";
- public static final String SCA_NODE_ATTRIBUTE = Node.class.getName();
- private static NodeFactory factory;
-
- private static InputStream openStream(ServletContext servletContext, String location) throws IOException {
- URI uri = URI.create(location);
- if (uri.isAbsolute()) {
- return uri.toURL().openStream();
- } else {
- String path = location;
- if (!path.startsWith("/")) {
- path = "/" + path;
- }
- return servletContext.getResourceAsStream(path);
- }
- }
-
- private static URL getResource(ServletContext servletContext, String location) throws IOException {
- URI uri = URI.create(location);
- if (uri.isAbsolute()) {
- return uri.toURL();
- } else {
- String path = location;
- if (!path.startsWith("/")) {
- path = "/" + path;
- }
- URL url = servletContext.getResource(path);
- if (url != null && url.getProtocol().equals("jndi")) {
- //this is Tomcat case, we should use getRealPath
- File warRootFile = new File(servletContext.getRealPath(path));
- return warRootFile.toURI().toURL();
- } else {
- //this is Jetty case
- return url;
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private static NodeConfiguration getNodeConfiguration(ServletContext servletContext) throws IOException {
- NodeConfiguration configuration = null;
- String nodeConfigURI = servletContext.getInitParameter("node.configuration");
- if (nodeConfigURI != null) {
- configuration = factory.loadConfiguration(openStream(servletContext, nodeConfigURI));
- } else {
- configuration = factory.createNodeConfiguration();
- configuration.setDomainURI(factory.getDomainURI());
- Enumeration<String> names = servletContext.getInitParameterNames();
- while (names.hasMoreElements()) {
- String name = names.nextElement();
- if (name.startsWith("contribution.")) {
- String contrib = servletContext.getInitParameter(name);
- if (contrib != null) {
- configuration.addContribution(getResource(servletContext, contrib));
- }
- }
- }
- if (configuration.getContributions().isEmpty()) {
- // TODO: Which path should be the default root
- configuration.addContribution(getResource(servletContext, "/"));
- }
- URL composite = getResource(servletContext, "/WEB-INF/web.composite");
- if (composite != null) {
- configuration.getContributions().get(0).addDeploymentComposite(composite);
- }
- String nodeURI = servletContext.getInitParameter("node.uri");
- if (nodeURI == null) {
- nodeURI = new File(servletContext.getRealPath("/")).getName();
- }
- configuration.setURI(nodeURI);
- String domainURI = servletContext.getInitParameter("domain.uri");
- if (domainURI != null) {
- configuration.setDomainURI(domainURI);
- }
- }
- return configuration;
- }
-
- public static ServletHost init(final ServletContext servletContext) {
- Node node = (Node)servletContext.getAttribute(SCA_NODE_ATTRIBUTE);
- if (node == null) {
- try {
- String domainName = (String)servletContext.getAttribute(DOMAIN_NAME_ATTR);
- if (domainName != null) {
- factory = NodeFactory.getInstance(domainName);
- } else {
- factory = NodeFactory.newInstance();
- }
- node = createNode(servletContext);
- servletContext.setAttribute(SCA_NODE_ATTRIBUTE, node);
- getServletHost(node).init(new ServletConfig() {
- public String getInitParameter(String name) {
- return servletContext.getInitParameter(name);
- }
-
- public Enumeration<?> getInitParameterNames() {
- return servletContext.getInitParameterNames();
- }
-
- public ServletContext getServletContext() {
- return servletContext;
- }
-
- public String getServletName() {
- return servletContext.getServletContextName();
- }
- });
- } catch (ServletException e) {
- throw new RuntimeException(e);
- }
- }
- return getServletHost(node);
- }
-
- private static WebAppServletHost getServletHost(Node node) {
- NodeImpl nodeImpl = (NodeImpl)node;
- ExtensionPointRegistry eps = nodeImpl.getExtensionPoints();
- ServletHostExtensionPoint servletHosts = eps.getExtensionPoint(ServletHostExtensionPoint.class);
- List<ServletHost> hosts = servletHosts.getServletHosts();
- if (hosts == null || hosts.size() < 1) {
- throw new IllegalStateException("No ServletHost found");
- }
- ServletHost servletHost = hosts.get(0);
- if (!(servletHost instanceof WebAppServletHost)) {
- throw new IllegalStateException("unexpected ServletHost type: " + servletHost);
- }
- return (WebAppServletHost)servletHost;
- }
-
- private static Node createNode(final ServletContext servletContext) throws ServletException {
- NodeConfiguration configuration;
- try {
- configuration = getNodeConfiguration(servletContext);
- } catch (IOException e) {
- throw new ServletException(e);
- }
- Node node = factory.createNode(configuration).start();
- return node;
- }
-
- public static void stop(ServletContext servletContext) {
- Node node = (Node)servletContext.getAttribute(ServletHostHelper.SCA_NODE_ATTRIBUTE);
- if (node != null) {
- node.stop();
- servletContext.setAttribute(ServletHostHelper.SCA_NODE_ATTRIBUTE, null);
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.host.webapp;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.host.http.ServletHost;
+import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+public class ServletHostHelper {
+ public static final String DOMAIN_NAME_ATTR = "org.apache.tuscany.sca.domain.name";
+ public static final String SCA_NODE_ATTRIBUTE = Node.class.getName();
+ private static NodeFactory factory;
+
+ private static InputStream openStream(ServletContext servletContext, String location) throws IOException {
+ URI uri = URI.create(location);
+ if (uri.isAbsolute()) {
+ return uri.toURL().openStream();
+ } else {
+ String path = location;
+ if (!path.startsWith("/")) {
+ path = "/" + path;
+ }
+ return servletContext.getResourceAsStream(path);
+ }
+ }
+
+ private static URL getResource(ServletContext servletContext, String location) throws IOException {
+ URI uri = URI.create(location);
+ if (uri.isAbsolute()) {
+ return uri.toURL();
+ } else {
+ String path = location;
+ if (!path.startsWith("/")) {
+ path = "/" + path;
+ }
+ URL url = servletContext.getResource(path);
+ if (url != null && url.getProtocol().equals("jndi")) {
+ //this is Tomcat case, we should use getRealPath
+ File warRootFile = new File(servletContext.getRealPath(path));
+ return warRootFile.toURI().toURL();
+ } else {
+ //this is Jetty case
+ return url;
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private static NodeConfiguration getNodeConfiguration(ServletContext servletContext) throws IOException {
+ NodeConfiguration configuration = null;
+ String nodeConfigURI = servletContext.getInitParameter("node.configuration");
+ if (nodeConfigURI != null) {
+ configuration = factory.loadConfiguration(openStream(servletContext, nodeConfigURI));
+ } else {
+ configuration = factory.createNodeConfiguration();
+ configuration.setDomainURI(factory.getDomainURI());
+ Enumeration<String> names = servletContext.getInitParameterNames();
+ while (names.hasMoreElements()) {
+ String name = names.nextElement();
+ if (name.startsWith("contribution.")) {
+ String contrib = servletContext.getInitParameter(name);
+ if (contrib != null) {
+ configuration.addContribution(getResource(servletContext, contrib));
+ }
+ }
+ }
+ if (configuration.getContributions().isEmpty()) {
+ // TODO: Which path should be the default root
+ configuration.addContribution(getResource(servletContext, "/"));
+ }
+ URL composite = getResource(servletContext, "/WEB-INF/web.composite");
+ if (composite != null) {
+ configuration.getContributions().get(0).addDeploymentComposite(composite);
+ }
+ String nodeURI = servletContext.getInitParameter("node.uri");
+ if (nodeURI == null) {
+ nodeURI = new File(servletContext.getRealPath("/")).getName();
+ }
+ configuration.setURI(nodeURI);
+ String domainURI = servletContext.getInitParameter("domain.uri");
+ if (domainURI != null) {
+ configuration.setDomainURI(domainURI);
+ }
+ }
+ return configuration;
+ }
+
+ public static ServletHost init(final ServletContext servletContext) {
+ Node node = (Node)servletContext.getAttribute(SCA_NODE_ATTRIBUTE);
+ if (node == null) {
+ try {
+ String domainName = (String)servletContext.getAttribute(DOMAIN_NAME_ATTR);
+ if (domainName != null) {
+ factory = NodeFactory.getInstance(domainName);
+ } else {
+ factory = NodeFactory.newInstance();
+ }
+ node = createNode(servletContext);
+ servletContext.setAttribute(SCA_NODE_ATTRIBUTE, node);
+ getServletHost(node).init(new ServletConfig() {
+ public String getInitParameter(String name) {
+ return servletContext.getInitParameter(name);
+ }
+
+ public Enumeration<?> getInitParameterNames() {
+ return servletContext.getInitParameterNames();
+ }
+
+ public ServletContext getServletContext() {
+ return servletContext;
+ }
+
+ public String getServletName() {
+ return servletContext.getServletContextName();
+ }
+ });
+ } catch (ServletException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ return getServletHost(node);
+ }
+
+ private static WebAppServletHost getServletHost(Node node) {
+ NodeImpl nodeImpl = (NodeImpl)node;
+ ExtensionPointRegistry eps = nodeImpl.getExtensionPoints();
+ ServletHostExtensionPoint servletHosts = eps.getExtensionPoint(ServletHostExtensionPoint.class);
+ List<ServletHost> hosts = servletHosts.getServletHosts();
+ if (hosts == null || hosts.size() < 1) {
+ throw new IllegalStateException("No ServletHost found");
+ }
+ ServletHost servletHost = hosts.get(0);
+ if (!(servletHost instanceof WebAppServletHost)) {
+ throw new IllegalStateException("unexpected ServletHost type: " + servletHost);
+ }
+ return (WebAppServletHost)servletHost;
+ }
+
+ private static Node createNode(final ServletContext servletContext) throws ServletException {
+ NodeConfiguration configuration;
+ try {
+ configuration = getNodeConfiguration(servletContext);
+ } catch (IOException e) {
+ throw new ServletException(e);
+ }
+ Node node = factory.createNode(configuration).start();
+ return node;
+ }
+
+ public static void stop(ServletContext servletContext) {
+ Node node = (Node)servletContext.getAttribute(ServletHostHelper.SCA_NODE_ATTRIBUTE);
+ if (node != null) {
+ node.stop();
+ servletContext.setAttribute(ServletHostHelper.SCA_NODE_ATTRIBUTE, null);
+ }
+ }
+}
diff --git a/java/sca/modules/implementation-bpel-runtime/pom.xml b/java/sca/modules/implementation-bpel-runtime/pom.xml
index 122896976d..0ccca6424c 100644
--- a/java/sca/modules/implementation-bpel-runtime/pom.xml
+++ b/java/sca/modules/implementation-bpel-runtime/pom.xml
@@ -1,458 +1,458 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-implementation-bpel-runtime</artifactId>
- <name>Apache Tuscany SCA BPEL ODE Implementation Extension</name>
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-bpel</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl-xml</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- ODE Jars -->
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-epr</artifactId>
- <version>1.3.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-store</artifactId>
- <version>1.3.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-dao</artifactId>
- <version>1.3.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-dao-jpa</artifactId>
- <version>1.3.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-dao-jpa-ojpa-derby</artifactId>
- <version>1.3.2</version>
- <type>zip</type>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-runtime</artifactId>
- <version>1.3.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-api</artifactId>
- <version>1.3.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-scheduler-simple</artifactId>
- <version>1.3.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-utils</artifactId>
- <version>1.3.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-compiler</artifactId>
- <version>1.3.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-schemas</artifactId>
- <version>1.3.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-obj</artifactId>
- <version>1.3.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-jacob</artifactId>
- <version>1.3.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-jacob-ap</artifactId>
- <version>1.3.2</version>
- </dependency>
- <!-- http://issues.apache.org/jira/browse/ODE-604 -->
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-agents</artifactId>
- <version>1.3.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-dao-hibernate</artifactId>
- <version>1.3.2</version>
- </dependency>
-
- <!-- implementation-bpel non-sca dependencies -->
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>common</artifactId>
- <version>3.5.0-v20090520-1800</version>
- </dependency>
-
- <!-- ODE Dependencies -->
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.3</version>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jta_1.1_spec</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-kernel</artifactId>
- <version>2.0.1</version>
- <exclusions>
- <exclusion>
- <groupId>asm</groupId>
- <artifactId>asm-commons</artifactId>
- </exclusion>
- <exclusion>
- <groupId>mx4j</groupId>
- <artifactId>mx4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>cglib</groupId>
- <artifactId>cglib-nodep</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xpp3</groupId>
- <artifactId>xpp3</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xstream</groupId>
- <artifactId>xstream</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.components</groupId>
- <artifactId>geronimo-transaction</artifactId>
- <version>2.0.1</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jta_1.0.1B_spec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-ejb_2.1_spec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ognl</groupId>
- <artifactId>ognl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-ejb_2.1_spec</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.components</groupId>
- <artifactId>geronimo-connector</artifactId>
- <version>2.0.1</version>
- <exclusions>
- <exclusion>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jta_1.0.1B_spec</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xmlbeans</groupId>
- <artifactId>xbean</artifactId>
- </exclusion>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>10.4.1.3</version>
- </dependency>
- <dependency>
- <groupId>tranql</groupId>
- <artifactId>tranql-connector</artifactId>
- <version>1.1</version>
- <exclusions>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>geronimo-spec</groupId>
- <artifactId>geronimo-spec-j2ee-connector</artifactId>
- </exclusion>
- <exclusion>
- <groupId>geronimo-spec</groupId>
- <artifactId>geronimo-spec-jta</artifactId>
- </exclusion>
- <exclusion>
- <groupId>axion</groupId>
- <artifactId>axion</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-primitives</groupId>
- <artifactId>commons-primitives</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- http://issues.apache.org/jira/browse/ODE-605 -->
- <dependency>
- <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa</artifactId>
- <version>1.2.1</version>
- <!--
- <exclusions> <exclusion> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa-lib</artifactId>
- </exclusion> <exclusion> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa-kernel</artifactId>
- </exclusion> <exclusion> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa-kernel-5</artifactId>
- </exclusion> <exclusion> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa-jdbc</artifactId>
- </exclusion> <exclusion> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa-jdbc-5</artifactId>
- </exclusion> <exclusion> <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa-persistence-jdbc</artifactId> </exclusion> <exclusion>
- <groupId>org.apache.openjpa</groupId> <artifactId>openjpa-xmlstore</artifactId> </exclusion> <exclusion>
- <groupId>junit</groupId> <artifactId>junit</artifactId> </exclusion> </exclusions>
- -->
- </dependency>
- <dependency>
- <groupId>net.sourceforge.serp</groupId>
- <artifactId>serp</artifactId>
- <version>1.13.1</version>
- <exclusions>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>jaxen</groupId>
- <artifactId>jaxen</artifactId>
- <version>1.1.1</version>
- <exclusions>
- <exclusion>
- <groupId>xom</groupId>
- <artifactId>xom</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.7.0</version>
- <exclusions>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.9.0</version>
- <exclusions>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.xmlbeans</groupId>
- <artifactId>xmlbeans</artifactId>
- <version>2.3.0</version>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon</artifactId>
- <version>9.x</version>
- </dependency>
- <dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-dom</artifactId>
- <version>9.x</version>
- </dependency>
- <dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-xpath</artifactId>
- <version>9.x</version>
- </dependency>
- <dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon-xqj</artifactId>
- <version>9.x</version>
- </dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.3</version>
- <exclusions>
- <exclusion>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.13</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.ode</groupId>
- <artifactId>ode-dao-jpa-ojpa-derby</artifactId>
- <version>1.3.2</version>
- <type>zip</type>
- <overWrite>true</overWrite>
- <outputDirectory>${project.build.directory}/test-classes/
- </outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-implementation-bpel-runtime</artifactId>
+ <name>Apache Tuscany SCA BPEL ODE Implementation Extension</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-bpel</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xml</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-wsdl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-wsdl-xml</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- ODE Jars -->
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-bpel-epr</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-bpel-store</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-bpel-dao</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-dao-jpa</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-dao-jpa-ojpa-derby</artifactId>
+ <version>1.3.2</version>
+ <type>zip</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-bpel-runtime</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-bpel-api</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-scheduler-simple</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-utils</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-bpel-compiler</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-bpel-schemas</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-bpel-obj</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-jacob</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-jacob-ap</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <!-- http://issues.apache.org/jira/browse/ODE-604 -->
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-agents</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-dao-hibernate</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+
+ <!-- implementation-bpel non-sca dependencies -->
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>common</artifactId>
+ <version>3.5.0-v20090520-1800</version>
+ </dependency>
+
+ <!-- ODE Dependencies -->
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.3</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jta_1.1_spec</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>geronimo-kernel</artifactId>
+ <version>2.0.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>asm</groupId>
+ <artifactId>asm-commons</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>mx4j</groupId>
+ <artifactId>mx4j</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xpp3</groupId>
+ <artifactId>xpp3</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xstream</groupId>
+ <artifactId>xstream</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.components</groupId>
+ <artifactId>geronimo-transaction</artifactId>
+ <version>2.0.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jta_1.0.1B_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-ejb_2.1_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>ognl</groupId>
+ <artifactId>ognl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-ejb_2.1_spec</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.components</groupId>
+ <artifactId>geronimo-connector</artifactId>
+ <version>2.0.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jta_1.0.1B_spec</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xmlbeans</groupId>
+ <artifactId>xbean</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.4.1.3</version>
+ </dependency>
+ <dependency>
+ <groupId>tranql</groupId>
+ <artifactId>tranql-connector</artifactId>
+ <version>1.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>geronimo-spec</groupId>
+ <artifactId>geronimo-spec-j2ee-connector</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>geronimo-spec</groupId>
+ <artifactId>geronimo-spec-jta</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>axion</groupId>
+ <artifactId>axion</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-primitives</groupId>
+ <artifactId>commons-primitives</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <!-- http://issues.apache.org/jira/browse/ODE-605 -->
+ <dependency>
+ <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa</artifactId>
+ <version>1.2.1</version>
+ <!--
+ <exclusions> <exclusion> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa-lib</artifactId>
+ </exclusion> <exclusion> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa-kernel</artifactId>
+ </exclusion> <exclusion> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa-kernel-5</artifactId>
+ </exclusion> <exclusion> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa-jdbc</artifactId>
+ </exclusion> <exclusion> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa-jdbc-5</artifactId>
+ </exclusion> <exclusion> <groupId>org.apache.openjpa</groupId>
+ <artifactId>openjpa-persistence-jdbc</artifactId> </exclusion> <exclusion>
+ <groupId>org.apache.openjpa</groupId> <artifactId>openjpa-xmlstore</artifactId> </exclusion> <exclusion>
+ <groupId>junit</groupId> <artifactId>junit</artifactId> </exclusion> </exclusions>
+ -->
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.serp</groupId>
+ <artifactId>serp</artifactId>
+ <version>1.13.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ <version>1.1.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xom</groupId>
+ <artifactId>xom</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.7.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.9.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.xmlbeans</groupId>
+ <artifactId>xmlbeans</artifactId>
+ <version>2.3.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ <version>9.x</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.saxon</groupId>
+ <artifactId>saxon-dom</artifactId>
+ <version>9.x</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.saxon</groupId>
+ <artifactId>saxon-xpath</artifactId>
+ <version>9.x</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.saxon</groupId>
+ <artifactId>saxon-xqj</artifactId>
+ <version>9.x</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.13</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.ode</groupId>
+ <artifactId>ode-dao-jpa-ojpa-derby</artifactId>
+ <version>1.3.2</version>
+ <type>zip</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>${project.build.directory}/test-classes/
+ </outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
diff --git a/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/BPELODEDeployFile.java b/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/BPELODEDeployFile.java
index 2520e78d63..fe1e2d620b 100644
--- a/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/BPELODEDeployFile.java
+++ b/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/BPELODEDeployFile.java
@@ -1,233 +1,233 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.bpel.ode;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.net.URI;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.implementation.bpel.BPELImplementation;
-
-/**
- * A class that handles the deploy.xml file required for each BPEL process by the ODE runtime
- * @author Mike Edwards
- *
- * An explanation of the structure of the ODE deploy file:
- *
- * <deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
- * xmlns:tns="http://helloworld"
- * xmlns:tus="http://tuscany.apache.org/xmlns/sca/1.1">
- *
- * <process name="tns:HelloWorld">
- * <active>true</active>
- * <provide partnerLink="helloPartnerLink">
- * <service name="tus:helloPartnerLink" port="HelloWorld"/>
- * </provide>
- * <invoke partnerLink="greetingsPartnerLink">
- * <service name="tus:greetingsPartnerLink" port="Greetings"/>
- * </invoke>
- * </process>
- * </deploy>
- *
- * For SCA purposes:
- *
- * a) Each partner link in the BPEL process is declared using either a <provide.../>
- * (for a service) or using a <invoke.../> (for a reference).
- *
- * b) Each <provide/> and <invoke/> must use the partnerLink name, as declared in the
- * BPEL process.
- *
- * c) The <provide/> and <invoke/> elements each have a single child <service/> element.
- * The <service/> elements have name and port attributes. The NAME attribute MUST be set
- * to the same name as the partnerLink and MUST be prefixed by a prefix which references
- * the namespace "http://tuscany.apache.org" ("tus" in the example above).
- * The port attribute can be set to any name (it must be present but it is not actually
- * used for anything significant).
- *
- * When SCA loads a BPEL process to the ODE server, this file is read by the ODE server to
- * characterize the process. When SCA interacts with ODE at later points - either when a
- * service is being invoked or the process invokes a reference - it is the service @name
- * attribute that identifies the service or reference involved.
- *
- * @version
- */
-public class BPELODEDeployFile {
- private final Log __log = LogFactory.getLog(getClass());
-
- static final String DEPLOY_ELEMENT_START = "<deploy xmlns=\"http://www.apache.org/ode/schemas/dd/2007/03\"";
- static final String DEPLOY_ENDELEMENT = "</deploy>";
- static final String PROCESS_NAMESPACE_DECL = "xmlns:tns=";
- static final String SERVICE_NAMESPACE = "xmlns:tus=\"http://tuscany.apache.org\"";
- static final String PROCESS_ELEMENT_START = "<process name=\"tns:";
- static final String PROCESS_ELEMENT_END = "\">";
- static final String PROCESS_ENDELEMENT = "</process>";
- static final String ACTIVE_ELEMENT = "<active>true</active>";
- static final String PROVIDE_ELEMENT_START = "<provide partnerLink=\"";
- static final String PROVIDE_ELEMENT_END = "\">";
- static final String PROVIDE_ENDELEMENT = "</provide>";
- static final String SERVICE_ELEMENT_START = "<service name=\"tus:";
- static final String SERVICE_ELEMENT_PORT = "\" port=\"";
- static final String SERVICE_ELEMENT_END = "Port\"/>";
- static final String INVOKE_ELEMENT_START = "<invoke partnerLink=\"";
- static final String INVOKE_ELEMENT_END = "\">";
- static final String INVOKE_ENDELEMENT = "</invoke>";
-
- static final String DEPLOY_FILENAME = "deploy.xml";
-
- private BPELImplementation implementation;
-
- /**
- * Constructor - requires a BPELImplementation as a parameter
- * The ODE deploy.xml file is for this supplied BPELImplementation
- * @param theImplementation
- */
- public BPELODEDeployFile( BPELImplementation theImplementation ) {
-
- implementation = theImplementation;
-
- } // end BPELODEDeployFile constructor
-
- /**
- * Writes the deploy file into the same directory as the BPEL process file, with the name
- * "deploy.xml"
- */
- public void writeDeployfile() throws IOException {
-
- File theDirectory = getDirectory();
-
- File deployFile = new File( theDirectory, DEPLOY_FILENAME );
- new FileOutputStream( deployFile );
- //if( !deployFile.canWrite() ) throw new IOException( "Unable to write to deploy file" +
- // deployFile.getPath() );
-
- // Create a stream for the data and write the data to the file
- PrintStream theStream = new PrintStream( new FileOutputStream( deployFile ) );
- try {
- constructDeployXML( theStream );
- if( theStream.checkError() ) throw new IOException();
- } catch (Exception e) {
- throw new IOException( "Unable to write data to deploy file" +
- deployFile.getPath() );
- } finally {
- theStream.close();
- } // end try
-
- } // end writeDeployFile
-
- /**
- * Creates the deploy.xml data and writes it to a supplied PrintStream
- * @param stream
- */
- public void constructDeployXML( PrintStream stream ) {
-
- // <deploy + namespace...
- stream.println( DEPLOY_ELEMENT_START );
- // namespace of the BPEL process
- QName process = implementation.getProcess();
- String processNamespace = process.getNamespaceURI();
- stream.println( PROCESS_NAMESPACE_DECL + "\"" + processNamespace + "\"" );
- // namespace for the service name elements
- stream.println( SERVICE_NAMESPACE + ">" );
-
- // <process> element
- stream.println( PROCESS_ELEMENT_START + process.getLocalPart() +
- PROCESS_ELEMENT_END );
-
- // <active/> element
- stream.println( ACTIVE_ELEMENT );
-
- ComponentType componentType = implementation.getComponentType();
- List<Service> theServices = componentType.getServices();
- // Loop over the <provide/> elements - one per service
- for ( Service service : theServices ) {
- String serviceName = service.getName();
- // Provide element...
- stream.println( PROVIDE_ELEMENT_START + serviceName + PROVIDE_ELEMENT_END );
- // Child service element...
- stream.println( SERVICE_ELEMENT_START + serviceName +
- SERVICE_ELEMENT_PORT + serviceName + SERVICE_ELEMENT_END );
- stream.println( PROVIDE_ENDELEMENT );
- } // end for
-
- // Loop over the <invoke/> elements - one per reference
- List<Reference> theReferences = componentType.getReferences();
- for ( Reference reference : theReferences ) {
- String referenceName = reference.getName();
- stream.println( INVOKE_ELEMENT_START + referenceName + INVOKE_ELEMENT_END );
- // Child service element...
- stream.println( SERVICE_ELEMENT_START + referenceName +
- SERVICE_ELEMENT_PORT + referenceName + SERVICE_ELEMENT_END );
- stream.println( INVOKE_ENDELEMENT );
-
- } // end for
-
- // </process> element
- stream.println( PROCESS_ENDELEMENT );
-
- // </deploy>
- stream.println( DEPLOY_ENDELEMENT );
-
- } // end constructDeployXML
-
- /**
- * Gets the directory containing the BPEL process
- * @return
- */
- private File getDirectory() {
- File theDir = getBPELFile().getParentFile();
- return theDir;
- } // end getDirectory
-
- /**
- * Gets the File containing the BPEL process definition
- * @return - the File object containing the BPEL process
- */
- private File getBPELFile() {
- try {
- String location = this.implementation.getProcessDefinition().getLocation();
- URI locationURI;
- if (location.indexOf('%') != -1) {
- locationURI = URI.create(location);
- } else {
- locationURI = new URI(null, location, null);
- }
-
- File theProcess = new File(locationURI);
- return theProcess;
- } catch( Exception e ) {
- if(__log.isDebugEnabled()) {
- __log.debug("Exception converting BPEL file URL to an URI: " + e );
- }
- } // end try
- return null;
- } // end getBPELFile
-
-
-
-} // end class BPELODEDeployFile
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.bpel.ode;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.net.URI;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.implementation.bpel.BPELImplementation;
+
+/**
+ * A class that handles the deploy.xml file required for each BPEL process by the ODE runtime
+ * @author Mike Edwards
+ *
+ * An explanation of the structure of the ODE deploy file:
+ *
+ * <deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+ * xmlns:tns="http://helloworld"
+ * xmlns:tus="http://tuscany.apache.org/xmlns/sca/1.1">
+ *
+ * <process name="tns:HelloWorld">
+ * <active>true</active>
+ * <provide partnerLink="helloPartnerLink">
+ * <service name="tus:helloPartnerLink" port="HelloWorld"/>
+ * </provide>
+ * <invoke partnerLink="greetingsPartnerLink">
+ * <service name="tus:greetingsPartnerLink" port="Greetings"/>
+ * </invoke>
+ * </process>
+ * </deploy>
+ *
+ * For SCA purposes:
+ *
+ * a) Each partner link in the BPEL process is declared using either a <provide.../>
+ * (for a service) or using a <invoke.../> (for a reference).
+ *
+ * b) Each <provide/> and <invoke/> must use the partnerLink name, as declared in the
+ * BPEL process.
+ *
+ * c) The <provide/> and <invoke/> elements each have a single child <service/> element.
+ * The <service/> elements have name and port attributes. The NAME attribute MUST be set
+ * to the same name as the partnerLink and MUST be prefixed by a prefix which references
+ * the namespace "http://tuscany.apache.org" ("tus" in the example above).
+ * The port attribute can be set to any name (it must be present but it is not actually
+ * used for anything significant).
+ *
+ * When SCA loads a BPEL process to the ODE server, this file is read by the ODE server to
+ * characterize the process. When SCA interacts with ODE at later points - either when a
+ * service is being invoked or the process invokes a reference - it is the service @name
+ * attribute that identifies the service or reference involved.
+ *
+ * @version
+ */
+public class BPELODEDeployFile {
+ private final Log __log = LogFactory.getLog(getClass());
+
+ static final String DEPLOY_ELEMENT_START = "<deploy xmlns=\"http://www.apache.org/ode/schemas/dd/2007/03\"";
+ static final String DEPLOY_ENDELEMENT = "</deploy>";
+ static final String PROCESS_NAMESPACE_DECL = "xmlns:tns=";
+ static final String SERVICE_NAMESPACE = "xmlns:tus=\"http://tuscany.apache.org\"";
+ static final String PROCESS_ELEMENT_START = "<process name=\"tns:";
+ static final String PROCESS_ELEMENT_END = "\">";
+ static final String PROCESS_ENDELEMENT = "</process>";
+ static final String ACTIVE_ELEMENT = "<active>true</active>";
+ static final String PROVIDE_ELEMENT_START = "<provide partnerLink=\"";
+ static final String PROVIDE_ELEMENT_END = "\">";
+ static final String PROVIDE_ENDELEMENT = "</provide>";
+ static final String SERVICE_ELEMENT_START = "<service name=\"tus:";
+ static final String SERVICE_ELEMENT_PORT = "\" port=\"";
+ static final String SERVICE_ELEMENT_END = "Port\"/>";
+ static final String INVOKE_ELEMENT_START = "<invoke partnerLink=\"";
+ static final String INVOKE_ELEMENT_END = "\">";
+ static final String INVOKE_ENDELEMENT = "</invoke>";
+
+ static final String DEPLOY_FILENAME = "deploy.xml";
+
+ private BPELImplementation implementation;
+
+ /**
+ * Constructor - requires a BPELImplementation as a parameter
+ * The ODE deploy.xml file is for this supplied BPELImplementation
+ * @param theImplementation
+ */
+ public BPELODEDeployFile( BPELImplementation theImplementation ) {
+
+ implementation = theImplementation;
+
+ } // end BPELODEDeployFile constructor
+
+ /**
+ * Writes the deploy file into the same directory as the BPEL process file, with the name
+ * "deploy.xml"
+ */
+ public void writeDeployfile() throws IOException {
+
+ File theDirectory = getDirectory();
+
+ File deployFile = new File( theDirectory, DEPLOY_FILENAME );
+ new FileOutputStream( deployFile );
+ //if( !deployFile.canWrite() ) throw new IOException( "Unable to write to deploy file" +
+ // deployFile.getPath() );
+
+ // Create a stream for the data and write the data to the file
+ PrintStream theStream = new PrintStream( new FileOutputStream( deployFile ) );
+ try {
+ constructDeployXML( theStream );
+ if( theStream.checkError() ) throw new IOException();
+ } catch (Exception e) {
+ throw new IOException( "Unable to write data to deploy file" +
+ deployFile.getPath() );
+ } finally {
+ theStream.close();
+ } // end try
+
+ } // end writeDeployFile
+
+ /**
+ * Creates the deploy.xml data and writes it to a supplied PrintStream
+ * @param stream
+ */
+ public void constructDeployXML( PrintStream stream ) {
+
+ // <deploy + namespace...
+ stream.println( DEPLOY_ELEMENT_START );
+ // namespace of the BPEL process
+ QName process = implementation.getProcess();
+ String processNamespace = process.getNamespaceURI();
+ stream.println( PROCESS_NAMESPACE_DECL + "\"" + processNamespace + "\"" );
+ // namespace for the service name elements
+ stream.println( SERVICE_NAMESPACE + ">" );
+
+ // <process> element
+ stream.println( PROCESS_ELEMENT_START + process.getLocalPart() +
+ PROCESS_ELEMENT_END );
+
+ // <active/> element
+ stream.println( ACTIVE_ELEMENT );
+
+ ComponentType componentType = implementation.getComponentType();
+ List<Service> theServices = componentType.getServices();
+ // Loop over the <provide/> elements - one per service
+ for ( Service service : theServices ) {
+ String serviceName = service.getName();
+ // Provide element...
+ stream.println( PROVIDE_ELEMENT_START + serviceName + PROVIDE_ELEMENT_END );
+ // Child service element...
+ stream.println( SERVICE_ELEMENT_START + serviceName +
+ SERVICE_ELEMENT_PORT + serviceName + SERVICE_ELEMENT_END );
+ stream.println( PROVIDE_ENDELEMENT );
+ } // end for
+
+ // Loop over the <invoke/> elements - one per reference
+ List<Reference> theReferences = componentType.getReferences();
+ for ( Reference reference : theReferences ) {
+ String referenceName = reference.getName();
+ stream.println( INVOKE_ELEMENT_START + referenceName + INVOKE_ELEMENT_END );
+ // Child service element...
+ stream.println( SERVICE_ELEMENT_START + referenceName +
+ SERVICE_ELEMENT_PORT + referenceName + SERVICE_ELEMENT_END );
+ stream.println( INVOKE_ENDELEMENT );
+
+ } // end for
+
+ // </process> element
+ stream.println( PROCESS_ENDELEMENT );
+
+ // </deploy>
+ stream.println( DEPLOY_ENDELEMENT );
+
+ } // end constructDeployXML
+
+ /**
+ * Gets the directory containing the BPEL process
+ * @return
+ */
+ private File getDirectory() {
+ File theDir = getBPELFile().getParentFile();
+ return theDir;
+ } // end getDirectory
+
+ /**
+ * Gets the File containing the BPEL process definition
+ * @return - the File object containing the BPEL process
+ */
+ private File getBPELFile() {
+ try {
+ String location = this.implementation.getProcessDefinition().getLocation();
+ URI locationURI;
+ if (location.indexOf('%') != -1) {
+ locationURI = URI.create(location);
+ } else {
+ locationURI = new URI(null, location, null);
+ }
+
+ File theProcess = new File(locationURI);
+ return theProcess;
+ } catch( Exception e ) {
+ if(__log.isDebugEnabled()) {
+ __log.debug("Exception converting BPEL file URL to an URI: " + e );
+ }
+ } // end try
+ return null;
+ } // end getBPELFile
+
+
+
+} // end class BPELODEDeployFile
diff --git a/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEEndpointReference.java b/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEEndpointReference.java
index 36d9ac1a20..079a0f96f5 100644
--- a/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEEndpointReference.java
+++ b/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEEndpointReference.java
@@ -1,96 +1,96 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.bpel.ode;
-
-import org.apache.ode.bpel.iapi.Endpoint;
-import org.apache.ode.bpel.iapi.EndpointReference;
-import org.apache.ode.utils.DOMUtils;
-import org.apache.tuscany.sca.assembly.Base;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * Tuscany implementation of the ODE EndpointReference interface
- *
- */
-public class ODEEndpointReference implements EndpointReference {
-
-
- private Document doc = DOMUtils.newDocument();
- private Element serviceref;
-
- /**
- * Private constructor for the EndpointReference
- */
- private ODEEndpointReference() {
- super();
- } // end ODEEndpointReference()
-
- /**
- * Add a new <service-ref/> element to the EndpointReference
- */
- private void addServiceRef() {
- serviceref = doc.createElementNS(EndpointReference.SERVICE_REF_QNAME.getNamespaceURI(),
- EndpointReference.SERVICE_REF_QNAME.getLocalPart());
- doc.appendChild(serviceref);
- } // end method addServiceRef()
-
- /**
- * Create an EndpointReference from an Endpoint object
- * @param anEndpoint - the endpoint object
- */
- public ODEEndpointReference( Endpoint anEndpoint ) {
- this();
- addServiceRef();
- // If there is an endpoint for this reference (ie the reference is wired)
- // then add an element to indicate this
- String eprCount = anEndpoint.portName;
- if( !"0".equals(eprCount) ) {
- Element eprElement = doc.createElementNS( Base.SCA11_TUSCANY_NS, "EPR");
- serviceref.appendChild(eprElement);
- } // end if
- return;
- } // end
-
- /**
- * Create a new EndpointReference from an existing endpointElement, which is assumed
- * to be of the form:
- * <sref:service-ref>
- * <EPR/>
- * </sref:service-ref>
- *
- * @param endpointElement the endpointElement
- */
- public ODEEndpointReference( Element endpointElement ) {
- this();
- if( endpointElement != null ) {
- // import the service-ref element into this EndpointReference, if the
- // root element is a <sref:service-ref/>
- if( endpointElement.getLocalName().equals("service-ref") ) {
- doc.appendChild( doc.importNode(endpointElement, true) );
- } // end if
- } // end if
- return;
- } // end
-
- public Document toXML() {
- return doc;
- } // end toXML()
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.bpel.ode;
+
+import org.apache.ode.bpel.iapi.Endpoint;
+import org.apache.ode.bpel.iapi.EndpointReference;
+import org.apache.ode.utils.DOMUtils;
+import org.apache.tuscany.sca.assembly.Base;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Tuscany implementation of the ODE EndpointReference interface
+ *
+ */
+public class ODEEndpointReference implements EndpointReference {
+
+
+ private Document doc = DOMUtils.newDocument();
+ private Element serviceref;
+
+ /**
+ * Private constructor for the EndpointReference
+ */
+ private ODEEndpointReference() {
+ super();
+ } // end ODEEndpointReference()
+
+ /**
+ * Add a new <service-ref/> element to the EndpointReference
+ */
+ private void addServiceRef() {
+ serviceref = doc.createElementNS(EndpointReference.SERVICE_REF_QNAME.getNamespaceURI(),
+ EndpointReference.SERVICE_REF_QNAME.getLocalPart());
+ doc.appendChild(serviceref);
+ } // end method addServiceRef()
+
+ /**
+ * Create an EndpointReference from an Endpoint object
+ * @param anEndpoint - the endpoint object
+ */
+ public ODEEndpointReference( Endpoint anEndpoint ) {
+ this();
+ addServiceRef();
+ // If there is an endpoint for this reference (ie the reference is wired)
+ // then add an element to indicate this
+ String eprCount = anEndpoint.portName;
+ if( !"0".equals(eprCount) ) {
+ Element eprElement = doc.createElementNS( Base.SCA11_TUSCANY_NS, "EPR");
+ serviceref.appendChild(eprElement);
+ } // end if
+ return;
+ } // end
+
+ /**
+ * Create a new EndpointReference from an existing endpointElement, which is assumed
+ * to be of the form:
+ * <sref:service-ref>
+ * <EPR/>
+ * </sref:service-ref>
+ *
+ * @param endpointElement the endpointElement
+ */
+ public ODEEndpointReference( Element endpointElement ) {
+ this();
+ if( endpointElement != null ) {
+ // import the service-ref element into this EndpointReference, if the
+ // root element is a <sref:service-ref/>
+ if( endpointElement.getLocalName().equals("service-ref") ) {
+ doc.appendChild( doc.importNode(endpointElement, true) );
+ } // end if
+ } // end if
+ return;
+ } // end
+
+ public Document toXML() {
+ return doc;
+ } // end toXML()
+
+}
diff --git a/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEEprContext.java b/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEEprContext.java
index 2c5faef14d..972f77ad65 100644
--- a/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEEprContext.java
+++ b/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEEprContext.java
@@ -1,75 +1,75 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.bpel.ode;
-
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.ode.bpel.iapi.EndpointReference;
-import org.apache.ode.bpel.iapi.EndpointReferenceContext;
-import org.w3c.dom.Element;
-
-/**
- * Implementation of the ODE EndpointReferenceContext interface, used by the ODE BPEL Engine
- * to handle conversions of EndpointReferences at runtime.
- *
- * An ODE Endpoint reference relates to SCA Reference EndpointReferences (pointers to target
- * services) and to BPEL PartnerLink elements and any associated BPEL process variables with
- * type set to element="sref:service-ref"
- *
- */
-public class ODEEprContext implements EndpointReferenceContext {
-
- /**
- * Converts an endpoint reference from its XML representation to another
- * type of endpoint reference.
- *
- * @param targetType
- * @param sourceEndpoint
- * @return converted EndpointReference, being of targetType
- */
- public EndpointReference convertEndpoint( QName targetType,
- Element sourceEndpoint) {
- // For the present, Tuscany only has one type of EndpointReference, so that the
- // targetType parameter is of no significance.
- return new ODEEndpointReference( sourceEndpoint );
- } // end method convertEndpoint
-
- public Map getConfigLookup(EndpointReference epr) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * Resolve an end-point reference from its XML representation. The
- * nature of the representation is determined by the integration
- * layer. The BPEL engine uses this method to reconstruct
- * {@link EndpointReference} objects that have been persisted in the
- * database via {@link EndpointReference#toXML(javax.xml.transform.Result)}
- * method.
- *
- * @param XML representation of the EPR
- * @return reconstituted EPR object {@link EndpointReference}
- */
- public EndpointReference resolveEndpointReference(Element epr) {
- return new ODEEndpointReference( epr );
- } // end method resolveEndpointReference
-
-} // end class ODEEprContext
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.bpel.ode;
+
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.iapi.EndpointReference;
+import org.apache.ode.bpel.iapi.EndpointReferenceContext;
+import org.w3c.dom.Element;
+
+/**
+ * Implementation of the ODE EndpointReferenceContext interface, used by the ODE BPEL Engine
+ * to handle conversions of EndpointReferences at runtime.
+ *
+ * An ODE Endpoint reference relates to SCA Reference EndpointReferences (pointers to target
+ * services) and to BPEL PartnerLink elements and any associated BPEL process variables with
+ * type set to element="sref:service-ref"
+ *
+ */
+public class ODEEprContext implements EndpointReferenceContext {
+
+ /**
+ * Converts an endpoint reference from its XML representation to another
+ * type of endpoint reference.
+ *
+ * @param targetType
+ * @param sourceEndpoint
+ * @return converted EndpointReference, being of targetType
+ */
+ public EndpointReference convertEndpoint( QName targetType,
+ Element sourceEndpoint) {
+ // For the present, Tuscany only has one type of EndpointReference, so that the
+ // targetType parameter is of no significance.
+ return new ODEEndpointReference( sourceEndpoint );
+ } // end method convertEndpoint
+
+ public Map getConfigLookup(EndpointReference epr) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * Resolve an end-point reference from its XML representation. The
+ * nature of the representation is determined by the integration
+ * layer. The BPEL engine uses this method to reconstruct
+ * {@link EndpointReference} objects that have been persisted in the
+ * database via {@link EndpointReference#toXML(javax.xml.transform.Result)}
+ * method.
+ *
+ * @param XML representation of the EPR
+ * @return reconstituted EPR object {@link EndpointReference}
+ */
+ public EndpointReference resolveEndpointReference(Element epr) {
+ return new ODEEndpointReference( epr );
+ } // end method resolveEndpointReference
+
+} // end class ODEEprContext
diff --git a/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/ODEInvocationException.java b/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/ODEInvocationException.java
index 343ba2d02a..7b6f9ceafa 100644
--- a/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/ODEInvocationException.java
+++ b/java/sca/modules/implementation-bpel-runtime/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/provider/ODEInvocationException.java
@@ -1,33 +1,33 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.bpel.ode.provider;
-
-public class ODEInvocationException extends Exception {
-
- /**
- * Thrown when the result of the invocation of a BPEL Process operation
- * returns a Fault or Failure code
- */
- private static final long serialVersionUID = 5096941965798566018L;
-
- public ODEInvocationException(String message) {
- super(message);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.bpel.ode.provider;
+
+public class ODEInvocationException extends Exception {
+
+ /**
+ * Thrown when the result of the invocation of a BPEL Process operation
+ * returns a Fault or Failure code
+ */
+ private static final long serialVersionUID = 5096941965798566018L;
+
+ public ODEInvocationException(String message) {
+ super(message);
+ }
+
+}
diff --git a/java/sca/modules/implementation-bpel-runtime/src/test/resources/helloworld/greetings.wsdl b/java/sca/modules/implementation-bpel-runtime/src/test/resources/helloworld/greetings.wsdl
index bcd3ea6afa..e768707ccd 100644
--- a/java/sca/modules/implementation-bpel-runtime/src/test/resources/helloworld/greetings.wsdl
+++ b/java/sca/modules/implementation-bpel-runtime/src/test/resources/helloworld/greetings.wsdl
@@ -1,87 +1,87 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<wsdl:definitions name="greetings"
- targetNamespace="http://greetings"
- xmlns:tns="http://greetings"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
-
- <wsdl:types>
- <schema elementFormDefault="qualified" targetNamespace="http://greetings" xmlns="http://www.w3.org/2001/XMLSchema">
-
- <element name="getGreetings">
- <complexType>
- <sequence>
- <element name="name" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
-
- <element name="getGreetingsResponse">
- <complexType>
- <sequence>
- <element name="getGreetingsReturn" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
-
- </schema>
- </wsdl:types>
-
- <wsdl:message name="getGreetingsRequest">
- <wsdl:part element="tns:getGreetings" name="parameters"/>
- </wsdl:message>
-
- <wsdl:message name="getGreetingsResponse">
- <wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
- </wsdl:message>
-
- <wsdl:portType name="Greetings">
- <wsdl:operation name="getGreetings">
- <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
- <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
- </wsdl:operation>
- </wsdl:portType>
-
- <wsdl:binding name="GreetingsSoapBinding" type="tns:Greetings">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="getGreetings">
- <wsdlsoap:operation soapAction=""/>
- <wsdl:input name="getGreetingsRequest">
- <wsdlsoap:body use="literal"/>
- </wsdl:input>
- <wsdl:output name="getGreetingsResponse">
- <wsdlsoap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="GreetingsService">
- <wsdl:port name="GreetingsSoapPort" binding="tns:GreetingsSoapBinding">
- <wsdlsoap:address location="http://localhost:8085/GreetingsServiceComponent"/>
- </wsdl:port>
- </wsdl:service>
-
- <plnk:partnerLinkType name="GreetingsPartnerLinkType">
- <plnk:role name="Provider" portType="tns:Greetings"/>
- </plnk:partnerLinkType>
-</wsdl:definitions>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions name="greetings"
+ targetNamespace="http://greetings"
+ xmlns:tns="http://greetings"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified" targetNamespace="http://greetings" xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <element name="getGreetings">
+ <complexType>
+ <sequence>
+ <element name="name" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="getGreetingsResponse">
+ <complexType>
+ <sequence>
+ <element name="getGreetingsReturn" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetingsRequest">
+ <wsdl:part element="tns:getGreetings" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:message name="getGreetingsResponse">
+ <wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:portType name="Greetings">
+ <wsdl:operation name="getGreetings">
+ <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
+ <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="GreetingsSoapBinding" type="tns:Greetings">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="getGreetings">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="getGreetingsRequest">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="getGreetingsResponse">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="GreetingsService">
+ <wsdl:port name="GreetingsSoapPort" binding="tns:GreetingsSoapBinding">
+ <wsdlsoap:address location="http://localhost:8085/GreetingsServiceComponent"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="GreetingsPartnerLinkType">
+ <plnk:role name="Provider" portType="tns:Greetings"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
diff --git a/java/sca/modules/implementation-bpel-runtime/src/test/resources/helloworld/helloworld.wsdl b/java/sca/modules/implementation-bpel-runtime/src/test/resources/helloworld/helloworld.wsdl
index 1d71727b2d..610bda3cc4 100644
--- a/java/sca/modules/implementation-bpel-runtime/src/test/resources/helloworld/helloworld.wsdl
+++ b/java/sca/modules/implementation-bpel-runtime/src/test/resources/helloworld/helloworld.wsdl
@@ -1,82 +1,82 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-
-<wsdl:definitions name="helloworld"
- targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
- xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
-
- <wsdl:types>
- <schema elementFormDefault="qualified"
- targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns="http://www.w3.org/2001/XMLSchema">
-
- <element name="hello">
- <complexType>
- <sequence>
- <element name="message" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
- </schema>
- </wsdl:types>
-
- <wsdl:message name="HelloMessage">
- <wsdl:part element="tns:hello" name="TestPart"/>
- </wsdl:message>
-
- <wsdl:portType name="HelloPortType">
- <wsdl:operation name="hello">
- <wsdl:input message="tns:HelloMessage" name="TestIn"/>
- <wsdl:output message="tns:HelloMessage" name="TestOut"/>
- </wsdl:operation>
- </wsdl:portType>
-
-
- <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="hello">
- <wsdlsoap:operation soapAction=""/>
- <wsdl:input name="TestIn">
- <wsdlsoap:body use="literal"/>
- </wsdl:input>
- <wsdl:output name="TestOut">
- <wsdlsoap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="HelloService">
- <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
- <soap:address location="http://localhost:8085/ode/processes/helloWorld"/>
- </wsdl:port>
- </wsdl:service>
-
- <plnk:partnerLinkType name="HelloPartnerLinkType">
- <plnk:role name="me" portType="tns:HelloPortType"/>
- <plnk:role name="you" portType="tns:HelloPortType"/>
- </plnk:partnerLinkType>
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<wsdl:definitions name="helloworld"
+ targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+ xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified"
+ targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <element name="hello">
+ <complexType>
+ <sequence>
+ <element name="message" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="HelloMessage">
+ <wsdl:part element="tns:hello" name="TestPart"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloPortType">
+ <wsdl:operation name="hello">
+ <wsdl:input message="tns:HelloMessage" name="TestIn"/>
+ <wsdl:output message="tns:HelloMessage" name="TestOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+
+ <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="hello">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="TestIn">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="TestOut">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="HelloService">
+ <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
+ <soap:address location="http://localhost:8085/ode/processes/helloWorld"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="HelloPartnerLinkType">
+ <plnk:role name="me" portType="tns:HelloPortType"/>
+ <plnk:role name="you" portType="tns:HelloPortType"/>
+ </plnk:partnerLinkType>
</wsdl:definitions> \ No newline at end of file
diff --git a/java/sca/modules/implementation-bpel/pom.xml b/java/sca/modules/implementation-bpel/pom.xml
index 39959337b8..eefd83a0a8 100644
--- a/java/sca/modules/implementation-bpel/pom.xml
+++ b/java/sca/modules/implementation-bpel/pom.xml
@@ -1,76 +1,76 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-implementation-bpel</artifactId>
- <name>Apache Tuscany SCA BPEL Implementation Extension</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-wsdl</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface-java</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-databinding</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-implementation-bpel</artifactId>
+ <name>Apache Tuscany SCA BPEL Implementation Extension</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xml</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-wsdl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface-java</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-databinding</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImportElement.java b/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImportElement.java
index bf0020323c..959d1ec5d5 100644
--- a/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImportElement.java
+++ b/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELImportElement.java
@@ -1,65 +1,65 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.bpel.xml;
-
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-
-/**
- * Represents an <import.../> element in a BPEL process
- * - this has attributes:
- * location
- * importType
- * namespace
- *
- * @version $Rev$ $Date$
- */
-public class BPELImportElement {
-
- private String location;
- private String importType;
- private String namespace;
- private WSDLDefinition theWSDL = null;
-
- public BPELImportElement(String location, String importType, String namespace) {
- this.location = location;
- this.importType = importType;
- this.namespace = namespace;
- }
-
- public String getImportType() {
- return importType;
- }
-
- public String getLocation() {
- return location;
- }
-
- public String getNamespace() {
- return namespace;
- }
-
- public void setWSDLDefinition(WSDLDefinition theDefinition) {
- theWSDL = theDefinition;
- }
-
- public WSDLDefinition getWSDLDefinition() {
- return theWSDL;
- }
-
-} // end class BPELImportElement
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.bpel.xml;
+
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+
+/**
+ * Represents an <import.../> element in a BPEL process
+ * - this has attributes:
+ * location
+ * importType
+ * namespace
+ *
+ * @version $Rev$ $Date$
+ */
+public class BPELImportElement {
+
+ private String location;
+ private String importType;
+ private String namespace;
+ private WSDLDefinition theWSDL = null;
+
+ public BPELImportElement(String location, String importType, String namespace) {
+ this.location = location;
+ this.importType = importType;
+ this.namespace = namespace;
+ }
+
+ public String getImportType() {
+ return importType;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public String getNamespace() {
+ return namespace;
+ }
+
+ public void setWSDLDefinition(WSDLDefinition theDefinition) {
+ theWSDL = theDefinition;
+ }
+
+ public WSDLDefinition getWSDLDefinition() {
+ return theWSDL;
+ }
+
+} // end class BPELImportElement
diff --git a/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkElement.java b/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkElement.java
index cf90bea837..4781e8ef93 100644
--- a/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkElement.java
+++ b/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkElement.java
@@ -1,129 +1,129 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.bpel.xml;
-
-import javax.wsdl.PortType;
-import javax.xml.namespace.QName;
-
-/**
- * Represents a <partnerLink.../> element in a BPEL process
- * - this has attributes:
- * name
- * partnerLinkType
- * myRole
- * partnerRole
- * - plus zero or more property elements as children
- *
- * The partnerlink may also be given an SCA Type - either of service or of reference - this must
- * generally be calculated and set on the partnerLink by inspecting the BPEL process
- *
- * @version $Rev$ $Date$
- */
-public class BPELPartnerLinkElement {
-
- private String REFERENCE_TYPE = "reference";
- private String SERVICE_TYPE = "service";
- private String name;
- private QName partnerLinkType;
- private BPELPartnerLinkTypeElement pLinkType = null;
- private String myRole;
- private String partnerRole;
- private String scaName; // Holds the SCA reference or service name
- private String scaType = null; // Holds the SCA type = null | service | reference
-
- public BPELPartnerLinkElement(String name,
- QName partnerLinkType,
- String myRole,
- String partnerRole ) {
- this.name = name;
- this.partnerLinkType = partnerLinkType;
- this.myRole = myRole;
- this.partnerRole = partnerRole;
-
- scaName = null;
- }
-
- public QName getPartnerLinkType() {
- return partnerLinkType;
- }
-
- public void setPartnerLinkType( BPELPartnerLinkTypeElement pLinkType ) {
- this.pLinkType = pLinkType;
- }
-
-
- public PortType getMyRolePortType() {
- return getRolePortType( myRole );
- }
-
- public PortType getPartnerRolePortType() {
- return getRolePortType( partnerRole );
- }
-
- private PortType getRolePortType( String theRole ) {
- if (theRole == null || theRole.length() == 0) {
- return null;
- } // end if
- if (theRole.equals(pLinkType.getRole1Name())) {
- return pLinkType.getRole1pType();
- } else if (theRole.equals(pLinkType.getRole2Name())) {
- return pLinkType.getRole2pType();
- } // end if
- return null;
- } // end getRolePortType
-
- public String getName() {
- return name;
- }
-
- public String getMyRole() {
- return myRole;
- }
-
- public String getPartnerRole() {
- return partnerRole;
- }
-
- public void setSCAName( String name ) {
- scaName = name;
- }
-
- public String getSCAName() {
- return scaName;
- }
-
- public boolean isSCATyped() {
- return ( !(scaType == null) );
- }
-
- public void setAsReference( String name ) {
- scaType = REFERENCE_TYPE;
- scaName = name;
- }
-
- public void setAsService( String name ) {
- scaType = SERVICE_TYPE;
- scaName = name;
- }
-
- public String querySCAType() {
- return scaType;
- }
-
-} // end class BPELPartnerLinkElement
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.bpel.xml;
+
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+
+/**
+ * Represents a <partnerLink.../> element in a BPEL process
+ * - this has attributes:
+ * name
+ * partnerLinkType
+ * myRole
+ * partnerRole
+ * - plus zero or more property elements as children
+ *
+ * The partnerlink may also be given an SCA Type - either of service or of reference - this must
+ * generally be calculated and set on the partnerLink by inspecting the BPEL process
+ *
+ * @version $Rev$ $Date$
+ */
+public class BPELPartnerLinkElement {
+
+ private String REFERENCE_TYPE = "reference";
+ private String SERVICE_TYPE = "service";
+ private String name;
+ private QName partnerLinkType;
+ private BPELPartnerLinkTypeElement pLinkType = null;
+ private String myRole;
+ private String partnerRole;
+ private String scaName; // Holds the SCA reference or service name
+ private String scaType = null; // Holds the SCA type = null | service | reference
+
+ public BPELPartnerLinkElement(String name,
+ QName partnerLinkType,
+ String myRole,
+ String partnerRole ) {
+ this.name = name;
+ this.partnerLinkType = partnerLinkType;
+ this.myRole = myRole;
+ this.partnerRole = partnerRole;
+
+ scaName = null;
+ }
+
+ public QName getPartnerLinkType() {
+ return partnerLinkType;
+ }
+
+ public void setPartnerLinkType( BPELPartnerLinkTypeElement pLinkType ) {
+ this.pLinkType = pLinkType;
+ }
+
+
+ public PortType getMyRolePortType() {
+ return getRolePortType( myRole );
+ }
+
+ public PortType getPartnerRolePortType() {
+ return getRolePortType( partnerRole );
+ }
+
+ private PortType getRolePortType( String theRole ) {
+ if (theRole == null || theRole.length() == 0) {
+ return null;
+ } // end if
+ if (theRole.equals(pLinkType.getRole1Name())) {
+ return pLinkType.getRole1pType();
+ } else if (theRole.equals(pLinkType.getRole2Name())) {
+ return pLinkType.getRole2pType();
+ } // end if
+ return null;
+ } // end getRolePortType
+
+ public String getName() {
+ return name;
+ }
+
+ public String getMyRole() {
+ return myRole;
+ }
+
+ public String getPartnerRole() {
+ return partnerRole;
+ }
+
+ public void setSCAName( String name ) {
+ scaName = name;
+ }
+
+ public String getSCAName() {
+ return scaName;
+ }
+
+ public boolean isSCATyped() {
+ return ( !(scaType == null) );
+ }
+
+ public void setAsReference( String name ) {
+ scaType = REFERENCE_TYPE;
+ scaName = name;
+ }
+
+ public void setAsService( String name ) {
+ scaType = SERVICE_TYPE;
+ scaName = name;
+ }
+
+ public String querySCAType() {
+ return scaType;
+ }
+
+} // end class BPELPartnerLinkElement
diff --git a/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkTypeElement.java b/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkTypeElement.java
index 86a1d757d5..3ae9ef19c0 100644
--- a/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkTypeElement.java
+++ b/java/sca/modules/implementation-bpel/src/main/java/org/apache/tuscany/sca/implementation/bpel/xml/BPELPartnerLinkTypeElement.java
@@ -1,111 +1,111 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */package org.apache.tuscany.sca.implementation.bpel.xml;
-
- import javax.wsdl.PortType;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.xml.namespace.QName;
-
-/**
- * Represents a <partnerLinkType.../> element related to a BPEL process
- * - this has attributes:
- * name
- * Role1 name
- * Role1 portType
- * Role2 name
- * Role2 portType
- *
- * - in the XML the 2 roles are child elements of the partnerLinkType element, but there
- * seems little point in reflecting this back into this model - it is simpler to include
- * both roles within the representation of the partnerLinkType itself
- *
- * @version $Rev$ $Date$
- */
-public class BPELPartnerLinkTypeElement implements ExtensibilityElement {
-
- private QName name;
- private String Role1name = null;
- private QName Role1porttype = null;
- private PortType Role1pType = null;
- private String Role2name = null;
- private QName Role2porttype = null;
- private PortType Role2pType = null;
- private QName elementType = null;
- private Boolean required = false;
-
- public BPELPartnerLinkTypeElement(QName name) {
- this.name = name;
- }
-
- public QName getName() {
- return name;
- }
-
- public void setRole1(String name, QName portType, PortType pType) {
- Role1name = name;
- Role1porttype = portType;
- Role1pType = pType;
- }
-
- public void setRole2(String name, QName portType, PortType pType) {
- Role2name = name;
- Role2porttype = portType;
- Role2pType = pType;
- }
-
- public String getRole1Name() {
- return Role1name;
- }
-
- public String getRole2Name() {
- return Role2name;
- }
-
- public QName getRole1PortType() {
- return Role1porttype;
- }
-
- public QName getRole2PortType() {
- return Role2porttype;
- }
-
- public PortType getRole1pType() {
- return Role1pType;
- }
-
- public PortType getRole2pType() {
- return Role2pType;
- }
-
- public QName getElementType() {
- return elementType;
- }
-
- public Boolean getRequired() {
- return required;
- }
-
- public void setElementType(QName elementType) {
- this.elementType = elementType;
- }
-
- public void setRequired(java.lang.Boolean required) {
- this.required = required;
- }
-
-} // end BPELPartnerLinkType
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */package org.apache.tuscany.sca.implementation.bpel.xml;
+
+ import javax.wsdl.PortType;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.xml.namespace.QName;
+
+/**
+ * Represents a <partnerLinkType.../> element related to a BPEL process
+ * - this has attributes:
+ * name
+ * Role1 name
+ * Role1 portType
+ * Role2 name
+ * Role2 portType
+ *
+ * - in the XML the 2 roles are child elements of the partnerLinkType element, but there
+ * seems little point in reflecting this back into this model - it is simpler to include
+ * both roles within the representation of the partnerLinkType itself
+ *
+ * @version $Rev$ $Date$
+ */
+public class BPELPartnerLinkTypeElement implements ExtensibilityElement {
+
+ private QName name;
+ private String Role1name = null;
+ private QName Role1porttype = null;
+ private PortType Role1pType = null;
+ private String Role2name = null;
+ private QName Role2porttype = null;
+ private PortType Role2pType = null;
+ private QName elementType = null;
+ private Boolean required = false;
+
+ public BPELPartnerLinkTypeElement(QName name) {
+ this.name = name;
+ }
+
+ public QName getName() {
+ return name;
+ }
+
+ public void setRole1(String name, QName portType, PortType pType) {
+ Role1name = name;
+ Role1porttype = portType;
+ Role1pType = pType;
+ }
+
+ public void setRole2(String name, QName portType, PortType pType) {
+ Role2name = name;
+ Role2porttype = portType;
+ Role2pType = pType;
+ }
+
+ public String getRole1Name() {
+ return Role1name;
+ }
+
+ public String getRole2Name() {
+ return Role2name;
+ }
+
+ public QName getRole1PortType() {
+ return Role1porttype;
+ }
+
+ public QName getRole2PortType() {
+ return Role2porttype;
+ }
+
+ public PortType getRole1pType() {
+ return Role1pType;
+ }
+
+ public PortType getRole2pType() {
+ return Role2pType;
+ }
+
+ public QName getElementType() {
+ return elementType;
+ }
+
+ public Boolean getRequired() {
+ return required;
+ }
+
+ public void setElementType(QName elementType) {
+ this.elementType = elementType;
+ }
+
+ public void setRequired(java.lang.Boolean required) {
+ this.required = required;
+ }
+
+} // end BPELPartnerLinkType
diff --git a/java/sca/modules/implementation-bpel/src/test/resources/helloworld/helloworld.wsdl b/java/sca/modules/implementation-bpel/src/test/resources/helloworld/helloworld.wsdl
index 1d71727b2d..610bda3cc4 100644
--- a/java/sca/modules/implementation-bpel/src/test/resources/helloworld/helloworld.wsdl
+++ b/java/sca/modules/implementation-bpel/src/test/resources/helloworld/helloworld.wsdl
@@ -1,82 +1,82 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-
-<wsdl:definitions name="helloworld"
- targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
- xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
-
- <wsdl:types>
- <schema elementFormDefault="qualified"
- targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns="http://www.w3.org/2001/XMLSchema">
-
- <element name="hello">
- <complexType>
- <sequence>
- <element name="message" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
- </schema>
- </wsdl:types>
-
- <wsdl:message name="HelloMessage">
- <wsdl:part element="tns:hello" name="TestPart"/>
- </wsdl:message>
-
- <wsdl:portType name="HelloPortType">
- <wsdl:operation name="hello">
- <wsdl:input message="tns:HelloMessage" name="TestIn"/>
- <wsdl:output message="tns:HelloMessage" name="TestOut"/>
- </wsdl:operation>
- </wsdl:portType>
-
-
- <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="hello">
- <wsdlsoap:operation soapAction=""/>
- <wsdl:input name="TestIn">
- <wsdlsoap:body use="literal"/>
- </wsdl:input>
- <wsdl:output name="TestOut">
- <wsdlsoap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="HelloService">
- <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
- <soap:address location="http://localhost:8085/ode/processes/helloWorld"/>
- </wsdl:port>
- </wsdl:service>
-
- <plnk:partnerLinkType name="HelloPartnerLinkType">
- <plnk:role name="me" portType="tns:HelloPortType"/>
- <plnk:role name="you" portType="tns:HelloPortType"/>
- </plnk:partnerLinkType>
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<wsdl:definitions name="helloworld"
+ targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+ xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified"
+ targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <element name="hello">
+ <complexType>
+ <sequence>
+ <element name="message" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="HelloMessage">
+ <wsdl:part element="tns:hello" name="TestPart"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloPortType">
+ <wsdl:operation name="hello">
+ <wsdl:input message="tns:HelloMessage" name="TestIn"/>
+ <wsdl:output message="tns:HelloMessage" name="TestOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+
+ <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="hello">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="TestIn">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="TestOut">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="HelloService">
+ <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
+ <soap:address location="http://localhost:8085/ode/processes/helloWorld"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="HelloPartnerLinkType">
+ <plnk:role name="me" portType="tns:HelloPortType"/>
+ <plnk:role name="you" portType="tns:HelloPortType"/>
+ </plnk:partnerLinkType>
</wsdl:definitions> \ No newline at end of file
diff --git a/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ConversationIDObjectFactory.java b/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ConversationIDObjectFactory.java
index e8aa178232..4bf55e3a72 100644
--- a/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ConversationIDObjectFactory.java
+++ b/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/ConversationIDObjectFactory.java
@@ -1,42 +1,42 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.core.invocation.ThreadMessageContext;
-
-/**
- * Object Factory that is used to retrieve the ConversationID from the
- * Message on the ThreadMessageContext.
- *
- * @version $Rev$ $Date$
- */
-public class ConversationIDObjectFactory implements ObjectFactory {
-
- public ConversationIDObjectFactory() {
- }
-
- public Object getInstance() {
- /* TODO - EPR - not reqiured for OASIS
- return ThreadMessageContext.getMessageContext().getFrom().getReferenceParameters().getConversationID();
- */
- return null;
-
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.java.injection;
+
+import org.apache.tuscany.sca.core.factory.ObjectFactory;
+import org.apache.tuscany.sca.core.invocation.ThreadMessageContext;
+
+/**
+ * Object Factory that is used to retrieve the ConversationID from the
+ * Message on the ThreadMessageContext.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ConversationIDObjectFactory implements ObjectFactory {
+
+ public ConversationIDObjectFactory() {
+ }
+
+ public Object getInstance() {
+ /* TODO - EPR - not reqiured for OASIS
+ return ThreadMessageContext.getMessageContext().getFrom().getReferenceParameters().getConversationID();
+ */
+ return null;
+
+ }
+}
diff --git a/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java b/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java
index e681af7217..d99ce25686 100644
--- a/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java
+++ b/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/injection/JavaPropertyValueObjectFactory.java
@@ -1,326 +1,326 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.injection;
-
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.context.PropertyValueFactory;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.core.factory.ObjectCreationException;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.databinding.Mediator;
-import org.apache.tuscany.sca.databinding.SimpleTypeMapper;
-import org.apache.tuscany.sca.databinding.impl.DOMHelper;
-import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
-import org.apache.tuscany.sca.databinding.xml.DOMDataBinding;
-import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
-import org.apache.tuscany.sca.interfacedef.util.TypeInfo;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JavaPropertyValueObjectFactory implements PropertyValueFactory {
- private Mediator mediator = null;
- private SimpleTypeMapper simpleTypeMapper;
- private boolean isSimpleType;
-
- public JavaPropertyValueObjectFactory(ExtensionPointRegistry registry) {
- UtilityExtensionPoint utilityExtensionPoint = registry.getExtensionPoint(UtilityExtensionPoint.class);
- this.mediator = utilityExtensionPoint.getUtility(Mediator.class);
- this.simpleTypeMapper = utilityExtensionPoint.getUtility(SimpleTypeMapper.class);
- }
-
- public JavaPropertyValueObjectFactory(Mediator mediator) {
- this.mediator = mediator;
- }
-
- /**
- * Introspect the property
- * @param javaElement
- * @return
- */
- private DataType<?> introspect(JavaElementImpl javaElement) {
- DataType<XMLType> dt =
- new DataTypeImpl<XMLType>(null, javaElement.getType(), javaElement.getGenericType(), XMLType.UNKNOWN);
- mediator.getDataBindings().introspectType(dt, null);
- return dt;
- }
-
- public ObjectFactory createValueFactory(Property property, Object propertyValue, JavaElementImpl javaElement) {
- Document doc = (Document)propertyValue;
- List<Node> nodes = getValues(doc);
- Class<?> javaType = JavaIntrospectionHelper.getBaseType(javaElement.getType(), javaElement.getGenericType());
- if (property.isMany()) {
- if (javaElement.getType().isArray()) {
- return new ArrayObjectFactoryImpl(property, nodes, javaType);
- } else {
- return new ListObjectFactoryImpl(property, nodes, javaType);
- }
- } else {
- Object value = null;
- if (!nodes.isEmpty()) {
- value = nodes.get(0);
- }
- return new ObjectFactoryImpl(property, value, javaType);
-
- }
- }
-
- public ObjectFactory createValueFactory(Property property, Object propertyValue, Class<?> javaType) {
- Document doc = (Document)propertyValue;
- List<Node> nodes = getValues(doc);
- if (property.isMany()) {
- return new ListObjectFactoryImpl(property, nodes, javaType);
- } else {
- Object value = null;
- if (!nodes.isEmpty()) {
- value = nodes.get(0);
- }
- return new ObjectFactoryImpl(property, value, javaType);
- }
- }
-
- public <B> B createPropertyValue(ComponentProperty property, Class<B> type) {
- ObjectFactory<B> factory = this.createValueFactory(property, property.getValue(), type);
- return factory.getInstance();
- }
-
- abstract class ObjectFactoryImplBase implements ObjectFactory {
- protected SimpleTypeMapper simpleTypeMapper = new SimpleTypeMapperImpl();
- protected Property property;
- protected Object propertyValue;
- protected Class<?> javaType;
- protected DataType<XMLType> sourceDataType;
- protected DataType<?> targetDataType;
-
- public ObjectFactoryImplBase(Property property, Object propertyValue, Class<?> javaType) {
- this.property = property;
- this.propertyValue = propertyValue;
- this.javaType = javaType;
- sourceDataType =
- new DataTypeImpl<XMLType>(DOMDataBinding.NAME, Node.class,
- new XMLType(null, this.property.getXSDType()));
- TypeInfo typeInfo = null;
- if (this.property.getXSDType() != null) {
- if (simpleTypeMapper.isSimpleXSDType(this.property.getXSDType())) {
- typeInfo = new TypeInfo(property.getXSDType(), true, null);
- } else {
- typeInfo = new TypeInfo(property.getXSDType(), false, null);
- }
- } else {
- typeInfo = new TypeInfo(property.getXSDType(), false, null);
- }
-
- XMLType xmlType = new XMLType(typeInfo);
- String dataBinding = null; // (String)property.getExtensions().get(DataBinding.class.getName());
- if (dataBinding != null) {
- targetDataType = new DataTypeImpl<XMLType>(dataBinding, javaType, xmlType);
- } else {
- targetDataType = new DataTypeImpl<XMLType>(dataBinding, javaType, xmlType);
- mediator.getDataBindings().introspectType(targetDataType, null);
- }
- }
- }
-
- class ObjectFactoryImpl extends ObjectFactoryImplBase {
- public ObjectFactoryImpl(Property property, Object propertyValue, Class<?> javaType) {
- super(property, propertyValue, javaType);
- }
-
- public Object getInstance() throws ObjectCreationException {
- if (isSimpleType) {
- try {
- return simpleTypeMapper.toJavaObject(property.getXSDType(), (String)propertyValue, null);
- } catch (NumberFormatException ex) {
- throw new ObjectCreationException("Failed to create instance for property " + property.getName()
- + " with value "
- + propertyValue, ex);
- } catch (IllegalArgumentException ex) {
- throw new ObjectCreationException("Failed to create instance for property " + property.getName()
- + " with value "
- + propertyValue, ex);
- }
- } else {
- return mediator.mediate(propertyValue, sourceDataType, targetDataType, null);
- // return null;
- }
- }
- }
-
- class ListObjectFactoryImpl extends ObjectFactoryImplBase {
- public ListObjectFactoryImpl(Property property, List<?> propertyValues, Class<?> javaType) {
- super(property, propertyValues, javaType);
- }
-
- @SuppressWarnings("unchecked")
- public List<?> getInstance() throws ObjectCreationException {
- if (isSimpleType) {
- List<Object> values = new ArrayList<Object>();
- for (String aValue : (List<String>)propertyValue) {
- try {
- values.add(simpleTypeMapper.toJavaObject(property.getXSDType(), aValue, null));
- } catch (NumberFormatException ex) {
- throw new ObjectCreationException("Failed to create instance for property " + property
- .getName()
- + " with value "
- + aValue
- + " from value list of "
- + propertyValue, ex);
- } catch (IllegalArgumentException ex) {
- throw new ObjectCreationException("Failed to create instance for property " + property
- .getName()
- + " with value "
- + aValue
- + " from value list of "
- + propertyValue, ex);
- }
- }
- return values;
- } else {
- List instances = new ArrayList();
- for (Node aValue : (List<Node>)propertyValue) {
- instances.add(mediator.mediate(aValue, sourceDataType, targetDataType, null));
- }
- return instances;
- }
- }
- }
-
- class ArrayObjectFactoryImpl extends ObjectFactoryImplBase {
- public ArrayObjectFactoryImpl(Property property, List<?> propertyValues, Class<?> javaType) {
- super(property, propertyValues, javaType);
- }
-
- @SuppressWarnings("unchecked")
- public Object getInstance() throws ObjectCreationException {
- if (isSimpleType) {
- int count = 0;
- Object values = Array.newInstance(javaType, ((List<Object>)propertyValue).size());
- for (String aValue : (List<String>)propertyValue) {
- try {
- Array.set(values, count++, simpleTypeMapper.toJavaObject(property.getXSDType(), aValue, null));
- } catch (NumberFormatException ex) {
- throw new ObjectCreationException("Failed to create instance for property " + property
- .getName()
- + " with value "
- + aValue
- + " from value list of "
- + propertyValue, ex);
- } catch (IllegalArgumentException ex) {
- throw new ObjectCreationException("Failed to create instance for property " + property
- .getName()
- + " with value "
- + aValue
- + " from value list of "
- + propertyValue, ex);
- }
- }
- return values;
- } else {
- Object instances = Array.newInstance(javaType, ((List<Object>)propertyValue).size());
- int count = 0;
- for (Node aValue : (List<Node>)propertyValue) {
- Array.set(instances, count++, mediator.mediate(aValue, sourceDataType, targetDataType, null));
- }
- return instances;
- }
- }
- }
-
- /**
- * Utility methods
- */
-
- /**
- *
- * @param property
- * @return
- */
- private boolean isSimpleType(Property property) {
- if (property.getXSDType() != null) {
- return simpleTypeMapper.isSimpleXSDType(property.getXSDType());
- } else {
- if (property instanceof Document) {
- Document doc = (Document)property;
- Element element = doc.getDocumentElement();
- if (element.getChildNodes().getLength() == 1 && element.getChildNodes().item(0).getNodeType() == Element.TEXT_NODE) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Retrieve list of simple property values
- * @param concatenatedValue
- * @param javaType
- * @return
- */
- private static List<String> getSimplePropertyValues(String concatenatedValue, Class<?> javaType) {
- List<String> propValues = new ArrayList<String>();
- StringTokenizer st = null;
- if (javaType.getName().equals("java.lang.String")) {
- st = new StringTokenizer(concatenatedValue, "\"");
- } else {
- st = new StringTokenizer(concatenatedValue);
- }
- String aToken = null;
- while (st.hasMoreTokens()) {
- aToken = st.nextToken();
- if (aToken.trim().length() > 0) {
- propValues.add(aToken);
- }
- }
- return propValues;
- }
-
- /**
- * Retrieve the list of complex property values
- * @param document
- * @return
- */
- private static List<Node> getValues(Document document) {
- // The root is the property element
- Element rootElement = document.getDocumentElement();
- List<Node> propValues = new ArrayList<Node>();
- NodeList nodes = rootElement.getChildNodes();
- for (int count = 0; count < nodes.getLength(); ++count) {
- if (nodes.item(count).getNodeType() == Document.ELEMENT_NODE) {
- propValues.add(DOMHelper.promote(nodes.item(count)));
- }
- }
- return propValues;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.java.injection;
+
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.apache.tuscany.sca.assembly.ComponentProperty;
+import org.apache.tuscany.sca.assembly.Property;
+import org.apache.tuscany.sca.context.PropertyValueFactory;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.core.factory.ObjectCreationException;
+import org.apache.tuscany.sca.core.factory.ObjectFactory;
+import org.apache.tuscany.sca.databinding.Mediator;
+import org.apache.tuscany.sca.databinding.SimpleTypeMapper;
+import org.apache.tuscany.sca.databinding.impl.DOMHelper;
+import org.apache.tuscany.sca.databinding.impl.SimpleTypeMapperImpl;
+import org.apache.tuscany.sca.databinding.xml.DOMDataBinding;
+import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
+import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
+import org.apache.tuscany.sca.interfacedef.DataType;
+import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl;
+import org.apache.tuscany.sca.interfacedef.util.TypeInfo;
+import org.apache.tuscany.sca.interfacedef.util.XMLType;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ *
+ * @version $Rev$ $Date$
+ */
+public class JavaPropertyValueObjectFactory implements PropertyValueFactory {
+ private Mediator mediator = null;
+ private SimpleTypeMapper simpleTypeMapper;
+ private boolean isSimpleType;
+
+ public JavaPropertyValueObjectFactory(ExtensionPointRegistry registry) {
+ UtilityExtensionPoint utilityExtensionPoint = registry.getExtensionPoint(UtilityExtensionPoint.class);
+ this.mediator = utilityExtensionPoint.getUtility(Mediator.class);
+ this.simpleTypeMapper = utilityExtensionPoint.getUtility(SimpleTypeMapper.class);
+ }
+
+ public JavaPropertyValueObjectFactory(Mediator mediator) {
+ this.mediator = mediator;
+ }
+
+ /**
+ * Introspect the property
+ * @param javaElement
+ * @return
+ */
+ private DataType<?> introspect(JavaElementImpl javaElement) {
+ DataType<XMLType> dt =
+ new DataTypeImpl<XMLType>(null, javaElement.getType(), javaElement.getGenericType(), XMLType.UNKNOWN);
+ mediator.getDataBindings().introspectType(dt, null);
+ return dt;
+ }
+
+ public ObjectFactory createValueFactory(Property property, Object propertyValue, JavaElementImpl javaElement) {
+ Document doc = (Document)propertyValue;
+ List<Node> nodes = getValues(doc);
+ Class<?> javaType = JavaIntrospectionHelper.getBaseType(javaElement.getType(), javaElement.getGenericType());
+ if (property.isMany()) {
+ if (javaElement.getType().isArray()) {
+ return new ArrayObjectFactoryImpl(property, nodes, javaType);
+ } else {
+ return new ListObjectFactoryImpl(property, nodes, javaType);
+ }
+ } else {
+ Object value = null;
+ if (!nodes.isEmpty()) {
+ value = nodes.get(0);
+ }
+ return new ObjectFactoryImpl(property, value, javaType);
+
+ }
+ }
+
+ public ObjectFactory createValueFactory(Property property, Object propertyValue, Class<?> javaType) {
+ Document doc = (Document)propertyValue;
+ List<Node> nodes = getValues(doc);
+ if (property.isMany()) {
+ return new ListObjectFactoryImpl(property, nodes, javaType);
+ } else {
+ Object value = null;
+ if (!nodes.isEmpty()) {
+ value = nodes.get(0);
+ }
+ return new ObjectFactoryImpl(property, value, javaType);
+ }
+ }
+
+ public <B> B createPropertyValue(ComponentProperty property, Class<B> type) {
+ ObjectFactory<B> factory = this.createValueFactory(property, property.getValue(), type);
+ return factory.getInstance();
+ }
+
+ abstract class ObjectFactoryImplBase implements ObjectFactory {
+ protected SimpleTypeMapper simpleTypeMapper = new SimpleTypeMapperImpl();
+ protected Property property;
+ protected Object propertyValue;
+ protected Class<?> javaType;
+ protected DataType<XMLType> sourceDataType;
+ protected DataType<?> targetDataType;
+
+ public ObjectFactoryImplBase(Property property, Object propertyValue, Class<?> javaType) {
+ this.property = property;
+ this.propertyValue = propertyValue;
+ this.javaType = javaType;
+ sourceDataType =
+ new DataTypeImpl<XMLType>(DOMDataBinding.NAME, Node.class,
+ new XMLType(null, this.property.getXSDType()));
+ TypeInfo typeInfo = null;
+ if (this.property.getXSDType() != null) {
+ if (simpleTypeMapper.isSimpleXSDType(this.property.getXSDType())) {
+ typeInfo = new TypeInfo(property.getXSDType(), true, null);
+ } else {
+ typeInfo = new TypeInfo(property.getXSDType(), false, null);
+ }
+ } else {
+ typeInfo = new TypeInfo(property.getXSDType(), false, null);
+ }
+
+ XMLType xmlType = new XMLType(typeInfo);
+ String dataBinding = null; // (String)property.getExtensions().get(DataBinding.class.getName());
+ if (dataBinding != null) {
+ targetDataType = new DataTypeImpl<XMLType>(dataBinding, javaType, xmlType);
+ } else {
+ targetDataType = new DataTypeImpl<XMLType>(dataBinding, javaType, xmlType);
+ mediator.getDataBindings().introspectType(targetDataType, null);
+ }
+ }
+ }
+
+ class ObjectFactoryImpl extends ObjectFactoryImplBase {
+ public ObjectFactoryImpl(Property property, Object propertyValue, Class<?> javaType) {
+ super(property, propertyValue, javaType);
+ }
+
+ public Object getInstance() throws ObjectCreationException {
+ if (isSimpleType) {
+ try {
+ return simpleTypeMapper.toJavaObject(property.getXSDType(), (String)propertyValue, null);
+ } catch (NumberFormatException ex) {
+ throw new ObjectCreationException("Failed to create instance for property " + property.getName()
+ + " with value "
+ + propertyValue, ex);
+ } catch (IllegalArgumentException ex) {
+ throw new ObjectCreationException("Failed to create instance for property " + property.getName()
+ + " with value "
+ + propertyValue, ex);
+ }
+ } else {
+ return mediator.mediate(propertyValue, sourceDataType, targetDataType, null);
+ // return null;
+ }
+ }
+ }
+
+ class ListObjectFactoryImpl extends ObjectFactoryImplBase {
+ public ListObjectFactoryImpl(Property property, List<?> propertyValues, Class<?> javaType) {
+ super(property, propertyValues, javaType);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List<?> getInstance() throws ObjectCreationException {
+ if (isSimpleType) {
+ List<Object> values = new ArrayList<Object>();
+ for (String aValue : (List<String>)propertyValue) {
+ try {
+ values.add(simpleTypeMapper.toJavaObject(property.getXSDType(), aValue, null));
+ } catch (NumberFormatException ex) {
+ throw new ObjectCreationException("Failed to create instance for property " + property
+ .getName()
+ + " with value "
+ + aValue
+ + " from value list of "
+ + propertyValue, ex);
+ } catch (IllegalArgumentException ex) {
+ throw new ObjectCreationException("Failed to create instance for property " + property
+ .getName()
+ + " with value "
+ + aValue
+ + " from value list of "
+ + propertyValue, ex);
+ }
+ }
+ return values;
+ } else {
+ List instances = new ArrayList();
+ for (Node aValue : (List<Node>)propertyValue) {
+ instances.add(mediator.mediate(aValue, sourceDataType, targetDataType, null));
+ }
+ return instances;
+ }
+ }
+ }
+
+ class ArrayObjectFactoryImpl extends ObjectFactoryImplBase {
+ public ArrayObjectFactoryImpl(Property property, List<?> propertyValues, Class<?> javaType) {
+ super(property, propertyValues, javaType);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getInstance() throws ObjectCreationException {
+ if (isSimpleType) {
+ int count = 0;
+ Object values = Array.newInstance(javaType, ((List<Object>)propertyValue).size());
+ for (String aValue : (List<String>)propertyValue) {
+ try {
+ Array.set(values, count++, simpleTypeMapper.toJavaObject(property.getXSDType(), aValue, null));
+ } catch (NumberFormatException ex) {
+ throw new ObjectCreationException("Failed to create instance for property " + property
+ .getName()
+ + " with value "
+ + aValue
+ + " from value list of "
+ + propertyValue, ex);
+ } catch (IllegalArgumentException ex) {
+ throw new ObjectCreationException("Failed to create instance for property " + property
+ .getName()
+ + " with value "
+ + aValue
+ + " from value list of "
+ + propertyValue, ex);
+ }
+ }
+ return values;
+ } else {
+ Object instances = Array.newInstance(javaType, ((List<Object>)propertyValue).size());
+ int count = 0;
+ for (Node aValue : (List<Node>)propertyValue) {
+ Array.set(instances, count++, mediator.mediate(aValue, sourceDataType, targetDataType, null));
+ }
+ return instances;
+ }
+ }
+ }
+
+ /**
+ * Utility methods
+ */
+
+ /**
+ *
+ * @param property
+ * @return
+ */
+ private boolean isSimpleType(Property property) {
+ if (property.getXSDType() != null) {
+ return simpleTypeMapper.isSimpleXSDType(property.getXSDType());
+ } else {
+ if (property instanceof Document) {
+ Document doc = (Document)property;
+ Element element = doc.getDocumentElement();
+ if (element.getChildNodes().getLength() == 1 && element.getChildNodes().item(0).getNodeType() == Element.TEXT_NODE) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Retrieve list of simple property values
+ * @param concatenatedValue
+ * @param javaType
+ * @return
+ */
+ private static List<String> getSimplePropertyValues(String concatenatedValue, Class<?> javaType) {
+ List<String> propValues = new ArrayList<String>();
+ StringTokenizer st = null;
+ if (javaType.getName().equals("java.lang.String")) {
+ st = new StringTokenizer(concatenatedValue, "\"");
+ } else {
+ st = new StringTokenizer(concatenatedValue);
+ }
+ String aToken = null;
+ while (st.hasMoreTokens()) {
+ aToken = st.nextToken();
+ if (aToken.trim().length() > 0) {
+ propValues.add(aToken);
+ }
+ }
+ return propValues;
+ }
+
+ /**
+ * Retrieve the list of complex property values
+ * @param document
+ * @return
+ */
+ private static List<Node> getValues(Document document) {
+ // The root is the property element
+ Element rootElement = document.getDocumentElement();
+ List<Node> propValues = new ArrayList<Node>();
+ NodeList nodes = rootElement.getChildNodes();
+ for (int count = 0; count < nodes.getLength(); ++count) {
+ if (nodes.item(count).getNodeType() == Document.ELEMENT_NODE) {
+ propValues.add(DOMHelper.promote(nodes.item(count)));
+ }
+ }
+ return propValues;
+ }
+}
diff --git a/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/NoConversationalContractException.java b/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/NoConversationalContractException.java
index 5dc6bc790d..dbc5c6b640 100644
--- a/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/NoConversationalContractException.java
+++ b/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/sca/implementation/java/invocation/NoConversationalContractException.java
@@ -1,33 +1,33 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.java.invocation;
-
-
-/**
- * Raised when a component has conversational scope but no conversational contract
- *
- * @version $Rev: 487877 $ $Date: 2006-12-16 15:32:16 -0500 (Sat, 16 Dec 2006) $
- */
-public class NoConversationalContractException extends Exception {
- private static final long serialVersionUID = -1157790036638157539L;
-
- public NoConversationalContractException(String message) {
- super(message);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.java.invocation;
+
+
+/**
+ * Raised when a component has conversational scope but no conversational contract
+ *
+ * @version $Rev$ $Date$
+ */
+public class NoConversationalContractException extends Exception {
+ private static final long serialVersionUID = -1157790036638157539L;
+
+ public NoConversationalContractException(String message) {
+ super(message);
+ }
+}
diff --git a/java/sca/modules/implementation-java/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions.xml b/java/sca/modules/implementation-java/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions.xml
index cad25f1f73..88a8e346c7 100644
--- a/java/sca/modules/implementation-java/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions.xml
+++ b/java/sca/modules/implementation-java/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions.xml
@@ -1,100 +1,100 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<sca:definitions xmlns="http://test"
- targetNamespace="http://test"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
-
-<!-- simple intent -->
- <sca:intent name="tuscanyIntent_1"
- constrains="sca:binding sca:implementation.java">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_2"
- constrains="sca:binding sca:implementation.java">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_3"
- constrains="sca:binding sca:implementation.java">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_4"
- constrains="sca:binding sca:implementation.java">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
-<sca:intent name="tuscanyIntent_5"
- constrains="sca:binding sca:implementation.java">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_6"
- constrains="sca:binding sca:implementation.java">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_7"
- constrains="sca:binding sca:implementation.java">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_8"
- constrains="sca:binding sca:implementation.java">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <!-- qualified intents -->
- <sca:intent name="tuscanyIntent_1.qualified" />
- <sca:intent name="tuscanyIntent_2.qualified" />
- <sca:intent name="tuscanyIntent_6.qualified1" />
- <sca:intent name="tuscanyIntent_6.qualified2" />
-
- <sca:policySet name="tuscanyPolicySet_4"
- provides="tuscanyIntent_6"
- appliesTo="/sca:composite/sca:component"
- xmlns="http://test"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <sca:intentMap provides="tuscanyIntent_6" default="qualified2">
- <sca:qualifier name="qualified2">
- <wsp:Policy>
- <!-- policy expression and policy subject for "qualified2" alternative" -->
- </wsp:Policy>
- </sca:qualifier>
- </sca:intentMap>
- </sca:policySet>
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<sca:definitions xmlns="http://test"
+ targetNamespace="http://test"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+
+<!-- simple intent -->
+ <sca:intent name="tuscanyIntent_1"
+ constrains="sca:binding sca:implementation.java">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_2"
+ constrains="sca:binding sca:implementation.java">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_3"
+ constrains="sca:binding sca:implementation.java">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_4"
+ constrains="sca:binding sca:implementation.java">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+<sca:intent name="tuscanyIntent_5"
+ constrains="sca:binding sca:implementation.java">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_6"
+ constrains="sca:binding sca:implementation.java">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_7"
+ constrains="sca:binding sca:implementation.java">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_8"
+ constrains="sca:binding sca:implementation.java">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <!-- qualified intents -->
+ <sca:intent name="tuscanyIntent_1.qualified" />
+ <sca:intent name="tuscanyIntent_2.qualified" />
+ <sca:intent name="tuscanyIntent_6.qualified1" />
+ <sca:intent name="tuscanyIntent_6.qualified2" />
+
+ <sca:policySet name="tuscanyPolicySet_4"
+ provides="tuscanyIntent_6"
+ appliesTo="/sca:composite/sca:component"
+ xmlns="http://test"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <sca:intentMap provides="tuscanyIntent_6" default="qualified2">
+ <sca:qualifier name="qualified2">
+ <wsp:Policy>
+ <!-- policy expression and policy subject for "qualified2" alternative" -->
+ </wsp:Policy>
+ </sca:qualifier>
+ </sca:intentMap>
+ </sca:policySet>
</sca:definitions> \ No newline at end of file
diff --git a/java/sca/modules/implementation-java/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions_with_policysets.xml b/java/sca/modules/implementation-java/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions_with_policysets.xml
index 00319950c6..60d63a3e5f 100644
--- a/java/sca/modules/implementation-java/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions_with_policysets.xml
+++ b/java/sca/modules/implementation-java/src/test/resources/org/apache/tuscany/sca/implementation/java/xml/definitions_with_policysets.xml
@@ -1,113 +1,113 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<sca:definitions xmlns="http://test" targetNamespace="http://test" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
-
- <!-- simple intent -->
- <sca:intent name="tuscanyIntent_1" constrains="sca:binding sca:implementation.java">
- <sca:description>
- Sample Intent
- </sca:description>
- <!-- qualified intents -->
- <sca:qualifier name="qualified" default="true"/>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_2" constrains="sca:binding sca:implementation.java">
- <sca:description>
- Sample Intent
- </sca:description>
- <sca:qualifier name="qualified" default="true"/>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_3" constrains="sca:binding sca:implementation.java">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_4" constrains="sca:binding sca:implementation.java">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_5" constrains="sca:binding sca:implementation.java">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_6" constrains="sca:binding sca:implementation.java">
- <sca:description>
- Sample Intent
- </sca:description>
- <sca:qualifier name="qualified1" default="true"/>
- <sca:qualifier name="qualified2" />
-
-
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_7" constrains="sca:binding sca:implementation.java">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:intent name="tuscanyIntent_8" constrains="sca:binding sca:implementation.java">
- <sca:description>
- Sample Intent
- </sca:description>
- </sca:intent>
-
- <sca:policySet name="tuscanyPolicySet_1" provides="tuscanyIntent_1 tuscanyIntent_2 tuscanyIntent_3"
- appliesTo="/sca:composite/sca:component" xmlns="http://test" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- </sca:policySet>
-
- <sca:policySet name="tuscanyPolicySet_2" provides="tuscanyIntent_4 tuscanyIntent_5" appliesTo="/sca:composite/sca:component"
- xmlns="http://test" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- </sca:policySet>
-
- <sca:policySet name="tuscanyPolicySet_3" provides="tuscanyIntent_6" appliesTo="/sca:composite/sca:component"
- xmlns="http://test" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <sca:intentMap provides="tuscanyIntent_6" default="qualified1">
- <sca:qualifier name="qualified1">
- <wsp:Policy>
- <!-- policy expression and policy subject for "qualified1" alternative -->
- </wsp:Policy>
- </sca:qualifier>
- <sca:qualifier name="qualifed2">
- <wsp:Policy>
- <!-- policy expression and policy subject for "qualified2" alternative" -->
- </wsp:Policy>
- </sca:qualifier>
- </sca:intentMap>
- </sca:policySet>
-
- <sca:policySet name="tuscanyPolicySet_4" provides="tuscanyIntent_6" appliesTo="/sca:composite/sca:component"
- xmlns="http://test" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <sca:intentMap provides="tuscanyIntent_6" default="qualified2">
- <sca:qualifier name="qualified2">
- <wsp:Policy>
- <!-- policy expression and policy subject for "qualified2" alternative" -->
- </wsp:Policy>
- </sca:qualifier>
- </sca:intentMap>
- </sca:policySet>
-
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<sca:definitions xmlns="http://test" targetNamespace="http://test" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+
+ <!-- simple intent -->
+ <sca:intent name="tuscanyIntent_1" constrains="sca:binding sca:implementation.java">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ <!-- qualified intents -->
+ <sca:qualifier name="qualified" default="true"/>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_2" constrains="sca:binding sca:implementation.java">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ <sca:qualifier name="qualified" default="true"/>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_3" constrains="sca:binding sca:implementation.java">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_4" constrains="sca:binding sca:implementation.java">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_5" constrains="sca:binding sca:implementation.java">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_6" constrains="sca:binding sca:implementation.java">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ <sca:qualifier name="qualified1" default="true"/>
+ <sca:qualifier name="qualified2" />
+
+
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_7" constrains="sca:binding sca:implementation.java">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:intent name="tuscanyIntent_8" constrains="sca:binding sca:implementation.java">
+ <sca:description>
+ Sample Intent
+ </sca:description>
+ </sca:intent>
+
+ <sca:policySet name="tuscanyPolicySet_1" provides="tuscanyIntent_1 tuscanyIntent_2 tuscanyIntent_3"
+ appliesTo="/sca:composite/sca:component" xmlns="http://test" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ </sca:policySet>
+
+ <sca:policySet name="tuscanyPolicySet_2" provides="tuscanyIntent_4 tuscanyIntent_5" appliesTo="/sca:composite/sca:component"
+ xmlns="http://test" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ </sca:policySet>
+
+ <sca:policySet name="tuscanyPolicySet_3" provides="tuscanyIntent_6" appliesTo="/sca:composite/sca:component"
+ xmlns="http://test" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <sca:intentMap provides="tuscanyIntent_6" default="qualified1">
+ <sca:qualifier name="qualified1">
+ <wsp:Policy>
+ <!-- policy expression and policy subject for "qualified1" alternative -->
+ </wsp:Policy>
+ </sca:qualifier>
+ <sca:qualifier name="qualifed2">
+ <wsp:Policy>
+ <!-- policy expression and policy subject for "qualified2" alternative" -->
+ </wsp:Policy>
+ </sca:qualifier>
+ </sca:intentMap>
+ </sca:policySet>
+
+ <sca:policySet name="tuscanyPolicySet_4" provides="tuscanyIntent_6" appliesTo="/sca:composite/sca:component"
+ xmlns="http://test" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <sca:intentMap provides="tuscanyIntent_6" default="qualified2">
+ <sca:qualifier name="qualified2">
+ <wsp:Policy>
+ <!-- policy expression and policy subject for "qualified2" alternative" -->
+ </wsp:Policy>
+ </sca:qualifier>
+ </sca:intentMap>
+ </sca:policySet>
+
</sca:definitions> \ No newline at end of file
diff --git a/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/BindingDescriptions.java b/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/BindingDescriptions.java
index 068374c7cf..5265241920 100644
--- a/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/BindingDescriptions.java
+++ b/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/BindingDescriptions.java
@@ -1,34 +1,34 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.osgi;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Binding;
-
-/**
- * OSGi RFC 119 SCA binding descriptions
- */
-public interface BindingDescriptions extends List<Binding> {
- String OSGI_SD_NS = ServiceDescriptions.OSGI_SD_NS;
- QName BINDINGS_QNAME = new QName(OSGI_SD_NS, "bindings");
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.osgi;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.Binding;
+
+/**
+ * OSGi RFC 119 SCA binding descriptions
+ */
+public interface BindingDescriptions extends List<Binding> {
+ String OSGI_SD_NS = ServiceDescriptions.OSGI_SD_NS;
+ QName BINDINGS_QNAME = new QName(OSGI_SD_NS, "bindings");
+}
diff --git a/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/BindingDescriptionsImpl.java b/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/BindingDescriptionsImpl.java
index 67a724877d..66ca01bacf 100644
--- a/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/BindingDescriptionsImpl.java
+++ b/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/impl/BindingDescriptionsImpl.java
@@ -1,36 +1,36 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.osgi.impl;
-
-import java.util.ArrayList;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.implementation.osgi.BindingDescriptions;
-
-/**
- *
- */
-public class BindingDescriptionsImpl extends ArrayList<Binding> implements BindingDescriptions {
- private static final long serialVersionUID = 7647814680087128002L;
-
- public BindingDescriptionsImpl() {
- super();
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.osgi.impl;
+
+import java.util.ArrayList;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.implementation.osgi.BindingDescriptions;
+
+/**
+ *
+ */
+public class BindingDescriptionsImpl extends ArrayList<Binding> implements BindingDescriptions {
+ private static final long serialVersionUID = 7647814680087128002L;
+
+ public BindingDescriptionsImpl() {
+ super();
+ }
+}
diff --git a/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/introspection/ExportedServiceIntrospector.java b/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/introspection/ExportedServiceIntrospector.java
index a997724ce0..409e14bdd9 100644
--- a/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/introspection/ExportedServiceIntrospector.java
+++ b/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/introspection/ExportedServiceIntrospector.java
@@ -1,448 +1,448 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.osgi.introspection;
-
-import static org.apache.tuscany.sca.assembly.Base.SCA11_TUSCANY_NS;
-import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.REMOTE_CONFIG_SCA;
-import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SCA_BINDINGS;
-import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SERVICE_EXPORTED_INTENTS;
-import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SERVICE_EXPORTED_INTENTS_EXTRA;
-import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SERVICE_EXPORTED_INTERFACES;
-import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SERVICE_IMPORTED_CONFIGS;
-import static org.osgi.framework.Constants.OBJECTCLASS;
-import static org.osgi.framework.Constants.SERVICE_ID;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Dictionary;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Base;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentReference;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.implementation.osgi.BindingDescriptions;
-import org.apache.tuscany.sca.implementation.osgi.OSGiImplementation;
-import org.apache.tuscany.sca.implementation.osgi.OSGiImplementationFactory;
-import org.apache.tuscany.sca.implementation.osgi.OSGiProperty;
-import org.apache.tuscany.sca.implementation.osgi.ServiceDescriptionsFactory;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.MonitorFactory;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.Filter;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-
-/**
- * Introspect an OSGi Service to create an SCA composite that contains a single component with
- * implementation.osgi
- */
-public class ExportedServiceIntrospector {
- private AssemblyFactory assemblyFactory;
- private ContributionFactory contributionFactory;
- private OSGiImplementationFactory implementationFactory;
- private ServiceDescriptionsFactory serviceDescriptionsFactory;
- private PolicyFactory policyFactory;
- private ExtensionPointRegistry registry;
- private FactoryExtensionPoint factories;
- private ModelResolverExtensionPoint modelResolvers;
- private XMLInputFactory xmlInputFactory;
- private XMLOutputFactory xmlOutputFactory;
- private JavaInterfaceFactory javaInterfaceFactory;
- private StAXArtifactProcessor processor;
-
- /**
- * @param intentName
- * @return
- */
- private static QName getQName(String intentName) {
- QName qname;
- if (intentName.startsWith("{")) {
- int i = intentName.indexOf('}');
- if (i != -1) {
- qname = new QName(intentName.substring(1, i), intentName.substring(i + 1));
- } else {
- throw new IllegalArgumentException("Invalid intent: " + intentName);
- }
- } else {
- // Default to SCA namespace
- qname = new QName(Base.SCA11_NS, intentName);
- }
- return qname;
- }
-
- /**
- * @param registry
- */
- public ExportedServiceIntrospector(ExtensionPointRegistry registry) {
- super();
- this.registry = registry;
- this.factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
- this.modelResolvers = registry.getExtensionPoint(ModelResolverExtensionPoint.class);
- this.assemblyFactory = factories.getFactory(AssemblyFactory.class);
- this.contributionFactory = factories.getFactory(ContributionFactory.class);
- this.policyFactory = factories.getFactory(PolicyFactory.class);
- this.implementationFactory = factories.getFactory(OSGiImplementationFactory.class);
- this.serviceDescriptionsFactory = factories.getFactory(ServiceDescriptionsFactory.class);
- this.xmlInputFactory = factories.getFactory(XMLInputFactory.class);
- this.xmlOutputFactory = factories.getFactory(XMLOutputFactory.class);
- this.javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
- StAXArtifactProcessorExtensionPoint processors =
- registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- UtilityExtensionPoint utilities = this.registry.getExtensionPoint(UtilityExtensionPoint.class);
- MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
- Monitor monitor = null;
- if (monitorFactory != null) {
- monitor = monitorFactory.createMonitor();
- }
- processor = new ExtensibleStAXArtifactProcessor(processors, xmlInputFactory, xmlOutputFactory, monitor);
- }
-
- private Intent getIntent(String intent) {
- QName name = getQName(intent);
- Intent i = policyFactory.createIntent();
- i.setName(name);
- return i;
- }
-
- private List<Intent> getIntents(String[] intents) {
- if (intents == null || intents.length == 0) {
- return Collections.emptyList();
- }
- List<Intent> intentList = new ArrayList<Intent>();
- for (String i : intents) {
- Intent intent = getIntent(i);
- if (intent != null) {
- intentList.add(intent);
- }
- }
- return intentList;
- }
-
- private Map<String, Object> getProperties(ServiceReference reference) {
- String[] names = reference.getPropertyKeys();
- if (names != null) {
- Map<String, Object> properties = new HashMap<String, Object>();
- for (String name : names) {
- properties.put(name, reference.getProperty(name));
- }
- return properties;
- } else {
- return Collections.emptyMap();
- }
- }
-
- /**
- * Parse the Stringp[] to support values that are separated by comma
- * @param interfaces
- * @return
- */
- private String[] parse(String[] interfaces) {
- if (interfaces == null) {
- return null;
- }
- List<String> names = new ArrayList<String>();
- for (String i : interfaces) {
- String[] parts = i.split(",");
- for (String p : parts) {
- names.add(p.trim());
- }
- }
- return names.toArray(new String[names.size()]);
- }
-
- /**
- * Introspect a local OSGi Service represented by the ServiceReference to create
- * an SCA service with the required intents and bindings
- * @param reference The service reference for a local OSGi service
- * @return An SCA contribution with a deployable composite for the SCA service
- * @throws Exception
- */
- public Contribution introspect(ServiceReference reference) throws Exception {
- Map<String, Object> properties = getProperties(reference);
-
- OSGiProperty serviceID = implementationFactory.createOSGiProperty();
- serviceID.setName(SERVICE_ID);
- // The service.id is Long
- serviceID.setValue(String.valueOf(reference.getProperty(SERVICE_ID)));
-
- String id = "osgi.service." + serviceID.getValue();
- Composite composite = assemblyFactory.createComposite();
- composite.setName(new QName(SCA11_TUSCANY_NS, id));
-
- Component component = assemblyFactory.createComponent();
- component.setName(id);
- component.setAutowire(Boolean.TRUE);
-
- composite.getComponents().add(component);
-
- Bundle bundle = reference.getBundle();
- OSGiImplementation implementation = implementationFactory.createOSGiImplementation();
-
- implementation.setBundle(bundle);
- component.setImplementation(implementation);
- implementation.setUnresolved(false);
-
- String[] remoteInterfaces = getStrings(reference.getProperty(SERVICE_EXPORTED_INTERFACES));
- if (remoteInterfaces == null || remoteInterfaces.length > 0 && "*".equals(remoteInterfaces[0])) {
- remoteInterfaces = getStrings(reference.getProperty(OBJECTCLASS));
- } else {
- remoteInterfaces = parse(remoteInterfaces);
- }
- for (String intf : remoteInterfaces) {
- Service service = assemblyFactory.createService();
- JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
- Class<?> interfaceClass = bundle.loadClass(intf);
- JavaInterface javaInterface = javaInterfaceFactory.createJavaInterface(interfaceClass);
- interfaceContract.setInterface(javaInterface);
- if (javaInterface.getCallbackClass() != null) {
- interfaceContract.setCallbackInterface(javaInterfaceFactory.createJavaInterface(javaInterface
- .getCallbackClass()));
- }
-
- service.setName(interfaceClass.getSimpleName());
- service.setInterfaceContract(interfaceContract);
-
- service.getExtensions().add(serviceID);
-
- implementation.getServices().add(service);
-
- ComponentService componentService = assemblyFactory.createComponentService();
- componentService.setName(service.getName());
- component.getServices().add(componentService);
- componentService.setService(service);
- }
-
- String[] requiredIntents = getStrings(properties.get(SERVICE_EXPORTED_INTENTS));
- List<Intent> intents = getIntents(requiredIntents);
- String[] requiredIntentsExtra = getStrings(properties.get(SERVICE_EXPORTED_INTENTS_EXTRA));
- List<Intent> extraIntents = getIntents(requiredIntentsExtra);
-
- String[] bindingDocuments = getStrings(properties.get(SCA_BINDINGS));
- List<Binding> bindings = loadBindings(reference.getBundle(), bindingDocuments);
-
- for (ComponentService componentService : component.getServices()) {
- componentService.getRequiredIntents().addAll(intents);
- componentService.getRequiredIntents().addAll(extraIntents);
- componentService.getBindings().addAll(bindings);
- }
-
- // FIXME: Should we scan the owning bundle to create the SCA contribution?
- Contribution contribution = contributionFactory.createContribution();
- contribution.setURI("urn:" + id);
- contribution.setLocation(bundle.getEntry("/").toString());
- contribution.getDeployables().add(composite);
- ModelResolver modelResolver = new ExtensibleModelResolver(contribution, modelResolvers, factories);
- contribution.setModelResolver(modelResolver);
- contribution.setUnresolved(true);
- return contribution;
- }
-
- /**
- * Introspect an OSGi filter to create an SCA reference
- *
- * @param bundle
- * @param filterStr
- * @param properties
- * @return
- * @throws Exception
- */
- public Contribution introspect(Bundle bundle, String filterStr, Map<String, Object> properties) throws Exception {
- Filter filter = null;
- try {
- filter = bundle.getBundleContext().createFilter(filterStr);
- } catch (InvalidSyntaxException e) {
- e.printStackTrace();
- return null;
- }
-
- Dictionary<String, Object> props = new Hashtable<String, Object>();
- props.put(SERVICE_IMPORTED_CONFIGS, new String[] {REMOTE_CONFIG_SCA});
- if (!filter.match(props)) {
- return null;
- }
- String id = "osgi.reference." + UUID.randomUUID();
- Composite composite = assemblyFactory.createComposite();
- composite.setName(new QName(Base.SCA11_TUSCANY_NS, id));
-
- Component component = assemblyFactory.createComponent();
- component.setName(id);
- component.setAutowire(Boolean.TRUE);
-
- composite.getComponents().add(component);
-
- OSGiImplementation implementation = implementationFactory.createOSGiImplementation();
-
- implementation.setBundle(bundle);
- component.setImplementation(implementation);
- implementation.setUnresolved(false);
-
- String[] remoteInterfaces = getStrings(properties.get(SERVICE_EXPORTED_INTERFACES));
- if (remoteInterfaces == null || remoteInterfaces.length > 0 && "*".equals(remoteInterfaces[0])) {
- remoteInterfaces = getStrings(properties.get(OBJECTCLASS));
- } else {
- remoteInterfaces = parse(remoteInterfaces);
- }
- for (String intf : remoteInterfaces) {
- Reference reference = assemblyFactory.createReference();
- JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
- Class<?> interfaceClass = bundle.loadClass(intf);
- JavaInterface javaInterface = javaInterfaceFactory.createJavaInterface(interfaceClass);
- interfaceContract.setInterface(javaInterface);
- if (javaInterface.getCallbackClass() != null) {
- interfaceContract.setCallbackInterface(javaInterfaceFactory.createJavaInterface(javaInterface
- .getCallbackClass()));
- }
-
- reference.setName(id);
- reference.setInterfaceContract(interfaceContract);
-
- reference.getExtensions().add(filter);
-
- implementation.getReferences().add(reference);
-
- ComponentReference componentReference = assemblyFactory.createComponentReference();
- component.getReferences().add(componentReference);
- componentReference.setReference(reference);
- componentReference.setWiredByImpl(true);
- }
-
- String[] requiredIntents = getStrings(properties.get(SERVICE_EXPORTED_INTENTS));
- List<Intent> intents = getIntents(requiredIntents);
-
- String[] bindingDocuments = getStrings(properties.get(SCA_BINDINGS));
- List<Binding> bindings = loadBindings(bundle, bindingDocuments);
-
- for (ComponentReference componentReference : component.getReferences()) {
- componentReference.getRequiredIntents().addAll(intents);
- componentReference.getBindings().addAll(bindings);
- }
-
- // FIXME: Should we scan the owning bundle to create the SCA contribution?
- Contribution contribution = contributionFactory.createContribution();
- contribution.setURI("urn:" + id);
- contribution.setLocation(bundle.getEntry("/").toString());
- contribution.getDeployables().add(composite);
- ModelResolver modelResolver = new ExtensibleModelResolver(contribution, modelResolvers, factories);
- contribution.setModelResolver(modelResolver);
- contribution.setUnresolved(true);
- return contribution;
- }
-
- private List<Binding> loadBindings(Bundle bundle, String[] bindingDocuments) throws IOException,
- ContributionReadException {
- if (bindingDocuments == null || bindingDocuments.length == 0) {
- return Collections.emptyList();
- }
- List<Binding> bindings = new ArrayList<Binding>();
- for (String doc : bindingDocuments) {
- URL url = locate(bundle, doc);
- if (url == null) {
- throw new IOException("Entry " + doc + " cannot be found in bundle " + bundle);
- }
- bindings.addAll(loadBindings(url));
- }
- return bindings;
- }
-
- private List<Binding> loadBindings(URL url) throws ContributionReadException, IOException {
- InputStream is = url.openStream();
- try {
- XMLStreamReader reader = xmlInputFactory.createXMLStreamReader(is);
- reader.nextTag();
- Object model = processor.read(reader);
- if (model instanceof BindingDescriptions) {
- return ((BindingDescriptions)model);
- } else {
- return Collections.emptyList();
- }
- } catch (XMLStreamException e) {
- throw new ContributionReadException(e);
- } finally {
- is.close();
- }
- }
-
- private URL locate(Bundle bundle, String location) throws MalformedURLException {
- URI uri = URI.create(location);
- if (uri.isAbsolute()) {
- return uri.toURL();
- }
- return bundle.getEntry(location);
- }
-
- /**
- * In OSGi, the value of String+ can be a single String, String[] or Collection<String>
- * @param value
- * @return
- */
- private String[] getStrings(Object value) {
- if (value == null) {
- return null;
- }
- if (value instanceof String) {
- return new String[] {(String)value};
- } else if (value instanceof Collection) {
- Collection<String> collection = (Collection)value;
- return collection.toArray(new String[collection.size()]);
- }
- return (String[])value;
-
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.osgi.introspection;
+
+import static org.apache.tuscany.sca.assembly.Base.SCA11_TUSCANY_NS;
+import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.REMOTE_CONFIG_SCA;
+import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SCA_BINDINGS;
+import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SERVICE_EXPORTED_INTENTS;
+import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SERVICE_EXPORTED_INTENTS_EXTRA;
+import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SERVICE_EXPORTED_INTERFACES;
+import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SERVICE_IMPORTED_CONFIGS;
+import static org.osgi.framework.Constants.OBJECTCLASS;
+import static org.osgi.framework.Constants.SERVICE_ID;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.Base;
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentReference;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.ContributionFactory;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.implementation.osgi.BindingDescriptions;
+import org.apache.tuscany.sca.implementation.osgi.OSGiImplementation;
+import org.apache.tuscany.sca.implementation.osgi.OSGiImplementationFactory;
+import org.apache.tuscany.sca.implementation.osgi.OSGiProperty;
+import org.apache.tuscany.sca.implementation.osgi.ServiceDescriptionsFactory;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.MonitorFactory;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicyFactory;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+
+/**
+ * Introspect an OSGi Service to create an SCA composite that contains a single component with
+ * implementation.osgi
+ */
+public class ExportedServiceIntrospector {
+ private AssemblyFactory assemblyFactory;
+ private ContributionFactory contributionFactory;
+ private OSGiImplementationFactory implementationFactory;
+ private ServiceDescriptionsFactory serviceDescriptionsFactory;
+ private PolicyFactory policyFactory;
+ private ExtensionPointRegistry registry;
+ private FactoryExtensionPoint factories;
+ private ModelResolverExtensionPoint modelResolvers;
+ private XMLInputFactory xmlInputFactory;
+ private XMLOutputFactory xmlOutputFactory;
+ private JavaInterfaceFactory javaInterfaceFactory;
+ private StAXArtifactProcessor processor;
+
+ /**
+ * @param intentName
+ * @return
+ */
+ private static QName getQName(String intentName) {
+ QName qname;
+ if (intentName.startsWith("{")) {
+ int i = intentName.indexOf('}');
+ if (i != -1) {
+ qname = new QName(intentName.substring(1, i), intentName.substring(i + 1));
+ } else {
+ throw new IllegalArgumentException("Invalid intent: " + intentName);
+ }
+ } else {
+ // Default to SCA namespace
+ qname = new QName(Base.SCA11_NS, intentName);
+ }
+ return qname;
+ }
+
+ /**
+ * @param registry
+ */
+ public ExportedServiceIntrospector(ExtensionPointRegistry registry) {
+ super();
+ this.registry = registry;
+ this.factories = registry.getExtensionPoint(FactoryExtensionPoint.class);
+ this.modelResolvers = registry.getExtensionPoint(ModelResolverExtensionPoint.class);
+ this.assemblyFactory = factories.getFactory(AssemblyFactory.class);
+ this.contributionFactory = factories.getFactory(ContributionFactory.class);
+ this.policyFactory = factories.getFactory(PolicyFactory.class);
+ this.implementationFactory = factories.getFactory(OSGiImplementationFactory.class);
+ this.serviceDescriptionsFactory = factories.getFactory(ServiceDescriptionsFactory.class);
+ this.xmlInputFactory = factories.getFactory(XMLInputFactory.class);
+ this.xmlOutputFactory = factories.getFactory(XMLOutputFactory.class);
+ this.javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
+ StAXArtifactProcessorExtensionPoint processors =
+ registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+ UtilityExtensionPoint utilities = this.registry.getExtensionPoint(UtilityExtensionPoint.class);
+ MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
+ Monitor monitor = null;
+ if (monitorFactory != null) {
+ monitor = monitorFactory.createMonitor();
+ }
+ processor = new ExtensibleStAXArtifactProcessor(processors, xmlInputFactory, xmlOutputFactory, monitor);
+ }
+
+ private Intent getIntent(String intent) {
+ QName name = getQName(intent);
+ Intent i = policyFactory.createIntent();
+ i.setName(name);
+ return i;
+ }
+
+ private List<Intent> getIntents(String[] intents) {
+ if (intents == null || intents.length == 0) {
+ return Collections.emptyList();
+ }
+ List<Intent> intentList = new ArrayList<Intent>();
+ for (String i : intents) {
+ Intent intent = getIntent(i);
+ if (intent != null) {
+ intentList.add(intent);
+ }
+ }
+ return intentList;
+ }
+
+ private Map<String, Object> getProperties(ServiceReference reference) {
+ String[] names = reference.getPropertyKeys();
+ if (names != null) {
+ Map<String, Object> properties = new HashMap<String, Object>();
+ for (String name : names) {
+ properties.put(name, reference.getProperty(name));
+ }
+ return properties;
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ /**
+ * Parse the Stringp[] to support values that are separated by comma
+ * @param interfaces
+ * @return
+ */
+ private String[] parse(String[] interfaces) {
+ if (interfaces == null) {
+ return null;
+ }
+ List<String> names = new ArrayList<String>();
+ for (String i : interfaces) {
+ String[] parts = i.split(",");
+ for (String p : parts) {
+ names.add(p.trim());
+ }
+ }
+ return names.toArray(new String[names.size()]);
+ }
+
+ /**
+ * Introspect a local OSGi Service represented by the ServiceReference to create
+ * an SCA service with the required intents and bindings
+ * @param reference The service reference for a local OSGi service
+ * @return An SCA contribution with a deployable composite for the SCA service
+ * @throws Exception
+ */
+ public Contribution introspect(ServiceReference reference) throws Exception {
+ Map<String, Object> properties = getProperties(reference);
+
+ OSGiProperty serviceID = implementationFactory.createOSGiProperty();
+ serviceID.setName(SERVICE_ID);
+ // The service.id is Long
+ serviceID.setValue(String.valueOf(reference.getProperty(SERVICE_ID)));
+
+ String id = "osgi.service." + serviceID.getValue();
+ Composite composite = assemblyFactory.createComposite();
+ composite.setName(new QName(SCA11_TUSCANY_NS, id));
+
+ Component component = assemblyFactory.createComponent();
+ component.setName(id);
+ component.setAutowire(Boolean.TRUE);
+
+ composite.getComponents().add(component);
+
+ Bundle bundle = reference.getBundle();
+ OSGiImplementation implementation = implementationFactory.createOSGiImplementation();
+
+ implementation.setBundle(bundle);
+ component.setImplementation(implementation);
+ implementation.setUnresolved(false);
+
+ String[] remoteInterfaces = getStrings(reference.getProperty(SERVICE_EXPORTED_INTERFACES));
+ if (remoteInterfaces == null || remoteInterfaces.length > 0 && "*".equals(remoteInterfaces[0])) {
+ remoteInterfaces = getStrings(reference.getProperty(OBJECTCLASS));
+ } else {
+ remoteInterfaces = parse(remoteInterfaces);
+ }
+ for (String intf : remoteInterfaces) {
+ Service service = assemblyFactory.createService();
+ JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
+ Class<?> interfaceClass = bundle.loadClass(intf);
+ JavaInterface javaInterface = javaInterfaceFactory.createJavaInterface(interfaceClass);
+ interfaceContract.setInterface(javaInterface);
+ if (javaInterface.getCallbackClass() != null) {
+ interfaceContract.setCallbackInterface(javaInterfaceFactory.createJavaInterface(javaInterface
+ .getCallbackClass()));
+ }
+
+ service.setName(interfaceClass.getSimpleName());
+ service.setInterfaceContract(interfaceContract);
+
+ service.getExtensions().add(serviceID);
+
+ implementation.getServices().add(service);
+
+ ComponentService componentService = assemblyFactory.createComponentService();
+ componentService.setName(service.getName());
+ component.getServices().add(componentService);
+ componentService.setService(service);
+ }
+
+ String[] requiredIntents = getStrings(properties.get(SERVICE_EXPORTED_INTENTS));
+ List<Intent> intents = getIntents(requiredIntents);
+ String[] requiredIntentsExtra = getStrings(properties.get(SERVICE_EXPORTED_INTENTS_EXTRA));
+ List<Intent> extraIntents = getIntents(requiredIntentsExtra);
+
+ String[] bindingDocuments = getStrings(properties.get(SCA_BINDINGS));
+ List<Binding> bindings = loadBindings(reference.getBundle(), bindingDocuments);
+
+ for (ComponentService componentService : component.getServices()) {
+ componentService.getRequiredIntents().addAll(intents);
+ componentService.getRequiredIntents().addAll(extraIntents);
+ componentService.getBindings().addAll(bindings);
+ }
+
+ // FIXME: Should we scan the owning bundle to create the SCA contribution?
+ Contribution contribution = contributionFactory.createContribution();
+ contribution.setURI("urn:" + id);
+ contribution.setLocation(bundle.getEntry("/").toString());
+ contribution.getDeployables().add(composite);
+ ModelResolver modelResolver = new ExtensibleModelResolver(contribution, modelResolvers, factories);
+ contribution.setModelResolver(modelResolver);
+ contribution.setUnresolved(true);
+ return contribution;
+ }
+
+ /**
+ * Introspect an OSGi filter to create an SCA reference
+ *
+ * @param bundle
+ * @param filterStr
+ * @param properties
+ * @return
+ * @throws Exception
+ */
+ public Contribution introspect(Bundle bundle, String filterStr, Map<String, Object> properties) throws Exception {
+ Filter filter = null;
+ try {
+ filter = bundle.getBundleContext().createFilter(filterStr);
+ } catch (InvalidSyntaxException e) {
+ e.printStackTrace();
+ return null;
+ }
+
+ Dictionary<String, Object> props = new Hashtable<String, Object>();
+ props.put(SERVICE_IMPORTED_CONFIGS, new String[] {REMOTE_CONFIG_SCA});
+ if (!filter.match(props)) {
+ return null;
+ }
+ String id = "osgi.reference." + UUID.randomUUID();
+ Composite composite = assemblyFactory.createComposite();
+ composite.setName(new QName(Base.SCA11_TUSCANY_NS, id));
+
+ Component component = assemblyFactory.createComponent();
+ component.setName(id);
+ component.setAutowire(Boolean.TRUE);
+
+ composite.getComponents().add(component);
+
+ OSGiImplementation implementation = implementationFactory.createOSGiImplementation();
+
+ implementation.setBundle(bundle);
+ component.setImplementation(implementation);
+ implementation.setUnresolved(false);
+
+ String[] remoteInterfaces = getStrings(properties.get(SERVICE_EXPORTED_INTERFACES));
+ if (remoteInterfaces == null || remoteInterfaces.length > 0 && "*".equals(remoteInterfaces[0])) {
+ remoteInterfaces = getStrings(properties.get(OBJECTCLASS));
+ } else {
+ remoteInterfaces = parse(remoteInterfaces);
+ }
+ for (String intf : remoteInterfaces) {
+ Reference reference = assemblyFactory.createReference();
+ JavaInterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
+ Class<?> interfaceClass = bundle.loadClass(intf);
+ JavaInterface javaInterface = javaInterfaceFactory.createJavaInterface(interfaceClass);
+ interfaceContract.setInterface(javaInterface);
+ if (javaInterface.getCallbackClass() != null) {
+ interfaceContract.setCallbackInterface(javaInterfaceFactory.createJavaInterface(javaInterface
+ .getCallbackClass()));
+ }
+
+ reference.setName(id);
+ reference.setInterfaceContract(interfaceContract);
+
+ reference.getExtensions().add(filter);
+
+ implementation.getReferences().add(reference);
+
+ ComponentReference componentReference = assemblyFactory.createComponentReference();
+ component.getReferences().add(componentReference);
+ componentReference.setReference(reference);
+ componentReference.setWiredByImpl(true);
+ }
+
+ String[] requiredIntents = getStrings(properties.get(SERVICE_EXPORTED_INTENTS));
+ List<Intent> intents = getIntents(requiredIntents);
+
+ String[] bindingDocuments = getStrings(properties.get(SCA_BINDINGS));
+ List<Binding> bindings = loadBindings(bundle, bindingDocuments);
+
+ for (ComponentReference componentReference : component.getReferences()) {
+ componentReference.getRequiredIntents().addAll(intents);
+ componentReference.getBindings().addAll(bindings);
+ }
+
+ // FIXME: Should we scan the owning bundle to create the SCA contribution?
+ Contribution contribution = contributionFactory.createContribution();
+ contribution.setURI("urn:" + id);
+ contribution.setLocation(bundle.getEntry("/").toString());
+ contribution.getDeployables().add(composite);
+ ModelResolver modelResolver = new ExtensibleModelResolver(contribution, modelResolvers, factories);
+ contribution.setModelResolver(modelResolver);
+ contribution.setUnresolved(true);
+ return contribution;
+ }
+
+ private List<Binding> loadBindings(Bundle bundle, String[] bindingDocuments) throws IOException,
+ ContributionReadException {
+ if (bindingDocuments == null || bindingDocuments.length == 0) {
+ return Collections.emptyList();
+ }
+ List<Binding> bindings = new ArrayList<Binding>();
+ for (String doc : bindingDocuments) {
+ URL url = locate(bundle, doc);
+ if (url == null) {
+ throw new IOException("Entry " + doc + " cannot be found in bundle " + bundle);
+ }
+ bindings.addAll(loadBindings(url));
+ }
+ return bindings;
+ }
+
+ private List<Binding> loadBindings(URL url) throws ContributionReadException, IOException {
+ InputStream is = url.openStream();
+ try {
+ XMLStreamReader reader = xmlInputFactory.createXMLStreamReader(is);
+ reader.nextTag();
+ Object model = processor.read(reader);
+ if (model instanceof BindingDescriptions) {
+ return ((BindingDescriptions)model);
+ } else {
+ return Collections.emptyList();
+ }
+ } catch (XMLStreamException e) {
+ throw new ContributionReadException(e);
+ } finally {
+ is.close();
+ }
+ }
+
+ private URL locate(Bundle bundle, String location) throws MalformedURLException {
+ URI uri = URI.create(location);
+ if (uri.isAbsolute()) {
+ return uri.toURL();
+ }
+ return bundle.getEntry(location);
+ }
+
+ /**
+ * In OSGi, the value of String+ can be a single String, String[] or Collection<String>
+ * @param value
+ * @return
+ */
+ private String[] getStrings(Object value) {
+ if (value == null) {
+ return null;
+ }
+ if (value instanceof String) {
+ return new String[] {(String)value};
+ } else if (value instanceof Collection) {
+ Collection<String> collection = (Collection)value;
+ return collection.toArray(new String[collection.size()]);
+ }
+ return (String[])value;
+
+ }
+
+}
diff --git a/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/BindingDescriptionsProcessor.java b/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/BindingDescriptionsProcessor.java
index 0a94c6ae0a..7efb3f196a 100644
--- a/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/BindingDescriptionsProcessor.java
+++ b/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/BindingDescriptionsProcessor.java
@@ -1,117 +1,117 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.osgi.xml;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.implementation.osgi.BindingDescriptions;
-import org.apache.tuscany.sca.implementation.osgi.ServiceDescriptionsFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/*
-<?xml version="1.0" encoding="UTF-8"?>
-<bindings xmlns="http://www.osgi.org/xmlns/sd/v1.0.0" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
- <binding.ws/>
- <binding.sca/>
-</bindings>
-*/
-public class BindingDescriptionsProcessor implements StAXArtifactProcessor<BindingDescriptions> {
- private Monitor monitor;
- private StAXArtifactProcessor processor;
- private ServiceDescriptionsFactory factory;
-
- public BindingDescriptionsProcessor(ExtensionPointRegistry registry,
- StAXArtifactProcessor processor,
- Monitor monitor) {
- this.monitor = monitor;
- this.processor = processor;
- this.factory =
- registry.getExtensionPoint(FactoryExtensionPoint.class).getFactory(ServiceDescriptionsFactory.class);
- }
-
- public BindingDescriptions read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- BindingDescriptions bindings = factory.createBindingDescriptions();
- boolean exit = false;
- while (!exit) {
- int event = reader.getEventType();
- switch (event) {
- case XMLStreamConstants.START_ELEMENT:
- QName name = reader.getName();
- if (!"bindings".equals(name.getLocalPart())) {
- Object element = null;
- try {
- element = processor.read(reader);
- } catch (ContributionReadException e) {
- throw e;
- }
- if (element instanceof Binding) {
- bindings.add((Binding)element);
- }
- }
- break;
- case XMLStreamConstants.END_ELEMENT:
- name = reader.getName();
- if ("bindings".equals(name.getLocalPart())) {
- exit = true;
- }
- break;
- }
- if (reader.hasNext()) {
- reader.next();
- } else {
- exit = true;
- }
- }
- return bindings;
- }
-
- public QName getArtifactType() {
- return BindingDescriptions.BINDINGS_QNAME;
- }
-
- public void write(BindingDescriptions model, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
- writer.writeStartElement(BindingDescriptions.OSGI_SD_NS, "bindings");
- for (Binding binding : model) {
- processor.write(model, writer);
- }
- writer.writeEndElement();
- }
-
- public Class<BindingDescriptions> getModelType() {
- return BindingDescriptions.class;
- }
-
- public void resolve(BindingDescriptions model, ModelResolver resolver) throws ContributionResolveException {
- // TODO: To be implemented
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.osgi.xml;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.implementation.osgi.BindingDescriptions;
+import org.apache.tuscany.sca.implementation.osgi.ServiceDescriptionsFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
+
+/*
+<?xml version="1.0" encoding="UTF-8"?>
+<bindings xmlns="http://www.osgi.org/xmlns/sd/v1.0.0" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+ <binding.ws/>
+ <binding.sca/>
+</bindings>
+*/
+public class BindingDescriptionsProcessor implements StAXArtifactProcessor<BindingDescriptions> {
+ private Monitor monitor;
+ private StAXArtifactProcessor processor;
+ private ServiceDescriptionsFactory factory;
+
+ public BindingDescriptionsProcessor(ExtensionPointRegistry registry,
+ StAXArtifactProcessor processor,
+ Monitor monitor) {
+ this.monitor = monitor;
+ this.processor = processor;
+ this.factory =
+ registry.getExtensionPoint(FactoryExtensionPoint.class).getFactory(ServiceDescriptionsFactory.class);
+ }
+
+ public BindingDescriptions read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+ BindingDescriptions bindings = factory.createBindingDescriptions();
+ boolean exit = false;
+ while (!exit) {
+ int event = reader.getEventType();
+ switch (event) {
+ case XMLStreamConstants.START_ELEMENT:
+ QName name = reader.getName();
+ if (!"bindings".equals(name.getLocalPart())) {
+ Object element = null;
+ try {
+ element = processor.read(reader);
+ } catch (ContributionReadException e) {
+ throw e;
+ }
+ if (element instanceof Binding) {
+ bindings.add((Binding)element);
+ }
+ }
+ break;
+ case XMLStreamConstants.END_ELEMENT:
+ name = reader.getName();
+ if ("bindings".equals(name.getLocalPart())) {
+ exit = true;
+ }
+ break;
+ }
+ if (reader.hasNext()) {
+ reader.next();
+ } else {
+ exit = true;
+ }
+ }
+ return bindings;
+ }
+
+ public QName getArtifactType() {
+ return BindingDescriptions.BINDINGS_QNAME;
+ }
+
+ public void write(BindingDescriptions model, XMLStreamWriter writer) throws ContributionWriteException,
+ XMLStreamException {
+ writer.writeStartElement(BindingDescriptions.OSGI_SD_NS, "bindings");
+ for (Binding binding : model) {
+ processor.write(model, writer);
+ }
+ writer.writeEndElement();
+ }
+
+ public Class<BindingDescriptions> getModelType() {
+ return BindingDescriptions.class;
+ }
+
+ public void resolve(BindingDescriptions model, ModelResolver resolver) throws ContributionResolveException {
+ // TODO: To be implemented
+ }
+}
diff --git a/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/BluePrintComponentsProcessor.java b/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/BluePrintComponentsProcessor.java
index 92b0316b9c..8dfded0c4e 100644
--- a/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/BluePrintComponentsProcessor.java
+++ b/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/BluePrintComponentsProcessor.java
@@ -1,146 +1,146 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.osgi.xml;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/*
-<!-- A sample module-context.xml for OSGI RFC 124 (BluePrint Service) -->
-<components xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
- <component id="CalculatorComponent" class="calculator.dosgi.impl.CalculatorServiceImpl">
- <property name="addService" ref="AddService" />
- <property name="subtractService" ref="SubtractService" />
- <property name="multiplyService" ref="MultiplyService" />
- <property name="divideService" ref="DivideService" />
- </component>
-
- <!-- We can derive the SCA services for the implementation.osgi -->
- <service id="CalculatorService" ref="CalculatorComponent" interface="calculator.dosgi.CalculatorService">
- </service>
-
- <!-- We can derive the SCA references for the implementation.osgi -->
- <reference id="AddService" interface="calculator.dosgi.operations.AddService">
- </reference>
- <reference id="SubtractService" interface="calculator.dosgi.operations.SubtractService">
- </reference>
- <reference id="MultiplyService" interface="calculator.dosgi.operations.MultiplyService">
- </reference>
- <reference id="DivideService" interface="calculator.dosgi.operations.DivideService">
- </reference>
-
-</components>
-*/
-public class BluePrintComponentsProcessor implements StAXArtifactProcessor<ComponentType> {
- private static final String BLUE_PRINT_NS = "http://www.osgi.org/xmlns/blueprint/v1.0.0";
- private static final String COMPOMENTS = "components";
- private static final QName COMPONENTS_QNAME = new QName(BLUE_PRINT_NS, COMPOMENTS);
-
- private AssemblyFactory factory;
- private JavaInterfaceFactory javaInterfaceFactory;
- private Monitor monitor;
-
- public BluePrintComponentsProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.monitor = monitor;
- this.factory = modelFactories.getFactory(AssemblyFactory.class);
- this.javaInterfaceFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
- }
-
- public ComponentType read(XMLStreamReader reader) throws XMLStreamException {
- int event = reader.getEventType();
- ComponentType componentType = factory.createComponentType();
- while (true) {
- switch (event) {
- case XMLStreamConstants.START_ELEMENT:
- QName name = reader.getName();
- if (COMPONENTS_QNAME.equals(name)) {
- //
- } else if ("reference".equals(name.getLocalPart())) {
- Reference ref = factory.createReference();
- ref.setName(reader.getAttributeValue(null, "id"));
- String interfaceName = reader.getAttributeValue(null, "interface");
- InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
- ref.setInterfaceContract(interfaceContract);
- JavaInterface javaInterface = javaInterfaceFactory.createJavaInterface();
- javaInterface.setUnresolved(true);
- javaInterface.setName(interfaceName);
- interfaceContract.setInterface(javaInterface);
- componentType.getReferences().add(ref);
- } else if ("service".equals(name.getLocalPart())) {
- Service service = factory.createService();
- String interfaceName = reader.getAttributeValue(null, "interface");
- InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
- service.setInterfaceContract(interfaceContract);
- JavaInterface javaInterface = javaInterfaceFactory.createJavaInterface();
- javaInterface.setUnresolved(true);
- javaInterface.setName(interfaceName);
- interfaceContract.setInterface(javaInterface);
- componentType.getServices().add(service);
- }
- break;
- case XMLStreamConstants.END_ELEMENT:
- name = reader.getName();
- if (COMPONENTS_QNAME.equals(name)) {
- return componentType;
- }
- break;
- }
- if (reader.hasNext()) {
- event = reader.next();
- } else {
- return componentType;
- }
- }
- }
-
- public QName getArtifactType() {
- return COMPONENTS_QNAME;
- }
-
- public void write(ComponentType model, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
- // TODO: To be implemented
- }
-
- public Class<ComponentType> getModelType() {
- return ComponentType.class;
- }
-
- public void resolve(ComponentType model, ModelResolver resolver) throws ContributionResolveException {
- // TODO: To be implemented
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.osgi.xml;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
+
+/*
+<!-- A sample module-context.xml for OSGI RFC 124 (BluePrint Service) -->
+<components xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+ <component id="CalculatorComponent" class="calculator.dosgi.impl.CalculatorServiceImpl">
+ <property name="addService" ref="AddService" />
+ <property name="subtractService" ref="SubtractService" />
+ <property name="multiplyService" ref="MultiplyService" />
+ <property name="divideService" ref="DivideService" />
+ </component>
+
+ <!-- We can derive the SCA services for the implementation.osgi -->
+ <service id="CalculatorService" ref="CalculatorComponent" interface="calculator.dosgi.CalculatorService">
+ </service>
+
+ <!-- We can derive the SCA references for the implementation.osgi -->
+ <reference id="AddService" interface="calculator.dosgi.operations.AddService">
+ </reference>
+ <reference id="SubtractService" interface="calculator.dosgi.operations.SubtractService">
+ </reference>
+ <reference id="MultiplyService" interface="calculator.dosgi.operations.MultiplyService">
+ </reference>
+ <reference id="DivideService" interface="calculator.dosgi.operations.DivideService">
+ </reference>
+
+</components>
+*/
+public class BluePrintComponentsProcessor implements StAXArtifactProcessor<ComponentType> {
+ private static final String BLUE_PRINT_NS = "http://www.osgi.org/xmlns/blueprint/v1.0.0";
+ private static final String COMPOMENTS = "components";
+ private static final QName COMPONENTS_QNAME = new QName(BLUE_PRINT_NS, COMPOMENTS);
+
+ private AssemblyFactory factory;
+ private JavaInterfaceFactory javaInterfaceFactory;
+ private Monitor monitor;
+
+ public BluePrintComponentsProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
+ this.monitor = monitor;
+ this.factory = modelFactories.getFactory(AssemblyFactory.class);
+ this.javaInterfaceFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
+ }
+
+ public ComponentType read(XMLStreamReader reader) throws XMLStreamException {
+ int event = reader.getEventType();
+ ComponentType componentType = factory.createComponentType();
+ while (true) {
+ switch (event) {
+ case XMLStreamConstants.START_ELEMENT:
+ QName name = reader.getName();
+ if (COMPONENTS_QNAME.equals(name)) {
+ //
+ } else if ("reference".equals(name.getLocalPart())) {
+ Reference ref = factory.createReference();
+ ref.setName(reader.getAttributeValue(null, "id"));
+ String interfaceName = reader.getAttributeValue(null, "interface");
+ InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
+ ref.setInterfaceContract(interfaceContract);
+ JavaInterface javaInterface = javaInterfaceFactory.createJavaInterface();
+ javaInterface.setUnresolved(true);
+ javaInterface.setName(interfaceName);
+ interfaceContract.setInterface(javaInterface);
+ componentType.getReferences().add(ref);
+ } else if ("service".equals(name.getLocalPart())) {
+ Service service = factory.createService();
+ String interfaceName = reader.getAttributeValue(null, "interface");
+ InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
+ service.setInterfaceContract(interfaceContract);
+ JavaInterface javaInterface = javaInterfaceFactory.createJavaInterface();
+ javaInterface.setUnresolved(true);
+ javaInterface.setName(interfaceName);
+ interfaceContract.setInterface(javaInterface);
+ componentType.getServices().add(service);
+ }
+ break;
+ case XMLStreamConstants.END_ELEMENT:
+ name = reader.getName();
+ if (COMPONENTS_QNAME.equals(name)) {
+ return componentType;
+ }
+ break;
+ }
+ if (reader.hasNext()) {
+ event = reader.next();
+ } else {
+ return componentType;
+ }
+ }
+ }
+
+ public QName getArtifactType() {
+ return COMPONENTS_QNAME;
+ }
+
+ public void write(ComponentType model, XMLStreamWriter writer) throws ContributionWriteException,
+ XMLStreamException {
+ // TODO: To be implemented
+ }
+
+ public Class<ComponentType> getModelType() {
+ return ComponentType.class;
+ }
+
+ public void resolve(ComponentType model, ModelResolver resolver) throws ContributionResolveException {
+ // TODO: To be implemented
+ }
+}
diff --git a/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiComponentProcessor.java b/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiComponentProcessor.java
index d70458053e..e62c424a1a 100644
--- a/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiComponentProcessor.java
+++ b/java/sca/modules/implementation-osgi/src/main/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiComponentProcessor.java
@@ -1,175 +1,175 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.osgi.xml;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-
-/*
-<scr:component name="CalculatorComponent"
- xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
- <implementation class="calculator.dosgi.CalculatorServiceDSImpl" />
- <service>
- <provide interface="calculator.dosgi.CalculatorService" />
- </service>
-
- <reference name="addService" interface="calculator.dosgi.operations.AddService" bind="setAddService" unbind="unsetAddService"
- policy="dynamic" />
- <reference name="subtractService" interface="calculator.dosgi.operations.SubtractService" bind="setSubtractService"
- unbind="unsetSubtractService" policy="dynamic" />
- <reference name="multiplyService" interface="calculator.dosgi.operations.MultiplyService" bind="setMultiplyService"
- unbind="unsetMultiplyService" policy="dynamic" />
- <reference name="divideService" interface="calculator.dosgi.operations.DivideService" bind="setDivideService"
- unbind="unsetDivideService" policy="dynamic" />
-
-</scr:component>
-*/
-public class OSGiComponentProcessor implements StAXArtifactProcessor<ComponentType> {
- private static final String OSGI_SCR_NS = "http://www.osgi.org/xmlns/scr/v1.0.0";
- private static final String COMPOMENT = "component";
- private static final QName COMPONENT_QNAME = new QName(OSGI_SCR_NS, COMPOMENT);
-
- private AssemblyFactory factory;
- private JavaInterfaceFactory javaInterfaceFactory;
- private Monitor monitor;
-
- public OSGiComponentProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.monitor = monitor;
- this.factory = modelFactories.getFactory(AssemblyFactory.class);
- this.javaInterfaceFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
- }
-
- public ComponentType read(XMLStreamReader reader) throws XMLStreamException {
- int event = reader.getEventType();
- ComponentType componentType = factory.createComponentType();
- while (true) {
- switch (event) {
- case XMLStreamConstants.START_ELEMENT:
- QName name = reader.getName();
- if (COMPONENT_QNAME.equals(name)) {
- //
- } else if ("reference".equals(name.getLocalPart())) {
- Reference ref = factory.createReference();
- ref.setName(reader.getAttributeValue(null, "name"));
- String interfaceName = reader.getAttributeValue(null, "interface");
- InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
- ref.setInterfaceContract(interfaceContract);
- JavaInterface javaInterface = javaInterfaceFactory.createJavaInterface();
- javaInterface.setUnresolved(true);
- javaInterface.setName(interfaceName);
- interfaceContract.setInterface(javaInterface);
- componentType.getReferences().add(ref);
- } else if ("provide".equals(name.getLocalPart())) {
- Service service = factory.createService();
- String interfaceName = reader.getAttributeValue(null, "interface");
- InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
- service.setInterfaceContract(interfaceContract);
- JavaInterface javaInterface = javaInterfaceFactory.createJavaInterface();
- javaInterface.setUnresolved(true);
- javaInterface.setName(interfaceName);
- interfaceContract.setInterface(javaInterface);
- componentType.getServices().add(service);
- } else if ("property".equals(name.getLocalPart())) {
- String propName = reader.getAttributeValue(null, "name");
- String propValue = reader.getAttributeValue(null, "value");
- String propType = reader.getAttributeValue(null, "type");
- if (propType == null) {
- propType = "String";
- }
- if (propValue == null) {
- propValue = reader.getElementText();
- }
- if (propValue != null) {
- propValue = propValue.trim();
- }
- Object prop = propValue;
- if ("Integer".equals(propType)) {
- prop = Integer.valueOf(propValue);
- } else if ("Long".equals(propType)) {
- prop = Long.valueOf(propValue);
- } else if ("Float".equals(propType)) {
- prop = Float.valueOf(propValue);
- } else if ("Double".equals(propType)) {
- prop = Double.valueOf(propValue);
- } else if ("Short".equals(propType)) {
- prop = Short.valueOf(propValue);
- } else if ("Character".equals(propType)) {
- prop = propValue.charAt(0);
- } else if ("Byte".equals(propType)) {
- prop = Byte.valueOf(propValue);
- } else if ("Boolean".equals(propType)) {
- prop = Boolean.valueOf(propValue);
- }
- Property property = factory.createProperty();
- property.setName(propName);
- property.setValue(prop);
- componentType.getProperties().add(property);
- }
- break;
- case XMLStreamConstants.END_ELEMENT:
- name = reader.getName();
- if (COMPONENT_QNAME.equals(name)) {
- return componentType;
- }
- break;
- }
- if (reader.hasNext()) {
- event = reader.next();
- } else {
- return componentType;
- }
- }
- }
-
- public QName getArtifactType() {
- return COMPONENT_QNAME;
- }
-
- public void write(ComponentType model, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
- // TODO: To be implemented
- }
-
- public Class<ComponentType> getModelType() {
- return ComponentType.class;
- }
-
- public void resolve(ComponentType model, ModelResolver resolver) throws ContributionResolveException {
- // TODO: To be implemented
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.osgi.xml;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.Property;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
+
+/*
+<scr:component name="CalculatorComponent"
+ xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+ <implementation class="calculator.dosgi.CalculatorServiceDSImpl" />
+ <service>
+ <provide interface="calculator.dosgi.CalculatorService" />
+ </service>
+
+ <reference name="addService" interface="calculator.dosgi.operations.AddService" bind="setAddService" unbind="unsetAddService"
+ policy="dynamic" />
+ <reference name="subtractService" interface="calculator.dosgi.operations.SubtractService" bind="setSubtractService"
+ unbind="unsetSubtractService" policy="dynamic" />
+ <reference name="multiplyService" interface="calculator.dosgi.operations.MultiplyService" bind="setMultiplyService"
+ unbind="unsetMultiplyService" policy="dynamic" />
+ <reference name="divideService" interface="calculator.dosgi.operations.DivideService" bind="setDivideService"
+ unbind="unsetDivideService" policy="dynamic" />
+
+</scr:component>
+*/
+public class OSGiComponentProcessor implements StAXArtifactProcessor<ComponentType> {
+ private static final String OSGI_SCR_NS = "http://www.osgi.org/xmlns/scr/v1.0.0";
+ private static final String COMPOMENT = "component";
+ private static final QName COMPONENT_QNAME = new QName(OSGI_SCR_NS, COMPOMENT);
+
+ private AssemblyFactory factory;
+ private JavaInterfaceFactory javaInterfaceFactory;
+ private Monitor monitor;
+
+ public OSGiComponentProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
+ this.monitor = monitor;
+ this.factory = modelFactories.getFactory(AssemblyFactory.class);
+ this.javaInterfaceFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
+ }
+
+ public ComponentType read(XMLStreamReader reader) throws XMLStreamException {
+ int event = reader.getEventType();
+ ComponentType componentType = factory.createComponentType();
+ while (true) {
+ switch (event) {
+ case XMLStreamConstants.START_ELEMENT:
+ QName name = reader.getName();
+ if (COMPONENT_QNAME.equals(name)) {
+ //
+ } else if ("reference".equals(name.getLocalPart())) {
+ Reference ref = factory.createReference();
+ ref.setName(reader.getAttributeValue(null, "name"));
+ String interfaceName = reader.getAttributeValue(null, "interface");
+ InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
+ ref.setInterfaceContract(interfaceContract);
+ JavaInterface javaInterface = javaInterfaceFactory.createJavaInterface();
+ javaInterface.setUnresolved(true);
+ javaInterface.setName(interfaceName);
+ interfaceContract.setInterface(javaInterface);
+ componentType.getReferences().add(ref);
+ } else if ("provide".equals(name.getLocalPart())) {
+ Service service = factory.createService();
+ String interfaceName = reader.getAttributeValue(null, "interface");
+ InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
+ service.setInterfaceContract(interfaceContract);
+ JavaInterface javaInterface = javaInterfaceFactory.createJavaInterface();
+ javaInterface.setUnresolved(true);
+ javaInterface.setName(interfaceName);
+ interfaceContract.setInterface(javaInterface);
+ componentType.getServices().add(service);
+ } else if ("property".equals(name.getLocalPart())) {
+ String propName = reader.getAttributeValue(null, "name");
+ String propValue = reader.getAttributeValue(null, "value");
+ String propType = reader.getAttributeValue(null, "type");
+ if (propType == null) {
+ propType = "String";
+ }
+ if (propValue == null) {
+ propValue = reader.getElementText();
+ }
+ if (propValue != null) {
+ propValue = propValue.trim();
+ }
+ Object prop = propValue;
+ if ("Integer".equals(propType)) {
+ prop = Integer.valueOf(propValue);
+ } else if ("Long".equals(propType)) {
+ prop = Long.valueOf(propValue);
+ } else if ("Float".equals(propType)) {
+ prop = Float.valueOf(propValue);
+ } else if ("Double".equals(propType)) {
+ prop = Double.valueOf(propValue);
+ } else if ("Short".equals(propType)) {
+ prop = Short.valueOf(propValue);
+ } else if ("Character".equals(propType)) {
+ prop = propValue.charAt(0);
+ } else if ("Byte".equals(propType)) {
+ prop = Byte.valueOf(propValue);
+ } else if ("Boolean".equals(propType)) {
+ prop = Boolean.valueOf(propValue);
+ }
+ Property property = factory.createProperty();
+ property.setName(propName);
+ property.setValue(prop);
+ componentType.getProperties().add(property);
+ }
+ break;
+ case XMLStreamConstants.END_ELEMENT:
+ name = reader.getName();
+ if (COMPONENT_QNAME.equals(name)) {
+ return componentType;
+ }
+ break;
+ }
+ if (reader.hasNext()) {
+ event = reader.next();
+ } else {
+ return componentType;
+ }
+ }
+ }
+
+ public QName getArtifactType() {
+ return COMPONENT_QNAME;
+ }
+
+ public void write(ComponentType model, XMLStreamWriter writer) throws ContributionWriteException,
+ XMLStreamException {
+ // TODO: To be implemented
+ }
+
+ public Class<ComponentType> getModelType() {
+ return ComponentType.class;
+ }
+
+ public void resolve(ComponentType model, ModelResolver resolver) throws ContributionResolveException {
+ // TODO: To be implemented
+ }
+}
diff --git a/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/BluePrintComponentsProcessorTestCase.java b/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/BluePrintComponentsProcessorTestCase.java
index fd1a89ccf3..1865c27141 100644
--- a/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/BluePrintComponentsProcessorTestCase.java
+++ b/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/BluePrintComponentsProcessorTestCase.java
@@ -1,89 +1,89 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.osgi.xml;
-
-import java.io.StringReader;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.DefaultFactoryExtensionPoint;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- *
- */
-public class BluePrintComponentsProcessorTestCase {
- private static final String xml =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<components xmlns=\"http://www.osgi.org/xmlns/blueprint/v1.0.0\">"
- + "<component id=\"CalculatorComponent\" class=\"calculator.dosgi.impl.CalculatorServiceImpl\">"
- + "<property name=\"addService\" ref=\"AddService\" />"
- + "<property name=\"subtractService\" ref=\"SubtractService\" />"
- + "<property name=\"multiplyService\" ref=\"MultiplyService\" />"
- + "<property name=\"divideService\" ref=\"DivideService\" />"
- + "</component>"
- + "<service id=\"CalculatorService\" ref=\"CalculatorComponent\" interface=\"calculator.dosgi.CalculatorService\">"
- + "</service>"
- + "<reference id=\"AddService\" interface=\"calculator.dosgi.operations.AddService\">"
- + "</reference>"
- + "<reference id=\"SubtractService\" interface=\"calculator.dosgi.operations.SubtractService\">"
- + "</reference>"
- + "<reference id=\"MultiplyService\" interface=\"calculator.dosgi.operations.MultiplyService\">"
- + "</reference>"
- + "<reference id=\"DivideService\" interface=\"calculator.dosgi.operations.DivideService\">"
- + "</reference>"
- + "</components>";
- private static XMLStreamReader reader;
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- XMLInputFactory factory = XMLInputFactory.newInstance();
- reader = factory.createXMLStreamReader(new StringReader(xml));
- }
-
- @Test
- public void testLoad() throws Exception {
- BluePrintComponentsProcessor processor =
- new BluePrintComponentsProcessor(new DefaultFactoryExtensionPoint(new DefaultExtensionPointRegistry()),
- null);
- ComponentType ct = processor.read(reader);
- Assert.assertEquals(1, ct.getServices().size());
- Assert.assertEquals(4, ct.getReferences().size());
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- if (reader != null) {
- reader.close();
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.osgi.xml;
+
+import java.io.StringReader;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.DefaultFactoryExtensionPoint;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ */
+public class BluePrintComponentsProcessorTestCase {
+ private static final String xml =
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<components xmlns=\"http://www.osgi.org/xmlns/blueprint/v1.0.0\">"
+ + "<component id=\"CalculatorComponent\" class=\"calculator.dosgi.impl.CalculatorServiceImpl\">"
+ + "<property name=\"addService\" ref=\"AddService\" />"
+ + "<property name=\"subtractService\" ref=\"SubtractService\" />"
+ + "<property name=\"multiplyService\" ref=\"MultiplyService\" />"
+ + "<property name=\"divideService\" ref=\"DivideService\" />"
+ + "</component>"
+ + "<service id=\"CalculatorService\" ref=\"CalculatorComponent\" interface=\"calculator.dosgi.CalculatorService\">"
+ + "</service>"
+ + "<reference id=\"AddService\" interface=\"calculator.dosgi.operations.AddService\">"
+ + "</reference>"
+ + "<reference id=\"SubtractService\" interface=\"calculator.dosgi.operations.SubtractService\">"
+ + "</reference>"
+ + "<reference id=\"MultiplyService\" interface=\"calculator.dosgi.operations.MultiplyService\">"
+ + "</reference>"
+ + "<reference id=\"DivideService\" interface=\"calculator.dosgi.operations.DivideService\">"
+ + "</reference>"
+ + "</components>";
+ private static XMLStreamReader reader;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ XMLInputFactory factory = XMLInputFactory.newInstance();
+ reader = factory.createXMLStreamReader(new StringReader(xml));
+ }
+
+ @Test
+ public void testLoad() throws Exception {
+ BluePrintComponentsProcessor processor =
+ new BluePrintComponentsProcessor(new DefaultFactoryExtensionPoint(new DefaultExtensionPointRegistry()),
+ null);
+ ComponentType ct = processor.read(reader);
+ Assert.assertEquals(1, ct.getServices().size());
+ Assert.assertEquals(4, ct.getReferences().size());
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (reader != null) {
+ reader.close();
+ }
+ }
+
+}
diff --git a/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiComponentProcessorTestCase.java b/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiComponentProcessorTestCase.java
index 5f2a7d690c..3b26fdb999 100644
--- a/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiComponentProcessorTestCase.java
+++ b/java/sca/modules/implementation-osgi/src/test/java/org/apache/tuscany/sca/implementation/osgi/xml/OSGiComponentProcessorTestCase.java
@@ -1,86 +1,86 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.osgi.xml;
-
-import java.io.StringReader;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.DefaultFactoryExtensionPoint;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- *
- */
-public class OSGiComponentProcessorTestCase {
- private static final String xml =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<scr:component name=\"CalculatorComponent\""
- + " xmlns:scr=\"http://www.osgi.org/xmlns/scr/v1.0.0\">"
- + "<implementation class=\"calculator.dosgi.CalculatorServiceDSImpl\" />"
- + "<service>"
- + "<provide interface=\"calculator.dosgi.CalculatorService\" />"
- + "</service>"
- + "<reference name=\"addService\" interface=\"calculator.dosgi.operations.AddService\""
- + " bind=\"setAddService\" unbind=\"unsetAddService\" policy=\"dynamic\" />"
- + "<reference name=\"subtractService\" interface=\"calculator.dosgi.operations.SubtractService\""
- + " bind=\"setSubtractService\" unbind=\"unsetSubtractService\" policy=\"dynamic\" />"
- + "<reference name=\"multiplyService\" interface=\"calculator.dosgi.operations.MultiplyService\""
- + " bind=\"setMultiplyService\" unbind=\"unsetMultiplyService\" policy=\"dynamic\" />"
- + "<reference name=\"divideService\" interface=\"calculator.dosgi.operations.DivideService\""
- + " bind=\"setDivideService\" unbind=\"unsetDivideService\" policy=\"dynamic\" />"
- + "</scr:component>";
-
- private static XMLStreamReader reader;
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- XMLInputFactory factory = XMLInputFactory.newInstance();
- reader = factory.createXMLStreamReader(new StringReader(xml));
- }
-
- @Test
- public void testLoad() throws Exception {
- OSGiComponentProcessor processor =
- new OSGiComponentProcessor(new DefaultFactoryExtensionPoint(new DefaultExtensionPointRegistry()), null);
- ComponentType ct = processor.read(reader);
- Assert.assertEquals(1, ct.getServices().size());
- Assert.assertEquals(4, ct.getReferences().size());
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- if (reader != null) {
- reader.close();
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.osgi.xml;
+
+import java.io.StringReader;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.DefaultFactoryExtensionPoint;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ */
+public class OSGiComponentProcessorTestCase {
+ private static final String xml =
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<scr:component name=\"CalculatorComponent\""
+ + " xmlns:scr=\"http://www.osgi.org/xmlns/scr/v1.0.0\">"
+ + "<implementation class=\"calculator.dosgi.CalculatorServiceDSImpl\" />"
+ + "<service>"
+ + "<provide interface=\"calculator.dosgi.CalculatorService\" />"
+ + "</service>"
+ + "<reference name=\"addService\" interface=\"calculator.dosgi.operations.AddService\""
+ + " bind=\"setAddService\" unbind=\"unsetAddService\" policy=\"dynamic\" />"
+ + "<reference name=\"subtractService\" interface=\"calculator.dosgi.operations.SubtractService\""
+ + " bind=\"setSubtractService\" unbind=\"unsetSubtractService\" policy=\"dynamic\" />"
+ + "<reference name=\"multiplyService\" interface=\"calculator.dosgi.operations.MultiplyService\""
+ + " bind=\"setMultiplyService\" unbind=\"unsetMultiplyService\" policy=\"dynamic\" />"
+ + "<reference name=\"divideService\" interface=\"calculator.dosgi.operations.DivideService\""
+ + " bind=\"setDivideService\" unbind=\"unsetDivideService\" policy=\"dynamic\" />"
+ + "</scr:component>";
+
+ private static XMLStreamReader reader;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ XMLInputFactory factory = XMLInputFactory.newInstance();
+ reader = factory.createXMLStreamReader(new StringReader(xml));
+ }
+
+ @Test
+ public void testLoad() throws Exception {
+ OSGiComponentProcessor processor =
+ new OSGiComponentProcessor(new DefaultFactoryExtensionPoint(new DefaultExtensionPointRegistry()), null);
+ ComponentType ct = processor.read(reader);
+ Assert.assertEquals(1, ct.getServices().size());
+ Assert.assertEquals(4, ct.getReferences().size());
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (reader != null) {
+ reader.close();
+ }
+ }
+
+}
diff --git a/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/sca/bundle.componentType b/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/sca/bundle.componentType
index 7860094626..bc9e4f6aaf 100644
--- a/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/sca/bundle.componentType
+++ b/java/sca/modules/implementation-osgi/src/test/resources/OSGI-INF/sca/bundle.componentType
@@ -1,54 +1,54 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1">
- <!-- The service elment defines an SCA view of the OSGi service -->
- <service name="Calculator">
- <!-- The interface will be mapped into the OSGi service class -->
- <interface.java interface="calculator.dosgi.CalculatorService"/>
- <!-- The list of OSGi properties -->
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </service>
-
- <!-- The reference elment defines an SCA proxy to a remote OSGi service -->
- <reference name="addService">
- <interface.java interface="calculator.dosgi.operations.AddService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </reference>
- <reference name="subtractService">
- <interface.java interface="calculator.dosgi.operations.SubtractService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </reference>
- <reference name="multiplyService">
- <interface.java interface="calculator.dosgi.operations.MultiplyService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </reference>
- <reference name="divideService">
- <interface.java interface="calculator.dosgi.operations.DivideService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </reference>
-
-</componentType>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1">
+ <!-- The service elment defines an SCA view of the OSGi service -->
+ <service name="Calculator">
+ <!-- The interface will be mapped into the OSGi service class -->
+ <interface.java interface="calculator.dosgi.CalculatorService"/>
+ <!-- The list of OSGi properties -->
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </service>
+
+ <!-- The reference elment defines an SCA proxy to a remote OSGi service -->
+ <reference name="addService">
+ <interface.java interface="calculator.dosgi.operations.AddService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </reference>
+ <reference name="subtractService">
+ <interface.java interface="calculator.dosgi.operations.SubtractService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </reference>
+ <reference name="multiplyService">
+ <interface.java interface="calculator.dosgi.operations.MultiplyService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </reference>
+ <reference name="divideService">
+ <interface.java interface="calculator.dosgi.operations.DivideService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </reference>
+
+</componentType>
diff --git a/java/sca/modules/implementation-osgi/src/test/resources/osgitest.composite b/java/sca/modules/implementation-osgi/src/test/resources/osgitest.composite
index 24c5716abd..8c59703724 100644
--- a/java/sca/modules/implementation-osgi/src/test/resources/osgitest.composite
+++ b/java/sca/modules/implementation-osgi/src/test/resources/osgitest.composite
@@ -1,35 +1,35 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://test"
- name="OSGiTestComposite">
-
- <component name="OSGiTestServiceComponent">
- <tuscany:implementation.osgi bundleVersion="1.0.0"
- bundleSymbolicName="osgi.test" />
-
- <property name="currency" type="xsd:string">USD</property>
- <property name="exchangeRate" type="xsd:double">2.0</property>
-
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://test"
+ name="OSGiTestComposite">
+
+ <component name="OSGiTestServiceComponent">
+ <tuscany:implementation.osgi bundleVersion="1.0.0"
+ bundleSymbolicName="osgi.test" />
+
+ <property name="currency" type="xsd:string">USD</property>
+ <property name="exchangeRate" type="xsd:double">2.0</property>
+
+ </component>
+
+</composite>
diff --git a/java/sca/modules/implementation-spring-sca/pom.xml b/java/sca/modules/implementation-spring-sca/pom.xml
index 746b8cc2ac..abb60e0c68 100644
--- a/java/sca/modules/implementation-spring-sca/pom.xml
+++ b/java/sca/modules/implementation-spring-sca/pom.xml
@@ -1,70 +1,70 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-implementation-spring-sca</artifactId>
- <name>Apache Tuscany SCA Spring Implementation Runtime Model</name>
-
- <dependencies>
-
- <!-- **************************************** -->
- <!-- * * -->
- <!-- * DONT ADD ANY TUSCANY DEPENDENCIES!!! * -->
- <!-- * * -->
- <!-- * See the README for details why not * -->
- <!-- * * -->
- <!-- * * -->
- <!-- **************************************** -->
-
- <!-- SCA API dependency -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- Spring dependencies... -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>2.5.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-beans</artifactId>
- <version>2.5.5</version>
- </dependency>
-
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>2.5.5</version>
- </dependency>
-
- </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-implementation-spring-sca</artifactId>
+ <name>Apache Tuscany SCA Spring Implementation Runtime Model</name>
+
+ <dependencies>
+
+ <!-- **************************************** -->
+ <!-- * * -->
+ <!-- * DONT ADD ANY TUSCANY DEPENDENCIES!!! * -->
+ <!-- * * -->
+ <!-- * See the README for details why not * -->
+ <!-- * * -->
+ <!-- * * -->
+ <!-- **************************************** -->
+
+ <!-- SCA API dependency -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Spring dependencies... -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>2.5.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>2.5.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>2.5.5</version>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/SCANamespaceHandlerResolver.java b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/SCANamespaceHandlerResolver.java
index 52f0260d11..75e00007f6 100644
--- a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/SCANamespaceHandlerResolver.java
+++ b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/SCANamespaceHandlerResolver.java
@@ -1,53 +1,53 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring.namespace;
-
-import org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver;
-import org.springframework.beans.factory.xml.NamespaceHandler;
-
-/**
- * Overrides the default Spring namespace resolver to automatically register
- * {@link ScaNamespaceHandler} instead of requiring a value to be supplied in a
- * Spring configuration
- *
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class SCANamespaceHandlerResolver extends DefaultNamespaceHandlerResolver {
- private static final String SCA_NAMESPACE = "http://www.springframework.org/schema/sca";
-
- private ScaNamespaceHandler handler;
-
- public SCANamespaceHandlerResolver(ClassLoader classLoader) {
- super(classLoader);
- handler = new ScaNamespaceHandler(/*componentType*/);
- }
-
- public SCANamespaceHandlerResolver(String handlerMappingsLocation, ClassLoader classLoader) {
- super(classLoader, handlerMappingsLocation);
- handler = new ScaNamespaceHandler(/*componentType*/);
- }
-
- @Override
- public NamespaceHandler resolve(String namespaceUri) {
- if (SCA_NAMESPACE.equals(namespaceUri)) {
- return handler;
- }
- return super.resolve(namespaceUri);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring.namespace;
+
+import org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver;
+import org.springframework.beans.factory.xml.NamespaceHandler;
+
+/**
+ * Overrides the default Spring namespace resolver to automatically register
+ * {@link ScaNamespaceHandler} instead of requiring a value to be supplied in a
+ * Spring configuration
+ *
+ * @version $Rev$ $Date$
+ */
+public class SCANamespaceHandlerResolver extends DefaultNamespaceHandlerResolver {
+ private static final String SCA_NAMESPACE = "http://www.springframework.org/schema/sca";
+
+ private ScaNamespaceHandler handler;
+
+ public SCANamespaceHandlerResolver(ClassLoader classLoader) {
+ super(classLoader);
+ handler = new ScaNamespaceHandler(/*componentType*/);
+ }
+
+ public SCANamespaceHandlerResolver(String handlerMappingsLocation, ClassLoader classLoader) {
+ super(classLoader, handlerMappingsLocation);
+ handler = new ScaNamespaceHandler(/*componentType*/);
+ }
+
+ @Override
+ public NamespaceHandler resolve(String namespaceUri) {
+ if (SCA_NAMESPACE.equals(namespaceUri)) {
+ return handler;
+ }
+ return super.resolve(namespaceUri);
+ }
+}
diff --git a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaNamespaceHandler.java b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaNamespaceHandler.java
index a3af64ed0d..f136e45b87 100644
--- a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaNamespaceHandler.java
+++ b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaNamespaceHandler.java
@@ -1,38 +1,38 @@
-/*
- * Copyright 2002-2006 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.tuscany.sca.implementation.spring.namespace;
-
-import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
-
-/**
- * Handler for the &lt;sca:&gt; namespace in an application context
- *
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class ScaNamespaceHandler extends NamespaceHandlerSupport {
-
- public ScaNamespaceHandler() {
- init();
- }
-
- public final void init() {
- registerBeanDefinitionParser("reference", new ScaReferenceBeanDefinitionParser());
- registerBeanDefinitionParser("service", new ScaServiceBeanDefinitionParser());
- registerBeanDefinitionParser("property", new ScaPropertyBeanDefinitionParser());
- }
-
-}
+/*
+ * Copyright 2002-2006 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tuscany.sca.implementation.spring.namespace;
+
+import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+
+/**
+ * Handler for the &lt;sca:&gt; namespace in an application context
+ *
+ * @version $Rev$ $Date$
+ */
+public class ScaNamespaceHandler extends NamespaceHandlerSupport {
+
+ public ScaNamespaceHandler() {
+ init();
+ }
+
+ public final void init() {
+ registerBeanDefinitionParser("reference", new ScaReferenceBeanDefinitionParser());
+ registerBeanDefinitionParser("service", new ScaServiceBeanDefinitionParser());
+ registerBeanDefinitionParser("property", new ScaPropertyBeanDefinitionParser());
+ }
+
+}
diff --git a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaPropertyBeanDefinitionParser.java b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaPropertyBeanDefinitionParser.java
index ce17477fca..5b1064d8d8 100644
--- a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaPropertyBeanDefinitionParser.java
+++ b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaPropertyBeanDefinitionParser.java
@@ -1,35 +1,35 @@
-/*
- * Copyright 2002-2006 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.tuscany.sca.implementation.spring.namespace;
-
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.xml.BeanDefinitionParser;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.w3c.dom.Element;
-
-/**
- * Parser for the &lt;sca:reference&gt; element
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class ScaPropertyBeanDefinitionParser implements BeanDefinitionParser {
-
- public BeanDefinition parse(Element element, ParserContext parserContext) {
- // do nothing, this is handled by Tuscany
- return null;
- }
-
-}
+/*
+ * Copyright 2002-2006 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tuscany.sca.implementation.spring.namespace;
+
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.xml.BeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.w3c.dom.Element;
+
+/**
+ * Parser for the &lt;sca:reference&gt; element
+ * @version $Rev$ $Date$
+ */
+public class ScaPropertyBeanDefinitionParser implements BeanDefinitionParser {
+
+ public BeanDefinition parse(Element element, ParserContext parserContext) {
+ // do nothing, this is handled by Tuscany
+ return null;
+ }
+
+}
diff --git a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaReferenceBeanDefinitionParser.java b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaReferenceBeanDefinitionParser.java
index eca6f50f26..fac02760c9 100644
--- a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaReferenceBeanDefinitionParser.java
+++ b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaReferenceBeanDefinitionParser.java
@@ -1,36 +1,36 @@
-/*
- * Copyright 2002-2006 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.tuscany.sca.implementation.spring.namespace;
-
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.xml.BeanDefinitionParser;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.w3c.dom.Element;
-
-/**
- * Parser for the &lt;sca:reference&gt; element
- *
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class ScaReferenceBeanDefinitionParser implements BeanDefinitionParser {
-
- public BeanDefinition parse(Element element, ParserContext parserContext) {
- // do nothing, this is handled by Tuscany
- return null;
- }
-
-}
+/*
+ * Copyright 2002-2006 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tuscany.sca.implementation.spring.namespace;
+
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.xml.BeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.w3c.dom.Element;
+
+/**
+ * Parser for the &lt;sca:reference&gt; element
+ *
+ * @version $Rev$ $Date$
+ */
+public class ScaReferenceBeanDefinitionParser implements BeanDefinitionParser {
+
+ public BeanDefinition parse(Element element, ParserContext parserContext) {
+ // do nothing, this is handled by Tuscany
+ return null;
+ }
+
+}
diff --git a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaServiceBeanDefinitionParser.java b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaServiceBeanDefinitionParser.java
index 0e98277e78..3020dca8bc 100644
--- a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaServiceBeanDefinitionParser.java
+++ b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/namespace/ScaServiceBeanDefinitionParser.java
@@ -1,36 +1,36 @@
-/*
- * Copyright 2002-2006 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.tuscany.sca.implementation.spring.namespace;
-
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.xml.BeanDefinitionParser;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.w3c.dom.Element;
-
-/**
- * Parser for the &lt;sca:service/&gt; element
- *
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class ScaServiceBeanDefinitionParser implements BeanDefinitionParser {
-
- public BeanDefinition parse(Element element, ParserContext parserContext) {
- // do nothing, handled by Tuscany
- return null;
- }
-
-}
+/*
+ * Copyright 2002-2006 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.tuscany.sca.implementation.spring.namespace;
+
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.xml.BeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.w3c.dom.Element;
+
+/**
+ * Parser for the &lt;sca:service/&gt; element
+ *
+ * @version $Rev$ $Date$
+ */
+public class ScaServiceBeanDefinitionParser implements BeanDefinitionParser {
+
+ public BeanDefinition parse(Element element, ParserContext parserContext) {
+ // do nothing, handled by Tuscany
+ return null;
+ }
+
+}
diff --git a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentNameAnnotationProcessor.java b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentNameAnnotationProcessor.java
index 1e5eb19634..7613f8166d 100644
--- a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentNameAnnotationProcessor.java
+++ b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentNameAnnotationProcessor.java
@@ -1,150 +1,150 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring.processor;
-
-import java.beans.PropertyDescriptor;
-import java.lang.annotation.Annotation;
-import java.lang.ref.Reference;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
-import org.oasisopen.sca.annotation.ComponentName;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.FatalBeanException;
-import org.springframework.beans.factory.config.BeanPostProcessor;
-import org.springframework.util.Assert;
-import org.springframework.util.ReflectionUtils;
-
-public class ComponentNameAnnotationProcessor implements BeanPostProcessor {
-
- private Class<? extends Annotation> componentNameAnnotationType = ComponentName.class;
-
- private String componentName;
-
- public ComponentNameAnnotationProcessor (String componentName) {
- this.componentName = componentName;
- }
-
- /**
- * Gets componentName annotation type.
- */
- protected Class<? extends Annotation> getComponentNameAnnotationType() {
- return this.componentNameAnnotationType;
- }
-
- /**
- * Sets componentName annotation type.
- */
- public void setComponentNameAnnotationType(Class<? extends Annotation> componentNameAnnotationType) {
- Assert.notNull(componentNameAnnotationType, "'componentNameAnnotationType' type must not be null.");
- this.componentNameAnnotationType = componentNameAnnotationType;
- }
-
- /**
- * This method is used to execute before a bean's initialization callback.
- *
- * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
- */
- public Object postProcessBeforeInitialization(Object bean, String beanName)
- throws BeansException {
- processAnnotation(bean);
- return bean;
- }
-
- /**
- * This method is used to execute after a bean's initialization callback.
- *
- * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
- */
- public Object postProcessAfterInitialization(Object bean, String beanName)
- throws BeansException {
- return bean;
- }
-
- /**
- * <p>Processes a beans fields for injection if it has a {@link Reference} annotation.</p>
- */
- protected void processAnnotation(final Object bean) {
-
- final Class<?> clazz = bean.getClass();
-
- ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() {
- public void doWith(Field field) {
- Annotation annotation = field.getAnnotation(getComponentNameAnnotationType());
-
- if (annotation != null) {
- if (Modifier.isStatic(field.getModifiers())) {
- throw new IllegalStateException("ComponentName annotation is not supported on static fields");
- }
-
- if (Modifier.isPrivate(field.getModifiers())) {
- throw new IllegalStateException("ComponentName annotation is not supported on private fields");
- }
-
- ReflectionUtils.makeAccessible(field);
-
- if (field.getType().getName().equals("java.lang.String")) {
- Object nameObj = componentName;
- if (nameObj != null)
- ReflectionUtils.setField(field, bean, nameObj);
- } else {
- throw new IllegalStateException("ComponentName annotation is supported only on java.lang.String field type.");
- }
- }
- }
- });
-
- ReflectionUtils.doWithMethods(clazz, new ReflectionUtils.MethodCallback() {
- public void doWith(Method method) {
- Annotation annotation = method.getAnnotation(getComponentNameAnnotationType());
-
- if (annotation != null) {
- if (Modifier.isStatic(method.getModifiers())) {
- throw new IllegalStateException("ComponentName annotation is not supported on static methods");
- }
-
- if (Modifier.isPrivate(method.getModifiers())) {
- throw new IllegalStateException("ComponentName annotation is not supported on private methods");
- }
-
- if (method.getParameterTypes().length == 0) {
- throw new IllegalStateException("ComponentName annotation requires at least one argument: " + method);
- }
-
- PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
-
- if (pd.getPropertyType().getName().equals("java.lang.String")) {
- Object nameObj = componentName;
- if (nameObj != null) {
- try {
- pd.getWriteMethod().invoke(bean, new Object[] { nameObj });
- } catch (Throwable e) {
- throw new FatalBeanException("Problem injecting reference: " + e.getMessage(), e);
- }
- }
- } else {
- throw new IllegalStateException("ComponentName annotation is supported only on java.lang.String field type.");
- }
- }
- }
- });
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring.processor;
+
+import java.beans.PropertyDescriptor;
+import java.lang.annotation.Annotation;
+import java.lang.ref.Reference;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+
+import org.oasisopen.sca.annotation.ComponentName;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.FatalBeanException;
+import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.util.Assert;
+import org.springframework.util.ReflectionUtils;
+
+public class ComponentNameAnnotationProcessor implements BeanPostProcessor {
+
+ private Class<? extends Annotation> componentNameAnnotationType = ComponentName.class;
+
+ private String componentName;
+
+ public ComponentNameAnnotationProcessor (String componentName) {
+ this.componentName = componentName;
+ }
+
+ /**
+ * Gets componentName annotation type.
+ */
+ protected Class<? extends Annotation> getComponentNameAnnotationType() {
+ return this.componentNameAnnotationType;
+ }
+
+ /**
+ * Sets componentName annotation type.
+ */
+ public void setComponentNameAnnotationType(Class<? extends Annotation> componentNameAnnotationType) {
+ Assert.notNull(componentNameAnnotationType, "'componentNameAnnotationType' type must not be null.");
+ this.componentNameAnnotationType = componentNameAnnotationType;
+ }
+
+ /**
+ * This method is used to execute before a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessBeforeInitialization(Object bean, String beanName)
+ throws BeansException {
+ processAnnotation(bean);
+ return bean;
+ }
+
+ /**
+ * This method is used to execute after a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessAfterInitialization(Object bean, String beanName)
+ throws BeansException {
+ return bean;
+ }
+
+ /**
+ * <p>Processes a beans fields for injection if it has a {@link Reference} annotation.</p>
+ */
+ protected void processAnnotation(final Object bean) {
+
+ final Class<?> clazz = bean.getClass();
+
+ ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() {
+ public void doWith(Field field) {
+ Annotation annotation = field.getAnnotation(getComponentNameAnnotationType());
+
+ if (annotation != null) {
+ if (Modifier.isStatic(field.getModifiers())) {
+ throw new IllegalStateException("ComponentName annotation is not supported on static fields");
+ }
+
+ if (Modifier.isPrivate(field.getModifiers())) {
+ throw new IllegalStateException("ComponentName annotation is not supported on private fields");
+ }
+
+ ReflectionUtils.makeAccessible(field);
+
+ if (field.getType().getName().equals("java.lang.String")) {
+ Object nameObj = componentName;
+ if (nameObj != null)
+ ReflectionUtils.setField(field, bean, nameObj);
+ } else {
+ throw new IllegalStateException("ComponentName annotation is supported only on java.lang.String field type.");
+ }
+ }
+ }
+ });
+
+ ReflectionUtils.doWithMethods(clazz, new ReflectionUtils.MethodCallback() {
+ public void doWith(Method method) {
+ Annotation annotation = method.getAnnotation(getComponentNameAnnotationType());
+
+ if (annotation != null) {
+ if (Modifier.isStatic(method.getModifiers())) {
+ throw new IllegalStateException("ComponentName annotation is not supported on static methods");
+ }
+
+ if (Modifier.isPrivate(method.getModifiers())) {
+ throw new IllegalStateException("ComponentName annotation is not supported on private methods");
+ }
+
+ if (method.getParameterTypes().length == 0) {
+ throw new IllegalStateException("ComponentName annotation requires at least one argument: " + method);
+ }
+
+ PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
+
+ if (pd.getPropertyType().getName().equals("java.lang.String")) {
+ Object nameObj = componentName;
+ if (nameObj != null) {
+ try {
+ pd.getWriteMethod().invoke(bean, new Object[] { nameObj });
+ } catch (Throwable e) {
+ throw new FatalBeanException("Problem injecting reference: " + e.getMessage(), e);
+ }
+ }
+ } else {
+ throw new IllegalStateException("ComponentName annotation is supported only on java.lang.String field type.");
+ }
+ }
+ }
+ });
+ }
+}
diff --git a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentStub.java b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentStub.java
index 72db91327c..c72ccd6636 100644
--- a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentStub.java
+++ b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ComponentStub.java
@@ -1,54 +1,54 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.spring.processor;
-
-import java.lang.reflect.Method;
-
-/**
- * This is the Spring runtime side stub for the corresponding Tuscany tie class.
- * It enables the Tuscany code to invoke methods on a Spring context without
- * needing to know about any Spring classes. See the ComponentTie class
- * in the implementation-spring module for what the tie does.
- */
-public class ComponentStub {
-
- private Object tie;
- private Method getService;
-
- public ComponentStub(Object tie) {
- this.tie = tie;
- Class<?> tieClass = tie.getClass();
- try {
- getService = tieClass.getMethod("getService", new Class<?>[]{Class.class, String.class});
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- public Object getService(Class<?> type, String name) {
- try {
-
- return getService.invoke(tie, type, name);
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.spring.processor;
+
+import java.lang.reflect.Method;
+
+/**
+ * This is the Spring runtime side stub for the corresponding Tuscany tie class.
+ * It enables the Tuscany code to invoke methods on a Spring context without
+ * needing to know about any Spring classes. See the ComponentTie class
+ * in the implementation-spring module for what the tie does.
+ */
+public class ComponentStub {
+
+ private Object tie;
+ private Method getService;
+
+ public ComponentStub(Object tie) {
+ this.tie = tie;
+ Class<?> tieClass = tie.getClass();
+ try {
+ getService = tieClass.getMethod("getService", new Class<?>[]{Class.class, String.class});
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Object getService(Class<?> type, String name) {
+ try {
+
+ return getService.invoke(tie, type, name);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ConstructorAnnotationProcessor.java b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ConstructorAnnotationProcessor.java
index 91c89f2af1..7eb63678f6 100644
--- a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ConstructorAnnotationProcessor.java
+++ b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ConstructorAnnotationProcessor.java
@@ -1,115 +1,115 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring.processor;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter;
-import org.springframework.util.Assert;
-
-public class ConstructorAnnotationProcessor extends InstantiationAwareBeanPostProcessorAdapter {
-
- private Class<? extends Annotation> constructorAnnotationType
- = org.oasisopen.sca.annotation.Constructor.class;
-
- private Class<? extends Annotation> autowiredAnnotationType = Autowired.class;
-
- public ConstructorAnnotationProcessor () {
- // Default constructor.
- }
-
- /**
- * Set the 'autowired' annotation type, to be used on constructors, fields,
- * setter methods and arbitrary config methods.
- */
- public void setAutowiredAnnotationType(Class<? extends Annotation> autowiredAnnotationType) {
- Assert.notNull(autowiredAnnotationType, "'autowiredAnnotationType' must not be null");
- this.autowiredAnnotationType = autowiredAnnotationType;
- }
-
- /**
- * Return the 'autowired' annotation type.
- */
- protected Class<? extends Annotation> getAutowiredAnnotationType() {
- return this.autowiredAnnotationType;
- }
-
- /**
- * Return the 'constructor' annotation type.
- */
- protected Class<? extends Annotation> getConstructorAnnotationType() {
- return this.constructorAnnotationType;
- }
-
- /**
- * Sets the 'constructor' annotation type.
- */
- public void setConstructorAnnotationType(Class<? extends Annotation> constructorAnnotationType) {
- Assert.notNull(constructorAnnotationType, "'constructorAnnotationType' type must not be null.");
- this.constructorAnnotationType = constructorAnnotationType;
- }
-
- /**
- * This method is used to execute before a bean's initialization callback.
- *
- * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
- */
- public Object postProcessBeforeInitialization(Object bean, String beanName)
- throws BeansException {
- return bean;
- }
-
- /**
- * This method is used to execute after a bean's initialization callback.
- *
- * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
- */
- public Object postProcessAfterInitialization(Object bean, String beanName)
- throws BeansException {
- return bean;
- }
-
- public Constructor[] determineCandidateConstructors(Class beanClass, String beanName) throws BeansException {
- /*Constructor[] declaredConstructors = beanClass.getDeclaredConstructors();
- Method[] declaredMethods = beanClass.getDeclaredMethods();
- List candidates = new ArrayList(declaredConstructors.length);
-
- for (int i = 0; i < declaredMethods.length; i++) {
- Method method = declaredMethods[i];
- Annotation annotation = method.getAnnotation(getConstructorAnnotationType());
- if (annotation != null) {
- if (Modifier.isStatic(method.getModifiers())) {
- throw new IllegalStateException("Constructor annotation is not supported on static methods");
- }
-
- if (candidates.size() == 1) {
- throw new IllegalStateException("Only one method is allowed to have constructor annotation in a bean: " + method);
- }
-
- candidates.add(method);
- }
- }
-
- return (Constructor[]) candidates.toArray(new Constructor[candidates.size()]);*/
- return null;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring.processor;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter;
+import org.springframework.util.Assert;
+
+public class ConstructorAnnotationProcessor extends InstantiationAwareBeanPostProcessorAdapter {
+
+ private Class<? extends Annotation> constructorAnnotationType
+ = org.oasisopen.sca.annotation.Constructor.class;
+
+ private Class<? extends Annotation> autowiredAnnotationType = Autowired.class;
+
+ public ConstructorAnnotationProcessor () {
+ // Default constructor.
+ }
+
+ /**
+ * Set the 'autowired' annotation type, to be used on constructors, fields,
+ * setter methods and arbitrary config methods.
+ */
+ public void setAutowiredAnnotationType(Class<? extends Annotation> autowiredAnnotationType) {
+ Assert.notNull(autowiredAnnotationType, "'autowiredAnnotationType' must not be null");
+ this.autowiredAnnotationType = autowiredAnnotationType;
+ }
+
+ /**
+ * Return the 'autowired' annotation type.
+ */
+ protected Class<? extends Annotation> getAutowiredAnnotationType() {
+ return this.autowiredAnnotationType;
+ }
+
+ /**
+ * Return the 'constructor' annotation type.
+ */
+ protected Class<? extends Annotation> getConstructorAnnotationType() {
+ return this.constructorAnnotationType;
+ }
+
+ /**
+ * Sets the 'constructor' annotation type.
+ */
+ public void setConstructorAnnotationType(Class<? extends Annotation> constructorAnnotationType) {
+ Assert.notNull(constructorAnnotationType, "'constructorAnnotationType' type must not be null.");
+ this.constructorAnnotationType = constructorAnnotationType;
+ }
+
+ /**
+ * This method is used to execute before a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessBeforeInitialization(Object bean, String beanName)
+ throws BeansException {
+ return bean;
+ }
+
+ /**
+ * This method is used to execute after a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessAfterInitialization(Object bean, String beanName)
+ throws BeansException {
+ return bean;
+ }
+
+ public Constructor[] determineCandidateConstructors(Class beanClass, String beanName) throws BeansException {
+ /*Constructor[] declaredConstructors = beanClass.getDeclaredConstructors();
+ Method[] declaredMethods = beanClass.getDeclaredMethods();
+ List candidates = new ArrayList(declaredConstructors.length);
+
+ for (int i = 0; i < declaredMethods.length; i++) {
+ Method method = declaredMethods[i];
+ Annotation annotation = method.getAnnotation(getConstructorAnnotationType());
+ if (annotation != null) {
+ if (Modifier.isStatic(method.getModifiers())) {
+ throw new IllegalStateException("Constructor annotation is not supported on static methods");
+ }
+
+ if (candidates.size() == 1) {
+ throw new IllegalStateException("Only one method is allowed to have constructor annotation in a bean: " + method);
+ }
+
+ candidates.add(method);
+ }
+ }
+
+ return (Constructor[]) candidates.toArray(new Constructor[candidates.size()]);*/
+ return null;
+ }
+}
diff --git a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/InitDestroyAnnotationProcessor.java b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/InitDestroyAnnotationProcessor.java
index e05b782926..477582b1d3 100644
--- a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/InitDestroyAnnotationProcessor.java
+++ b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/InitDestroyAnnotationProcessor.java
@@ -1,75 +1,75 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring.processor;
-
-import java.lang.annotation.Annotation;
-
-import org.oasisopen.sca.annotation.Destroy;
-import org.oasisopen.sca.annotation.Init;
-import org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor;
-
-public class InitDestroyAnnotationProcessor extends InitDestroyAnnotationBeanPostProcessor {
-
- private static final long serialVersionUID = 0;
-
- private Class<? extends Annotation> initAnnotationType = Init.class;
- private Class<? extends Annotation> destroyAnnotationType = Destroy.class;
-
- /**
- * Gets init annotation type.
- */
- protected Class<? extends Annotation> getInitAnnotationType() {
- return this.initAnnotationType;
- }
-
- /**
- * Sets init annotation type.
- */
- /*
- * public void setInitAnnotationType(Class<? extends Annotation>
- * initAnnotationType) { Assert.notNull(initAnnotationType,
- * "Init annotation type must not be null."); this.initAnnotationType =
- * initAnnotationType; }
- */
-
- /**
- * Gets destroy annotation type.
- */
- protected Class<? extends Annotation> getDestroyAnnotationType() {
- return this.destroyAnnotationType;
- }
-
- /**
- * Sets destroy annotation type.
- */
- /*
- * public void setDestroyAnnotationType(Class<? extends Annotation>
- * destroyAnnotationType) { Assert.notNull(destroyAnnotationType,
- * "Destroy annotation type must not be null."); this.destroyAnnotationType
- * = destroyAnnotationType; }
- */
-
- public InitDestroyAnnotationProcessor() {
- // Set the @Init annotation type
- setInitAnnotationType(initAnnotationType);
-
- // Set the @Destroy annotation type
- setDestroyAnnotationType(destroyAnnotationType);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring.processor;
+
+import java.lang.annotation.Annotation;
+
+import org.oasisopen.sca.annotation.Destroy;
+import org.oasisopen.sca.annotation.Init;
+import org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor;
+
+public class InitDestroyAnnotationProcessor extends InitDestroyAnnotationBeanPostProcessor {
+
+ private static final long serialVersionUID = 0;
+
+ private Class<? extends Annotation> initAnnotationType = Init.class;
+ private Class<? extends Annotation> destroyAnnotationType = Destroy.class;
+
+ /**
+ * Gets init annotation type.
+ */
+ protected Class<? extends Annotation> getInitAnnotationType() {
+ return this.initAnnotationType;
+ }
+
+ /**
+ * Sets init annotation type.
+ */
+ /*
+ * public void setInitAnnotationType(Class<? extends Annotation>
+ * initAnnotationType) { Assert.notNull(initAnnotationType,
+ * "Init annotation type must not be null."); this.initAnnotationType =
+ * initAnnotationType; }
+ */
+
+ /**
+ * Gets destroy annotation type.
+ */
+ protected Class<? extends Annotation> getDestroyAnnotationType() {
+ return this.destroyAnnotationType;
+ }
+
+ /**
+ * Sets destroy annotation type.
+ */
+ /*
+ * public void setDestroyAnnotationType(Class<? extends Annotation>
+ * destroyAnnotationType) { Assert.notNull(destroyAnnotationType,
+ * "Destroy annotation type must not be null."); this.destroyAnnotationType
+ * = destroyAnnotationType; }
+ */
+
+ public InitDestroyAnnotationProcessor() {
+ // Set the @Init annotation type
+ setInitAnnotationType(initAnnotationType);
+
+ // Set the @Destroy annotation type
+ setDestroyAnnotationType(destroyAnnotationType);
+ }
+}
diff --git a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyAnnotationProcessor.java b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyAnnotationProcessor.java
index d87ea5e4c7..f800654c34 100644
--- a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyAnnotationProcessor.java
+++ b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyAnnotationProcessor.java
@@ -1,161 +1,161 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring.processor;
-
-import java.beans.PropertyDescriptor;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
-import org.oasisopen.sca.annotation.Property;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.FatalBeanException;
-import org.springframework.beans.factory.config.BeanPostProcessor;
-import org.springframework.util.Assert;
-import org.springframework.util.ReflectionUtils;
-
-public class PropertyAnnotationProcessor implements BeanPostProcessor {
-
- private Class<? extends Annotation> propertyAnnotationType = Property.class;
-
- private PropertyValueStub propertyValue;
-
- public PropertyAnnotationProcessor (PropertyValueStub propertyValue) {
- this.propertyValue = propertyValue;
- }
-
- /**
- * Gets property annotation type.
- */
- protected Class<? extends Annotation> getPropertyAnnotationType() {
- return this.propertyAnnotationType;
- }
-
- /**
- * Sets property annotation type.
- */
- public void setPropertyAnnotationType(Class<? extends Annotation> propertyAnnotationType) {
- Assert.notNull(propertyAnnotationType, "'propertyAnnotationType' type must not be null.");
- this.propertyAnnotationType = propertyAnnotationType;
- }
-
- /**
- * This method is used to execute before a bean's initialization callback.
- *
- * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
- */
- public Object postProcessBeforeInitialization(Object bean, String beanName)
- throws BeansException {
- processAnnotation(bean);
- return bean;
- }
-
- /**
- * This method is used to execute after a bean's initialization callback.
- *
- * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
- */
- public Object postProcessAfterInitialization(Object bean, String beanName)
- throws BeansException {
- return bean;
- }
-
- /**
- * <p>Processes a beans fields for injection if it has a {@link Property} annotation.</p>
- */
- protected void processAnnotation(final Object bean) {
-
- final Class<?> clazz = bean.getClass();
-
- ReflectionUtils.doWithMethods(clazz, new ReflectionUtils.MethodCallback() {
- public void doWith(Method method) {
-
- Property annotation = (Property) method.getAnnotation(getPropertyAnnotationType());
-
- if (annotation != null) {
- if (Modifier.isStatic(method.getModifiers())) {
- throw new IllegalStateException("Property annotation is not supported on static methods");
- }
-
- if (Modifier.isPrivate(method.getModifiers())) {
- throw new IllegalStateException("Property annotation is not supported on private methods");
- }
-
- if (method.getParameterTypes().length == 0) {
- throw new IllegalStateException("Property annotation requires at least one argument: " + method);
- }
-
- PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
- if (pd != null) {
- String propName = annotation.name();
- if ("".equals(propName)) {
- injectProperty(bean, pd, propertyValue.getPropertyObj(pd.getPropertyType(), pd.getName()));
- } else {
- injectProperty(bean, pd, propertyValue.getPropertyObj(pd.getPropertyType(), propName));
- }
- }
- }
- }
- });
-
- ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() {
- public void doWith(Field field) {
-
- Property annotation = (Property) field.getAnnotation(getPropertyAnnotationType());
-
- if (annotation != null) {
- if (Modifier.isStatic(field.getModifiers())) {
- throw new IllegalStateException("Property annotation is not supported on static fields");
- }
-
- if (Modifier.isPrivate(field.getModifiers())) {
- throw new IllegalStateException("Property annotation is not supported on private fields");
- }
-
- ReflectionUtils.makeAccessible(field);
-
- Object propertyObj = null;
- String propName = annotation.name();
- if ("".equals(propName)) {
- propertyObj = propertyValue.getPropertyObj(field.getType(), field.getName());
- } else {
- propertyObj = propertyValue.getPropertyObj(field.getType(), propName);
- }
-
- if (propertyObj != null)
- ReflectionUtils.setField(field, bean, propertyObj);
- }
- }
- });
- }
-
- public void injectProperty(Object bean, PropertyDescriptor pd, Object propertyObj) {
-
- if (propertyObj != null) {
- try {
- pd.getWriteMethod().invoke(bean, new Object[] { propertyObj });
- } catch (Throwable e) {
- throw new FatalBeanException("Problem injecting property: " + e.getMessage(), e);
- }
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring.processor;
+
+import java.beans.PropertyDescriptor;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+
+import org.oasisopen.sca.annotation.Property;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.FatalBeanException;
+import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.util.Assert;
+import org.springframework.util.ReflectionUtils;
+
+public class PropertyAnnotationProcessor implements BeanPostProcessor {
+
+ private Class<? extends Annotation> propertyAnnotationType = Property.class;
+
+ private PropertyValueStub propertyValue;
+
+ public PropertyAnnotationProcessor (PropertyValueStub propertyValue) {
+ this.propertyValue = propertyValue;
+ }
+
+ /**
+ * Gets property annotation type.
+ */
+ protected Class<? extends Annotation> getPropertyAnnotationType() {
+ return this.propertyAnnotationType;
+ }
+
+ /**
+ * Sets property annotation type.
+ */
+ public void setPropertyAnnotationType(Class<? extends Annotation> propertyAnnotationType) {
+ Assert.notNull(propertyAnnotationType, "'propertyAnnotationType' type must not be null.");
+ this.propertyAnnotationType = propertyAnnotationType;
+ }
+
+ /**
+ * This method is used to execute before a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessBeforeInitialization(Object bean, String beanName)
+ throws BeansException {
+ processAnnotation(bean);
+ return bean;
+ }
+
+ /**
+ * This method is used to execute after a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessAfterInitialization(Object bean, String beanName)
+ throws BeansException {
+ return bean;
+ }
+
+ /**
+ * <p>Processes a beans fields for injection if it has a {@link Property} annotation.</p>
+ */
+ protected void processAnnotation(final Object bean) {
+
+ final Class<?> clazz = bean.getClass();
+
+ ReflectionUtils.doWithMethods(clazz, new ReflectionUtils.MethodCallback() {
+ public void doWith(Method method) {
+
+ Property annotation = (Property) method.getAnnotation(getPropertyAnnotationType());
+
+ if (annotation != null) {
+ if (Modifier.isStatic(method.getModifiers())) {
+ throw new IllegalStateException("Property annotation is not supported on static methods");
+ }
+
+ if (Modifier.isPrivate(method.getModifiers())) {
+ throw new IllegalStateException("Property annotation is not supported on private methods");
+ }
+
+ if (method.getParameterTypes().length == 0) {
+ throw new IllegalStateException("Property annotation requires at least one argument: " + method);
+ }
+
+ PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
+ if (pd != null) {
+ String propName = annotation.name();
+ if ("".equals(propName)) {
+ injectProperty(bean, pd, propertyValue.getPropertyObj(pd.getPropertyType(), pd.getName()));
+ } else {
+ injectProperty(bean, pd, propertyValue.getPropertyObj(pd.getPropertyType(), propName));
+ }
+ }
+ }
+ }
+ });
+
+ ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() {
+ public void doWith(Field field) {
+
+ Property annotation = (Property) field.getAnnotation(getPropertyAnnotationType());
+
+ if (annotation != null) {
+ if (Modifier.isStatic(field.getModifiers())) {
+ throw new IllegalStateException("Property annotation is not supported on static fields");
+ }
+
+ if (Modifier.isPrivate(field.getModifiers())) {
+ throw new IllegalStateException("Property annotation is not supported on private fields");
+ }
+
+ ReflectionUtils.makeAccessible(field);
+
+ Object propertyObj = null;
+ String propName = annotation.name();
+ if ("".equals(propName)) {
+ propertyObj = propertyValue.getPropertyObj(field.getType(), field.getName());
+ } else {
+ propertyObj = propertyValue.getPropertyObj(field.getType(), propName);
+ }
+
+ if (propertyObj != null)
+ ReflectionUtils.setField(field, bean, propertyObj);
+ }
+ }
+ });
+ }
+
+ public void injectProperty(Object bean, PropertyDescriptor pd, Object propertyObj) {
+
+ if (propertyObj != null) {
+ try {
+ pd.getWriteMethod().invoke(bean, new Object[] { propertyObj });
+ } catch (Throwable e) {
+ throw new FatalBeanException("Problem injecting property: " + e.getMessage(), e);
+ }
+ }
+ }
+
+}
diff --git a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyValueStub.java b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyValueStub.java
index bc222e622c..ea8f560ae1 100644
--- a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyValueStub.java
+++ b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/PropertyValueStub.java
@@ -1,55 +1,55 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.spring.processor;
-
-import java.lang.reflect.Method;
-
-/**
- * This is the Spring runtime side stub for the corresponding Tuscany tie class.
- * It enables the Tuscany code to invoke methods on a Spring context without
- * needing to know about any Spring classes. See the PropertyValueTie class
- * in the implementation-spring module for what the tie does.
- */
-public class PropertyValueStub {
-
- private Object tie;
- private Method getPropertyObj;
-
- public PropertyValueStub(Object tie) {
- this.tie = tie;
- Class<?> tieClass = tie.getClass();
- try {
- getPropertyObj = tieClass.getMethod("getPropertyObj", new Class<?>[]{Class.class, String.class});
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- public Object getPropertyObj(Class<?> propertyType, String name) {
- try {
-
- return getPropertyObj.invoke(tie, propertyType, name);
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.spring.processor;
+
+import java.lang.reflect.Method;
+
+/**
+ * This is the Spring runtime side stub for the corresponding Tuscany tie class.
+ * It enables the Tuscany code to invoke methods on a Spring context without
+ * needing to know about any Spring classes. See the PropertyValueTie class
+ * in the implementation-spring module for what the tie does.
+ */
+public class PropertyValueStub {
+
+ private Object tie;
+ private Method getPropertyObj;
+
+ public PropertyValueStub(Object tie) {
+ this.tie = tie;
+ Class<?> tieClass = tie.getClass();
+ try {
+ getPropertyObj = tieClass.getMethod("getPropertyObj", new Class<?>[]{Class.class, String.class});
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Object getPropertyObj(Class<?> propertyType, String name) {
+ try {
+
+ return getPropertyObj.invoke(tie, propertyType, name);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+}
diff --git a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ReferenceAnnotationProcessor.java b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ReferenceAnnotationProcessor.java
index 96b9622891..dd43d63d97 100644
--- a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ReferenceAnnotationProcessor.java
+++ b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/processor/ReferenceAnnotationProcessor.java
@@ -1,164 +1,164 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring.processor;
-
-import java.beans.PropertyDescriptor;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
-import org.oasisopen.sca.annotation.Reference;
-import org.springframework.beans.BeanUtils;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.FatalBeanException;
-import org.springframework.beans.factory.config.BeanPostProcessor;
-import org.springframework.util.Assert;
-import org.springframework.util.ReflectionUtils;
-
-public class ReferenceAnnotationProcessor implements BeanPostProcessor {
-
- private Class<? extends Annotation> referenceAnnotationType = Reference.class;
- private ComponentStub component;
-
- public ReferenceAnnotationProcessor (ComponentStub component) {
- this.component = component;
- }
-
- /**
- * Gets referece annotation type.
- */
- protected Class<? extends Annotation> getReferenceAnnotationType() {
- return this.referenceAnnotationType;
- }
-
- /**
- * Sets referece annotation type.
- */
- public void setReferenceAnnotationType(Class<? extends Annotation> referenceAnnotationType) {
- Assert.notNull(referenceAnnotationType, "'referenceAnnotationType' type must not be null.");
- this.referenceAnnotationType = referenceAnnotationType;
- }
-
- /**
- * This method is used to execute before a bean's initialization callback.
- *
- * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
- */
- public Object postProcessBeforeInitialization(Object bean, String beanName)
- throws BeansException {
- processAnnotation(bean);
- return bean;
- }
-
- /**
- * This method is used to execute after a bean's initialization callback.
- *
- * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
- */
- public Object postProcessAfterInitialization(Object bean, String beanName)
- throws BeansException {
- return bean;
- }
-
- /**
- * <p>Processes a beans fields for injection if it has a {@link Reference} annotation.</p>
- */
- protected void processAnnotation(final Object bean) {
-
- final Class<?> clazz = bean.getClass();
-
- ReflectionUtils.doWithMethods(clazz, new ReflectionUtils.MethodCallback() {
- public void doWith(Method method) {
-
- Reference annotation = (Reference) method.getAnnotation(getReferenceAnnotationType());
-
- if (annotation != null) {
- if (Modifier.isStatic(method.getModifiers())) {
- throw new IllegalStateException("Reference annotation is not supported on static methods");
- }
-
- if (Modifier.isPrivate(method.getModifiers())) {
- throw new IllegalStateException("Reference annotation is not supported on private methods");
- }
-
- if (method.getParameterTypes().length == 0) {
- throw new IllegalStateException("Reference annotation requires at least one argument: " + method);
- }
-
- PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
- if (pd != null) {
- String refName = annotation.name();
- if ("".equals(refName)) {
- injectReference(bean, pd, pd.getName());
- } else {
- injectReference(bean, pd, refName);
- }
- }
- }
- }
- });
-
- ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() {
- public void doWith(Field field) {
-
- Reference annotation = (Reference) field.getAnnotation(getReferenceAnnotationType());
-
- if (annotation != null) {
- if (Modifier.isStatic(field.getModifiers())) {
- throw new IllegalStateException("Reference annotation is not supported on static fields");
- }
-
- if (Modifier.isPrivate(field.getModifiers())) {
- throw new IllegalStateException("Reference annotation is not supported on private fields");
- }
-
- ReflectionUtils.makeAccessible(field);
-
- Object referenceObj = null;
- String refName = annotation.name();
- if ("".equals(refName)) {
- referenceObj = component.getService(field.getType(), field.getName());
- } else {
- referenceObj = component.getService(field.getType(), refName);
- }
-
- if (referenceObj != null)
- ReflectionUtils.setField(field, bean, referenceObj);
- }
- }
- });
- }
-
- /**
- * Processes a property descriptor to inject a service.
- */
- public void injectReference(Object bean, PropertyDescriptor pd, String name) {
-
- Object referenceObj = component.getService(pd.getPropertyType(), name);
-
- if (referenceObj != null) {
- try {
- pd.getWriteMethod().invoke(bean, new Object[] { referenceObj });
- } catch (Throwable e) {
- throw new FatalBeanException("Problem injecting reference: " + e.getMessage(), e);
- }
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring.processor;
+
+import java.beans.PropertyDescriptor;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+
+import org.oasisopen.sca.annotation.Reference;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.FatalBeanException;
+import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.util.Assert;
+import org.springframework.util.ReflectionUtils;
+
+public class ReferenceAnnotationProcessor implements BeanPostProcessor {
+
+ private Class<? extends Annotation> referenceAnnotationType = Reference.class;
+ private ComponentStub component;
+
+ public ReferenceAnnotationProcessor (ComponentStub component) {
+ this.component = component;
+ }
+
+ /**
+ * Gets referece annotation type.
+ */
+ protected Class<? extends Annotation> getReferenceAnnotationType() {
+ return this.referenceAnnotationType;
+ }
+
+ /**
+ * Sets referece annotation type.
+ */
+ public void setReferenceAnnotationType(Class<? extends Annotation> referenceAnnotationType) {
+ Assert.notNull(referenceAnnotationType, "'referenceAnnotationType' type must not be null.");
+ this.referenceAnnotationType = referenceAnnotationType;
+ }
+
+ /**
+ * This method is used to execute before a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessBeforeInitialization(Object bean, String beanName)
+ throws BeansException {
+ processAnnotation(bean);
+ return bean;
+ }
+
+ /**
+ * This method is used to execute after a bean's initialization callback.
+ *
+ * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessAfterInitialization(java.lang.Object, java.lang.String)
+ */
+ public Object postProcessAfterInitialization(Object bean, String beanName)
+ throws BeansException {
+ return bean;
+ }
+
+ /**
+ * <p>Processes a beans fields for injection if it has a {@link Reference} annotation.</p>
+ */
+ protected void processAnnotation(final Object bean) {
+
+ final Class<?> clazz = bean.getClass();
+
+ ReflectionUtils.doWithMethods(clazz, new ReflectionUtils.MethodCallback() {
+ public void doWith(Method method) {
+
+ Reference annotation = (Reference) method.getAnnotation(getReferenceAnnotationType());
+
+ if (annotation != null) {
+ if (Modifier.isStatic(method.getModifiers())) {
+ throw new IllegalStateException("Reference annotation is not supported on static methods");
+ }
+
+ if (Modifier.isPrivate(method.getModifiers())) {
+ throw new IllegalStateException("Reference annotation is not supported on private methods");
+ }
+
+ if (method.getParameterTypes().length == 0) {
+ throw new IllegalStateException("Reference annotation requires at least one argument: " + method);
+ }
+
+ PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
+ if (pd != null) {
+ String refName = annotation.name();
+ if ("".equals(refName)) {
+ injectReference(bean, pd, pd.getName());
+ } else {
+ injectReference(bean, pd, refName);
+ }
+ }
+ }
+ }
+ });
+
+ ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() {
+ public void doWith(Field field) {
+
+ Reference annotation = (Reference) field.getAnnotation(getReferenceAnnotationType());
+
+ if (annotation != null) {
+ if (Modifier.isStatic(field.getModifiers())) {
+ throw new IllegalStateException("Reference annotation is not supported on static fields");
+ }
+
+ if (Modifier.isPrivate(field.getModifiers())) {
+ throw new IllegalStateException("Reference annotation is not supported on private fields");
+ }
+
+ ReflectionUtils.makeAccessible(field);
+
+ Object referenceObj = null;
+ String refName = annotation.name();
+ if ("".equals(refName)) {
+ referenceObj = component.getService(field.getType(), field.getName());
+ } else {
+ referenceObj = component.getService(field.getType(), refName);
+ }
+
+ if (referenceObj != null)
+ ReflectionUtils.setField(field, bean, referenceObj);
+ }
+ }
+ });
+ }
+
+ /**
+ * Processes a property descriptor to inject a service.
+ */
+ public void injectReference(Object bean, PropertyDescriptor pd, String name) {
+
+ Object referenceObj = component.getService(pd.getPropertyType(), name);
+
+ if (referenceObj != null) {
+ try {
+ pd.getWriteMethod().invoke(bean, new Object[] { referenceObj });
+ } catch (Throwable e) {
+ throw new FatalBeanException("Problem injecting reference: " + e.getMessage(), e);
+ }
+ }
+ }
+}
diff --git a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SCAParentApplicationContext.java b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SCAParentApplicationContext.java
index b93874a9f3..184a147f51 100644
--- a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SCAParentApplicationContext.java
+++ b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SCAParentApplicationContext.java
@@ -1,190 +1,190 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring.runtime.context;
-
-import java.io.IOException;
-import java.util.Locale;
-import java.util.Map;
-
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.beans.factory.NoSuchBeanDefinitionException;
-import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationEvent;
-import org.springframework.context.MessageSourceResolvable;
-import org.springframework.context.NoSuchMessageException;
-import org.springframework.core.io.Resource;
-
-/**
- * A Spring ParentApplicationContext for a given Spring Implementation
- *
- * The Parent application context is responsible for handling those entities within a Spring
- * application context that actually belong to SCA rather than to Spring. The principal things
- * are Properties and References. These may be present either through explicit <sca:property/>
- * and <sca:reference/> elements in the application context or they may be implicit through
- * unresolved Spring bean <property.../> elements. In either case, it is the Parent application
- * context that must provide Spring beans that correspond to the property or reference, as derived
- * from the SCA composite in which the Spring application context is an implementation.
- *
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-class SCAParentApplicationContext implements ApplicationContext {
-
- // The Spring implementation for which this is the parent application context
- private SpringImplementationStub implementation;
-
- private static final String[] EMPTY_ARRAY = new String[0];
-
- public SCAParentApplicationContext(SpringImplementationStub implementation) {
- this.implementation = implementation;
- } // end constructor
-
- public Object getBean(String name) throws BeansException {
- return getBean(name, (Class) null);
- }
-
- /**
- * Get a Bean for a reference or for a property.
- *
- * @param name - the name of the Bean required
- * @param requiredType - the required type of the Bean (either a Java class or a Java interface)
- * @return Object - a Bean which matches the requested bean
- */
- public Object getBean(String name, Class requiredType) throws BeansException {
- return implementation.getBean(name, requiredType);
- } // end method getBean( String, Class )
-
- public Object getBean(String name, Object[] args) throws BeansException {
- return getBean(name, ((Class)null));
- }
-
- public boolean containsBean(String name) {
- // TODO
- System.out.println("Spring parent context - containsBean called for name: " + name);
- return false;
- }
-
- public boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
- // TODO
- return false;
- }
-
- public boolean isTypeMatch(String name, Class targetType) throws NoSuchBeanDefinitionException {
- throw new UnsupportedOperationException();
- }
-
- public Class getType(String name) throws NoSuchBeanDefinitionException {
- return null;
- }
-
- public String[] getAliases(String name) throws NoSuchBeanDefinitionException {
- return EMPTY_ARRAY;
- }
-
- public ApplicationContext getParent() {
- return null;
- }
-
- public AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws IllegalStateException {
- return null;
- }
-
- public String getId() {
- return this.toString();
- }
-
- public String getDisplayName() {
- return implementation.getURI();
- }
-
- public long getStartupDate() {
- return 0;
- }
-
- public boolean containsBeanDefinition(String beanName) {
- return false;
- }
-
- public int getBeanDefinitionCount() {
- return 0;
- }
-
- public String[] getBeanDefinitionNames() {
- return new String[0];
- }
-
- public String[] getBeanNamesForType(Class type) {
- return new String[0];
- }
-
- public String[] getBeanNamesForType(Class type, boolean includePrototypes, boolean includeFactoryBeans) {
- return new String[0];
- }
-
- public Map getBeansOfType(Class type) throws BeansException {
- return null;
- }
-
- public Map getBeansOfType(Class type, boolean includePrototypes, boolean includeFactoryBeans) throws BeansException {
- return null;
- }
-
- public boolean isPrototype(String theString) {
- return false;
- }
-
- public BeanFactory getParentBeanFactory() {
- return null;
- }
-
- public boolean containsLocalBean(String name) {
- return false;
- }
-
- public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) {
- return null;
- }
-
- public String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException {
- return null;
- }
-
- public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException {
- return null;
- }
-
- public void publishEvent(ApplicationEvent event) {
-
- }
-
- public Resource[] getResources(String locationPattern) throws IOException {
- return new Resource[0];
- }
-
- public Resource getResource(String location) {
- return null;
- }
-
- public ClassLoader getClassLoader() {
- // REVIEW: this is almost certainly flawed, but it's not clear how the SCA runtime's
- // resource loading mechanism is exposed right now.
- return this.getClass().getClassLoader();
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring.runtime.context;
+
+import java.io.IOException;
+import java.util.Locale;
+import java.util.Map;
+
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationEvent;
+import org.springframework.context.MessageSourceResolvable;
+import org.springframework.context.NoSuchMessageException;
+import org.springframework.core.io.Resource;
+
+/**
+ * A Spring ParentApplicationContext for a given Spring Implementation
+ *
+ * The Parent application context is responsible for handling those entities within a Spring
+ * application context that actually belong to SCA rather than to Spring. The principal things
+ * are Properties and References. These may be present either through explicit <sca:property/>
+ * and <sca:reference/> elements in the application context or they may be implicit through
+ * unresolved Spring bean <property.../> elements. In either case, it is the Parent application
+ * context that must provide Spring beans that correspond to the property or reference, as derived
+ * from the SCA composite in which the Spring application context is an implementation.
+ *
+ * @version $Rev$ $Date$
+ */
+class SCAParentApplicationContext implements ApplicationContext {
+
+ // The Spring implementation for which this is the parent application context
+ private SpringImplementationStub implementation;
+
+ private static final String[] EMPTY_ARRAY = new String[0];
+
+ public SCAParentApplicationContext(SpringImplementationStub implementation) {
+ this.implementation = implementation;
+ } // end constructor
+
+ public Object getBean(String name) throws BeansException {
+ return getBean(name, (Class) null);
+ }
+
+ /**
+ * Get a Bean for a reference or for a property.
+ *
+ * @param name - the name of the Bean required
+ * @param requiredType - the required type of the Bean (either a Java class or a Java interface)
+ * @return Object - a Bean which matches the requested bean
+ */
+ public Object getBean(String name, Class requiredType) throws BeansException {
+ return implementation.getBean(name, requiredType);
+ } // end method getBean( String, Class )
+
+ public Object getBean(String name, Object[] args) throws BeansException {
+ return getBean(name, ((Class)null));
+ }
+
+ public boolean containsBean(String name) {
+ // TODO
+ System.out.println("Spring parent context - containsBean called for name: " + name);
+ return false;
+ }
+
+ public boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
+ // TODO
+ return false;
+ }
+
+ public boolean isTypeMatch(String name, Class targetType) throws NoSuchBeanDefinitionException {
+ throw new UnsupportedOperationException();
+ }
+
+ public Class getType(String name) throws NoSuchBeanDefinitionException {
+ return null;
+ }
+
+ public String[] getAliases(String name) throws NoSuchBeanDefinitionException {
+ return EMPTY_ARRAY;
+ }
+
+ public ApplicationContext getParent() {
+ return null;
+ }
+
+ public AutowireCapableBeanFactory getAutowireCapableBeanFactory() throws IllegalStateException {
+ return null;
+ }
+
+ public String getId() {
+ return this.toString();
+ }
+
+ public String getDisplayName() {
+ return implementation.getURI();
+ }
+
+ public long getStartupDate() {
+ return 0;
+ }
+
+ public boolean containsBeanDefinition(String beanName) {
+ return false;
+ }
+
+ public int getBeanDefinitionCount() {
+ return 0;
+ }
+
+ public String[] getBeanDefinitionNames() {
+ return new String[0];
+ }
+
+ public String[] getBeanNamesForType(Class type) {
+ return new String[0];
+ }
+
+ public String[] getBeanNamesForType(Class type, boolean includePrototypes, boolean includeFactoryBeans) {
+ return new String[0];
+ }
+
+ public Map getBeansOfType(Class type) throws BeansException {
+ return null;
+ }
+
+ public Map getBeansOfType(Class type, boolean includePrototypes, boolean includeFactoryBeans) throws BeansException {
+ return null;
+ }
+
+ public boolean isPrototype(String theString) {
+ return false;
+ }
+
+ public BeanFactory getParentBeanFactory() {
+ return null;
+ }
+
+ public boolean containsLocalBean(String name) {
+ return false;
+ }
+
+ public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) {
+ return null;
+ }
+
+ public String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException {
+ return null;
+ }
+
+ public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException {
+ return null;
+ }
+
+ public void publishEvent(ApplicationEvent event) {
+
+ }
+
+ public Resource[] getResources(String locationPattern) throws IOException {
+ return new Resource[0];
+ }
+
+ public Resource getResource(String location) {
+ return null;
+ }
+
+ public ClassLoader getClassLoader() {
+ // REVIEW: this is almost certainly flawed, but it's not clear how the SCA runtime's
+ // resource loading mechanism is exposed right now.
+ return this.getClass().getClassLoader();
+ }
+}
diff --git a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
index d2f615e030..3c36b04ba8 100644
--- a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
+++ b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringContextTie.java
@@ -1,168 +1,168 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.spring.runtime.context;
-
-import java.net.URL;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.tuscany.sca.implementation.spring.processor.ComponentNameAnnotationProcessor;
-import org.apache.tuscany.sca.implementation.spring.processor.ComponentStub;
-import org.apache.tuscany.sca.implementation.spring.processor.ConstructorAnnotationProcessor;
-import org.apache.tuscany.sca.implementation.spring.processor.InitDestroyAnnotationProcessor;
-import org.apache.tuscany.sca.implementation.spring.processor.PropertyAnnotationProcessor;
-import org.apache.tuscany.sca.implementation.spring.processor.PropertyValueStub;
-import org.apache.tuscany.sca.implementation.spring.processor.ReferenceAnnotationProcessor;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.config.BeanPostProcessor;
-import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
-import org.springframework.beans.factory.config.ConstructorArgumentValues;
-import org.springframework.beans.factory.config.TypedStringValue;
-import org.springframework.beans.factory.support.ManagedList;
-import org.springframework.beans.factory.xml.XmlBeanFactory;
-import org.springframework.context.support.AbstractApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.context.support.FileSystemXmlApplicationContext;
-import org.springframework.context.support.GenericApplicationContext;
-import org.springframework.core.io.UrlResource;
-
-/**
- * This is the runtime side tie for the corresponding tuscany side stub class.
- * It enables the Tuscany code to invoke methods on a Spring context without
- * needing to know about any Spring classes. See the SpringContextStub class
- * in the implementation-spring module for what the stub does.
- */
-public class SpringContextTie {
-
- private AbstractApplicationContext springContext;
- private SpringImplementationStub implementation;
-
- public SpringContextTie(SpringImplementationStub implementation, URL resource) {
- this.implementation = implementation;
- SCAParentApplicationContext scaParentContext = new SCAParentApplicationContext(implementation);
- springContext = createApplicationContext(scaParentContext, resource);
- }
-
- public void start() {
- // Do refresh here to ensure that Spring Beans are not touched before the SCA config process is complete...
- springContext.refresh();
- springContext.start();
- }
-
- public void close() {
- springContext.close();
- if (springContext instanceof GenericApplicationContext) {
- springContext.stop();
- }
- }
-
- /**
- * Include BeanPostProcessor to deal with SCA Annotations in Spring Bean
- */
-// private Object createApplicationContext(SCAParentApplicationContext scaParentContext) {
-
- private AbstractApplicationContext createApplicationContext(SCAParentApplicationContext scaParentContext, URL resource) {
-
- XmlBeanFactory beanFactory = new XmlBeanFactory(new UrlResource(resource));
- AbstractApplicationContext appContext = null;
-
- for (String bean : beanFactory.getBeanDefinitionNames()) {
- String beanClassName = (beanFactory.getType(bean)).getName();
- if (beanClassName.indexOf(".ClassPathXmlApplicationContext") != -1 ||
- beanClassName.indexOf(".FileSystemXmlApplicationContext") != -1)
- {
- BeanDefinition beanDef = beanFactory.getBeanDefinition(bean);
- String[] listValues = null;
- List<ConstructorArgumentValues.ValueHolder> conArgs =
- beanDef.getConstructorArgumentValues().getGenericArgumentValues();
- for (ConstructorArgumentValues.ValueHolder conArg : conArgs) {
- if (conArg.getValue() instanceof TypedStringValue) {
- TypedStringValue value = (TypedStringValue) conArg.getValue();
- if (value.getValue().indexOf(".xml") != -1)
- listValues = new String[]{value.getValue()};
- }
- if (conArg.getValue() instanceof ManagedList) {
- Iterator itml = ((ManagedList)conArg.getValue()).iterator();
- StringBuffer values = new StringBuffer();
- while (itml.hasNext()) {
- TypedStringValue next = (TypedStringValue)itml.next();
- if (next.getValue().indexOf(".xml") != -1) {
- values.append(next.getValue());
- values.append("~");
- }
- }
- listValues = (values.toString()).split("~");
- }
- }
-
- if (beanClassName.indexOf(".ClassPathXmlApplicationContext") != -1) {
- appContext = new ClassPathXmlApplicationContext(listValues, false, scaParentContext);
- appContext.refresh(); // TODO why is this needed here now?
- includeAnnotationProcessors(appContext.getBeanFactory());
- return appContext;
- } else {
- appContext = new FileSystemXmlApplicationContext(listValues, false, scaParentContext);
- appContext.refresh(); // TODO why is this needed here now?
- includeAnnotationProcessors(appContext.getBeanFactory());
- return appContext;
- }
- }
- }
-
- // use the generic application context as default
- includeAnnotationProcessors(beanFactory);
- appContext = new GenericApplicationContext(beanFactory, scaParentContext);
- return appContext;
- }
-
- public Object getBean(String id) throws BeansException {
- return springContext.getBean(id);
- }
-
- /**
- * Include BeanPostProcessor to deal with SCA Annotations in Spring Bean
- */
- private void includeAnnotationProcessors(ConfigurableListableBeanFactory beanFactory) {
-
- // Processor to deal with @Init and @Destroy SCA Annotations
- BeanPostProcessor initDestroyProcessor = new InitDestroyAnnotationProcessor();
- beanFactory.addBeanPostProcessor(initDestroyProcessor);
-
- // Processor to deal with @Reference SCA Annotations
- ComponentStub component = new ComponentStub(implementation.getComponentTie());
- BeanPostProcessor referenceProcessor = new ReferenceAnnotationProcessor(component);
- beanFactory.addBeanPostProcessor(referenceProcessor);
-
- // Processor to deal with @Property SCA Annotations
- PropertyValueStub pvs = new PropertyValueStub(implementation.getPropertyValueTie());
- BeanPostProcessor propertyProcessor = new PropertyAnnotationProcessor(pvs);
- beanFactory.addBeanPostProcessor(propertyProcessor);
-
- // Processor to deal with @ComponentName SCA Annotations
- BeanPostProcessor componentNameProcessor = new ComponentNameAnnotationProcessor(implementation.getComponentName());
- beanFactory.addBeanPostProcessor(componentNameProcessor);
-
- // Processor to deal with @Constructor SCA Annotations
- BeanPostProcessor constructorProcessor = new ConstructorAnnotationProcessor();
- beanFactory.addBeanPostProcessor(constructorProcessor);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.spring.runtime.context;
+
+import java.net.URL;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.tuscany.sca.implementation.spring.processor.ComponentNameAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.ComponentStub;
+import org.apache.tuscany.sca.implementation.spring.processor.ConstructorAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.InitDestroyAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.PropertyAnnotationProcessor;
+import org.apache.tuscany.sca.implementation.spring.processor.PropertyValueStub;
+import org.apache.tuscany.sca.implementation.spring.processor.ReferenceAnnotationProcessor;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.config.BeanPostProcessor;
+import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
+import org.springframework.beans.factory.config.ConstructorArgumentValues;
+import org.springframework.beans.factory.config.TypedStringValue;
+import org.springframework.beans.factory.support.ManagedList;
+import org.springframework.beans.factory.xml.XmlBeanFactory;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.context.support.FileSystemXmlApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.core.io.UrlResource;
+
+/**
+ * This is the runtime side tie for the corresponding tuscany side stub class.
+ * It enables the Tuscany code to invoke methods on a Spring context without
+ * needing to know about any Spring classes. See the SpringContextStub class
+ * in the implementation-spring module for what the stub does.
+ */
+public class SpringContextTie {
+
+ private AbstractApplicationContext springContext;
+ private SpringImplementationStub implementation;
+
+ public SpringContextTie(SpringImplementationStub implementation, URL resource) {
+ this.implementation = implementation;
+ SCAParentApplicationContext scaParentContext = new SCAParentApplicationContext(implementation);
+ springContext = createApplicationContext(scaParentContext, resource);
+ }
+
+ public void start() {
+ // Do refresh here to ensure that Spring Beans are not touched before the SCA config process is complete...
+ springContext.refresh();
+ springContext.start();
+ }
+
+ public void close() {
+ springContext.close();
+ if (springContext instanceof GenericApplicationContext) {
+ springContext.stop();
+ }
+ }
+
+ /**
+ * Include BeanPostProcessor to deal with SCA Annotations in Spring Bean
+ */
+// private Object createApplicationContext(SCAParentApplicationContext scaParentContext) {
+
+ private AbstractApplicationContext createApplicationContext(SCAParentApplicationContext scaParentContext, URL resource) {
+
+ XmlBeanFactory beanFactory = new XmlBeanFactory(new UrlResource(resource));
+ AbstractApplicationContext appContext = null;
+
+ for (String bean : beanFactory.getBeanDefinitionNames()) {
+ String beanClassName = (beanFactory.getType(bean)).getName();
+ if (beanClassName.indexOf(".ClassPathXmlApplicationContext") != -1 ||
+ beanClassName.indexOf(".FileSystemXmlApplicationContext") != -1)
+ {
+ BeanDefinition beanDef = beanFactory.getBeanDefinition(bean);
+ String[] listValues = null;
+ List<ConstructorArgumentValues.ValueHolder> conArgs =
+ beanDef.getConstructorArgumentValues().getGenericArgumentValues();
+ for (ConstructorArgumentValues.ValueHolder conArg : conArgs) {
+ if (conArg.getValue() instanceof TypedStringValue) {
+ TypedStringValue value = (TypedStringValue) conArg.getValue();
+ if (value.getValue().indexOf(".xml") != -1)
+ listValues = new String[]{value.getValue()};
+ }
+ if (conArg.getValue() instanceof ManagedList) {
+ Iterator itml = ((ManagedList)conArg.getValue()).iterator();
+ StringBuffer values = new StringBuffer();
+ while (itml.hasNext()) {
+ TypedStringValue next = (TypedStringValue)itml.next();
+ if (next.getValue().indexOf(".xml") != -1) {
+ values.append(next.getValue());
+ values.append("~");
+ }
+ }
+ listValues = (values.toString()).split("~");
+ }
+ }
+
+ if (beanClassName.indexOf(".ClassPathXmlApplicationContext") != -1) {
+ appContext = new ClassPathXmlApplicationContext(listValues, false, scaParentContext);
+ appContext.refresh(); // TODO why is this needed here now?
+ includeAnnotationProcessors(appContext.getBeanFactory());
+ return appContext;
+ } else {
+ appContext = new FileSystemXmlApplicationContext(listValues, false, scaParentContext);
+ appContext.refresh(); // TODO why is this needed here now?
+ includeAnnotationProcessors(appContext.getBeanFactory());
+ return appContext;
+ }
+ }
+ }
+
+ // use the generic application context as default
+ includeAnnotationProcessors(beanFactory);
+ appContext = new GenericApplicationContext(beanFactory, scaParentContext);
+ return appContext;
+ }
+
+ public Object getBean(String id) throws BeansException {
+ return springContext.getBean(id);
+ }
+
+ /**
+ * Include BeanPostProcessor to deal with SCA Annotations in Spring Bean
+ */
+ private void includeAnnotationProcessors(ConfigurableListableBeanFactory beanFactory) {
+
+ // Processor to deal with @Init and @Destroy SCA Annotations
+ BeanPostProcessor initDestroyProcessor = new InitDestroyAnnotationProcessor();
+ beanFactory.addBeanPostProcessor(initDestroyProcessor);
+
+ // Processor to deal with @Reference SCA Annotations
+ ComponentStub component = new ComponentStub(implementation.getComponentTie());
+ BeanPostProcessor referenceProcessor = new ReferenceAnnotationProcessor(component);
+ beanFactory.addBeanPostProcessor(referenceProcessor);
+
+ // Processor to deal with @Property SCA Annotations
+ PropertyValueStub pvs = new PropertyValueStub(implementation.getPropertyValueTie());
+ BeanPostProcessor propertyProcessor = new PropertyAnnotationProcessor(pvs);
+ beanFactory.addBeanPostProcessor(propertyProcessor);
+
+ // Processor to deal with @ComponentName SCA Annotations
+ BeanPostProcessor componentNameProcessor = new ComponentNameAnnotationProcessor(implementation.getComponentName());
+ beanFactory.addBeanPostProcessor(componentNameProcessor);
+
+ // Processor to deal with @Constructor SCA Annotations
+ BeanPostProcessor constructorProcessor = new ConstructorAnnotationProcessor();
+ beanFactory.addBeanPostProcessor(constructorProcessor);
+ }
+
+}
diff --git a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringImplementationStub.java b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringImplementationStub.java
index 3139c9c500..abf9d55e86 100644
--- a/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringImplementationStub.java
+++ b/java/sca/modules/implementation-spring-sca/src/main/java/org/apache/tuscany/sca/implementation/spring/runtime/context/SpringImplementationStub.java
@@ -1,117 +1,117 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.spring.runtime.context;
-
-import java.lang.reflect.Method;
-
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.NoSuchBeanDefinitionException;
-
-/**
- * This is the runtime side stub for the corresponding Tuscany-side stub class.
- * It enables the Spring code in the runtime module to invoke methods on a
- * Tuscany SpringImplementation without the Spring runtime module
- * needing to know about any Tuscany classes. See the SpringImplementationTie class
- * in the implementation-spring module for what the tie does.
- */
-public class SpringImplementationStub {
-
- Object tie;
- Method getURI;
- Method getBean;
- Method getComponentName;
- Method getComponentTie;
- Method getPropertyValueTie;
-
- public SpringImplementationStub(Object tie) {
- this.tie = tie;
- Class<?> tieClass = tie.getClass();
- try {
- getURI = tieClass.getMethod("getURI", new Class<?>[]{});
- getBean = tieClass.getMethod("getBean", new Class<?>[]{String.class, Class.class});
- getComponentName = tieClass.getMethod("getComponentName");
- getComponentTie = tieClass.getMethod("getComponentTie");
- getPropertyValueTie = tieClass.getMethod("getPropertyValueTie");
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- public String getURI() {
- try {
-
- return (String)getURI.invoke(tie);
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Get a Bean for a reference or for a property.
- *
- * @param name - the name of the Bean required
- * @param requiredType - the required type of the Bean (either a Java class or a Java interface)
- * @return Object - a Bean which matches the requested bean
- */
- public Object getBean(String name, Class<?> requiredType) throws BeansException {
- try {
-
- Object bean = getBean.invoke(tie, new Object[] {name, requiredType});
- if (bean == null) {
- throw new NoSuchBeanDefinitionException("Unable to find Bean with name " + name);
- }
- return bean;
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- public String getComponentName() {
- try {
-
- return (String)getComponentName.invoke(tie);
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- public Object getComponentTie() {
- try {
-
- return getComponentTie.invoke(tie);
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- public Object getPropertyValueTie() {
- try {
-
- return getPropertyValueTie.invoke(tie);
-
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.spring.runtime.context;
+
+import java.lang.reflect.Method;
+
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+
+/**
+ * This is the runtime side stub for the corresponding Tuscany-side stub class.
+ * It enables the Spring code in the runtime module to invoke methods on a
+ * Tuscany SpringImplementation without the Spring runtime module
+ * needing to know about any Tuscany classes. See the SpringImplementationTie class
+ * in the implementation-spring module for what the tie does.
+ */
+public class SpringImplementationStub {
+
+ Object tie;
+ Method getURI;
+ Method getBean;
+ Method getComponentName;
+ Method getComponentTie;
+ Method getPropertyValueTie;
+
+ public SpringImplementationStub(Object tie) {
+ this.tie = tie;
+ Class<?> tieClass = tie.getClass();
+ try {
+ getURI = tieClass.getMethod("getURI", new Class<?>[]{});
+ getBean = tieClass.getMethod("getBean", new Class<?>[]{String.class, Class.class});
+ getComponentName = tieClass.getMethod("getComponentName");
+ getComponentTie = tieClass.getMethod("getComponentTie");
+ getPropertyValueTie = tieClass.getMethod("getPropertyValueTie");
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public String getURI() {
+ try {
+
+ return (String)getURI.invoke(tie);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ * Get a Bean for a reference or for a property.
+ *
+ * @param name - the name of the Bean required
+ * @param requiredType - the required type of the Bean (either a Java class or a Java interface)
+ * @return Object - a Bean which matches the requested bean
+ */
+ public Object getBean(String name, Class<?> requiredType) throws BeansException {
+ try {
+
+ Object bean = getBean.invoke(tie, new Object[] {name, requiredType});
+ if (bean == null) {
+ throw new NoSuchBeanDefinitionException("Unable to find Bean with name " + name);
+ }
+ return bean;
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public String getComponentName() {
+ try {
+
+ return (String)getComponentName.invoke(tie);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Object getComponentTie() {
+ try {
+
+ return getComponentTie.invoke(tie);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Object getPropertyValueTie() {
+ try {
+
+ return getPropertyValueTie.invoke(tie);
+
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
diff --git a/java/sca/modules/implementation-spring-sca/src/main/resources/org/springframework/sca/xml/spring-sca.xsd b/java/sca/modules/implementation-spring-sca/src/main/resources/org/springframework/sca/xml/spring-sca.xsd
index 3ac14e3e58..dfa0b931f6 100644
--- a/java/sca/modules/implementation-spring-sca/src/main/resources/org/springframework/sca/xml/spring-sca.xsd
+++ b/java/sca/modules/implementation-spring-sca/src/main/resources/org/springframework/sca/xml/spring-sca.xsd
@@ -1,84 +1,84 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<xsd:schema xmlns="http://www.springframework.org/schema/sca" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- attributeFormDefault="unqualified" elementFormDefault="qualified"
- targetNamespace="http://www.springframework.org/schema/sca">
-
- <xsd:element name="reference">
- <xsd:complexType>
- <xsd:attribute name="name" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="type" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="default" use="optional">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="property">
- <xsd:complexType>
- <xsd:attribute name="id" use="optional">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="name" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="type" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="service">
- <xsd:complexType>
- <xsd:attribute name="name" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="type" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="target" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string" />
- </xsd:simpleType>
- </xsd:attribute>
- </xsd:complexType>
- </xsd:element>
-
-</xsd:schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<xsd:schema xmlns="http://www.springframework.org/schema/sca" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ attributeFormDefault="unqualified" elementFormDefault="qualified"
+ targetNamespace="http://www.springframework.org/schema/sca">
+
+ <xsd:element name="reference">
+ <xsd:complexType>
+ <xsd:attribute name="name" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="type" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="default" use="optional">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="property">
+ <xsd:complexType>
+ <xsd:attribute name="id" use="optional">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="name" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="type" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="service">
+ <xsd:complexType>
+ <xsd:attribute name="name" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="type" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ <xsd:attribute name="target" use="required">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string" />
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+
+</xsd:schema>
diff --git a/java/sca/modules/implementation-spring/pom.xml b/java/sca/modules/implementation-spring/pom.xml
index d02c5bffaa..1e84fc0156 100644
--- a/java/sca/modules/implementation-spring/pom.xml
+++ b/java/sca/modules/implementation-spring/pom.xml
@@ -1,74 +1,74 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-implementation-spring</artifactId>
- <name>Apache Tuscany SCA Spring Implementation Model</name>
-
- <dependencies>
-
- <!-- **************************************** -->
- <!-- * * -->
- <!-- * DONT ADD ANY SPRING DEPENDENCIES!!! * -->
- <!-- * * -->
- <!-- * See the README for details why not * -->
- <!-- * * -->
- <!-- * * -->
- <!-- **************************************** -->
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-interface</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-implementation-spring</artifactId>
+ <name>Apache Tuscany SCA Spring Implementation Model</name>
+
+ <dependencies>
+
+ <!-- **************************************** -->
+ <!-- * * -->
+ <!-- * DONT ADD ANY SPRING DEPENDENCIES!!! * -->
+ <!-- * * -->
+ <!-- * See the README for details why not * -->
+ <!-- * * -->
+ <!-- * * -->
+ <!-- **************************************** -->
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-interface</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xml</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+</project>
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringBeanElement.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringBeanElement.java
index 86902e5104..f098e2d78e 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringBeanElement.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringBeanElement.java
@@ -1,76 +1,76 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Represents a <bean> element in a Spring application-context
- * - this has id and className attributes
- * - plus zero or more property elements as children
- *
- * @version $Rev: 512919 $ $Date: 2007-02-28 19:32:56 +0000 (Wed, 28 Feb 2007) $
- */
-public class SpringBeanElement {
-
- private String id;
- private String className;
- private boolean innerBean = false;
- private List<SpringPropertyElement> properties = new ArrayList<SpringPropertyElement>();
- private List<SpringConstructorArgElement> constructorargs = new ArrayList<SpringConstructorArgElement>();
-
- public SpringBeanElement(String id, String className) {
- this.id = id;
- this.className = className;
- }
-
- public String getClassName() {
- return className;
- }
-
- public String getId() {
- return id;
- }
-
- public List<SpringPropertyElement> getProperties() {
- return properties;
- }
-
- public void addProperty(SpringPropertyElement property) {
- properties.add(property);
- }
-
- public List<SpringConstructorArgElement> getCustructorArgs() {
- return constructorargs;
- }
-
- public void addCustructorArgs(SpringConstructorArgElement args) {
- constructorargs.add(args);
- }
-
- public boolean isInnerBean() {
- return innerBean;
- }
-
- public void setInnerBean(boolean innerBean) {
- this.innerBean = innerBean;
- }
-
-} // end class SpringBeanElement
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Represents a <bean> element in a Spring application-context
+ * - this has id and className attributes
+ * - plus zero or more property elements as children
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringBeanElement {
+
+ private String id;
+ private String className;
+ private boolean innerBean = false;
+ private List<SpringPropertyElement> properties = new ArrayList<SpringPropertyElement>();
+ private List<SpringConstructorArgElement> constructorargs = new ArrayList<SpringConstructorArgElement>();
+
+ public SpringBeanElement(String id, String className) {
+ this.id = id;
+ this.className = className;
+ }
+
+ public String getClassName() {
+ return className;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public List<SpringPropertyElement> getProperties() {
+ return properties;
+ }
+
+ public void addProperty(SpringPropertyElement property) {
+ properties.add(property);
+ }
+
+ public List<SpringConstructorArgElement> getCustructorArgs() {
+ return constructorargs;
+ }
+
+ public void addCustructorArgs(SpringConstructorArgElement args) {
+ constructorargs.add(args);
+ }
+
+ public boolean isInnerBean() {
+ return innerBean;
+ }
+
+ public void setInnerBean(boolean innerBean) {
+ this.innerBean = innerBean;
+ }
+
+} // end class SpringBeanElement
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringConstructorArgElement.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringConstructorArgElement.java
index b644a69c15..88dbaaf119 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringConstructorArgElement.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringConstructorArgElement.java
@@ -1,78 +1,78 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Represents a <constructor-arg> element in a Spring application-context
- * - this has ref attribute
- *
- * @version $Rev: 512919 $ $Date: 2007-02-28 19:32:56 +0000 (Wed, 28 Feb 2007) $
- */
-public class SpringConstructorArgElement {
-
- private String ref;
- private String type;
- private int autoIndex = -1;
- private int index = -1;
- private List<String> values = new ArrayList<String>();
-
- public SpringConstructorArgElement(String ref, String type) {
- this.ref = ref;
- this.type = type;
- }
-
- public String getType() {
- return this.type;
- }
-
- public String getRef() {
- return this.ref;
- }
-
- public void setRef(String ref) {
- this.ref = ref;
- }
-
- public int getIndex() {
- return this.index;
- }
-
- public void setIndex(int index) {
- this.index = index;
- }
-
- public int getAutoIndex() {
- return this.autoIndex;
- }
-
- public void setAutoIndex(int index) {
- this.autoIndex = index;
- }
-
- public List<String> getValues() {
- return this.values;
- }
-
- public void addValue(String value) {
- this.values.add(value);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Represents a <constructor-arg> element in a Spring application-context
+ * - this has ref attribute
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringConstructorArgElement {
+
+ private String ref;
+ private String type;
+ private int autoIndex = -1;
+ private int index = -1;
+ private List<String> values = new ArrayList<String>();
+
+ public SpringConstructorArgElement(String ref, String type) {
+ this.ref = ref;
+ this.type = type;
+ }
+
+ public String getType() {
+ return this.type;
+ }
+
+ public String getRef() {
+ return this.ref;
+ }
+
+ public void setRef(String ref) {
+ this.ref = ref;
+ }
+
+ public int getIndex() {
+ return this.index;
+ }
+
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+ public int getAutoIndex() {
+ return this.autoIndex;
+ }
+
+ public void setAutoIndex(int index) {
+ this.autoIndex = index;
+ }
+
+ public List<String> getValues() {
+ return this.values;
+ }
+
+ public void addValue(String value) {
+ this.values.add(value);
+ }
+}
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java
index 72ad5adb61..0df04457fb 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementation.java
@@ -1,220 +1,220 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring;
-
-import java.net.URL;
-import java.util.Hashtable;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Extensible;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.builder.ComponentPreProcessor;
-import org.apache.tuscany.sca.assembly.impl.ImplementationImpl;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-
-/**
- * Represents a Spring implementation.
- *
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class SpringImplementation extends ImplementationImpl implements Implementation, ComponentPreProcessor, Extensible {
- private final static QName TYPE = new QName(SCA11_NS, "implementation.spring");
- // The location attribute which points to the Spring application-context XML file
- private String location;
- // The application-context file as a Spring Resource
- private URL resource;
- private ComponentType componentType;
- // Mapping of Services to Beans
- private Hashtable<String, SpringBeanElement> serviceMap;
- // Mapping of property names to Java class
- private Hashtable<String, Class<?>> propertyMap;
- // List of unresolved bean property references
- private Hashtable<String, Reference> unresolvedBeanRef;
-
- public SpringImplementation() {
- super(TYPE);
- this.location = null;
- this.resource = null;
- setUnresolved(true);
- serviceMap = new Hashtable<String, SpringBeanElement>();
- propertyMap = new Hashtable<String, Class<?>>();
- unresolvedBeanRef = new Hashtable<String, Reference>();
- } // end method SpringImplementation
-
- /* Returns the location attribute for this Spring implementation */
- public String getLocation() {
- return location;
- }
-
- /**
- * Sets the location attribute for this Spring implementation
- * location - a URI to the Spring application-context file
- */
- public void setLocation(String location) {
- this.location = location;
- return;
- }
-
- public void setResource(URL resource) {
- this.resource = resource;
- }
-
- public URL getResource() {
- return resource;
- }
-
- /*
- * Returns the componentType for this Spring implementation
- */
- public ComponentType getComponentType() {
- return componentType;
- }
-
- /*
- * Sets the componentType for this Spring implementation
- */
- public void setComponentType(ComponentType componentType) {
- this.componentType = componentType;
- }
-
- @Override
- public List<Service> getServices() {
- return componentType.getServices();
- }
-
- @Override
- public List<Reference> getReferences() {
- return componentType.getReferences();
- }
-
- @Override
- public List<Property> getProperties() {
- return componentType.getProperties();
- }
-
- /**
- * Returns the Spring Bean which implements a particular service
- * @param service the service
- * @return the bean which implements the service, as a SpringBeanElement
- */
- public SpringBeanElement getBeanFromService(Service service) {
- SpringBeanElement theBean = serviceMap.get(service.getName());
- return theBean;
- }
-
- /**
- * Sets the mapping from a service to the Spring Bean that implements the service
- * @param service the service
- * @param theBean a SpringBeanElement for the Bean implementing the service
- */
- public void setBeanForService(Service service, SpringBeanElement theBean) {
- serviceMap.put(service.getName(), theBean);
- }
-
- /**
- * Add a mapping from a SCA property name to a Java class for the property
- * @param propertyName
- * @param propertyClass
- */
- public void setPropertyClass(String propertyName, Class<?> propertyClass) {
- if (propertyName == null || propertyClass == null)
- return;
- propertyMap.put(propertyName, propertyClass);
- return;
- } // end method setPropertyClass
-
- /**
- * Gets the Java Class for an SCA property
- * @param propertyName - the property name
- * @return - a Class object for the type of the property
- */
- public Class<?> getPropertyClass(String propertyName) {
- return propertyMap.get(propertyName);
- } // end method getPropertyClass
-
- public void setUnresolvedBeanRef(String refName, Reference reference) {
- if (refName == null || reference == null)
- return;
- unresolvedBeanRef.put(refName, reference);
- return;
- } // end method setUnresolvedBeanRef
-
- public Reference getUnresolvedBeanRef(String refName) {
- return unresolvedBeanRef.get(refName);
- } // end method getUnresolvedBeanRef
-
-
- /**
- * Use preProcess to validate and map the references and properties dynamically
- */
- public void preProcess(Component component) {
- if (!(component instanceof RuntimeComponent))
- return;
-
- RuntimeComponent rtc = (RuntimeComponent) component;
-
- for (Reference reference : rtc.getReferences()) {
- if (unresolvedBeanRef.containsKey(reference.getName())) {
- Reference ref = unresolvedBeanRef.get(reference.getName());
- componentType.getReferences().add(
- createReference(reference, ref.getInterfaceContract()));
- unresolvedBeanRef.remove(reference.getName());
- }
- }
-
- for (Property property : rtc.getProperties()) {
- if (unresolvedBeanRef.containsKey(property.getName())) {
- componentType.getProperties().add(createProperty(property));
- this.setPropertyClass(property.getName(), property.getClass());
- unresolvedBeanRef.remove(property.getName());
- }
- }
- }
-
- protected Reference createReference(Reference reference, InterfaceContract interfaze) {
- Reference newReference;
- try {
- newReference = (Reference)reference.clone();
- if (newReference.getInterfaceContract() == null)
- newReference.setInterfaceContract(interfaze);
- } catch (CloneNotSupportedException e) {
- throw new AssertionError(e); // should not ever happen
- }
- return newReference;
- }
-
- protected Property createProperty(Property property) {
- Property newProperty;
- try {
- newProperty = (Property)property.clone();
- } catch (CloneNotSupportedException e) {
- throw new AssertionError(e); // should not ever happen
- }
- return newProperty;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring;
+
+import java.net.URL;
+import java.util.Hashtable;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.Extensible;
+import org.apache.tuscany.sca.assembly.Implementation;
+import org.apache.tuscany.sca.assembly.Property;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.assembly.builder.ComponentPreProcessor;
+import org.apache.tuscany.sca.assembly.impl.ImplementationImpl;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+
+/**
+ * Represents a Spring implementation.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringImplementation extends ImplementationImpl implements Implementation, ComponentPreProcessor, Extensible {
+ private final static QName TYPE = new QName(SCA11_NS, "implementation.spring");
+ // The location attribute which points to the Spring application-context XML file
+ private String location;
+ // The application-context file as a Spring Resource
+ private URL resource;
+ private ComponentType componentType;
+ // Mapping of Services to Beans
+ private Hashtable<String, SpringBeanElement> serviceMap;
+ // Mapping of property names to Java class
+ private Hashtable<String, Class<?>> propertyMap;
+ // List of unresolved bean property references
+ private Hashtable<String, Reference> unresolvedBeanRef;
+
+ public SpringImplementation() {
+ super(TYPE);
+ this.location = null;
+ this.resource = null;
+ setUnresolved(true);
+ serviceMap = new Hashtable<String, SpringBeanElement>();
+ propertyMap = new Hashtable<String, Class<?>>();
+ unresolvedBeanRef = new Hashtable<String, Reference>();
+ } // end method SpringImplementation
+
+ /* Returns the location attribute for this Spring implementation */
+ public String getLocation() {
+ return location;
+ }
+
+ /**
+ * Sets the location attribute for this Spring implementation
+ * location - a URI to the Spring application-context file
+ */
+ public void setLocation(String location) {
+ this.location = location;
+ return;
+ }
+
+ public void setResource(URL resource) {
+ this.resource = resource;
+ }
+
+ public URL getResource() {
+ return resource;
+ }
+
+ /*
+ * Returns the componentType for this Spring implementation
+ */
+ public ComponentType getComponentType() {
+ return componentType;
+ }
+
+ /*
+ * Sets the componentType for this Spring implementation
+ */
+ public void setComponentType(ComponentType componentType) {
+ this.componentType = componentType;
+ }
+
+ @Override
+ public List<Service> getServices() {
+ return componentType.getServices();
+ }
+
+ @Override
+ public List<Reference> getReferences() {
+ return componentType.getReferences();
+ }
+
+ @Override
+ public List<Property> getProperties() {
+ return componentType.getProperties();
+ }
+
+ /**
+ * Returns the Spring Bean which implements a particular service
+ * @param service the service
+ * @return the bean which implements the service, as a SpringBeanElement
+ */
+ public SpringBeanElement getBeanFromService(Service service) {
+ SpringBeanElement theBean = serviceMap.get(service.getName());
+ return theBean;
+ }
+
+ /**
+ * Sets the mapping from a service to the Spring Bean that implements the service
+ * @param service the service
+ * @param theBean a SpringBeanElement for the Bean implementing the service
+ */
+ public void setBeanForService(Service service, SpringBeanElement theBean) {
+ serviceMap.put(service.getName(), theBean);
+ }
+
+ /**
+ * Add a mapping from a SCA property name to a Java class for the property
+ * @param propertyName
+ * @param propertyClass
+ */
+ public void setPropertyClass(String propertyName, Class<?> propertyClass) {
+ if (propertyName == null || propertyClass == null)
+ return;
+ propertyMap.put(propertyName, propertyClass);
+ return;
+ } // end method setPropertyClass
+
+ /**
+ * Gets the Java Class for an SCA property
+ * @param propertyName - the property name
+ * @return - a Class object for the type of the property
+ */
+ public Class<?> getPropertyClass(String propertyName) {
+ return propertyMap.get(propertyName);
+ } // end method getPropertyClass
+
+ public void setUnresolvedBeanRef(String refName, Reference reference) {
+ if (refName == null || reference == null)
+ return;
+ unresolvedBeanRef.put(refName, reference);
+ return;
+ } // end method setUnresolvedBeanRef
+
+ public Reference getUnresolvedBeanRef(String refName) {
+ return unresolvedBeanRef.get(refName);
+ } // end method getUnresolvedBeanRef
+
+
+ /**
+ * Use preProcess to validate and map the references and properties dynamically
+ */
+ public void preProcess(Component component) {
+ if (!(component instanceof RuntimeComponent))
+ return;
+
+ RuntimeComponent rtc = (RuntimeComponent) component;
+
+ for (Reference reference : rtc.getReferences()) {
+ if (unresolvedBeanRef.containsKey(reference.getName())) {
+ Reference ref = unresolvedBeanRef.get(reference.getName());
+ componentType.getReferences().add(
+ createReference(reference, ref.getInterfaceContract()));
+ unresolvedBeanRef.remove(reference.getName());
+ }
+ }
+
+ for (Property property : rtc.getProperties()) {
+ if (unresolvedBeanRef.containsKey(property.getName())) {
+ componentType.getProperties().add(createProperty(property));
+ this.setPropertyClass(property.getName(), property.getClass());
+ unresolvedBeanRef.remove(property.getName());
+ }
+ }
+ }
+
+ protected Reference createReference(Reference reference, InterfaceContract interfaze) {
+ Reference newReference;
+ try {
+ newReference = (Reference)reference.clone();
+ if (newReference.getInterfaceContract() == null)
+ newReference.setInterfaceContract(interfaze);
+ } catch (CloneNotSupportedException e) {
+ throw new AssertionError(e); // should not ever happen
+ }
+ return newReference;
+ }
+
+ protected Property createProperty(Property property) {
+ Property newProperty;
+ try {
+ newProperty = (Property)property.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new AssertionError(e); // should not ever happen
+ }
+ return newProperty;
+ }
+}
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationConstants.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationConstants.java
index 339e753c04..0bccdb369c 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationConstants.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringImplementationConstants.java
@@ -1,64 +1,64 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.spring;
-
-import javax.xml.namespace.QName;
-
-/**
- * Constants used in Spring Application Context XML files.
- */
-public interface SpringImplementationConstants {
-
- String SCA_NS = "http://www.springframework.org/schema/sca";
- String SPRING_NS = "http://www.springframework.org/schema/beans";
-
- String PROPERTY = "property";
- QName SCAPROPERTY_ELEMENT = new QName(SCA_NS, PROPERTY);
- QName PROPERTY_ELEMENT = new QName(SPRING_NS, PROPERTY);
-
- String SERVICE = "service";
- QName SERVICE_ELEMENT = new QName(SCA_NS, SERVICE);
-
- String REFERENCE = "reference";
- QName REFERENCE_ELEMENT = new QName(SCA_NS, REFERENCE);
-
- String BEANS = "beans";
- QName BEANS_ELEMENT = new QName(SPRING_NS, BEANS);
-
- String IMPORT = "import";
- QName IMPORT_ELEMENT = new QName(SPRING_NS, IMPORT);
-
- String BEAN = "bean";
- QName BEAN_ELEMENT = new QName(SPRING_NS, BEAN);
-
- String CONSTRUCTORARG = "constructor-arg";
- QName CONSTRUCTORARG_ELEMENT = new QName(SPRING_NS, CONSTRUCTORARG);
-
- String LIST = "list";
- QName LIST_ELEMENT = new QName(SPRING_NS, LIST);
-
- String VALUE = "value";
- QName VALUE_ELEMENT = new QName(SPRING_NS, VALUE);
-
- String REF = "ref";
- QName REF_ELEMENT = new QName(SPRING_NS, REF);
-
- String APPLICATION_CONTEXT = "application-context.xml";
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.spring;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Constants used in Spring Application Context XML files.
+ */
+public interface SpringImplementationConstants {
+
+ String SCA_NS = "http://www.springframework.org/schema/sca";
+ String SPRING_NS = "http://www.springframework.org/schema/beans";
+
+ String PROPERTY = "property";
+ QName SCAPROPERTY_ELEMENT = new QName(SCA_NS, PROPERTY);
+ QName PROPERTY_ELEMENT = new QName(SPRING_NS, PROPERTY);
+
+ String SERVICE = "service";
+ QName SERVICE_ELEMENT = new QName(SCA_NS, SERVICE);
+
+ String REFERENCE = "reference";
+ QName REFERENCE_ELEMENT = new QName(SCA_NS, REFERENCE);
+
+ String BEANS = "beans";
+ QName BEANS_ELEMENT = new QName(SPRING_NS, BEANS);
+
+ String IMPORT = "import";
+ QName IMPORT_ELEMENT = new QName(SPRING_NS, IMPORT);
+
+ String BEAN = "bean";
+ QName BEAN_ELEMENT = new QName(SPRING_NS, BEAN);
+
+ String CONSTRUCTORARG = "constructor-arg";
+ QName CONSTRUCTORARG_ELEMENT = new QName(SPRING_NS, CONSTRUCTORARG);
+
+ String LIST = "list";
+ QName LIST_ELEMENT = new QName(SPRING_NS, LIST);
+
+ String VALUE = "value";
+ QName VALUE_ELEMENT = new QName(SPRING_NS, VALUE);
+
+ String REF = "ref";
+ QName REF_ELEMENT = new QName(SPRING_NS, REF);
+
+ String APPLICATION_CONTEXT = "application-context.xml";
+}
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringPropertyElement.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringPropertyElement.java
index c6637d31c4..2a55e2c7c8 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringPropertyElement.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringPropertyElement.java
@@ -1,61 +1,61 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Represents a <property> element in a Spring application-context
- * - this has name and ref attributes
- *
- * @version $Rev: 512919 $ $Date: 2007-02-28 19:32:56 +0000 (Wed, 28 Feb 2007) $
- */
-public class SpringPropertyElement {
-
- private String name;
- private String ref;
- private List<String> values = new ArrayList<String>();
-
- public SpringPropertyElement(String name, String ref) {
- this.name = name;
- this.ref = ref;
- }
-
- public String getName() {
- return name;
- }
-
- public String getRef() {
- return ref;
- }
-
- public void setRef(String ref) {
- this.ref = ref;
- }
-
- public List<String> getValues() {
- return this.values;
- }
-
- public void addValue(String value) {
- this.values.add(value);
- }
-
-} // end class SpringPropertyElement
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Represents a <property> element in a Spring application-context
+ * - this has name and ref attributes
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringPropertyElement {
+
+ private String name;
+ private String ref;
+ private List<String> values = new ArrayList<String>();
+
+ public SpringPropertyElement(String name, String ref) {
+ this.name = name;
+ this.ref = ref;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getRef() {
+ return ref;
+ }
+
+ public void setRef(String ref) {
+ this.ref = ref;
+ }
+
+ public List<String> getValues() {
+ return this.values;
+ }
+
+ public void addValue(String value) {
+ this.values.add(value);
+ }
+
+} // end class SpringPropertyElement
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAPropertyElement.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAPropertyElement.java
index c666217777..b192580a78 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAPropertyElement.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAPropertyElement.java
@@ -1,52 +1,52 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring;
-
-/**
- * Represents an <sca:property> element in a Spring application-context
- * - this has name and type attributes
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class SpringSCAPropertyElement {
-
- private String name;
- private String type;
-
- public SpringSCAPropertyElement(String name, String type) {
- this.name = name;
- this.type = type;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getType() {
- return type;
- }
-
-} // end class SpringPropertyElement
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring;
+
+/**
+ * Represents an <sca:property> element in a Spring application-context
+ * - this has name and type attributes
+ * @version $Rev$ $Date$
+ */
+public class SpringSCAPropertyElement {
+
+ private String name;
+ private String type;
+
+ public SpringSCAPropertyElement(String name, String type) {
+ this.name = name;
+ this.type = type;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+} // end class SpringPropertyElement
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAReferenceElement.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAReferenceElement.java
index 5b6206ef9b..47c87fe7fe 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAReferenceElement.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAReferenceElement.java
@@ -1,54 +1,54 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring;
-
-/**
- * Represents a <sca:reference> element in a Spring application-context
- * - this has id and className attributes
- * - plus zero or more property elements as children
- *
- * @version $Rev: 512919 $ $Date: 2007-02-28 19:32:56 +0000 (Wed, 28 Feb 2007) $
- */
-public class SpringSCAReferenceElement {
-
- private String name;
- private String type;
-
- public SpringSCAReferenceElement(String name, String type) {
- this.name = name;
- this.type = type;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getType() {
- return type;
- }
-
-} // end class SpringSCAReferenceElement
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring;
+
+/**
+ * Represents a <sca:reference> element in a Spring application-context
+ * - this has id and className attributes
+ * - plus zero or more property elements as children
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringSCAReferenceElement {
+
+ private String name;
+ private String type;
+
+ public SpringSCAReferenceElement(String name, String type) {
+ this.name = name;
+ this.type = type;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+} // end class SpringSCAReferenceElement
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAServiceElement.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAServiceElement.java
index 774bc051d3..7362a4521c 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAServiceElement.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/SpringSCAServiceElement.java
@@ -1,64 +1,64 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring;
-
-/**
- * Represents a <sca:service> element in a Spring application-context
- * - this has id and className attributes
- * - plus zero or more property elements as children
- *
- * @version $Rev: 512919 $ $Date: 2007-02-28 19:32:56 +0000 (Wed, 28 Feb 2007) $
- */
-public class SpringSCAServiceElement {
-
- private String name;
- private String type;
- private String target;
-
- public SpringSCAServiceElement(String name, String type, String target) {
- this.name = name;
- this.type = type;
- this.target = target;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getType() {
- return type;
- }
-
- public void setTarget(String target) {
- this.target = target;
- }
-
- public String getTarget() {
- return target;
- }
-
-} // end class SpringSCAServiceElement
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring;
+
+/**
+ * Represents a <sca:service> element in a Spring application-context
+ * - this has id and className attributes
+ * - plus zero or more property elements as children
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringSCAServiceElement {
+
+ private String name;
+ private String type;
+ private String target;
+
+ public SpringSCAServiceElement(String name, String type, String target) {
+ this.name = name;
+ this.type = type;
+ this.target = target;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setTarget(String target) {
+ this.target = target;
+ }
+
+ public String getTarget() {
+ return target;
+ }
+
+} // end class SpringSCAServiceElement
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanIntrospector.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanIntrospector.java
index de137e3d9c..720db77e35 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanIntrospector.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanIntrospector.java
@@ -1,135 +1,135 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring.introspect;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
-import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ComponentNameProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ConstructorProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ContextProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.DestroyProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.EagerInitProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.InitProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.PolicyProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.PropertyProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ReferenceProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ResourceProcessor;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.ServiceProcessor;
-import org.apache.tuscany.sca.implementation.spring.SpringConstructorArgElement;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-
-/**
- * Provides introspection functions for Spring beans
- * This version leans heavily on the implementation-java classes
- *
- * @version $Rev: 512919 $ $Date: 2007-02-28 19:32:56 +0000 (Wed, 28 Feb 2007) $
- */
-public class SpringBeanIntrospector {
-
- private JavaImplementationFactory javaImplementationFactory;
-
- /**
- * The constructor sets up the various visitor elements that will be used to introspect
- * the Spring bean and extract SCA information.
- *
- * @param assemblyFactory The Assembly Factory to use
- * @param javaFactory The Java Interface Factory to use
- * @param policyFactory The Policy Factory to use.
- */
- public SpringBeanIntrospector(AssemblyFactory assemblyFactory,
- JavaInterfaceFactory javaFactory,
- PolicyFactory policyFactory,
- List<SpringConstructorArgElement> conArgs) {
-
- javaImplementationFactory = new DefaultJavaImplementationFactory();
-
- // Create the list of class visitors
- BaseJavaClassVisitor[] extensions =
- new BaseJavaClassVisitor[] {
- new ConstructorProcessor(assemblyFactory),
- new ComponentNameProcessor(assemblyFactory),
- new ContextProcessor(assemblyFactory),
- new DestroyProcessor(assemblyFactory),
- new EagerInitProcessor(assemblyFactory),
- new InitProcessor(assemblyFactory),
- new PropertyProcessor(assemblyFactory),
- new ReferenceProcessor(assemblyFactory, javaFactory),
- new ResourceProcessor(assemblyFactory),
- new ServiceProcessor(assemblyFactory, javaFactory),
- new SpringBeanPojoProcessor(assemblyFactory, javaFactory, conArgs),
- new PolicyProcessor(assemblyFactory, policyFactory)};
- for (JavaClassVisitor extension : extensions) {
- javaImplementationFactory.addClassVisitor(extension);
- }
-
- } // end constructor
-
- /**
- * Introspect a Spring Bean and extract the features important to SCA
- * @param beanClass the Spring Bean class to introspect
- * @param componentType the componentType that is filled in through the introspection
- * process (assumed empty on invocation, filled on return
- * @return a Map of property names to JavaElementImpl
- * @throws ContributionResolveException - if there was a problem resolving the
- * Spring Bean or its componentType
- *
- */
- public JavaImplementation introspectBean(Class<?> beanClass, ComponentType componentType) throws ContributionResolveException
- {
- if (componentType == null)
- throw new ContributionResolveException("Introspect Spring bean: supplied componentType is null");
-
- // Create a Java implementation ready for the introspection
- JavaImplementation javaImplementation = javaImplementationFactory.createJavaImplementation();
-
- try {
- // Introspect the bean...the results of the introspection are placed into the Java implementation
- javaImplementationFactory.createJavaImplementation(javaImplementation, beanClass);
-
- // Extract the services, references & properties found through introspection
- // put the services, references and properties into the component type
- componentType.getServices().addAll(javaImplementation.getServices());
- componentType.getReferences().addAll(javaImplementation.getReferences());
- componentType.getProperties().addAll(javaImplementation.getProperties());
-
- } catch (IntrospectionException e) {
- throw new ContributionResolveException(e);
- } // end try
-
- /* List<Service> services = javaImplementation.getServices();
- for (Service service : services) {
- String name = service.getName();
- System.out.println("Spring Bean: found service with name: " + name);
- } // end for */
-
- return javaImplementation;
-
- } // end method introspectBean
-
-} // end class SpringBeanIntrospector
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring.introspect;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.implementation.java.DefaultJavaImplementationFactory;
+import org.apache.tuscany.sca.implementation.java.IntrospectionException;
+import org.apache.tuscany.sca.implementation.java.JavaImplementation;
+import org.apache.tuscany.sca.implementation.java.JavaImplementationFactory;
+import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
+import org.apache.tuscany.sca.implementation.java.introspect.JavaClassVisitor;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.ComponentNameProcessor;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.ConstructorProcessor;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.ContextProcessor;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.DestroyProcessor;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.EagerInitProcessor;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.InitProcessor;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.PolicyProcessor;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.PropertyProcessor;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.ReferenceProcessor;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.ResourceProcessor;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.ServiceProcessor;
+import org.apache.tuscany.sca.implementation.spring.SpringConstructorArgElement;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.policy.PolicyFactory;
+
+/**
+ * Provides introspection functions for Spring beans
+ * This version leans heavily on the implementation-java classes
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringBeanIntrospector {
+
+ private JavaImplementationFactory javaImplementationFactory;
+
+ /**
+ * The constructor sets up the various visitor elements that will be used to introspect
+ * the Spring bean and extract SCA information.
+ *
+ * @param assemblyFactory The Assembly Factory to use
+ * @param javaFactory The Java Interface Factory to use
+ * @param policyFactory The Policy Factory to use.
+ */
+ public SpringBeanIntrospector(AssemblyFactory assemblyFactory,
+ JavaInterfaceFactory javaFactory,
+ PolicyFactory policyFactory,
+ List<SpringConstructorArgElement> conArgs) {
+
+ javaImplementationFactory = new DefaultJavaImplementationFactory();
+
+ // Create the list of class visitors
+ BaseJavaClassVisitor[] extensions =
+ new BaseJavaClassVisitor[] {
+ new ConstructorProcessor(assemblyFactory),
+ new ComponentNameProcessor(assemblyFactory),
+ new ContextProcessor(assemblyFactory),
+ new DestroyProcessor(assemblyFactory),
+ new EagerInitProcessor(assemblyFactory),
+ new InitProcessor(assemblyFactory),
+ new PropertyProcessor(assemblyFactory),
+ new ReferenceProcessor(assemblyFactory, javaFactory),
+ new ResourceProcessor(assemblyFactory),
+ new ServiceProcessor(assemblyFactory, javaFactory),
+ new SpringBeanPojoProcessor(assemblyFactory, javaFactory, conArgs),
+ new PolicyProcessor(assemblyFactory, policyFactory)};
+ for (JavaClassVisitor extension : extensions) {
+ javaImplementationFactory.addClassVisitor(extension);
+ }
+
+ } // end constructor
+
+ /**
+ * Introspect a Spring Bean and extract the features important to SCA
+ * @param beanClass the Spring Bean class to introspect
+ * @param componentType the componentType that is filled in through the introspection
+ * process (assumed empty on invocation, filled on return
+ * @return a Map of property names to JavaElementImpl
+ * @throws ContributionResolveException - if there was a problem resolving the
+ * Spring Bean or its componentType
+ *
+ */
+ public JavaImplementation introspectBean(Class<?> beanClass, ComponentType componentType) throws ContributionResolveException
+ {
+ if (componentType == null)
+ throw new ContributionResolveException("Introspect Spring bean: supplied componentType is null");
+
+ // Create a Java implementation ready for the introspection
+ JavaImplementation javaImplementation = javaImplementationFactory.createJavaImplementation();
+
+ try {
+ // Introspect the bean...the results of the introspection are placed into the Java implementation
+ javaImplementationFactory.createJavaImplementation(javaImplementation, beanClass);
+
+ // Extract the services, references & properties found through introspection
+ // put the services, references and properties into the component type
+ componentType.getServices().addAll(javaImplementation.getServices());
+ componentType.getReferences().addAll(javaImplementation.getReferences());
+ componentType.getProperties().addAll(javaImplementation.getProperties());
+
+ } catch (IntrospectionException e) {
+ throw new ContributionResolveException(e);
+ } // end try
+
+ /* List<Service> services = javaImplementation.getServices();
+ for (Service service : services) {
+ String name = service.getName();
+ System.out.println("Spring Bean: found service with name: " + name);
+ } // end for */
+
+ return javaImplementation;
+
+ } // end method introspectBean
+
+} // end class SpringBeanIntrospector
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanPojoProcessor.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanPojoProcessor.java
index 56b3ce2213..bef2d3665d 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanPojoProcessor.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringBeanPojoProcessor.java
@@ -1,656 +1,656 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring.introspect;
-
-import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getAllInterfaces;
-import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getAllPublicAndProtectedFields;
-import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getAllUniquePublicProtectedMethods;
-import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getPrivateFields;
-import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.toPropertyName;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.jws.WebService;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Contract;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.implementation.java.IntrospectionException;
-import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
-import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaParameterImpl;
-import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
-import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.AmbiguousConstructorException;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidServiceTypeException;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.NoConstructorException;
-import org.apache.tuscany.sca.implementation.java.introspect.impl.Resource;
-import org.apache.tuscany.sca.implementation.spring.SpringConstructorArgElement;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
-import org.oasisopen.sca.annotation.Callback;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * Heuristically evaluates an un-annotated Java implementation type to determine
- * services, references, and properties according to the algorithm described in
- * the SCA Java Client and Implementation Model Specification <p/> TODO
- * Implement: <p/> When no service interface is annotated, need to calculate a
- * single service comprising all public methods that are not reference or
- * property injection sites. If that service can be exactly mapped to an
- * interface implemented by the class then the service interface will be defined
- * in terms of that interface.
- *
- * @version $Rev: 689426 $ $Date: 2008-08-27 14:56:06 +0530 (Wed, 27 Aug 2008) $
- */
-public class SpringBeanPojoProcessor extends BaseJavaClassVisitor {
- private JavaInterfaceFactory javaFactory;
- private List<SpringConstructorArgElement> conArgs;
-
- public SpringBeanPojoProcessor(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory, List<SpringConstructorArgElement> conArgs) {
- super(assemblyFactory);
- this.javaFactory = javaFactory;
- this.conArgs = conArgs;
- }
-
- @Override
- public <T> void visitEnd(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
- List<org.apache.tuscany.sca.assembly.Service> services = type.getServices();
- if (services.isEmpty()) {
- // heuristically determine the service
- /**
- * The following is quoted from Java Specification 1.2.1.3. Introspecting services offered by a Java implementation
- * In the cases described below, the services offered by a Java implementation class may be determined
- * through introspection, eliding the need to specify them using @Service. The following algorithm is used
- * to determine how services are introspected from an implementation class:
- *
- * If the interfaces of the SCA services are not specified with the @Service annotation on the
- * implementation class, it is assumed that all implemented interfaces that have been annotated
- * as @Remotable are the service interfaces provided by the component. If none of the implemented
- * interfaces is remotable, then by default the implementation offers a single service whose type
- * is the implementation class.
- */
- Set<Class<?>> interfaces = getAllInterfaces(clazz);
- for (Class<?> i : interfaces) {
- if (i.isAnnotationPresent(Remotable.class) || i.isAnnotationPresent(WebService.class)) {
- addService(type, i);
- }
- }
- if (services.isEmpty()) {
- // class is the interface
- addService(type, clazz);
- }
- }
- Set<Method> methods = getAllUniquePublicProtectedMethods(clazz, false);
- if (!type.getReferenceMembers().isEmpty() || !type.getPropertyMembers().isEmpty()) {
- // references and properties have been explicitly defined
- // if (type.getServices().isEmpty()) {
- // calculateServiceInterface(clazz, type, methods);
- // if (type.getServices().isEmpty()) {
- // throw new ServiceTypeNotFoundException(clazz.getName());
- // }
- // }
- evaluateConstructor(type, clazz);
- return;
- }
- calcPropRefs(methods, services, type, clazz);
- evaluateConstructor(type, clazz);
- }
-
- private void addService(JavaImplementation type, Class<?> clazz) throws IntrospectionException {
- try {
- org.apache.tuscany.sca.assembly.Service service = createService(clazz);
- type.getServices().add(service);
- } catch (InvalidInterfaceException e) {
- throw new IntrospectionException(e);
- }
- }
-
- private boolean isPublicSetter(Method method) {
- return method.getParameterTypes().length == 1 && Modifier.isPublic(method.getModifiers())
- && method.getName().startsWith("set")
- && method.getReturnType() == void.class;
- }
-
- private boolean isProtectedSetter(Method method) {
- return method.getParameterTypes().length == 1 && Modifier.isProtected(method.getModifiers())
- && method.getName().startsWith("set")
- && method.getReturnType() == void.class;
- }
-
- private <T> void calcPropRefs(Set<Method> methods,
- List<org.apache.tuscany.sca.assembly.Service> services,
- JavaImplementation type,
- Class<T> clazz) throws IntrospectionException {
- // heuristically determine the properties references
- // make a first pass through all public methods with one param
- Set<String> setters = new HashSet<String>();
- Set<String> others = new HashSet<String>();
- for (Method method : methods) {
- if (!isPublicSetter(method)) {
- continue;
- }
- if (method.isAnnotationPresent(Callback.class) || method.isAnnotationPresent(Context.class)) {
- // Add the property name as others
- others.add(toPropertyName(method.getName()));
- continue;
- }
- if (!isInServiceInterface(method, services)) {
- // Not part of the service interface
- String name = toPropertyName(method.getName());
- setters.add(name);
- // avoid duplicate property or ref names
- if (!type.getPropertyMembers().containsKey(name) && !type.getReferenceMembers().containsKey(name)) {
- Class<?> param = method.getParameterTypes()[0];
- Type genericType = method.getGenericParameterTypes()[0];
- if (isReferenceType(param, genericType)) {
- type.getReferences().add(createReference(name, param));
- type.getReferenceMembers().put(name, new JavaElementImpl(method, 0));
- } else {
- type.getProperties().add(createProperty(name, param));
- type.getPropertyMembers().put(name, new JavaElementImpl(method, 0));
- }
- }
- }
- }
- // second pass for protected methods with one param
- for (Method method : methods) {
- if (!isProtectedSetter(method)) {
- continue;
- }
- if (method.isAnnotationPresent(Callback.class) || method.isAnnotationPresent(Context.class)) {
- // Add the property name as others
- others.add(toPropertyName(method.getName()));
- continue;
- }
- Class<?> param = method.getParameterTypes()[0];
- String name = toPropertyName(method.getName());
- setters.add(name);
- // avoid duplicate property or ref names
- if (isReferenceType(param, method.getGenericParameterTypes()[0])) {
- if (!type.getReferenceMembers().containsKey(name)) {
- type.getReferences().add(createReference(name, param));
- type.getReferenceMembers().put(name, new JavaElementImpl(method, 0));
- }
- } else {
- if (!type.getPropertyMembers().containsKey(name)) {
- type.getProperties().add(createProperty(name, param));
- type.getPropertyMembers().put(name, new JavaElementImpl(method, 0));
- }
- }
- }
-
- // Public or protected fields unless there is a public or protected
- // setter method
- // for the same name
- Set<Field> fields = getAllPublicAndProtectedFields(clazz, false);
- for (Field field : fields) {
- if (field.isAnnotationPresent(Callback.class) || field.isAnnotationPresent(Context.class)) {
- continue;
- }
- if (setters.contains(field.getName()) || others.contains(field.getName())) {
- continue;
- }
- String name = field.getName();
- Class<?> paramType = field.getType();
- if (isReferenceType(paramType, field.getGenericType())) {
- if (!type.getReferenceMembers().containsKey(name)) {
- type.getReferences().add(createReference(name, paramType));
- type.getReferenceMembers().put(name, new JavaElementImpl(field));
- }
- } else {
- if (!type.getPropertyMembers().containsKey(name)) {
- type.getProperties().add(createProperty(name, paramType));
- type.getPropertyMembers().put(name, new JavaElementImpl(field));
- }
- }
- }
-
- // Private fields unless there is a public or protected
- // setter method for the same name
- Set<Field> privateFields = getPrivateFields(clazz);
- for (Field field : privateFields) {
- if (field.isAnnotationPresent(Callback.class) || field.isAnnotationPresent(Context.class)) {
- continue;
- }
- if (setters.contains(field.getName()) || others.contains(field.getName())) {
- continue;
- }
- String name = field.getName();
- Class<?> paramType = field.getType();
- if (isReferenceType(paramType, field.getGenericType())) {
- if (!type.getReferenceMembers().containsKey(name)) {
- type.getReferences().add(createReference(name, paramType));
- type.getReferenceMembers().put(name, new JavaElementImpl(field));
- }
- } else {
- if (!type.getPropertyMembers().containsKey(name)) {
- type.getProperties().add(createProperty(name, paramType));
- type.getPropertyMembers().put(name, new JavaElementImpl(field));
- }
- }
- }
- }
-
- /**
- * Determines the constructor to use based on the component type's
- * references and properties
- *
- * @param type the component type
- * @param clazz the implementation class corresponding to the component type
- * @throws NoConstructorException if no suitable constructor is found
- * @throws AmbiguousConstructorException if the parameters of a constructor
- * cannot be unambiguously mapped to references and properties
- */
- @SuppressWarnings("unchecked")
- private <T> void evaluateConstructor(JavaImplementation type, Class<T> clazz) throws IntrospectionException {
- // determine constructor if one is not annotated
- JavaConstructorImpl<?> definition = type.getConstructor();
- Map<String, JavaElementImpl> props = type.getPropertyMembers();
- Map<String, JavaElementImpl> refs = type.getReferenceMembers();
- Constructor constructor;
- boolean explict = false;
- if (definition != null && definition.getConstructor()
- .isAnnotationPresent(org.oasisopen.sca.annotation.Constructor.class)) {
- // the constructor was already defined explicitly
- return;
- } else if (definition != null) {
- explict = true;
- constructor = definition.getConstructor();
- } else {
- // no definition, heuristically determine constructor
- Constructor[] constructors = clazz.getConstructors();
- if (constructors.length == 0) {
- throw new NoConstructorException("No public constructor for class");
- } else if (constructors.length == 1) {
- // Only one constructor, take it
- constructor = constructors[0];
- } else {
- // multiple constructors scenario
- Constructor<T> selected = null;
- for (Constructor<T> ctor : constructors) {
- if (ctor.getParameterTypes().length == 0) {
- selected = ctor;
- } else if (ctor.getParameterTypes().length == conArgs.size()) {
- // we will find a constructor which has atleast one
- // reference or property as its parameter types.
- Class<?>[] parametersTypes = ctor.getParameterTypes();
- for (Class<?> pType: parametersTypes) {
- for (JavaElementImpl property : props.values()) {
- if (pType.equals(property.getType()))
- selected = ctor;
- }
- for (JavaElementImpl reference : refs.values()) {
- if (pType.equals(reference.getType()))
- selected = ctor;
- }
- }
- }
- }
- if (selected == null) {
- throw new NoConstructorException();
- }
- constructor = selected;
- }
- definition = type.getConstructors().get(constructor);
- type.setConstructor(definition);
- }
-
- JavaParameterImpl[] parameters = definition.getParameters();
- if (parameters.length == 0) {
- return;
- }
-
- Annotation[][] annotations = constructor.getParameterAnnotations();
- if (!explict) {
- // the constructor wasn't defined by an annotation, so check to see
- // if any of the params have an annotation
- // which we can impute as explicitly defining the constructor, e.g.
- // @Property, @Reference, or @Autowire
- explict = injectionAnnotationsPresent(annotations);
- }
- if (explict) {
- for (int i = 0; i < parameters.length; i++) {
- if (isAnnotated(parameters[i])) {
- continue;
- } else if (!findReferenceOrProperty(parameters[i], props, refs)) {
- throw new AmbiguousConstructorException(parameters[i].toString());
- }
- }
- } else {
- if (!areUnique(parameters)) {
- throw new AmbiguousConstructorException("Cannot resolve non-unique parameter types, use @Constructor");
- }
- if (!calcPropRefUniqueness(props.values(), refs.values())) {
- throw new AmbiguousConstructorException("Cannot resolve non-unique parameter types, use @Constructor");
- }
- if (!(props.isEmpty() && refs.isEmpty())) {
- calcParamNames(parameters, props, refs);
- } else {
- heuristicParamNames(type, parameters);
-
- }
- }
- }
-
- private void calcParamNames(JavaParameterImpl[] parameters,
- Map<String, JavaElementImpl> props,
- Map<String, JavaElementImpl> refs) throws AmbiguousConstructorException {
- // the constructor param types must unambiguously match defined
- // reference or property types
- for (JavaParameterImpl param : parameters) {
- if (!findReferenceOrProperty(param, props, refs)) {
- throw new AmbiguousConstructorException(param.getName());
- }
- }
- }
-
- private void heuristicParamNames(JavaImplementation type, JavaParameterImpl[] parameters)
- throws IntrospectionException {
- // heuristically determine refs and props from the parameter types
- for (JavaParameterImpl p : parameters) {
- String name = p.getType().getSimpleName().toLowerCase();
- if (isReferenceType(p.getType(), p.getGenericType())) {
- type.getReferences().add(createReference(name, p.getType()));
- p.setClassifer(Reference.class);
- type.getReferenceMembers().put(name, p);
- } else {
- type.getProperties().add(createProperty(name, p.getType()));
- p.setClassifer(Property.class);
- type.getPropertyMembers().put(name, p);
- }
- p.setName(name);
- }
- }
-
- private static boolean areUnique(Class[] collection) {
- Set<Class> set = new HashSet<Class>(Arrays.asList(collection));
- return set.size() == collection.length;
- }
-
- /**
- * Returns true if the union of the given collections of properties and
- * references have unique Java types
- */
- private boolean calcPropRefUniqueness(Collection<JavaElementImpl> props, Collection<JavaElementImpl> refs) {
-
- Class[] classes = new Class[props.size() + refs.size()];
- int i = 0;
- for (JavaElementImpl property : props) {
- classes[i] = property.getType();
- i++;
- }
- for (JavaElementImpl reference : refs) {
- classes[i] = reference.getType();
- i++;
- }
- return areUnique(classes);
- }
-
- /**
- * Unambiguously finds the reference or property associated with the given
- * type
- *
- * @return the name of the reference or property if found, null if not
- * @throws AmbiguousConstructorException if the constructor parameter cannot
- * be resolved to a property or reference
- */
- private boolean findReferenceOrProperty(JavaParameterImpl parameter,
- Map<String, JavaElementImpl> props,
- Map<String, JavaElementImpl> refs) throws AmbiguousConstructorException {
-
- boolean found = false;
- if (!"".equals(parameter.getName())) {
- // Match by name
- JavaElementImpl prop = props.get(parameter.getName());
- if (prop != null && prop.getType() == parameter.getType()) {
- parameter.setClassifer(Property.class);
- return true;
- }
- JavaElementImpl ref = refs.get(parameter.getName());
- if (ref != null && ref.getType() == parameter.getType()) {
- parameter.setClassifer(Reference.class);
- return true;
- }
- }
- for (JavaElementImpl property : props.values()) {
- if (property.getType() == parameter.getType()) {
- if (found) {
- throw new AmbiguousConstructorException("Ambiguous property or reference for constructor type",
- (Member)parameter.getAnchor());
- }
- parameter.setClassifer(Property.class);
- parameter.setName(property.getName());
- found = true;
- // do not break since ambiguities must be checked, i.e. more
- // than one prop or ref of the same type
- }
- }
- for (JavaElementImpl reference : refs.values()) {
- if (reference.getType() == parameter.getType()) {
- if (found) {
- throw new AmbiguousConstructorException("Ambiguous property or reference for constructor type",
- (Member)parameter.getAnchor());
- }
- parameter.setClassifer(Reference.class);
- parameter.setName(reference.getName());
- found = true;
- // do not break since ambiguities must be checked, i.e. more
- // than one prop or ref of the same type
- }
- }
- return found;
- }
-
- /**
- * Returns true if a given type is reference according to the SCA
- * specification rules for determining reference types The following rules
- * are used to determine whether an unannotated field or setter method is a
- * property or reference:
- * <ol>
- * <li>If its type is simple, then it is a property.
- * <li>If its type is complex, then if the type is an interface marked by
- *
- * @Remotable, then it is a reference; otherwise, it is a property.
- * <li>Otherwise, if the type associated with the member is an
- * array or a java.util.Collection, the basetype is the element
- * type of the array or the parameterized type of the
- * Collection; otherwise the basetype is the member type. If the
- * basetype is an interface with an
- * @Remotable or
- * @Service annotation then the member is defined as a reference. Otherwise,
- * it is defined as a property.
- * </ol>
- * <p>
- * The name of the reference or of the property is derived from the
- * name found on the setter method or on the field.
- */
- private boolean isReferenceType(Class<?> cls, Type genericType) {
- Class<?> baseType = JavaIntrospectionHelper.getBaseType(cls, genericType);
- return baseType.isInterface() && baseType.isAnnotationPresent(Remotable.class);
- }
-
- /**
- * Returns true if the given operation is defined in the collection of
- * service interfaces
- */
- private boolean isInServiceInterface(Method operation, List<org.apache.tuscany.sca.assembly.Service> services) {
- for (org.apache.tuscany.sca.assembly.Service service : services) {
- Interface interface1 = service.getInterfaceContract().getInterface();
- if (interface1 instanceof JavaInterface) {
- Class<?> clazz = ((JavaInterface)interface1).getJavaClass();
- if (isMethodMatched(clazz, operation)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Test if the class declares a method which matches the signature of the
- * given method
- *
- * @param clazz
- * @param method
- * @return
- */
- private boolean isMethodMatched(Class<?> clazz, Method method) {
- if (method.getDeclaringClass() == clazz) {
- return true;
- }
- Method[] methods = clazz.getMethods();
- for (Method m : methods) {
- if (JavaIntrospectionHelper.exactMethodMatch(method, m)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Creates a mapped property.
- *
- * @param name the property name
- * @param paramType the property type
- */
- private org.apache.tuscany.sca.assembly.Property createProperty(String name, Class<?> paramType) {
- org.apache.tuscany.sca.assembly.Property property = assemblyFactory.createProperty();
- property.setName(name);
- property.setXSDType(JavaXMLMapper.getXMLType(paramType));
- return property;
- }
-
- private boolean isAnnotated(JavaParameterImpl parameter) {
- for (Annotation annotation : parameter.getAnnotations()) {
- Class<? extends Annotation> annotType = annotation.annotationType();
- if (annotType.equals(Property.class) || annotType.equals(Reference.class)
- || annotType.equals(Resource.class)) {
- return true;
- }
- }
- return false;
- }
-
- public boolean areUnique(JavaParameterImpl[] parameters) {
- Set<Class> set = new HashSet<Class>(parameters.length);
- for (JavaParameterImpl p : parameters) {
- if (!set.add(p.getType())) {
- return false;
- }
- }
- return true;
- }
-
- public org.apache.tuscany.sca.assembly.Reference createReference(String name, Class<?> paramType)
- throws IntrospectionException {
- org.apache.tuscany.sca.assembly.Reference reference = assemblyFactory.createReference();
- reference.setName(name);
- JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
- reference.setInterfaceContract(interfaceContract);
- try {
- JavaInterface callInterface = javaFactory.createJavaInterface(paramType);
- reference.getInterfaceContract().setInterface(callInterface);
- if (callInterface.getCallbackClass() != null) {
- JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
- reference.getInterfaceContract().setCallbackInterface(callbackInterface);
- }
- reference.setMultiplicity(Multiplicity.ZERO_ONE);
- } catch (InvalidInterfaceException e1) {
- throw new IntrospectionException(e1);
- }
-
- // FIXME: This part seems to have already been taken care above!!
- try {
- processCallback(paramType, reference);
- } catch (InvalidServiceTypeException e) {
- throw new IntrospectionException(e);
- }
- return reference;
- }
-
- public org.apache.tuscany.sca.assembly.Service createService(Class<?> interfaze) throws InvalidInterfaceException {
- org.apache.tuscany.sca.assembly.Service service = assemblyFactory.createService();
- service.setName(interfaze.getSimpleName());
-
- JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
- service.setInterfaceContract(interfaceContract);
-
- JavaInterface callInterface = javaFactory.createJavaInterface(interfaze);
- service.getInterfaceContract().setInterface(callInterface);
- if (callInterface.getCallbackClass() != null) {
- JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
- service.getInterfaceContract().setCallbackInterface(callbackInterface);
- }
-
- Interface javaInterface = service.getInterfaceContract().getInterface();
- javaInterface.setRemotable(interfaze.getAnnotation(Remotable.class) != null);
- service.getInterfaceContract().setInterface(javaInterface);
- return service;
- }
-
- public void processCallback(Class<?> interfaze, Contract contract) throws InvalidServiceTypeException {
- Callback callback = interfaze.getAnnotation(Callback.class);
- if (callback != null && !Void.class.equals(callback.value())) {
- Class<?> callbackClass = callback.value();
- JavaInterface javaInterface;
- try {
- javaInterface = javaFactory.createJavaInterface(callbackClass);
- contract.getInterfaceContract().setCallbackInterface(javaInterface);
- } catch (InvalidInterfaceException e) {
- throw new InvalidServiceTypeException("Invalid callback interface "+callbackClass, interfaze);
- }
- } else if (callback != null && Void.class.equals(callback.value())) {
- throw new InvalidServiceTypeException("No callback interface specified on annotation", interfaze);
- }
- }
-
- public boolean injectionAnnotationsPresent(Annotation[][] annots) {
- for (Annotation[] annotations : annots) {
- for (Annotation annotation : annotations) {
- Class<? extends Annotation> annotType = annotation.annotationType();
- if (annotType.equals(Property.class) || annotType.equals(Reference.class)
- || annotType.equals(Resource.class)) {
- return true;
- }
- }
- }
- return false;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring.introspect;
+
+import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getAllInterfaces;
+import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getAllPublicAndProtectedFields;
+import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getAllUniquePublicProtectedMethods;
+import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.getPrivateFields;
+import static org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper.toPropertyName;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.jws.WebService;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.Contract;
+import org.apache.tuscany.sca.assembly.Multiplicity;
+import org.apache.tuscany.sca.implementation.java.IntrospectionException;
+import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
+import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
+import org.apache.tuscany.sca.implementation.java.JavaImplementation;
+import org.apache.tuscany.sca.implementation.java.JavaParameterImpl;
+import org.apache.tuscany.sca.implementation.java.introspect.BaseJavaClassVisitor;
+import org.apache.tuscany.sca.implementation.java.introspect.JavaIntrospectionHelper;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.AmbiguousConstructorException;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.InvalidServiceTypeException;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.NoConstructorException;
+import org.apache.tuscany.sca.implementation.java.introspect.impl.Resource;
+import org.apache.tuscany.sca.implementation.spring.SpringConstructorArgElement;
+import org.apache.tuscany.sca.interfacedef.Interface;
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
+import org.oasisopen.sca.annotation.Callback;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.Property;
+import org.oasisopen.sca.annotation.Reference;
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * Heuristically evaluates an un-annotated Java implementation type to determine
+ * services, references, and properties according to the algorithm described in
+ * the SCA Java Client and Implementation Model Specification <p/> TODO
+ * Implement: <p/> When no service interface is annotated, need to calculate a
+ * single service comprising all public methods that are not reference or
+ * property injection sites. If that service can be exactly mapped to an
+ * interface implemented by the class then the service interface will be defined
+ * in terms of that interface.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringBeanPojoProcessor extends BaseJavaClassVisitor {
+ private JavaInterfaceFactory javaFactory;
+ private List<SpringConstructorArgElement> conArgs;
+
+ public SpringBeanPojoProcessor(AssemblyFactory assemblyFactory, JavaInterfaceFactory javaFactory, List<SpringConstructorArgElement> conArgs) {
+ super(assemblyFactory);
+ this.javaFactory = javaFactory;
+ this.conArgs = conArgs;
+ }
+
+ @Override
+ public <T> void visitEnd(Class<T> clazz, JavaImplementation type) throws IntrospectionException {
+ List<org.apache.tuscany.sca.assembly.Service> services = type.getServices();
+ if (services.isEmpty()) {
+ // heuristically determine the service
+ /**
+ * The following is quoted from Java Specification 1.2.1.3. Introspecting services offered by a Java implementation
+ * In the cases described below, the services offered by a Java implementation class may be determined
+ * through introspection, eliding the need to specify them using @Service. The following algorithm is used
+ * to determine how services are introspected from an implementation class:
+ *
+ * If the interfaces of the SCA services are not specified with the @Service annotation on the
+ * implementation class, it is assumed that all implemented interfaces that have been annotated
+ * as @Remotable are the service interfaces provided by the component. If none of the implemented
+ * interfaces is remotable, then by default the implementation offers a single service whose type
+ * is the implementation class.
+ */
+ Set<Class<?>> interfaces = getAllInterfaces(clazz);
+ for (Class<?> i : interfaces) {
+ if (i.isAnnotationPresent(Remotable.class) || i.isAnnotationPresent(WebService.class)) {
+ addService(type, i);
+ }
+ }
+ if (services.isEmpty()) {
+ // class is the interface
+ addService(type, clazz);
+ }
+ }
+ Set<Method> methods = getAllUniquePublicProtectedMethods(clazz, false);
+ if (!type.getReferenceMembers().isEmpty() || !type.getPropertyMembers().isEmpty()) {
+ // references and properties have been explicitly defined
+ // if (type.getServices().isEmpty()) {
+ // calculateServiceInterface(clazz, type, methods);
+ // if (type.getServices().isEmpty()) {
+ // throw new ServiceTypeNotFoundException(clazz.getName());
+ // }
+ // }
+ evaluateConstructor(type, clazz);
+ return;
+ }
+ calcPropRefs(methods, services, type, clazz);
+ evaluateConstructor(type, clazz);
+ }
+
+ private void addService(JavaImplementation type, Class<?> clazz) throws IntrospectionException {
+ try {
+ org.apache.tuscany.sca.assembly.Service service = createService(clazz);
+ type.getServices().add(service);
+ } catch (InvalidInterfaceException e) {
+ throw new IntrospectionException(e);
+ }
+ }
+
+ private boolean isPublicSetter(Method method) {
+ return method.getParameterTypes().length == 1 && Modifier.isPublic(method.getModifiers())
+ && method.getName().startsWith("set")
+ && method.getReturnType() == void.class;
+ }
+
+ private boolean isProtectedSetter(Method method) {
+ return method.getParameterTypes().length == 1 && Modifier.isProtected(method.getModifiers())
+ && method.getName().startsWith("set")
+ && method.getReturnType() == void.class;
+ }
+
+ private <T> void calcPropRefs(Set<Method> methods,
+ List<org.apache.tuscany.sca.assembly.Service> services,
+ JavaImplementation type,
+ Class<T> clazz) throws IntrospectionException {
+ // heuristically determine the properties references
+ // make a first pass through all public methods with one param
+ Set<String> setters = new HashSet<String>();
+ Set<String> others = new HashSet<String>();
+ for (Method method : methods) {
+ if (!isPublicSetter(method)) {
+ continue;
+ }
+ if (method.isAnnotationPresent(Callback.class) || method.isAnnotationPresent(Context.class)) {
+ // Add the property name as others
+ others.add(toPropertyName(method.getName()));
+ continue;
+ }
+ if (!isInServiceInterface(method, services)) {
+ // Not part of the service interface
+ String name = toPropertyName(method.getName());
+ setters.add(name);
+ // avoid duplicate property or ref names
+ if (!type.getPropertyMembers().containsKey(name) && !type.getReferenceMembers().containsKey(name)) {
+ Class<?> param = method.getParameterTypes()[0];
+ Type genericType = method.getGenericParameterTypes()[0];
+ if (isReferenceType(param, genericType)) {
+ type.getReferences().add(createReference(name, param));
+ type.getReferenceMembers().put(name, new JavaElementImpl(method, 0));
+ } else {
+ type.getProperties().add(createProperty(name, param));
+ type.getPropertyMembers().put(name, new JavaElementImpl(method, 0));
+ }
+ }
+ }
+ }
+ // second pass for protected methods with one param
+ for (Method method : methods) {
+ if (!isProtectedSetter(method)) {
+ continue;
+ }
+ if (method.isAnnotationPresent(Callback.class) || method.isAnnotationPresent(Context.class)) {
+ // Add the property name as others
+ others.add(toPropertyName(method.getName()));
+ continue;
+ }
+ Class<?> param = method.getParameterTypes()[0];
+ String name = toPropertyName(method.getName());
+ setters.add(name);
+ // avoid duplicate property or ref names
+ if (isReferenceType(param, method.getGenericParameterTypes()[0])) {
+ if (!type.getReferenceMembers().containsKey(name)) {
+ type.getReferences().add(createReference(name, param));
+ type.getReferenceMembers().put(name, new JavaElementImpl(method, 0));
+ }
+ } else {
+ if (!type.getPropertyMembers().containsKey(name)) {
+ type.getProperties().add(createProperty(name, param));
+ type.getPropertyMembers().put(name, new JavaElementImpl(method, 0));
+ }
+ }
+ }
+
+ // Public or protected fields unless there is a public or protected
+ // setter method
+ // for the same name
+ Set<Field> fields = getAllPublicAndProtectedFields(clazz, false);
+ for (Field field : fields) {
+ if (field.isAnnotationPresent(Callback.class) || field.isAnnotationPresent(Context.class)) {
+ continue;
+ }
+ if (setters.contains(field.getName()) || others.contains(field.getName())) {
+ continue;
+ }
+ String name = field.getName();
+ Class<?> paramType = field.getType();
+ if (isReferenceType(paramType, field.getGenericType())) {
+ if (!type.getReferenceMembers().containsKey(name)) {
+ type.getReferences().add(createReference(name, paramType));
+ type.getReferenceMembers().put(name, new JavaElementImpl(field));
+ }
+ } else {
+ if (!type.getPropertyMembers().containsKey(name)) {
+ type.getProperties().add(createProperty(name, paramType));
+ type.getPropertyMembers().put(name, new JavaElementImpl(field));
+ }
+ }
+ }
+
+ // Private fields unless there is a public or protected
+ // setter method for the same name
+ Set<Field> privateFields = getPrivateFields(clazz);
+ for (Field field : privateFields) {
+ if (field.isAnnotationPresent(Callback.class) || field.isAnnotationPresent(Context.class)) {
+ continue;
+ }
+ if (setters.contains(field.getName()) || others.contains(field.getName())) {
+ continue;
+ }
+ String name = field.getName();
+ Class<?> paramType = field.getType();
+ if (isReferenceType(paramType, field.getGenericType())) {
+ if (!type.getReferenceMembers().containsKey(name)) {
+ type.getReferences().add(createReference(name, paramType));
+ type.getReferenceMembers().put(name, new JavaElementImpl(field));
+ }
+ } else {
+ if (!type.getPropertyMembers().containsKey(name)) {
+ type.getProperties().add(createProperty(name, paramType));
+ type.getPropertyMembers().put(name, new JavaElementImpl(field));
+ }
+ }
+ }
+ }
+
+ /**
+ * Determines the constructor to use based on the component type's
+ * references and properties
+ *
+ * @param type the component type
+ * @param clazz the implementation class corresponding to the component type
+ * @throws NoConstructorException if no suitable constructor is found
+ * @throws AmbiguousConstructorException if the parameters of a constructor
+ * cannot be unambiguously mapped to references and properties
+ */
+ @SuppressWarnings("unchecked")
+ private <T> void evaluateConstructor(JavaImplementation type, Class<T> clazz) throws IntrospectionException {
+ // determine constructor if one is not annotated
+ JavaConstructorImpl<?> definition = type.getConstructor();
+ Map<String, JavaElementImpl> props = type.getPropertyMembers();
+ Map<String, JavaElementImpl> refs = type.getReferenceMembers();
+ Constructor constructor;
+ boolean explict = false;
+ if (definition != null && definition.getConstructor()
+ .isAnnotationPresent(org.oasisopen.sca.annotation.Constructor.class)) {
+ // the constructor was already defined explicitly
+ return;
+ } else if (definition != null) {
+ explict = true;
+ constructor = definition.getConstructor();
+ } else {
+ // no definition, heuristically determine constructor
+ Constructor[] constructors = clazz.getConstructors();
+ if (constructors.length == 0) {
+ throw new NoConstructorException("No public constructor for class");
+ } else if (constructors.length == 1) {
+ // Only one constructor, take it
+ constructor = constructors[0];
+ } else {
+ // multiple constructors scenario
+ Constructor<T> selected = null;
+ for (Constructor<T> ctor : constructors) {
+ if (ctor.getParameterTypes().length == 0) {
+ selected = ctor;
+ } else if (ctor.getParameterTypes().length == conArgs.size()) {
+ // we will find a constructor which has atleast one
+ // reference or property as its parameter types.
+ Class<?>[] parametersTypes = ctor.getParameterTypes();
+ for (Class<?> pType: parametersTypes) {
+ for (JavaElementImpl property : props.values()) {
+ if (pType.equals(property.getType()))
+ selected = ctor;
+ }
+ for (JavaElementImpl reference : refs.values()) {
+ if (pType.equals(reference.getType()))
+ selected = ctor;
+ }
+ }
+ }
+ }
+ if (selected == null) {
+ throw new NoConstructorException();
+ }
+ constructor = selected;
+ }
+ definition = type.getConstructors().get(constructor);
+ type.setConstructor(definition);
+ }
+
+ JavaParameterImpl[] parameters = definition.getParameters();
+ if (parameters.length == 0) {
+ return;
+ }
+
+ Annotation[][] annotations = constructor.getParameterAnnotations();
+ if (!explict) {
+ // the constructor wasn't defined by an annotation, so check to see
+ // if any of the params have an annotation
+ // which we can impute as explicitly defining the constructor, e.g.
+ // @Property, @Reference, or @Autowire
+ explict = injectionAnnotationsPresent(annotations);
+ }
+ if (explict) {
+ for (int i = 0; i < parameters.length; i++) {
+ if (isAnnotated(parameters[i])) {
+ continue;
+ } else if (!findReferenceOrProperty(parameters[i], props, refs)) {
+ throw new AmbiguousConstructorException(parameters[i].toString());
+ }
+ }
+ } else {
+ if (!areUnique(parameters)) {
+ throw new AmbiguousConstructorException("Cannot resolve non-unique parameter types, use @Constructor");
+ }
+ if (!calcPropRefUniqueness(props.values(), refs.values())) {
+ throw new AmbiguousConstructorException("Cannot resolve non-unique parameter types, use @Constructor");
+ }
+ if (!(props.isEmpty() && refs.isEmpty())) {
+ calcParamNames(parameters, props, refs);
+ } else {
+ heuristicParamNames(type, parameters);
+
+ }
+ }
+ }
+
+ private void calcParamNames(JavaParameterImpl[] parameters,
+ Map<String, JavaElementImpl> props,
+ Map<String, JavaElementImpl> refs) throws AmbiguousConstructorException {
+ // the constructor param types must unambiguously match defined
+ // reference or property types
+ for (JavaParameterImpl param : parameters) {
+ if (!findReferenceOrProperty(param, props, refs)) {
+ throw new AmbiguousConstructorException(param.getName());
+ }
+ }
+ }
+
+ private void heuristicParamNames(JavaImplementation type, JavaParameterImpl[] parameters)
+ throws IntrospectionException {
+ // heuristically determine refs and props from the parameter types
+ for (JavaParameterImpl p : parameters) {
+ String name = p.getType().getSimpleName().toLowerCase();
+ if (isReferenceType(p.getType(), p.getGenericType())) {
+ type.getReferences().add(createReference(name, p.getType()));
+ p.setClassifer(Reference.class);
+ type.getReferenceMembers().put(name, p);
+ } else {
+ type.getProperties().add(createProperty(name, p.getType()));
+ p.setClassifer(Property.class);
+ type.getPropertyMembers().put(name, p);
+ }
+ p.setName(name);
+ }
+ }
+
+ private static boolean areUnique(Class[] collection) {
+ Set<Class> set = new HashSet<Class>(Arrays.asList(collection));
+ return set.size() == collection.length;
+ }
+
+ /**
+ * Returns true if the union of the given collections of properties and
+ * references have unique Java types
+ */
+ private boolean calcPropRefUniqueness(Collection<JavaElementImpl> props, Collection<JavaElementImpl> refs) {
+
+ Class[] classes = new Class[props.size() + refs.size()];
+ int i = 0;
+ for (JavaElementImpl property : props) {
+ classes[i] = property.getType();
+ i++;
+ }
+ for (JavaElementImpl reference : refs) {
+ classes[i] = reference.getType();
+ i++;
+ }
+ return areUnique(classes);
+ }
+
+ /**
+ * Unambiguously finds the reference or property associated with the given
+ * type
+ *
+ * @return the name of the reference or property if found, null if not
+ * @throws AmbiguousConstructorException if the constructor parameter cannot
+ * be resolved to a property or reference
+ */
+ private boolean findReferenceOrProperty(JavaParameterImpl parameter,
+ Map<String, JavaElementImpl> props,
+ Map<String, JavaElementImpl> refs) throws AmbiguousConstructorException {
+
+ boolean found = false;
+ if (!"".equals(parameter.getName())) {
+ // Match by name
+ JavaElementImpl prop = props.get(parameter.getName());
+ if (prop != null && prop.getType() == parameter.getType()) {
+ parameter.setClassifer(Property.class);
+ return true;
+ }
+ JavaElementImpl ref = refs.get(parameter.getName());
+ if (ref != null && ref.getType() == parameter.getType()) {
+ parameter.setClassifer(Reference.class);
+ return true;
+ }
+ }
+ for (JavaElementImpl property : props.values()) {
+ if (property.getType() == parameter.getType()) {
+ if (found) {
+ throw new AmbiguousConstructorException("Ambiguous property or reference for constructor type",
+ (Member)parameter.getAnchor());
+ }
+ parameter.setClassifer(Property.class);
+ parameter.setName(property.getName());
+ found = true;
+ // do not break since ambiguities must be checked, i.e. more
+ // than one prop or ref of the same type
+ }
+ }
+ for (JavaElementImpl reference : refs.values()) {
+ if (reference.getType() == parameter.getType()) {
+ if (found) {
+ throw new AmbiguousConstructorException("Ambiguous property or reference for constructor type",
+ (Member)parameter.getAnchor());
+ }
+ parameter.setClassifer(Reference.class);
+ parameter.setName(reference.getName());
+ found = true;
+ // do not break since ambiguities must be checked, i.e. more
+ // than one prop or ref of the same type
+ }
+ }
+ return found;
+ }
+
+ /**
+ * Returns true if a given type is reference according to the SCA
+ * specification rules for determining reference types The following rules
+ * are used to determine whether an unannotated field or setter method is a
+ * property or reference:
+ * <ol>
+ * <li>If its type is simple, then it is a property.
+ * <li>If its type is complex, then if the type is an interface marked by
+ *
+ * @Remotable, then it is a reference; otherwise, it is a property.
+ * <li>Otherwise, if the type associated with the member is an
+ * array or a java.util.Collection, the basetype is the element
+ * type of the array or the parameterized type of the
+ * Collection; otherwise the basetype is the member type. If the
+ * basetype is an interface with an
+ * @Remotable or
+ * @Service annotation then the member is defined as a reference. Otherwise,
+ * it is defined as a property.
+ * </ol>
+ * <p>
+ * The name of the reference or of the property is derived from the
+ * name found on the setter method or on the field.
+ */
+ private boolean isReferenceType(Class<?> cls, Type genericType) {
+ Class<?> baseType = JavaIntrospectionHelper.getBaseType(cls, genericType);
+ return baseType.isInterface() && baseType.isAnnotationPresent(Remotable.class);
+ }
+
+ /**
+ * Returns true if the given operation is defined in the collection of
+ * service interfaces
+ */
+ private boolean isInServiceInterface(Method operation, List<org.apache.tuscany.sca.assembly.Service> services) {
+ for (org.apache.tuscany.sca.assembly.Service service : services) {
+ Interface interface1 = service.getInterfaceContract().getInterface();
+ if (interface1 instanceof JavaInterface) {
+ Class<?> clazz = ((JavaInterface)interface1).getJavaClass();
+ if (isMethodMatched(clazz, operation)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Test if the class declares a method which matches the signature of the
+ * given method
+ *
+ * @param clazz
+ * @param method
+ * @return
+ */
+ private boolean isMethodMatched(Class<?> clazz, Method method) {
+ if (method.getDeclaringClass() == clazz) {
+ return true;
+ }
+ Method[] methods = clazz.getMethods();
+ for (Method m : methods) {
+ if (JavaIntrospectionHelper.exactMethodMatch(method, m)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Creates a mapped property.
+ *
+ * @param name the property name
+ * @param paramType the property type
+ */
+ private org.apache.tuscany.sca.assembly.Property createProperty(String name, Class<?> paramType) {
+ org.apache.tuscany.sca.assembly.Property property = assemblyFactory.createProperty();
+ property.setName(name);
+ property.setXSDType(JavaXMLMapper.getXMLType(paramType));
+ return property;
+ }
+
+ private boolean isAnnotated(JavaParameterImpl parameter) {
+ for (Annotation annotation : parameter.getAnnotations()) {
+ Class<? extends Annotation> annotType = annotation.annotationType();
+ if (annotType.equals(Property.class) || annotType.equals(Reference.class)
+ || annotType.equals(Resource.class)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public boolean areUnique(JavaParameterImpl[] parameters) {
+ Set<Class> set = new HashSet<Class>(parameters.length);
+ for (JavaParameterImpl p : parameters) {
+ if (!set.add(p.getType())) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public org.apache.tuscany.sca.assembly.Reference createReference(String name, Class<?> paramType)
+ throws IntrospectionException {
+ org.apache.tuscany.sca.assembly.Reference reference = assemblyFactory.createReference();
+ reference.setName(name);
+ JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
+ reference.setInterfaceContract(interfaceContract);
+ try {
+ JavaInterface callInterface = javaFactory.createJavaInterface(paramType);
+ reference.getInterfaceContract().setInterface(callInterface);
+ if (callInterface.getCallbackClass() != null) {
+ JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
+ reference.getInterfaceContract().setCallbackInterface(callbackInterface);
+ }
+ reference.setMultiplicity(Multiplicity.ZERO_ONE);
+ } catch (InvalidInterfaceException e1) {
+ throw new IntrospectionException(e1);
+ }
+
+ // FIXME: This part seems to have already been taken care above!!
+ try {
+ processCallback(paramType, reference);
+ } catch (InvalidServiceTypeException e) {
+ throw new IntrospectionException(e);
+ }
+ return reference;
+ }
+
+ public org.apache.tuscany.sca.assembly.Service createService(Class<?> interfaze) throws InvalidInterfaceException {
+ org.apache.tuscany.sca.assembly.Service service = assemblyFactory.createService();
+ service.setName(interfaze.getSimpleName());
+
+ JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
+ service.setInterfaceContract(interfaceContract);
+
+ JavaInterface callInterface = javaFactory.createJavaInterface(interfaze);
+ service.getInterfaceContract().setInterface(callInterface);
+ if (callInterface.getCallbackClass() != null) {
+ JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
+ service.getInterfaceContract().setCallbackInterface(callbackInterface);
+ }
+
+ Interface javaInterface = service.getInterfaceContract().getInterface();
+ javaInterface.setRemotable(interfaze.getAnnotation(Remotable.class) != null);
+ service.getInterfaceContract().setInterface(javaInterface);
+ return service;
+ }
+
+ public void processCallback(Class<?> interfaze, Contract contract) throws InvalidServiceTypeException {
+ Callback callback = interfaze.getAnnotation(Callback.class);
+ if (callback != null && !Void.class.equals(callback.value())) {
+ Class<?> callbackClass = callback.value();
+ JavaInterface javaInterface;
+ try {
+ javaInterface = javaFactory.createJavaInterface(callbackClass);
+ contract.getInterfaceContract().setCallbackInterface(javaInterface);
+ } catch (InvalidInterfaceException e) {
+ throw new InvalidServiceTypeException("Invalid callback interface "+callbackClass, interfaze);
+ }
+ } else if (callback != null && Void.class.equals(callback.value())) {
+ throw new InvalidServiceTypeException("No callback interface specified on annotation", interfaze);
+ }
+ }
+
+ public boolean injectionAnnotationsPresent(Annotation[][] annots) {
+ for (Annotation[] annotations : annots) {
+ for (Annotation annotation : annotations) {
+ Class<? extends Annotation> annotType = annotation.annotationType();
+ if (annotType.equals(Property.class) || annotType.equals(Reference.class)
+ || annotType.equals(Resource.class)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+}
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
index b880e7ba2a..efc4b309e0 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java
@@ -1,781 +1,781 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring.introspect;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.jar.Attributes;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.util.jar.Manifest;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Multiplicity;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.resolver.ClassReference;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
-import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
-import org.apache.tuscany.sca.implementation.java.JavaImplementation;
-import org.apache.tuscany.sca.implementation.java.JavaParameterImpl;
-import org.apache.tuscany.sca.implementation.spring.SpringBeanElement;
-import org.apache.tuscany.sca.implementation.spring.SpringConstructorArgElement;
-import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
-import org.apache.tuscany.sca.implementation.spring.SpringImplementationConstants;
-import org.apache.tuscany.sca.implementation.spring.SpringPropertyElement;
-import org.apache.tuscany.sca.implementation.spring.SpringSCAPropertyElement;
-import org.apache.tuscany.sca.implementation.spring.SpringSCAReferenceElement;
-import org.apache.tuscany.sca.implementation.spring.SpringSCAServiceElement;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-
-/**
- * Introspects a Spring XML application-context configuration file to create <implementation-spring../>
- * component type information.
- *
- *
- * @version $Rev: 512919 $ $Date: 2007-02-28 19:32:56 +0000 (Wed, 28 Feb 2007) $
- */
-public class SpringXMLComponentTypeLoader {
-
- private XMLInputFactory xmlInputFactory;
- private ContributionFactory contributionFactory;
- private AssemblyFactory assemblyFactory;
- private JavaInterfaceFactory javaFactory;
- private PolicyFactory policyFactory;
-
- private SpringBeanIntrospector beanIntrospector;
-
- public SpringXMLComponentTypeLoader(FactoryExtensionPoint factories,
- AssemblyFactory assemblyFactory,
- JavaInterfaceFactory javaFactory,
- PolicyFactory policyFactory) {
- super();
- this.assemblyFactory = assemblyFactory;
- this.javaFactory = javaFactory;
- this.policyFactory = policyFactory;
- this.contributionFactory = factories.getFactory(ContributionFactory.class);
- this.xmlInputFactory = factories.getFactory(XMLInputFactory.class);
- }
-
- protected Class<SpringImplementation> getImplementationClass() {
- return SpringImplementation.class;
- }
-
- /**
- * Base method which loads the component type from the application-context attached to the
- * Spring implementation
- *
- */
- public void load(SpringImplementation implementation, ModelResolver resolver) throws ContributionReadException {
- //System.out.println("Spring TypeLoader - load method start");
- ComponentType componentType = implementation.getComponentType();
- /* Check that there is a component type object already set */
- if (componentType == null) {
- throw new ContributionReadException("SpringXMLLoader load: implementation has no ComponentType object");
- }
- if (componentType.isUnresolved()) {
- /* Fetch the location of the application-context file from the implementation */
- loadFromXML(implementation, resolver);
- if (!componentType.isUnresolved())
- implementation.setUnresolved(false);
- } // end if
- //System.out.println("Spring TypeLoader - load method complete");
- } // end method load
-
- private Class<?> resolveClass(ModelResolver resolver, String className) throws ClassNotFoundException {
- ClassReference classReference = new ClassReference(className);
- classReference = resolver.resolveModel(ClassReference.class, classReference);
- if (classReference.isUnresolved()) {
- throw new ClassNotFoundException(className);
- }
- Class<?> javaClass = classReference.getJavaClass();
- return javaClass;
- }
-
- /**
- * Method which fills out the component type for a Spring implementation by reading the
- * Spring application-context.xml file.
- *
- * @param implementation SpringImplementation into which to load the component type information
- * @throws ContributionReadException Failed to read the contribution
- */
- private void loadFromXML(SpringImplementation implementation, ModelResolver resolver) throws ContributionReadException {
- XMLStreamReader reader;
- List<SpringBeanElement> beans = new ArrayList<SpringBeanElement>();
- List<SpringSCAServiceElement> services = new ArrayList<SpringSCAServiceElement>();
- List<SpringSCAReferenceElement> references = new ArrayList<SpringSCAReferenceElement>();
- List<SpringSCAPropertyElement> scaproperties = new ArrayList<SpringSCAPropertyElement>();
-
- URL resource;
-
- String contextPath = implementation.getLocation();
-
- try {
- resource = resolveLocation(resolver, contextPath);
- resource = getApplicationContextResource(resource);
- implementation.setResource(resource);
- // The URI is used to uniquely identify the Implementation
- implementation.setURI(resource.toString());
- reader = xmlInputFactory.createXMLStreamReader(resource.openStream());
-
- // System.out.println("Spring TypeLoader - starting to read context file");
- readContextDefinition(resolver, reader, contextPath, beans, services, references, scaproperties);
-
- } catch (IOException e) {
- throw new ContributionReadException(e);
- } catch (XMLStreamException e) {
- throw new ContributionReadException(e);
- }
-
- /* At this point, the complete application-context.xml file has been read and its contents */
- /* stored in the lists of beans, services, references. These are now used to generate */
- /* the implied componentType for the application context */
- generateComponentType(implementation, resolver, beans, services, references, scaproperties);
-
- return;
- } // end method loadFromXML
-
- private URL resolveLocation(ModelResolver resolver, String contextPath) throws MalformedURLException,
- ContributionReadException {
- URL resource = null;
- URI uri = URI.create(contextPath);
- if (!uri.isAbsolute()) {
- Artifact artifact = contributionFactory.createArtifact();
- artifact.setUnresolved(true);
- artifact.setURI(contextPath);
- artifact = resolver.resolveModel(Artifact.class, artifact);
- if (!artifact.isUnresolved()) {
- resource = new URL(artifact.getLocation());
- } else {
- throw new ContributionReadException("Location cannot be resloved: " + contextPath);
- }
- } else {
- resource = new URL(contextPath);
- }
- return resource;
- }
-
- /**
- * Method which returns the XMLStreamReader for the Spring application-context.xml file
- * specified in the location attribute
- */
- private XMLStreamReader getApplicationContextReader(ModelResolver resolver, String location) throws ContributionReadException {
-
- try {
- URL resource = getApplicationContextResource(resolveLocation(resolver, location));
- XMLStreamReader reader =
- xmlInputFactory.createXMLStreamReader(resource.openStream());
- return reader;
- } catch (IOException e) {
- throw new ContributionReadException(e);
- } catch (XMLStreamException e) {
- throw new ContributionReadException(e);
- }
- }
-
- /**
- * Method which reads the spring context definitions from Spring application-context.xml
- * file and identifies the defined beans, properties, services and references
- */
- private void readContextDefinition(ModelResolver resolver,
- XMLStreamReader reader,
- String contextPath,
- List<SpringBeanElement> beans,
- List<SpringSCAServiceElement> services,
- List<SpringSCAReferenceElement> references,
- List<SpringSCAPropertyElement> scaproperties) throws ContributionReadException {
-
- SpringBeanElement bean = null;
-
- try {
- boolean completed = false;
- while (!completed) {
- switch (reader.next()) {
- case START_ELEMENT:
- QName qname = reader.getName();
- //System.out.println("Spring TypeLoader - found element with name: " + qname.toString());
- if (SpringImplementationConstants.IMPORT_ELEMENT.equals(qname)) {
- //FIXME - put the sequence of code below which gets the ireader into a subsidiary method
- String location = reader.getAttributeValue(null, "resource");
- if (location != null) {
- // FIXME - need to find a right way of generating this path
- String resourcePath = contextPath.substring(0, contextPath.lastIndexOf("/")+1) + location;
- XMLStreamReader ireader = getApplicationContextReader(resolver, resourcePath);
- // Read the context definition for the identified imported resource
- readContextDefinition(resolver, ireader, contextPath, beans, services, references, scaproperties);
- }
- } else if (SpringImplementationConstants.SERVICE_ELEMENT.equals(qname)) {
- SpringSCAServiceElement service =
- new SpringSCAServiceElement(reader.getAttributeValue(null, "name"), reader
- .getAttributeValue(null, "type"), reader.getAttributeValue(null, "target"));
- services.add(service);
- } else if (SpringImplementationConstants.REFERENCE_ELEMENT.equals(qname)) {
- SpringSCAReferenceElement reference =
- new SpringSCAReferenceElement(reader.getAttributeValue(null, "name"), reader
- .getAttributeValue(null, "type"));
- references.add(reference);
- } else if (SpringImplementationConstants.SCAPROPERTY_ELEMENT.equals(qname)) {
- SpringSCAPropertyElement scaproperty =
- new SpringSCAPropertyElement(reader.getAttributeValue(null, "name"), reader
- .getAttributeValue(null, "type"));
- scaproperties.add(scaproperty);
- } else if (SpringImplementationConstants.BEAN_ELEMENT.equals(qname)) {
- bean = new SpringBeanElement(reader.getAttributeValue(null, "id"), reader
- .getAttributeValue(null, "class"));
- beans.add(bean);
- // Read the <bean> element and its child elements
- readBeanDefinition(resolver, reader, contextPath, bean, beans, services, references, scaproperties);
- } // end if*/
- break;
- case END_ELEMENT:
- if (SpringImplementationConstants.BEANS_ELEMENT.equals(reader.getName())) {
- //System.out.println("Spring TypeLoader - finished read of context file");
- completed = true;
- break;
- } // end if
- } // end switch
- } // end while
- } catch (XMLStreamException e) {
- throw new ContributionReadException(e);
- }
- }
-
-
- /**
- * Method which reads the bean definitions from Spring application-context.xml file and identifies
- * the defined beans, properties, services and references
- */
- private void readBeanDefinition(ModelResolver resolver,
- XMLStreamReader reader,
- String contextPath,
- SpringBeanElement bean,
- List<SpringBeanElement> beans,
- List<SpringSCAServiceElement> services,
- List<SpringSCAReferenceElement> references,
- List<SpringSCAPropertyElement> scaproperties) throws ContributionReadException {
-
- SpringBeanElement innerbean = null;
- SpringPropertyElement property = null;
- SpringConstructorArgElement constructorArg = null;
- int autoConstructorIndex = -1;
-
- try {
- boolean completed = false;
- while (!completed) {
- switch (reader.next()) {
- case START_ELEMENT:
- QName qname = reader.getName();
- if (SpringImplementationConstants.BEAN_ELEMENT.equals(qname)) {
- innerbean = new SpringBeanElement(reader.getAttributeValue(null, "id"), reader
- .getAttributeValue(null, "class"));
- innerbean.setInnerBean(true);
- beans.add(innerbean);
- readBeanDefinition(resolver, reader, contextPath, innerbean, beans, services, references, scaproperties);
- } else if (SpringImplementationConstants.PROPERTY_ELEMENT.equals(qname)) {
- property = new SpringPropertyElement(reader.getAttributeValue(null, "name"), reader
- .getAttributeValue(null, "ref"));
- bean.addProperty(property);
- } else if (SpringImplementationConstants.CONSTRUCTORARG_ELEMENT.equals(qname)) {
- constructorArg = new SpringConstructorArgElement(reader.getAttributeValue(null, "ref"),
- reader.getAttributeValue(null, "type"));
- autoConstructorIndex++;
- constructorArg.setAutoIndex(autoConstructorIndex);
- if (reader.getAttributeValue(null, "index") != null)
- constructorArg.setIndex((new Integer(reader.getAttributeValue(null, "index"))).intValue());
- if (reader.getAttributeValue(null, "value") != null) {
- String value = reader.getAttributeValue(null, "value");
- constructorArg.addValue(value);
- if ((value.indexOf(".xml") != -1)) {
- if ((bean.getClassName().indexOf(".ClassPathXmlApplicationContext") != -1) ||
- (bean.getClassName().indexOf(".FileSystemXmlApplicationContext") != -1)) {
- XMLStreamReader creader = getApplicationContextReader(resolver, value);
- // Read the context definition for the constructor-arg resources
- readContextDefinition(resolver, creader, contextPath, beans, services, references, scaproperties);
- }
- }
- }
- bean.addCustructorArgs(constructorArg);
- } else if (SpringImplementationConstants.REF_ELEMENT.equals(qname)) {
- String ref = reader.getAttributeValue(null, "bean");
- // Check if the parent element is a property
- if (property != null) property.setRef(ref);
- // Check if the parent element is a constructor-arg
- if (constructorArg != null) constructorArg.setRef(ref);
- } else if (SpringImplementationConstants.VALUE_ELEMENT.equals(qname)) {
- String value = reader.getElementText();
- // Check if the parent element is a constructor-arg
- if (constructorArg != null) {
- constructorArg.addValue(value);
- // Identify the XML resource specified for the constructor-arg element
- if ((value.indexOf(".xml") != -1)) {
- if ((bean.getClassName().indexOf(".ClassPathXmlApplicationContext") != -1) ||
- (bean.getClassName().indexOf(".FileSystemXmlApplicationContext") != -1)) {
- XMLStreamReader creader = getApplicationContextReader(resolver, value);
- // Read the context definition for the constructor-arg resources
- readContextDefinition(resolver, creader, contextPath, beans, services, references, scaproperties);
- }
- }
- }
- } // end if
- break;
- case END_ELEMENT:
- if (SpringImplementationConstants.BEAN_ELEMENT.equals(reader.getName())) {
- completed = true;
- break;
- } else if (SpringImplementationConstants.PROPERTY_ELEMENT.equals(reader.getName())) {
- property = null;
- } else if (SpringImplementationConstants.CONSTRUCTORARG_ELEMENT.equals(reader.getName())) {
- constructorArg = null;
- } // end if
- } // end switch
- } // end while
- } catch (XMLStreamException e) {
- throw new ContributionReadException(e);
- }
- }
-
- /**
- * Generates the Spring implementation component type from the configuration contained in the
- * lists of beans, services, references and scaproperties derived from the application context
- */
- private void generateComponentType(SpringImplementation implementation,
- ModelResolver resolver,
- List<SpringBeanElement> beans,
- List<SpringSCAServiceElement> services,
- List<SpringSCAReferenceElement> references,
- List<SpringSCAPropertyElement> scaproperties) throws ContributionReadException {
- /*
- * 1. Each sca:service becomes a service in the component type
- * 2. Each sca:reference becomes a reference in the component type
- * 3. Each sca:property becomes a property in the component type
- * 4. IF there are no explicit service elements, each bean becomes a service
- * 5. Each bean property which is a reference not pointing at another bean in the
- * application context becomes a reference unless it is pointing at one of the references
- * 6. Each bean property which is not a reference and which is not pointing
- * at another bean in the application context becomes a property in the component type
- */
-
- JavaImplementation javaImplementation = null;
- ComponentType componentType = implementation.getComponentType();
-
- try {
- // Deal with the services first....
- Iterator<SpringSCAServiceElement> its = services.iterator();
- while (its.hasNext()) {
- SpringSCAServiceElement serviceElement = its.next();
- Class<?> interfaze = resolveClass(resolver, serviceElement.getType());
- Service theService = createService(interfaze, serviceElement.getName());
- componentType.getServices().add(theService);
- // Add this service to the Service / Bean map
- String beanName = serviceElement.getTarget();
- for (SpringBeanElement beanElement : beans) {
- if (beanName.equals(beanElement.getId())) {
- implementation.setBeanForService(theService, beanElement);
- }
- } // end for
- } // end while
-
- // Next handle the references
- Iterator<SpringSCAReferenceElement> itr = references.iterator();
- while (itr.hasNext()) {
- SpringSCAReferenceElement referenceElement = itr.next();
- Class<?> interfaze = resolveClass(resolver, referenceElement.getType());
- Reference theReference = createReference(interfaze, referenceElement.getName());
- componentType.getReferences().add(theReference);
- } // end while
-
- // Next handle the properties
- Iterator<SpringSCAPropertyElement> itsp = scaproperties.iterator();
- while (itsp.hasNext()) {
- SpringSCAPropertyElement scaproperty = itsp.next();
- // Create a component type property if the SCA property element has a name
- // and a type declared...
- if (scaproperty.getType() != null && scaproperty.getName() != null) {
- Property theProperty = assemblyFactory.createProperty();
- theProperty.setName(scaproperty.getName());
- // Get the Java class and then an XSD element type for the property
- Class<?> propType = Class.forName(scaproperty.getType());
- theProperty.setXSDType(JavaXMLMapper.getXMLType(propType));
- componentType.getProperties().add(theProperty);
- // Remember the Java Class (ie the type) for this property
- implementation.setPropertyClass(theProperty.getName(), propType);
- } // end if
- } // end while
-
- // Finally deal with the beans
- Iterator<SpringBeanElement> itb;
- // If there are no explicit service elements, then expose all the beans
- if (services.isEmpty()) {
- itb = beans.iterator();
- // Loop through all the beans found
- while (itb.hasNext()) {
- SpringBeanElement beanElement = itb.next();
- // If its a innerBean, ignore it
- if (beanElement.isInnerBean()) continue;
- // Load the Spring bean class
- Class<?> beanClass = resolveClass(resolver, beanElement.getClassName());
- // Introspect the bean
- beanIntrospector =
- new SpringBeanIntrospector(assemblyFactory, javaFactory, policyFactory, beanElement.getCustructorArgs());
- ComponentType beanComponentType = assemblyFactory.createComponentType();
- javaImplementation = beanIntrospector.introspectBean(beanClass, beanComponentType);
- // Get the service interface defined by this Spring Bean and add to
- // the component type of the Spring Assembly
- List<Service> beanServices = beanComponentType.getServices();
- componentType.getServices().addAll(beanServices);
- // Add these services to the Service / Bean map
- for (Service beanService : beanServices) {
- implementation.setBeanForService(beanService, beanElement);
- }
- } // end while
- } // end if
-
- itb = beans.iterator();
- while (itb.hasNext()) {
- SpringBeanElement beanElement = itb.next();
- // Ignore if the bean has no properties and constructor arguments
- if (beanElement.getProperties().isEmpty() && beanElement.getCustructorArgs().isEmpty())
- continue;
-
- Class<?> beanClass = resolveClass(resolver, beanElement.getClassName());
- // Introspect the bean
- beanIntrospector =
- new SpringBeanIntrospector(assemblyFactory, javaFactory, policyFactory, beanElement.getCustructorArgs());
- ComponentType beanComponentType = assemblyFactory.createComponentType();
- javaImplementation = beanIntrospector.introspectBean(beanClass, beanComponentType);
- Map<String, JavaElementImpl> propertyMap = javaImplementation.getPropertyMembers();
- JavaConstructorImpl constructor = javaImplementation.getConstructor();
- // Get the references by this Spring Bean and add the unresolved ones to
- // the component type of the Spring Assembly
- List<Reference> beanReferences = beanComponentType.getReferences();
- List<Property> beanProperties = beanComponentType.getProperties();
-
- Iterator<SpringPropertyElement> itp = beanElement.getProperties().iterator();
- while (itp.hasNext()) {
- SpringPropertyElement propertyElement = itp.next();
- if (propertyRefUnresolved(propertyElement.getRef(), beans, references, scaproperties)) {
- // This means an unresolved reference from the spring bean...
- for (Reference reference : beanReferences) {
- if (propertyElement.getName().equals(reference.getName())) {
- // The name of the reference in this case is the string in
- // the @ref attribute of the Spring property element, NOT the
- // name of the field in the Spring bean....
- reference.setName(propertyElement.getRef());
- componentType.getReferences().add(reference);
- } // end if
- } // end for
-
- // Store the unresolved references as unresolvedBeanRef in the Spring Implementation type
- for (Property scaproperty : beanProperties) {
- if (propertyElement.getName().equals(scaproperty.getName())) {
- // The name of the reference in this case is the string in
- // the @ref attribute of the Spring property element, NOT the
- // name of the field in the Spring bean....
- Class<?> interfaze = resolveClass(resolver, (propertyMap.get(propertyElement.getName()).getType()).getName());
- Reference theReference = createReference(interfaze, propertyElement.getRef());
- implementation.setUnresolvedBeanRef(propertyElement.getRef(), theReference);
- } // end if
- } // end for
- } // end if
- } // end while
-
- Iterator<SpringConstructorArgElement> itcr = beanElement.getCustructorArgs().iterator();
- while (itcr.hasNext()) {
- SpringConstructorArgElement conArgElement = itcr.next();
- if (propertyRefUnresolved(conArgElement.getRef(), beans, references, scaproperties)) {
- for (JavaParameterImpl parameter : constructor.getParameters()) {
- String paramType = parameter.getType().getName();
- Class<?> interfaze = resolveClass(resolver, paramType);
- // Create a component type reference/property if the constructor-arg element has a
- // type attribute OR index attribute declared...
- if ((conArgElement.getType() != null && paramType.equals(conArgElement.getType())) ||
- (conArgElement.getIndex() != -1 && (conArgElement.getIndex() == parameter.getIndex())) ||
- (conArgElement.getAutoIndex() == parameter.getIndex()))
- {
- if (parameter.getClassifer().getName().equals("org.osoa.sca.annotations.Reference")) {
- Reference theReference = createReference(interfaze, conArgElement.getRef());
- componentType.getReferences().add(theReference);
- }
- if (parameter.getClassifer().getName().equals("org.osoa.sca.annotations.Property")) {
- // Store the unresolved references as unresolvedBeanRef in the Spring Implementation type
- // we might need to verify with the component definition later.
- Reference theReference = createReference(interfaze, conArgElement.getRef());
- implementation.setUnresolvedBeanRef(conArgElement.getRef(), theReference);
- }
- }
- } // end for
- } // end if
- } // end while
-
- } // end while
-
- } catch (ClassNotFoundException e) {
- // Means that either an interface class, property class or a bean was not found
- throw new ContributionReadException(e);
- } catch (InvalidInterfaceException e) {
- throw new ContributionReadException(e);
- } catch (ContributionResolveException e) {
-
- } // end try
-
- // If we get here, the Spring assembly component type is resolved
- componentType.setUnresolved(false);
- implementation.setComponentType(componentType);
- return;
- } // end method generateComponentType
-
- /*
- * Determines whether a reference attribute of a Spring property element is resolved either
- * by a bean in the application context or by an SCA reference element or by an SCA property
- * element
- * @param ref - a String containing the name of the reference - may be null
- * @param beans - a List of SpringBean elements
- * @param references - a List of SCA reference elements
- * @return true if the property is not resolved, false if it is resolved
- */
- private boolean propertyRefUnresolved(String ref,
- List<SpringBeanElement> beans,
- List<SpringSCAReferenceElement> references,
- List<SpringSCAPropertyElement> scaproperties) {
- boolean unresolved = true;
-
- if (ref != null) {
- // Scan over the beans looking for a match
- Iterator<SpringBeanElement> itb = beans.iterator();
- while (itb.hasNext()) {
- SpringBeanElement beanElement = itb.next();
- // Does the bean name match the ref?
- if (ref.equals(beanElement.getId())) {
- unresolved = false;
- break;
- } // end if
- } // end while
- // Scan over the SCA reference elements looking for a match
- if (unresolved) {
- Iterator<SpringSCAReferenceElement> itr = references.iterator();
- while (itr.hasNext()) {
- SpringSCAReferenceElement referenceElement = itr.next();
- if (ref.equals(referenceElement.getName())) {
- unresolved = false;
- break;
- } // end if
- } // end while
- } // end if
- // Scan over the SCA property elements looking for a match
- if (unresolved) {
- Iterator<SpringSCAPropertyElement> itsp = scaproperties.iterator();
- while (itsp.hasNext()) {
- SpringSCAPropertyElement propertyElement = itsp.next();
- if (ref.equals(propertyElement.getName())) {
- unresolved = false;
- break;
- } // end if
- } // end while
- } // end if
- } else {
- // In the case where ref = null, the property is not going to be a reference of any
- // kind and can be ignored
- unresolved = false;
- } // end if
-
- return unresolved;
-
- } // end method propertyRefUnresolved
-
- /**
- * Gets hold of the application-context.xml file as a Spring resource
- * @param locationAttr - the location attribute from the <implementation.spring../> element
- * @param cl - the ClassLoader for the Spring implementation
- */
- protected URL getApplicationContextResource(URL url)
- throws ContributionReadException {
- File manifestFile = null;
- File appXmlFile;
- File locationFile = null;
-
- if (url != null) {
- String path = url.getPath();
- locationFile = new File(path);
- } else {
- throw new ContributionReadException(
- "SpringXMLLoader getApplicationContextResource: " + "unable to find resource file "
- + url);
- }
-
- if (locationFile.isDirectory()) {
- try {
- manifestFile = new File(locationFile, "META-INF"+ File.separator +"MANIFEST.MF");
- if (manifestFile.exists()) {
- Manifest mf = new Manifest(new FileInputStream(manifestFile));
- Attributes mainAttrs = mf.getMainAttributes();
- String appCtxPath = mainAttrs.getValue("Spring-Context");
- if (appCtxPath != null) {
- appXmlFile = new File(locationFile, appCtxPath);
- if (appXmlFile.exists()) {
- return appXmlFile.toURL();
- }
- }
- }
- // no manifest-specified Spring context, use default
- appXmlFile = new File(locationFile, "META-INF" + File.separator + "spring"
- + File.separator + SpringImplementationConstants.APPLICATION_CONTEXT);
- if (appXmlFile.exists()) {
- return appXmlFile.toURL();
- }
- } catch (IOException e) {
- throw new ContributionReadException("Error reading manifest " + manifestFile);
- }
- } else {
- if (locationFile.isFile() && locationFile.getName().endsWith(".jar")) {
- try {
- JarFile jf = new JarFile(locationFile);
- JarEntry je;
- Manifest mf = jf.getManifest();
- if (mf != null) {
- Attributes mainAttrs = mf.getMainAttributes();
- String appCtxPath = mainAttrs.getValue("Spring-Context");
- if (appCtxPath != null) {
- je = jf.getJarEntry(appCtxPath);
- if (je != null) {
- // TODO return a Spring specific Resource type for jars
- return new URL("jar:" + locationFile.toURI().toURL() + "!/" + appCtxPath);
- }
- }
- }
- je = jf.getJarEntry("META-INF" + "/" + "spring" + "/" + SpringImplementationConstants.APPLICATION_CONTEXT);
- if (je != null) {
- return new URL("jar:" + locationFile.toURI().toURL() + "!/" + SpringImplementationConstants.APPLICATION_CONTEXT);
- }
- } catch (IOException e) {
- // bad archive
- // TODO: create a more appropriate exception type
- throw new ContributionReadException("SpringXMLLoader getApplicationContextResource: "
- + " IO exception reading context file.", e);
- }
- }
- else {
- if (locationFile.getName().endsWith(".xml")) {
- return url;
- }
- else {
- // Deal with the directory inside a jar file, in case the contribution itself is a JAR file.
- try {
- if (locationFile.getPath().indexOf(".jar") > 0) {
- String jarEntry = url.getPath().substring(6, url.getPath().indexOf("!"));
- JarFile jf = new JarFile(jarEntry);
- JarEntry je = jf.getJarEntry(url.getPath().substring(url.getPath().indexOf("!/")+2)
- + "/" + "META-INF" + "/" + "MANIFEST.MF");
- if (je != null) {
- Manifest mf = new Manifest(jf.getInputStream(je));
- Attributes mainAttrs = mf.getMainAttributes();
- String appCtxPath = mainAttrs.getValue("Spring-Context");
- if (appCtxPath != null) {
- je = jf.getJarEntry(url.getPath().substring(url.getPath().indexOf("!/")+2) + "/" + appCtxPath);
- if (je != null) {
- return new URL("jar:" + url.getPath() + "/" + appCtxPath);
- }
- }
- }
- }
- } catch (IOException e) {
- throw new ContributionReadException("Error reading manifest " + manifestFile);
- }
- }
- }
- }
-
- throw new ContributionReadException("SpringXMLLoader getApplicationContextResource: "
- + "META-INF/spring/" + SpringImplementationConstants.APPLICATION_CONTEXT + "not found");
- } // end method getApplicationContextResource
-
- /**
- * Creates a Service for the component type based on its name and Java interface
- */
- public Service createService(Class<?> interfaze, String name) throws InvalidInterfaceException {
- Service service = assemblyFactory.createService();
- JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
- service.setInterfaceContract(interfaceContract);
-
- // Set the name for the service
- service.setName(name);
-
- // Set the call interface and, if present, the callback interface
- JavaInterface callInterface = javaFactory.createJavaInterface(interfaze);
- service.getInterfaceContract().setInterface(callInterface);
- if (callInterface.getCallbackClass() != null) {
- JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
- service.getInterfaceContract().setCallbackInterface(callbackInterface);
- }
- return service;
- } // end method createService
-
- /**
- * Creates a Reference for the component type based on its name and Java interface
- */
- private org.apache.tuscany.sca.assembly.Reference createReference(Class<?> interfaze, String name)
- throws InvalidInterfaceException {
- org.apache.tuscany.sca.assembly.Reference reference = assemblyFactory.createReference();
- JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
- reference.setInterfaceContract(interfaceContract);
-
- // Set the name of the reference to the supplied name and the multiplicity of the reference
- // to 1..1 - for Spring implementations, this is the only multiplicity supported
- reference.setName(name);
- reference.setMultiplicity(Multiplicity.ONE_ONE);
-
- // Set the call interface and, if present, the callback interface
- JavaInterface callInterface = javaFactory.createJavaInterface(interfaze);
- reference.getInterfaceContract().setInterface(callInterface);
- if (callInterface.getCallbackClass() != null) {
- JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
- reference.getInterfaceContract().setCallbackInterface(callbackInterface);
- }
-
- return reference;
- }
-} // end class SpringXMLComponentTypeLoader
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring.introspect;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.jar.Attributes;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.Multiplicity;
+import org.apache.tuscany.sca.assembly.Property;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.contribution.Artifact;
+import org.apache.tuscany.sca.contribution.ContributionFactory;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.resolver.ClassReference;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.implementation.java.JavaConstructorImpl;
+import org.apache.tuscany.sca.implementation.java.JavaElementImpl;
+import org.apache.tuscany.sca.implementation.java.JavaImplementation;
+import org.apache.tuscany.sca.implementation.java.JavaParameterImpl;
+import org.apache.tuscany.sca.implementation.spring.SpringBeanElement;
+import org.apache.tuscany.sca.implementation.spring.SpringConstructorArgElement;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementationConstants;
+import org.apache.tuscany.sca.implementation.spring.SpringPropertyElement;
+import org.apache.tuscany.sca.implementation.spring.SpringSCAPropertyElement;
+import org.apache.tuscany.sca.implementation.spring.SpringSCAReferenceElement;
+import org.apache.tuscany.sca.implementation.spring.SpringSCAServiceElement;
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.interfacedef.util.JavaXMLMapper;
+import org.apache.tuscany.sca.policy.PolicyFactory;
+
+/**
+ * Introspects a Spring XML application-context configuration file to create <implementation-spring../>
+ * component type information.
+ *
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringXMLComponentTypeLoader {
+
+ private XMLInputFactory xmlInputFactory;
+ private ContributionFactory contributionFactory;
+ private AssemblyFactory assemblyFactory;
+ private JavaInterfaceFactory javaFactory;
+ private PolicyFactory policyFactory;
+
+ private SpringBeanIntrospector beanIntrospector;
+
+ public SpringXMLComponentTypeLoader(FactoryExtensionPoint factories,
+ AssemblyFactory assemblyFactory,
+ JavaInterfaceFactory javaFactory,
+ PolicyFactory policyFactory) {
+ super();
+ this.assemblyFactory = assemblyFactory;
+ this.javaFactory = javaFactory;
+ this.policyFactory = policyFactory;
+ this.contributionFactory = factories.getFactory(ContributionFactory.class);
+ this.xmlInputFactory = factories.getFactory(XMLInputFactory.class);
+ }
+
+ protected Class<SpringImplementation> getImplementationClass() {
+ return SpringImplementation.class;
+ }
+
+ /**
+ * Base method which loads the component type from the application-context attached to the
+ * Spring implementation
+ *
+ */
+ public void load(SpringImplementation implementation, ModelResolver resolver) throws ContributionReadException {
+ //System.out.println("Spring TypeLoader - load method start");
+ ComponentType componentType = implementation.getComponentType();
+ /* Check that there is a component type object already set */
+ if (componentType == null) {
+ throw new ContributionReadException("SpringXMLLoader load: implementation has no ComponentType object");
+ }
+ if (componentType.isUnresolved()) {
+ /* Fetch the location of the application-context file from the implementation */
+ loadFromXML(implementation, resolver);
+ if (!componentType.isUnresolved())
+ implementation.setUnresolved(false);
+ } // end if
+ //System.out.println("Spring TypeLoader - load method complete");
+ } // end method load
+
+ private Class<?> resolveClass(ModelResolver resolver, String className) throws ClassNotFoundException {
+ ClassReference classReference = new ClassReference(className);
+ classReference = resolver.resolveModel(ClassReference.class, classReference);
+ if (classReference.isUnresolved()) {
+ throw new ClassNotFoundException(className);
+ }
+ Class<?> javaClass = classReference.getJavaClass();
+ return javaClass;
+ }
+
+ /**
+ * Method which fills out the component type for a Spring implementation by reading the
+ * Spring application-context.xml file.
+ *
+ * @param implementation SpringImplementation into which to load the component type information
+ * @throws ContributionReadException Failed to read the contribution
+ */
+ private void loadFromXML(SpringImplementation implementation, ModelResolver resolver) throws ContributionReadException {
+ XMLStreamReader reader;
+ List<SpringBeanElement> beans = new ArrayList<SpringBeanElement>();
+ List<SpringSCAServiceElement> services = new ArrayList<SpringSCAServiceElement>();
+ List<SpringSCAReferenceElement> references = new ArrayList<SpringSCAReferenceElement>();
+ List<SpringSCAPropertyElement> scaproperties = new ArrayList<SpringSCAPropertyElement>();
+
+ URL resource;
+
+ String contextPath = implementation.getLocation();
+
+ try {
+ resource = resolveLocation(resolver, contextPath);
+ resource = getApplicationContextResource(resource);
+ implementation.setResource(resource);
+ // The URI is used to uniquely identify the Implementation
+ implementation.setURI(resource.toString());
+ reader = xmlInputFactory.createXMLStreamReader(resource.openStream());
+
+ // System.out.println("Spring TypeLoader - starting to read context file");
+ readContextDefinition(resolver, reader, contextPath, beans, services, references, scaproperties);
+
+ } catch (IOException e) {
+ throw new ContributionReadException(e);
+ } catch (XMLStreamException e) {
+ throw new ContributionReadException(e);
+ }
+
+ /* At this point, the complete application-context.xml file has been read and its contents */
+ /* stored in the lists of beans, services, references. These are now used to generate */
+ /* the implied componentType for the application context */
+ generateComponentType(implementation, resolver, beans, services, references, scaproperties);
+
+ return;
+ } // end method loadFromXML
+
+ private URL resolveLocation(ModelResolver resolver, String contextPath) throws MalformedURLException,
+ ContributionReadException {
+ URL resource = null;
+ URI uri = URI.create(contextPath);
+ if (!uri.isAbsolute()) {
+ Artifact artifact = contributionFactory.createArtifact();
+ artifact.setUnresolved(true);
+ artifact.setURI(contextPath);
+ artifact = resolver.resolveModel(Artifact.class, artifact);
+ if (!artifact.isUnresolved()) {
+ resource = new URL(artifact.getLocation());
+ } else {
+ throw new ContributionReadException("Location cannot be resloved: " + contextPath);
+ }
+ } else {
+ resource = new URL(contextPath);
+ }
+ return resource;
+ }
+
+ /**
+ * Method which returns the XMLStreamReader for the Spring application-context.xml file
+ * specified in the location attribute
+ */
+ private XMLStreamReader getApplicationContextReader(ModelResolver resolver, String location) throws ContributionReadException {
+
+ try {
+ URL resource = getApplicationContextResource(resolveLocation(resolver, location));
+ XMLStreamReader reader =
+ xmlInputFactory.createXMLStreamReader(resource.openStream());
+ return reader;
+ } catch (IOException e) {
+ throw new ContributionReadException(e);
+ } catch (XMLStreamException e) {
+ throw new ContributionReadException(e);
+ }
+ }
+
+ /**
+ * Method which reads the spring context definitions from Spring application-context.xml
+ * file and identifies the defined beans, properties, services and references
+ */
+ private void readContextDefinition(ModelResolver resolver,
+ XMLStreamReader reader,
+ String contextPath,
+ List<SpringBeanElement> beans,
+ List<SpringSCAServiceElement> services,
+ List<SpringSCAReferenceElement> references,
+ List<SpringSCAPropertyElement> scaproperties) throws ContributionReadException {
+
+ SpringBeanElement bean = null;
+
+ try {
+ boolean completed = false;
+ while (!completed) {
+ switch (reader.next()) {
+ case START_ELEMENT:
+ QName qname = reader.getName();
+ //System.out.println("Spring TypeLoader - found element with name: " + qname.toString());
+ if (SpringImplementationConstants.IMPORT_ELEMENT.equals(qname)) {
+ //FIXME - put the sequence of code below which gets the ireader into a subsidiary method
+ String location = reader.getAttributeValue(null, "resource");
+ if (location != null) {
+ // FIXME - need to find a right way of generating this path
+ String resourcePath = contextPath.substring(0, contextPath.lastIndexOf("/")+1) + location;
+ XMLStreamReader ireader = getApplicationContextReader(resolver, resourcePath);
+ // Read the context definition for the identified imported resource
+ readContextDefinition(resolver, ireader, contextPath, beans, services, references, scaproperties);
+ }
+ } else if (SpringImplementationConstants.SERVICE_ELEMENT.equals(qname)) {
+ SpringSCAServiceElement service =
+ new SpringSCAServiceElement(reader.getAttributeValue(null, "name"), reader
+ .getAttributeValue(null, "type"), reader.getAttributeValue(null, "target"));
+ services.add(service);
+ } else if (SpringImplementationConstants.REFERENCE_ELEMENT.equals(qname)) {
+ SpringSCAReferenceElement reference =
+ new SpringSCAReferenceElement(reader.getAttributeValue(null, "name"), reader
+ .getAttributeValue(null, "type"));
+ references.add(reference);
+ } else if (SpringImplementationConstants.SCAPROPERTY_ELEMENT.equals(qname)) {
+ SpringSCAPropertyElement scaproperty =
+ new SpringSCAPropertyElement(reader.getAttributeValue(null, "name"), reader
+ .getAttributeValue(null, "type"));
+ scaproperties.add(scaproperty);
+ } else if (SpringImplementationConstants.BEAN_ELEMENT.equals(qname)) {
+ bean = new SpringBeanElement(reader.getAttributeValue(null, "id"), reader
+ .getAttributeValue(null, "class"));
+ beans.add(bean);
+ // Read the <bean> element and its child elements
+ readBeanDefinition(resolver, reader, contextPath, bean, beans, services, references, scaproperties);
+ } // end if*/
+ break;
+ case END_ELEMENT:
+ if (SpringImplementationConstants.BEANS_ELEMENT.equals(reader.getName())) {
+ //System.out.println("Spring TypeLoader - finished read of context file");
+ completed = true;
+ break;
+ } // end if
+ } // end switch
+ } // end while
+ } catch (XMLStreamException e) {
+ throw new ContributionReadException(e);
+ }
+ }
+
+
+ /**
+ * Method which reads the bean definitions from Spring application-context.xml file and identifies
+ * the defined beans, properties, services and references
+ */
+ private void readBeanDefinition(ModelResolver resolver,
+ XMLStreamReader reader,
+ String contextPath,
+ SpringBeanElement bean,
+ List<SpringBeanElement> beans,
+ List<SpringSCAServiceElement> services,
+ List<SpringSCAReferenceElement> references,
+ List<SpringSCAPropertyElement> scaproperties) throws ContributionReadException {
+
+ SpringBeanElement innerbean = null;
+ SpringPropertyElement property = null;
+ SpringConstructorArgElement constructorArg = null;
+ int autoConstructorIndex = -1;
+
+ try {
+ boolean completed = false;
+ while (!completed) {
+ switch (reader.next()) {
+ case START_ELEMENT:
+ QName qname = reader.getName();
+ if (SpringImplementationConstants.BEAN_ELEMENT.equals(qname)) {
+ innerbean = new SpringBeanElement(reader.getAttributeValue(null, "id"), reader
+ .getAttributeValue(null, "class"));
+ innerbean.setInnerBean(true);
+ beans.add(innerbean);
+ readBeanDefinition(resolver, reader, contextPath, innerbean, beans, services, references, scaproperties);
+ } else if (SpringImplementationConstants.PROPERTY_ELEMENT.equals(qname)) {
+ property = new SpringPropertyElement(reader.getAttributeValue(null, "name"), reader
+ .getAttributeValue(null, "ref"));
+ bean.addProperty(property);
+ } else if (SpringImplementationConstants.CONSTRUCTORARG_ELEMENT.equals(qname)) {
+ constructorArg = new SpringConstructorArgElement(reader.getAttributeValue(null, "ref"),
+ reader.getAttributeValue(null, "type"));
+ autoConstructorIndex++;
+ constructorArg.setAutoIndex(autoConstructorIndex);
+ if (reader.getAttributeValue(null, "index") != null)
+ constructorArg.setIndex((new Integer(reader.getAttributeValue(null, "index"))).intValue());
+ if (reader.getAttributeValue(null, "value") != null) {
+ String value = reader.getAttributeValue(null, "value");
+ constructorArg.addValue(value);
+ if ((value.indexOf(".xml") != -1)) {
+ if ((bean.getClassName().indexOf(".ClassPathXmlApplicationContext") != -1) ||
+ (bean.getClassName().indexOf(".FileSystemXmlApplicationContext") != -1)) {
+ XMLStreamReader creader = getApplicationContextReader(resolver, value);
+ // Read the context definition for the constructor-arg resources
+ readContextDefinition(resolver, creader, contextPath, beans, services, references, scaproperties);
+ }
+ }
+ }
+ bean.addCustructorArgs(constructorArg);
+ } else if (SpringImplementationConstants.REF_ELEMENT.equals(qname)) {
+ String ref = reader.getAttributeValue(null, "bean");
+ // Check if the parent element is a property
+ if (property != null) property.setRef(ref);
+ // Check if the parent element is a constructor-arg
+ if (constructorArg != null) constructorArg.setRef(ref);
+ } else if (SpringImplementationConstants.VALUE_ELEMENT.equals(qname)) {
+ String value = reader.getElementText();
+ // Check if the parent element is a constructor-arg
+ if (constructorArg != null) {
+ constructorArg.addValue(value);
+ // Identify the XML resource specified for the constructor-arg element
+ if ((value.indexOf(".xml") != -1)) {
+ if ((bean.getClassName().indexOf(".ClassPathXmlApplicationContext") != -1) ||
+ (bean.getClassName().indexOf(".FileSystemXmlApplicationContext") != -1)) {
+ XMLStreamReader creader = getApplicationContextReader(resolver, value);
+ // Read the context definition for the constructor-arg resources
+ readContextDefinition(resolver, creader, contextPath, beans, services, references, scaproperties);
+ }
+ }
+ }
+ } // end if
+ break;
+ case END_ELEMENT:
+ if (SpringImplementationConstants.BEAN_ELEMENT.equals(reader.getName())) {
+ completed = true;
+ break;
+ } else if (SpringImplementationConstants.PROPERTY_ELEMENT.equals(reader.getName())) {
+ property = null;
+ } else if (SpringImplementationConstants.CONSTRUCTORARG_ELEMENT.equals(reader.getName())) {
+ constructorArg = null;
+ } // end if
+ } // end switch
+ } // end while
+ } catch (XMLStreamException e) {
+ throw new ContributionReadException(e);
+ }
+ }
+
+ /**
+ * Generates the Spring implementation component type from the configuration contained in the
+ * lists of beans, services, references and scaproperties derived from the application context
+ */
+ private void generateComponentType(SpringImplementation implementation,
+ ModelResolver resolver,
+ List<SpringBeanElement> beans,
+ List<SpringSCAServiceElement> services,
+ List<SpringSCAReferenceElement> references,
+ List<SpringSCAPropertyElement> scaproperties) throws ContributionReadException {
+ /*
+ * 1. Each sca:service becomes a service in the component type
+ * 2. Each sca:reference becomes a reference in the component type
+ * 3. Each sca:property becomes a property in the component type
+ * 4. IF there are no explicit service elements, each bean becomes a service
+ * 5. Each bean property which is a reference not pointing at another bean in the
+ * application context becomes a reference unless it is pointing at one of the references
+ * 6. Each bean property which is not a reference and which is not pointing
+ * at another bean in the application context becomes a property in the component type
+ */
+
+ JavaImplementation javaImplementation = null;
+ ComponentType componentType = implementation.getComponentType();
+
+ try {
+ // Deal with the services first....
+ Iterator<SpringSCAServiceElement> its = services.iterator();
+ while (its.hasNext()) {
+ SpringSCAServiceElement serviceElement = its.next();
+ Class<?> interfaze = resolveClass(resolver, serviceElement.getType());
+ Service theService = createService(interfaze, serviceElement.getName());
+ componentType.getServices().add(theService);
+ // Add this service to the Service / Bean map
+ String beanName = serviceElement.getTarget();
+ for (SpringBeanElement beanElement : beans) {
+ if (beanName.equals(beanElement.getId())) {
+ implementation.setBeanForService(theService, beanElement);
+ }
+ } // end for
+ } // end while
+
+ // Next handle the references
+ Iterator<SpringSCAReferenceElement> itr = references.iterator();
+ while (itr.hasNext()) {
+ SpringSCAReferenceElement referenceElement = itr.next();
+ Class<?> interfaze = resolveClass(resolver, referenceElement.getType());
+ Reference theReference = createReference(interfaze, referenceElement.getName());
+ componentType.getReferences().add(theReference);
+ } // end while
+
+ // Next handle the properties
+ Iterator<SpringSCAPropertyElement> itsp = scaproperties.iterator();
+ while (itsp.hasNext()) {
+ SpringSCAPropertyElement scaproperty = itsp.next();
+ // Create a component type property if the SCA property element has a name
+ // and a type declared...
+ if (scaproperty.getType() != null && scaproperty.getName() != null) {
+ Property theProperty = assemblyFactory.createProperty();
+ theProperty.setName(scaproperty.getName());
+ // Get the Java class and then an XSD element type for the property
+ Class<?> propType = Class.forName(scaproperty.getType());
+ theProperty.setXSDType(JavaXMLMapper.getXMLType(propType));
+ componentType.getProperties().add(theProperty);
+ // Remember the Java Class (ie the type) for this property
+ implementation.setPropertyClass(theProperty.getName(), propType);
+ } // end if
+ } // end while
+
+ // Finally deal with the beans
+ Iterator<SpringBeanElement> itb;
+ // If there are no explicit service elements, then expose all the beans
+ if (services.isEmpty()) {
+ itb = beans.iterator();
+ // Loop through all the beans found
+ while (itb.hasNext()) {
+ SpringBeanElement beanElement = itb.next();
+ // If its a innerBean, ignore it
+ if (beanElement.isInnerBean()) continue;
+ // Load the Spring bean class
+ Class<?> beanClass = resolveClass(resolver, beanElement.getClassName());
+ // Introspect the bean
+ beanIntrospector =
+ new SpringBeanIntrospector(assemblyFactory, javaFactory, policyFactory, beanElement.getCustructorArgs());
+ ComponentType beanComponentType = assemblyFactory.createComponentType();
+ javaImplementation = beanIntrospector.introspectBean(beanClass, beanComponentType);
+ // Get the service interface defined by this Spring Bean and add to
+ // the component type of the Spring Assembly
+ List<Service> beanServices = beanComponentType.getServices();
+ componentType.getServices().addAll(beanServices);
+ // Add these services to the Service / Bean map
+ for (Service beanService : beanServices) {
+ implementation.setBeanForService(beanService, beanElement);
+ }
+ } // end while
+ } // end if
+
+ itb = beans.iterator();
+ while (itb.hasNext()) {
+ SpringBeanElement beanElement = itb.next();
+ // Ignore if the bean has no properties and constructor arguments
+ if (beanElement.getProperties().isEmpty() && beanElement.getCustructorArgs().isEmpty())
+ continue;
+
+ Class<?> beanClass = resolveClass(resolver, beanElement.getClassName());
+ // Introspect the bean
+ beanIntrospector =
+ new SpringBeanIntrospector(assemblyFactory, javaFactory, policyFactory, beanElement.getCustructorArgs());
+ ComponentType beanComponentType = assemblyFactory.createComponentType();
+ javaImplementation = beanIntrospector.introspectBean(beanClass, beanComponentType);
+ Map<String, JavaElementImpl> propertyMap = javaImplementation.getPropertyMembers();
+ JavaConstructorImpl constructor = javaImplementation.getConstructor();
+ // Get the references by this Spring Bean and add the unresolved ones to
+ // the component type of the Spring Assembly
+ List<Reference> beanReferences = beanComponentType.getReferences();
+ List<Property> beanProperties = beanComponentType.getProperties();
+
+ Iterator<SpringPropertyElement> itp = beanElement.getProperties().iterator();
+ while (itp.hasNext()) {
+ SpringPropertyElement propertyElement = itp.next();
+ if (propertyRefUnresolved(propertyElement.getRef(), beans, references, scaproperties)) {
+ // This means an unresolved reference from the spring bean...
+ for (Reference reference : beanReferences) {
+ if (propertyElement.getName().equals(reference.getName())) {
+ // The name of the reference in this case is the string in
+ // the @ref attribute of the Spring property element, NOT the
+ // name of the field in the Spring bean....
+ reference.setName(propertyElement.getRef());
+ componentType.getReferences().add(reference);
+ } // end if
+ } // end for
+
+ // Store the unresolved references as unresolvedBeanRef in the Spring Implementation type
+ for (Property scaproperty : beanProperties) {
+ if (propertyElement.getName().equals(scaproperty.getName())) {
+ // The name of the reference in this case is the string in
+ // the @ref attribute of the Spring property element, NOT the
+ // name of the field in the Spring bean....
+ Class<?> interfaze = resolveClass(resolver, (propertyMap.get(propertyElement.getName()).getType()).getName());
+ Reference theReference = createReference(interfaze, propertyElement.getRef());
+ implementation.setUnresolvedBeanRef(propertyElement.getRef(), theReference);
+ } // end if
+ } // end for
+ } // end if
+ } // end while
+
+ Iterator<SpringConstructorArgElement> itcr = beanElement.getCustructorArgs().iterator();
+ while (itcr.hasNext()) {
+ SpringConstructorArgElement conArgElement = itcr.next();
+ if (propertyRefUnresolved(conArgElement.getRef(), beans, references, scaproperties)) {
+ for (JavaParameterImpl parameter : constructor.getParameters()) {
+ String paramType = parameter.getType().getName();
+ Class<?> interfaze = resolveClass(resolver, paramType);
+ // Create a component type reference/property if the constructor-arg element has a
+ // type attribute OR index attribute declared...
+ if ((conArgElement.getType() != null && paramType.equals(conArgElement.getType())) ||
+ (conArgElement.getIndex() != -1 && (conArgElement.getIndex() == parameter.getIndex())) ||
+ (conArgElement.getAutoIndex() == parameter.getIndex()))
+ {
+ if (parameter.getClassifer().getName().equals("org.osoa.sca.annotations.Reference")) {
+ Reference theReference = createReference(interfaze, conArgElement.getRef());
+ componentType.getReferences().add(theReference);
+ }
+ if (parameter.getClassifer().getName().equals("org.osoa.sca.annotations.Property")) {
+ // Store the unresolved references as unresolvedBeanRef in the Spring Implementation type
+ // we might need to verify with the component definition later.
+ Reference theReference = createReference(interfaze, conArgElement.getRef());
+ implementation.setUnresolvedBeanRef(conArgElement.getRef(), theReference);
+ }
+ }
+ } // end for
+ } // end if
+ } // end while
+
+ } // end while
+
+ } catch (ClassNotFoundException e) {
+ // Means that either an interface class, property class or a bean was not found
+ throw new ContributionReadException(e);
+ } catch (InvalidInterfaceException e) {
+ throw new ContributionReadException(e);
+ } catch (ContributionResolveException e) {
+
+ } // end try
+
+ // If we get here, the Spring assembly component type is resolved
+ componentType.setUnresolved(false);
+ implementation.setComponentType(componentType);
+ return;
+ } // end method generateComponentType
+
+ /*
+ * Determines whether a reference attribute of a Spring property element is resolved either
+ * by a bean in the application context or by an SCA reference element or by an SCA property
+ * element
+ * @param ref - a String containing the name of the reference - may be null
+ * @param beans - a List of SpringBean elements
+ * @param references - a List of SCA reference elements
+ * @return true if the property is not resolved, false if it is resolved
+ */
+ private boolean propertyRefUnresolved(String ref,
+ List<SpringBeanElement> beans,
+ List<SpringSCAReferenceElement> references,
+ List<SpringSCAPropertyElement> scaproperties) {
+ boolean unresolved = true;
+
+ if (ref != null) {
+ // Scan over the beans looking for a match
+ Iterator<SpringBeanElement> itb = beans.iterator();
+ while (itb.hasNext()) {
+ SpringBeanElement beanElement = itb.next();
+ // Does the bean name match the ref?
+ if (ref.equals(beanElement.getId())) {
+ unresolved = false;
+ break;
+ } // end if
+ } // end while
+ // Scan over the SCA reference elements looking for a match
+ if (unresolved) {
+ Iterator<SpringSCAReferenceElement> itr = references.iterator();
+ while (itr.hasNext()) {
+ SpringSCAReferenceElement referenceElement = itr.next();
+ if (ref.equals(referenceElement.getName())) {
+ unresolved = false;
+ break;
+ } // end if
+ } // end while
+ } // end if
+ // Scan over the SCA property elements looking for a match
+ if (unresolved) {
+ Iterator<SpringSCAPropertyElement> itsp = scaproperties.iterator();
+ while (itsp.hasNext()) {
+ SpringSCAPropertyElement propertyElement = itsp.next();
+ if (ref.equals(propertyElement.getName())) {
+ unresolved = false;
+ break;
+ } // end if
+ } // end while
+ } // end if
+ } else {
+ // In the case where ref = null, the property is not going to be a reference of any
+ // kind and can be ignored
+ unresolved = false;
+ } // end if
+
+ return unresolved;
+
+ } // end method propertyRefUnresolved
+
+ /**
+ * Gets hold of the application-context.xml file as a Spring resource
+ * @param locationAttr - the location attribute from the <implementation.spring../> element
+ * @param cl - the ClassLoader for the Spring implementation
+ */
+ protected URL getApplicationContextResource(URL url)
+ throws ContributionReadException {
+ File manifestFile = null;
+ File appXmlFile;
+ File locationFile = null;
+
+ if (url != null) {
+ String path = url.getPath();
+ locationFile = new File(path);
+ } else {
+ throw new ContributionReadException(
+ "SpringXMLLoader getApplicationContextResource: " + "unable to find resource file "
+ + url);
+ }
+
+ if (locationFile.isDirectory()) {
+ try {
+ manifestFile = new File(locationFile, "META-INF"+ File.separator +"MANIFEST.MF");
+ if (manifestFile.exists()) {
+ Manifest mf = new Manifest(new FileInputStream(manifestFile));
+ Attributes mainAttrs = mf.getMainAttributes();
+ String appCtxPath = mainAttrs.getValue("Spring-Context");
+ if (appCtxPath != null) {
+ appXmlFile = new File(locationFile, appCtxPath);
+ if (appXmlFile.exists()) {
+ return appXmlFile.toURL();
+ }
+ }
+ }
+ // no manifest-specified Spring context, use default
+ appXmlFile = new File(locationFile, "META-INF" + File.separator + "spring"
+ + File.separator + SpringImplementationConstants.APPLICATION_CONTEXT);
+ if (appXmlFile.exists()) {
+ return appXmlFile.toURL();
+ }
+ } catch (IOException e) {
+ throw new ContributionReadException("Error reading manifest " + manifestFile);
+ }
+ } else {
+ if (locationFile.isFile() && locationFile.getName().endsWith(".jar")) {
+ try {
+ JarFile jf = new JarFile(locationFile);
+ JarEntry je;
+ Manifest mf = jf.getManifest();
+ if (mf != null) {
+ Attributes mainAttrs = mf.getMainAttributes();
+ String appCtxPath = mainAttrs.getValue("Spring-Context");
+ if (appCtxPath != null) {
+ je = jf.getJarEntry(appCtxPath);
+ if (je != null) {
+ // TODO return a Spring specific Resource type for jars
+ return new URL("jar:" + locationFile.toURI().toURL() + "!/" + appCtxPath);
+ }
+ }
+ }
+ je = jf.getJarEntry("META-INF" + "/" + "spring" + "/" + SpringImplementationConstants.APPLICATION_CONTEXT);
+ if (je != null) {
+ return new URL("jar:" + locationFile.toURI().toURL() + "!/" + SpringImplementationConstants.APPLICATION_CONTEXT);
+ }
+ } catch (IOException e) {
+ // bad archive
+ // TODO: create a more appropriate exception type
+ throw new ContributionReadException("SpringXMLLoader getApplicationContextResource: "
+ + " IO exception reading context file.", e);
+ }
+ }
+ else {
+ if (locationFile.getName().endsWith(".xml")) {
+ return url;
+ }
+ else {
+ // Deal with the directory inside a jar file, in case the contribution itself is a JAR file.
+ try {
+ if (locationFile.getPath().indexOf(".jar") > 0) {
+ String jarEntry = url.getPath().substring(6, url.getPath().indexOf("!"));
+ JarFile jf = new JarFile(jarEntry);
+ JarEntry je = jf.getJarEntry(url.getPath().substring(url.getPath().indexOf("!/")+2)
+ + "/" + "META-INF" + "/" + "MANIFEST.MF");
+ if (je != null) {
+ Manifest mf = new Manifest(jf.getInputStream(je));
+ Attributes mainAttrs = mf.getMainAttributes();
+ String appCtxPath = mainAttrs.getValue("Spring-Context");
+ if (appCtxPath != null) {
+ je = jf.getJarEntry(url.getPath().substring(url.getPath().indexOf("!/")+2) + "/" + appCtxPath);
+ if (je != null) {
+ return new URL("jar:" + url.getPath() + "/" + appCtxPath);
+ }
+ }
+ }
+ }
+ } catch (IOException e) {
+ throw new ContributionReadException("Error reading manifest " + manifestFile);
+ }
+ }
+ }
+ }
+
+ throw new ContributionReadException("SpringXMLLoader getApplicationContextResource: "
+ + "META-INF/spring/" + SpringImplementationConstants.APPLICATION_CONTEXT + "not found");
+ } // end method getApplicationContextResource
+
+ /**
+ * Creates a Service for the component type based on its name and Java interface
+ */
+ public Service createService(Class<?> interfaze, String name) throws InvalidInterfaceException {
+ Service service = assemblyFactory.createService();
+ JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
+ service.setInterfaceContract(interfaceContract);
+
+ // Set the name for the service
+ service.setName(name);
+
+ // Set the call interface and, if present, the callback interface
+ JavaInterface callInterface = javaFactory.createJavaInterface(interfaze);
+ service.getInterfaceContract().setInterface(callInterface);
+ if (callInterface.getCallbackClass() != null) {
+ JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
+ service.getInterfaceContract().setCallbackInterface(callbackInterface);
+ }
+ return service;
+ } // end method createService
+
+ /**
+ * Creates a Reference for the component type based on its name and Java interface
+ */
+ private org.apache.tuscany.sca.assembly.Reference createReference(Class<?> interfaze, String name)
+ throws InvalidInterfaceException {
+ org.apache.tuscany.sca.assembly.Reference reference = assemblyFactory.createReference();
+ JavaInterfaceContract interfaceContract = javaFactory.createJavaInterfaceContract();
+ reference.setInterfaceContract(interfaceContract);
+
+ // Set the name of the reference to the supplied name and the multiplicity of the reference
+ // to 1..1 - for Spring implementations, this is the only multiplicity supported
+ reference.setName(name);
+ reference.setMultiplicity(Multiplicity.ONE_ONE);
+
+ // Set the call interface and, if present, the callback interface
+ JavaInterface callInterface = javaFactory.createJavaInterface(interfaze);
+ reference.getInterfaceContract().setInterface(callInterface);
+ if (callInterface.getCallbackClass() != null) {
+ JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
+ reference.getInterfaceContract().setCallbackInterface(callbackInterface);
+ }
+
+ return reference;
+ }
+} // end class SpringXMLComponentTypeLoader
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/ComponentTie.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/ComponentTie.java
index 2f245d7f06..b97c02d216 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/ComponentTie.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/ComponentTie.java
@@ -1,41 +1,41 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.spring.invocation;
-
-/**
- * This is the Tuscany side tie for the corresponding Spring runtime side stub class.
- * It enables the Tuscany code to invoke methods on a Spring context without
- * needing to know about any Spring classes. See the ComponentStub class
- * in the implementation-spring-runtime module for what the stub does.
- */
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-public class ComponentTie {
-
- private RuntimeComponent component;
-
- public ComponentTie(RuntimeComponent component) {
- this.component = component;
- }
-
- public Object getService(Class<?> type, String name) {
- return component.getComponentContext().getService(type, name);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.spring.invocation;
+
+/**
+ * This is the Tuscany side tie for the corresponding Spring runtime side stub class.
+ * It enables the Tuscany code to invoke methods on a Spring context without
+ * needing to know about any Spring classes. See the ComponentStub class
+ * in the implementation-spring-runtime module for what the stub does.
+ */
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+public class ComponentTie {
+
+ private RuntimeComponent component;
+
+ public ComponentTie(RuntimeComponent component) {
+ this.component = component;
+ }
+
+ public Object getService(Class<?> type, String name) {
+ return component.getComponentContext().getService(type, name);
+ }
+}
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/PropertyValueTie.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/PropertyValueTie.java
index 743abaa79b..89d14961ac 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/PropertyValueTie.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/PropertyValueTie.java
@@ -1,53 +1,53 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.spring.invocation;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * This is the Tuscany side tie for the corresponding Spring runtime side stub class.
- * It enables the Tuscany code to invoke methods on a Spring context without
- * needing to know about any Spring classes. See the PropertyValueStub class
- * in the implementation-spring-runtime module for what the stub does.
- */
-public class PropertyValueTie {
-
- private RuntimeComponent component;
- private JavaPropertyValueObjectFactory propertyFactory;
-
- public PropertyValueTie(RuntimeComponent component, JavaPropertyValueObjectFactory propertyFactory) {
- this.component = component;
- this.propertyFactory = propertyFactory;
- }
-
- public Object getPropertyObj(Class<?> type, String name) {
- List<ComponentProperty> props = component.getProperties();
- for (ComponentProperty prop : props) {
- if (prop.getName().equals(name)) {
- return propertyFactory.createValueFactory(prop, prop.getValue(), type).getInstance();
- }
- }
- return null; // property name not found
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.spring.invocation;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.ComponentProperty;
+import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+/**
+ * This is the Tuscany side tie for the corresponding Spring runtime side stub class.
+ * It enables the Tuscany code to invoke methods on a Spring context without
+ * needing to know about any Spring classes. See the PropertyValueStub class
+ * in the implementation-spring-runtime module for what the stub does.
+ */
+public class PropertyValueTie {
+
+ private RuntimeComponent component;
+ private JavaPropertyValueObjectFactory propertyFactory;
+
+ public PropertyValueTie(RuntimeComponent component, JavaPropertyValueObjectFactory propertyFactory) {
+ this.component = component;
+ this.propertyFactory = propertyFactory;
+ }
+
+ public Object getPropertyObj(Class<?> type, String name) {
+ List<ComponentProperty> props = component.getProperties();
+ for (ComponentProperty prop : props) {
+ if (prop.getName().equals(name)) {
+ return propertyFactory.createValueFactory(prop, prop.getValue(), type).getInstance();
+ }
+ }
+ return null; // property name not found
+ }
+}
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java
index 3d8d4112f0..6a7eb2e024 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringContextStub.java
@@ -1,130 +1,130 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.spring.invocation;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.URL;
-
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * This is the Tuscany side stub for the corresponding runtime tie class.
- * It enables the Tuscany code to invoke methods on a Spring context without
- * needing to know about any Spring classes. See the SpringContextTie class
- * in the implementation-spring-runtime module for what the tie does.
- */
-public class SpringContextStub {
-
- private Object tie;
- private Method startMethod;
- private Method closeMethod;
- private Method getBeanMethod;
-
- public SpringContextStub(RuntimeComponent component,
- SpringImplementation implementation,
- ProxyFactory proxyService,
- JavaPropertyValueObjectFactory propertyValueObjectFactory) {
-
- initTie(component, implementation, propertyValueObjectFactory);
-
- }
-
- private void initTie(RuntimeComponent component,
- SpringImplementation implementation,
- JavaPropertyValueObjectFactory propertyValueObjectFactory) {
-
- // TODO: what class loader to use?
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
-
- try {
-
- Class<?> stubClass = Class.forName("org.apache.tuscany.sca.implementation.spring.runtime.context.SpringImplementationStub", true, cl);
- Constructor<?> stubConstructor = stubClass.getConstructor(new Class<?>[]{Object.class});
- Object stub = stubConstructor.newInstance(new SpringImplementationTie(implementation, component, propertyValueObjectFactory));
-
- Class<?> tieClass = Class.forName("org.apache.tuscany.sca.implementation.spring.runtime.context.SpringContextTie", true, cl);
- Constructor<?> tieConstructor = tieClass.getConstructor(new Class<?>[]{stubClass, URL.class});
- this.tie = tieConstructor.newInstance(stub, implementation.getResource());
-
- this.startMethod = tieClass.getMethod("start");
- this.closeMethod = tieClass.getMethod("close");
- this.getBeanMethod = tieClass.getMethod("getBean", String.class);
-
- } catch (ClassNotFoundException e) {
- throw new RuntimeException(e);
- } catch (SecurityException e) {
- throw new RuntimeException(e);
- } catch (NoSuchMethodException e) {
- throw new RuntimeException(e);
- } catch (IllegalArgumentException e) {
- throw new RuntimeException(e);
- } catch (InstantiationException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
- throw new RuntimeException(e);
- }
- }
-
- public void start() {
- try {
- startMethod.invoke(tie);
- } catch (IllegalArgumentException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
- throw new RuntimeException(e);
- }
- }
-
- public void close() {
- try {
- closeMethod.invoke(tie);
- } catch (IllegalArgumentException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
- throw new RuntimeException(e);
- }
- }
-
- public Object getBean(String id) throws SpringInvocationException {
- try {
-
- return getBeanMethod.invoke(tie, id);
-
- } catch (IllegalArgumentException e) {
- throw new RuntimeException(e);
- } catch (IllegalAccessException e) {
- throw new RuntimeException(e);
- } catch (InvocationTargetException e) {
- throw new RuntimeException(e);
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.spring.invocation;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+
+import org.apache.tuscany.sca.core.invocation.ProxyFactory;
+import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+/**
+ * This is the Tuscany side stub for the corresponding runtime tie class.
+ * It enables the Tuscany code to invoke methods on a Spring context without
+ * needing to know about any Spring classes. See the SpringContextTie class
+ * in the implementation-spring-runtime module for what the tie does.
+ */
+public class SpringContextStub {
+
+ private Object tie;
+ private Method startMethod;
+ private Method closeMethod;
+ private Method getBeanMethod;
+
+ public SpringContextStub(RuntimeComponent component,
+ SpringImplementation implementation,
+ ProxyFactory proxyService,
+ JavaPropertyValueObjectFactory propertyValueObjectFactory) {
+
+ initTie(component, implementation, propertyValueObjectFactory);
+
+ }
+
+ private void initTie(RuntimeComponent component,
+ SpringImplementation implementation,
+ JavaPropertyValueObjectFactory propertyValueObjectFactory) {
+
+ // TODO: what class loader to use?
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+
+ try {
+
+ Class<?> stubClass = Class.forName("org.apache.tuscany.sca.implementation.spring.runtime.context.SpringImplementationStub", true, cl);
+ Constructor<?> stubConstructor = stubClass.getConstructor(new Class<?>[]{Object.class});
+ Object stub = stubConstructor.newInstance(new SpringImplementationTie(implementation, component, propertyValueObjectFactory));
+
+ Class<?> tieClass = Class.forName("org.apache.tuscany.sca.implementation.spring.runtime.context.SpringContextTie", true, cl);
+ Constructor<?> tieConstructor = tieClass.getConstructor(new Class<?>[]{stubClass, URL.class});
+ this.tie = tieConstructor.newInstance(stub, implementation.getResource());
+
+ this.startMethod = tieClass.getMethod("start");
+ this.closeMethod = tieClass.getMethod("close");
+ this.getBeanMethod = tieClass.getMethod("getBean", String.class);
+
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ } catch (SecurityException e) {
+ throw new RuntimeException(e);
+ } catch (NoSuchMethodException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalArgumentException e) {
+ throw new RuntimeException(e);
+ } catch (InstantiationException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void start() {
+ try {
+ startMethod.invoke(tie);
+ } catch (IllegalArgumentException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void close() {
+ try {
+ closeMethod.invoke(tie);
+ } catch (IllegalArgumentException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Object getBean(String id) throws SpringInvocationException {
+ try {
+
+ return getBeanMethod.invoke(tie, id);
+
+ } catch (IllegalArgumentException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+}
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java
index e010f30776..0ecd00d5a8 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProvider.java
@@ -1,85 +1,85 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring.invocation;
-
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * A provider class for runtime Spring implementation instances
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class SpringImplementationProvider implements ImplementationProvider {
- private RuntimeComponent component;
-
- // A Spring application context object
- private SpringContextStub springContext;
-
- private SpringImplementation implementation;
-
- private JavaPropertyValueObjectFactory propertyValueObjectFactory;
-
- /**
- * Constructor for the provider - takes a component definition and a Spring implementation
- * description
- * @param component - the component in the assembly
- * @param implementation - the implementation
- */
- public SpringImplementationProvider(RuntimeComponent component,
- SpringImplementation implementation,
- ProxyFactory proxyService,
- JavaPropertyValueObjectFactory propertyValueObjectFactory) {
- super();
- this.implementation = implementation;
- this.component = component;
- this.propertyValueObjectFactory = propertyValueObjectFactory;
-
- springContext = new SpringContextStub(component, implementation, proxyService, propertyValueObjectFactory);
-
- } // end constructor
-
- public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
- return new SpringInvoker(component, springContext, service, operation);
- }
-
- public boolean supportsOneWayInvocation() {
- return false;
- }
-
- /**
- * Start this Spring implementation instance
- */
- public void start() {
- springContext.start();
- }
-
- /**
- * Stop this implementation instance
- */
- public void stop() {
- springContext.close();
- }
-
-} // end class SpringImplementationProvider
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring.invocation;
+
+import org.apache.tuscany.sca.core.invocation.ProxyFactory;
+import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+/**
+ * A provider class for runtime Spring implementation instances
+ * @version $Rev$ $Date$
+ */
+public class SpringImplementationProvider implements ImplementationProvider {
+ private RuntimeComponent component;
+
+ // A Spring application context object
+ private SpringContextStub springContext;
+
+ private SpringImplementation implementation;
+
+ private JavaPropertyValueObjectFactory propertyValueObjectFactory;
+
+ /**
+ * Constructor for the provider - takes a component definition and a Spring implementation
+ * description
+ * @param component - the component in the assembly
+ * @param implementation - the implementation
+ */
+ public SpringImplementationProvider(RuntimeComponent component,
+ SpringImplementation implementation,
+ ProxyFactory proxyService,
+ JavaPropertyValueObjectFactory propertyValueObjectFactory) {
+ super();
+ this.implementation = implementation;
+ this.component = component;
+ this.propertyValueObjectFactory = propertyValueObjectFactory;
+
+ springContext = new SpringContextStub(component, implementation, proxyService, propertyValueObjectFactory);
+
+ } // end constructor
+
+ public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
+ return new SpringInvoker(component, springContext, service, operation);
+ }
+
+ public boolean supportsOneWayInvocation() {
+ return false;
+ }
+
+ /**
+ * Start this Spring implementation instance
+ */
+ public void start() {
+ springContext.start();
+ }
+
+ /**
+ * Stop this implementation instance
+ */
+ public void stop() {
+ springContext.close();
+ }
+
+} // end class SpringImplementationProvider
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java
index b7deeb2eb5..5dfdbffd84 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationProviderFactory.java
@@ -1,77 +1,77 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring.invocation;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory;
-import org.apache.tuscany.sca.core.invocation.ProxyFactory;
-import org.apache.tuscany.sca.core.invocation.ProxyFactoryExtensionPoint;
-import org.apache.tuscany.sca.databinding.impl.MediatorImpl;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * ImplementationProviderFactory for Spring implementation type
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- *
- */
-public class SpringImplementationProviderFactory implements ImplementationProviderFactory<SpringImplementation> {
-
- private ProxyFactory proxyFactory;
- private JavaPropertyValueObjectFactory propertyFactory;
-
- /**
- * Simple constructor
- *
- */
- public SpringImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
- super();
-
- ProxyFactoryExtensionPoint proxyFactories = extensionPoints.getExtensionPoint(ProxyFactoryExtensionPoint.class);
- proxyFactory = new ExtensibleProxyFactory(proxyFactories);
-
- // TODO: could the runtime have a default PropertyValueObjectFactory?
- propertyFactory = new JavaPropertyValueObjectFactory(new MediatorImpl(extensionPoints));
- }
-
- /**
- * Returns a SpringImplementationProvider for a given component and Spring implementation
- * @param component the component for which implementation instances are required
- * @param implementation the Spring implementation with details of the component
- * implementation
- * @return the SpringImplementationProvider for the specified component
- */
- public ImplementationProvider createImplementationProvider(RuntimeComponent component,
- SpringImplementation implementation) {
- return new SpringImplementationProvider(component,
- implementation,
- proxyFactory,
- propertyFactory);
- }
-
- /**
- * Returns the class of the Spring implementation
- */
- public Class<SpringImplementation> getModelType() {
- return SpringImplementation.class;
- }
-} // end class SpringImplementationProviderFactory
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring.invocation;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory;
+import org.apache.tuscany.sca.core.invocation.ProxyFactory;
+import org.apache.tuscany.sca.core.invocation.ProxyFactoryExtensionPoint;
+import org.apache.tuscany.sca.databinding.impl.MediatorImpl;
+import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+/**
+ * ImplementationProviderFactory for Spring implementation type
+ * @version $Rev$ $Date$
+ *
+ */
+public class SpringImplementationProviderFactory implements ImplementationProviderFactory<SpringImplementation> {
+
+ private ProxyFactory proxyFactory;
+ private JavaPropertyValueObjectFactory propertyFactory;
+
+ /**
+ * Simple constructor
+ *
+ */
+ public SpringImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
+ super();
+
+ ProxyFactoryExtensionPoint proxyFactories = extensionPoints.getExtensionPoint(ProxyFactoryExtensionPoint.class);
+ proxyFactory = new ExtensibleProxyFactory(proxyFactories);
+
+ // TODO: could the runtime have a default PropertyValueObjectFactory?
+ propertyFactory = new JavaPropertyValueObjectFactory(new MediatorImpl(extensionPoints));
+ }
+
+ /**
+ * Returns a SpringImplementationProvider for a given component and Spring implementation
+ * @param component the component for which implementation instances are required
+ * @param implementation the Spring implementation with details of the component
+ * implementation
+ * @return the SpringImplementationProvider for the specified component
+ */
+ public ImplementationProvider createImplementationProvider(RuntimeComponent component,
+ SpringImplementation implementation) {
+ return new SpringImplementationProvider(component,
+ implementation,
+ proxyFactory,
+ propertyFactory);
+ }
+
+ /**
+ * Returns the class of the Spring implementation
+ */
+ public Class<SpringImplementation> getModelType() {
+ return SpringImplementation.class;
+ }
+} // end class SpringImplementationProviderFactory
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationTie.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationTie.java
index 6bdafdccd2..590b278e4c 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationTie.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringImplementationTie.java
@@ -1,143 +1,143 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.spring.invocation;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.core.factory.ObjectFactory;
-import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
-import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-/**
- * This is the Tuscany side tie for the corresponding runtime stub class.
- * It enables the Sping code in the runtime module to invoke methods on a
- * Tuscany SpringImplementation without the Spring runtime module
- * needing to know about any Tuscany classes. See the SpringImplementationStub class
- * in the implementation-spring-runtime module for what the stub does.
- */
-public class SpringImplementationTie {
-
- private SpringImplementation implementation;
- private RuntimeComponent component;
- private JavaPropertyValueObjectFactory propertyFactory;
-
- public SpringImplementationTie(SpringImplementation implementation, RuntimeComponent component, JavaPropertyValueObjectFactory propertyFactory) {
- this.implementation = implementation;
- this.component = component;
- this.propertyFactory = propertyFactory;
- }
-
- public String getURI() {
- throw new IllegalStateException("Not yet impl");
- }
-
- public String getComponentName() {
- return component.getName();
- }
- /**
- * Method to create a Java Bean for a Property value
- * @param <B> the class type of the Bean
- * @param requiredType - a Class object for the required type
- * @param name - the Property name
- * @return - a Bean of the specified property, with value set
- */
- private <B> B getPropertyBean(Class<?> requiredType, String name) {
- B propertyObject = null;
- // Get the component's list of properties
- List<ComponentProperty> props = component.getProperties();
- for (ComponentProperty prop : props) {
- if (prop.getName().equals(name)) {
- // On finding the property, create a factory for it and create a Bean using
- // the factory
- ObjectFactory<?> factory = propertyFactory.createValueFactory(prop, prop.getValue(), requiredType);
- propertyObject = (B)factory.getInstance();
- } // end if
- } // end for
-
- return propertyObject;
- }
-
- /**
- * Creates a proxy Bean for a reference
- * @param <B> the Business interface type for the reference
- * @param businessInterface - the business interface as a Class
- * @param referenceName - the name of the Reference
- * @return an Bean of the type defined by <B>
- */
- private <B> B getService(Class<B> businessInterface, String referenceName) {
- return component.getComponentContext().getService(businessInterface, referenceName);
- }
-
- /**
- * Get a Bean for a reference or for a property.
- *
- * @param name - the name of the Bean required
- * @param requiredType - the required type of the Bean (either a Java class or a Java interface)
- * @return Object - a Bean which matches the requested bean
- */
- public Object getBean(String name, Class<?> requiredType) {
- System.out.println("Spring parent context - getBean called for name: " + name);
- // The expectation is that the requested Bean is either a reference or a property
- // from the Spring context
- for (Reference reference : implementation.getReferences()) {
- if (reference.getName().equals(name)) {
- // Extract the Java interface for the reference (it can't be any other interface type
- // for a Spring application context)
- if (requiredType == null) {
- JavaInterface javaInterface = (JavaInterface)reference.getInterfaceContract().getInterface();
- requiredType = javaInterface.getJavaClass();
- }
- // Create and return the proxy for the reference
- return getService(requiredType, reference.getName());
- } // end if
- } // end for
-
- // For a property, get the name and the required Java type and create a Bean
- // of that type with the value inserted.
- for (Property property : implementation.getProperties()) {
- if (property.getName().equals(name)) {
- if (requiredType == null) {
- // The following code only deals with a subset of types and was superceded
- // by the information from the implementation (which uses Classes as found
- // in the Spring implementation itself.
- //requiredType = JavaXMLMapper.getJavaType( property.getXSDType() );
- requiredType = implementation.getPropertyClass(name);
- }
- return getPropertyBean(requiredType, property.getName());
- } // end if
- } // end for
- // TODO: NoSuchBeanException
- throw new RuntimeException("Unable to find Bean with name " + name);
-
- } // end method getBean( String, Class )
-
- public Object getComponentTie() {
- return new ComponentTie(component);
- }
-
- public Object getPropertyValueTie() {
- return new PropertyValueTie(component, propertyFactory);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.spring.invocation;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.ComponentProperty;
+import org.apache.tuscany.sca.assembly.Property;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.core.factory.ObjectFactory;
+import org.apache.tuscany.sca.implementation.java.injection.JavaPropertyValueObjectFactory;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+/**
+ * This is the Tuscany side tie for the corresponding runtime stub class.
+ * It enables the Sping code in the runtime module to invoke methods on a
+ * Tuscany SpringImplementation without the Spring runtime module
+ * needing to know about any Tuscany classes. See the SpringImplementationStub class
+ * in the implementation-spring-runtime module for what the stub does.
+ */
+public class SpringImplementationTie {
+
+ private SpringImplementation implementation;
+ private RuntimeComponent component;
+ private JavaPropertyValueObjectFactory propertyFactory;
+
+ public SpringImplementationTie(SpringImplementation implementation, RuntimeComponent component, JavaPropertyValueObjectFactory propertyFactory) {
+ this.implementation = implementation;
+ this.component = component;
+ this.propertyFactory = propertyFactory;
+ }
+
+ public String getURI() {
+ throw new IllegalStateException("Not yet impl");
+ }
+
+ public String getComponentName() {
+ return component.getName();
+ }
+ /**
+ * Method to create a Java Bean for a Property value
+ * @param <B> the class type of the Bean
+ * @param requiredType - a Class object for the required type
+ * @param name - the Property name
+ * @return - a Bean of the specified property, with value set
+ */
+ private <B> B getPropertyBean(Class<?> requiredType, String name) {
+ B propertyObject = null;
+ // Get the component's list of properties
+ List<ComponentProperty> props = component.getProperties();
+ for (ComponentProperty prop : props) {
+ if (prop.getName().equals(name)) {
+ // On finding the property, create a factory for it and create a Bean using
+ // the factory
+ ObjectFactory<?> factory = propertyFactory.createValueFactory(prop, prop.getValue(), requiredType);
+ propertyObject = (B)factory.getInstance();
+ } // end if
+ } // end for
+
+ return propertyObject;
+ }
+
+ /**
+ * Creates a proxy Bean for a reference
+ * @param <B> the Business interface type for the reference
+ * @param businessInterface - the business interface as a Class
+ * @param referenceName - the name of the Reference
+ * @return an Bean of the type defined by <B>
+ */
+ private <B> B getService(Class<B> businessInterface, String referenceName) {
+ return component.getComponentContext().getService(businessInterface, referenceName);
+ }
+
+ /**
+ * Get a Bean for a reference or for a property.
+ *
+ * @param name - the name of the Bean required
+ * @param requiredType - the required type of the Bean (either a Java class or a Java interface)
+ * @return Object - a Bean which matches the requested bean
+ */
+ public Object getBean(String name, Class<?> requiredType) {
+ System.out.println("Spring parent context - getBean called for name: " + name);
+ // The expectation is that the requested Bean is either a reference or a property
+ // from the Spring context
+ for (Reference reference : implementation.getReferences()) {
+ if (reference.getName().equals(name)) {
+ // Extract the Java interface for the reference (it can't be any other interface type
+ // for a Spring application context)
+ if (requiredType == null) {
+ JavaInterface javaInterface = (JavaInterface)reference.getInterfaceContract().getInterface();
+ requiredType = javaInterface.getJavaClass();
+ }
+ // Create and return the proxy for the reference
+ return getService(requiredType, reference.getName());
+ } // end if
+ } // end for
+
+ // For a property, get the name and the required Java type and create a Bean
+ // of that type with the value inserted.
+ for (Property property : implementation.getProperties()) {
+ if (property.getName().equals(name)) {
+ if (requiredType == null) {
+ // The following code only deals with a subset of types and was superceded
+ // by the information from the implementation (which uses Classes as found
+ // in the Spring implementation itself.
+ //requiredType = JavaXMLMapper.getJavaType( property.getXSDType() );
+ requiredType = implementation.getPropertyClass(name);
+ }
+ return getPropertyBean(requiredType, property.getName());
+ } // end if
+ } // end for
+ // TODO: NoSuchBeanException
+ throw new RuntimeException("Unable to find Bean with name " + name);
+
+ } // end method getBean( String, Class )
+
+ public Object getComponentTie() {
+ return new ComponentTie(component);
+ }
+
+ public Object getPropertyValueTie() {
+ return new PropertyValueTie(component, propertyFactory);
+ }
+}
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringInvocationException.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringInvocationException.java
index d1330f8471..6a23830aa9 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringInvocationException.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringInvocationException.java
@@ -1,40 +1,40 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring.invocation;
-
-/**
- * @version $Rev$ $Date$
- */
-public class SpringInvocationException extends Exception {
-
- private static final long serialVersionUID = -1157790036638157513L;
-
- public SpringInvocationException(String msg) {
- super(msg);
- }
-
- public SpringInvocationException(Throwable e) {
- super(e);
- }
-
- public SpringInvocationException(String msg,Throwable e) {
- super(msg,e);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring.invocation;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class SpringInvocationException extends Exception {
+
+ private static final long serialVersionUID = -1157790036638157513L;
+
+ public SpringInvocationException(String msg) {
+ super(msg);
+ }
+
+ public SpringInvocationException(Throwable e) {
+ super(e);
+ }
+
+ public SpringInvocationException(String msg,Throwable e) {
+ super(msg,e);
+ }
+
+}
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringInvoker.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringInvoker.java
index 3bf68a689c..1f9796ccc4 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringInvoker.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/invocation/SpringInvoker.java
@@ -1,124 +1,124 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.spring.invocation;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import org.apache.tuscany.sca.implementation.spring.SpringBeanElement;
-import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.invocation.Message;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-/**
- * Initial implementation of a Spring bean invoker
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class SpringInvoker implements Invoker {
-
- private Method theMethod = null;
- private Object bean;
- private SpringBeanElement beanElement;
- private boolean badInvoker = false;
-
- private SpringContextStub springContext;
- private Operation operation;
-
- /**
- * SpringInvoker constructor
- * @param component - the Spring component to invoke
- * @param service - the service to invoke
- * @param operation - the operation to invoke
- */
- public SpringInvoker(RuntimeComponent component,
- SpringContextStub springContext,
- RuntimeComponentService service,
- Operation operation) {
-
- this.springContext = springContext;
- this.operation = operation;
-
- // From the component and the service, identify the Spring Bean which is the target
- SpringImplementation theImplementation = (SpringImplementation)component.getImplementation();
- beanElement = theImplementation.getBeanFromService(service.getService());
-
- if (beanElement == null) {
- badInvoker = true;
- return;
- }
-
- } // end constructor SpringInvoker
-
- // Lazy-load the method to avoid timing problems with the Spring Context
- private void setupMethod() throws SpringInvocationException{
- try {
- bean = springContext.getBean(beanElement.getId());
- Class<?> beanClass = bean.getClass();
- theMethod = JavaInterfaceUtil.findMethod(beanClass, operation);
- //System.out.println("SpringInvoker - found method " + theMethod.getName() );
- } catch (NoSuchMethodException e) {
- throw new SpringInvocationException(e);
- }
- }
-
- private Object doInvoke(Object payload) throws SpringInvocationException {
- if (theMethod == null)
- setupMethod();
-
- if (badInvoker)
- throw new SpringInvocationException("Spring invoker incorrectly configured");
- // Invoke the method on the Spring bean using the payload, returning the results
- try {
- Object ret;
-
- if (payload != null && !payload.getClass().isArray()) {
- ret = theMethod.invoke(bean, payload);
- } else {
- ret = theMethod.invoke(bean, (Object[])payload);
- }
- return ret;
- } catch (InvocationTargetException e) {
- throw new SpringInvocationException("Spring invoker invoke method '"+ theMethod.getName()+"' error.",e.getCause());
- } catch (Exception e) {
- throw new SpringInvocationException("Spring invoker invoke method '"+ theMethod.getName()+"' error.",e);
- }
-
- } // end method doInvoke
-
- /**
- * @param msg the message to invoke on the target bean
- */
- public Message invoke(Message msg) {
- try {
- Object resp = doInvoke(msg.getBody());
- msg.setBody(resp);
- } catch (SpringInvocationException e) {
- msg.setFaultBody(e.getCause());
- }catch (Throwable e) {
- msg.setFaultBody(e);
- }
- //System.out.println("Spring Invoker - invoke called");
- return msg;
- } // end method invoke
-
-} // end class SpringInvoker
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.spring.invocation;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.apache.tuscany.sca.implementation.spring.SpringBeanElement;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceUtil;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+/**
+ * Initial implementation of a Spring bean invoker
+ * @version $Rev$ $Date$
+ */
+public class SpringInvoker implements Invoker {
+
+ private Method theMethod = null;
+ private Object bean;
+ private SpringBeanElement beanElement;
+ private boolean badInvoker = false;
+
+ private SpringContextStub springContext;
+ private Operation operation;
+
+ /**
+ * SpringInvoker constructor
+ * @param component - the Spring component to invoke
+ * @param service - the service to invoke
+ * @param operation - the operation to invoke
+ */
+ public SpringInvoker(RuntimeComponent component,
+ SpringContextStub springContext,
+ RuntimeComponentService service,
+ Operation operation) {
+
+ this.springContext = springContext;
+ this.operation = operation;
+
+ // From the component and the service, identify the Spring Bean which is the target
+ SpringImplementation theImplementation = (SpringImplementation)component.getImplementation();
+ beanElement = theImplementation.getBeanFromService(service.getService());
+
+ if (beanElement == null) {
+ badInvoker = true;
+ return;
+ }
+
+ } // end constructor SpringInvoker
+
+ // Lazy-load the method to avoid timing problems with the Spring Context
+ private void setupMethod() throws SpringInvocationException{
+ try {
+ bean = springContext.getBean(beanElement.getId());
+ Class<?> beanClass = bean.getClass();
+ theMethod = JavaInterfaceUtil.findMethod(beanClass, operation);
+ //System.out.println("SpringInvoker - found method " + theMethod.getName() );
+ } catch (NoSuchMethodException e) {
+ throw new SpringInvocationException(e);
+ }
+ }
+
+ private Object doInvoke(Object payload) throws SpringInvocationException {
+ if (theMethod == null)
+ setupMethod();
+
+ if (badInvoker)
+ throw new SpringInvocationException("Spring invoker incorrectly configured");
+ // Invoke the method on the Spring bean using the payload, returning the results
+ try {
+ Object ret;
+
+ if (payload != null && !payload.getClass().isArray()) {
+ ret = theMethod.invoke(bean, payload);
+ } else {
+ ret = theMethod.invoke(bean, (Object[])payload);
+ }
+ return ret;
+ } catch (InvocationTargetException e) {
+ throw new SpringInvocationException("Spring invoker invoke method '"+ theMethod.getName()+"' error.",e.getCause());
+ } catch (Exception e) {
+ throw new SpringInvocationException("Spring invoker invoke method '"+ theMethod.getName()+"' error.",e);
+ }
+
+ } // end method doInvoke
+
+ /**
+ * @param msg the message to invoke on the target bean
+ */
+ public Message invoke(Message msg) {
+ try {
+ Object resp = doInvoke(msg.getBody());
+ msg.setBody(resp);
+ } catch (SpringInvocationException e) {
+ msg.setFaultBody(e.getCause());
+ }catch (Throwable e) {
+ msg.setFaultBody(e);
+ }
+ //System.out.println("Spring Invoker - invoke called");
+ return msg;
+ } // end method invoke
+
+} // end class SpringInvoker
diff --git a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java
index eab0fb8942..ed67479eed 100644
--- a/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java
+++ b/java/sca/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/xml/SpringImplementationProcessor.java
@@ -1,233 +1,233 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.spring.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.assembly.xml.PolicySubjectProcessor;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
-import org.apache.tuscany.sca.implementation.spring.introspect.SpringXMLComponentTypeLoader;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.policy.PolicyFactory;
-
-/**
- * SpringArtifactProcessor is responsible for processing the XML of an <implementation.spring.../>
- * element in an SCA SCDL file.
- *
- * @version $Rev: 511195 $ $Date: 2007-02-24 02:29:46 +0000 (Sat, 24 Feb 2007) $
- */
-public class SpringImplementationProcessor implements StAXArtifactProcessor<SpringImplementation> {
-
- private static final String LOCATION = "location";
- private static final String IMPLEMENTATION_SPRING = "implementation.spring";
- private static final QName IMPLEMENTATION_SPRING_QNAME = new QName(Constants.SCA11_NS, IMPLEMENTATION_SPRING);
- private static final String MSG_LOCATION_MISSING = "Reading implementation.spring - location attribute missing";
-
- private AssemblyFactory assemblyFactory;
- private JavaInterfaceFactory javaFactory;
- private PolicyFactory policyFactory;
- private PolicySubjectProcessor policyProcessor;
- private Monitor monitor;
-
- private FactoryExtensionPoint factories;
-
- public SpringImplementationProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.factories = modelFactories;
- this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- this.javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
- this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
- this.policyProcessor = new PolicySubjectProcessor(policyFactory);
- this.monitor = monitor;
- }
-
- /**
- * Report a exception.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void error(String message, Object model, Exception ex) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "impl-spring-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- /**
- * Report a error.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void error(String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "impl-spring-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- /*
- * Read the XML and parse out the attributes.
- *
- * <implementation.spring.../> has a single required attribute:
- * "location" - which is the target URI of of an archive file or a directory that contains the Spring
- * application context files.
- * If the resource identified by the location attribute is an archive file, then the file
- * META-INF/MANIFEST.MF is read from the archive.
- * If the location URI identifies a directory, then META-INF/MANIFEST.MF must exist
- * underneath that directory.
- * If the manifest file contains a header "Spring-Context" of the format:
- * Spring-Context ::= path ( ';' path )*
- *
- * Where path is a relative path with respect to the location URI, then the set of paths
- * specified in the header identify the context configuration files.
- * If there is no MANIFEST.MF file or no Spring-Context header within that file,
- * then the default behaviour is to build an application context using all the *.xml files
- * in the METAINF/spring directory.
- */
- public SpringImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- // Create the Spring implementation
- SpringImplementation springImplementation = null;
-
- // Read the location attribute for the spring implementation
- String springLocation = reader.getAttributeValue(null, LOCATION);
- if (springLocation != null) {
- springImplementation = new SpringImplementation();
- springImplementation.setLocation(springLocation);
- springImplementation.setUnresolved(true);
- processComponentType(springImplementation);
- } else {
- error("LocationAttributeMissing", reader);
- //throw new ContributionReadException(MSG_LOCATION_MISSING);
- }
-
- // Read policies
- policyProcessor.readPolicies(springImplementation, reader);
-
- // Skip to end element
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && IMPLEMENTATION_SPRING_QNAME.equals(reader.getName())) {
- break;
- }
- } // end while
-
- return springImplementation;
- } // end read
-
- /*
- * Handles the component type for the Spring implementation
- * @param springImplementation - a Spring implementation. The component type information
- * is created for this implementation
- *
- */
- private void processComponentType(SpringImplementation springImplementation) {
-
- // Create a ComponentType and mark it unresolved
- ComponentType componentType = assemblyFactory.createComponentType();
- componentType.setUnresolved(true);
- springImplementation.setComponentType(componentType);
- } // end processComponentType
-
- /*
- * Write out the XML representation of the Spring implementation
- * <implementation.spring location="..." />
- */
- public void write(SpringImplementation springImplementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <implementation.spring>
- policyProcessor.writePolicyPrefixes(springImplementation, writer);
- writer.writeStartElement(Constants.SCA11_NS, IMPLEMENTATION_SPRING);
- policyProcessor.writePolicyAttributes(springImplementation, writer);
-
- if (springImplementation.getLocation() != null) {
- writer.writeAttribute(LOCATION, springImplementation.getLocation());
- }
-
- writer.writeEndElement();
-
- } // end write
-
- /**
- * Resolves the Spring implementation - loads the Spring application-context XML and
- * derives the spring implementation componentType from it
- */
- public void resolve(SpringImplementation springImplementation, ModelResolver resolver)
- throws ContributionResolveException {
-
- if (springImplementation == null)
- return;
-
- /* Load the Spring component type by reading the Spring application context */
- SpringXMLComponentTypeLoader springLoader =
- new SpringXMLComponentTypeLoader(factories, assemblyFactory, javaFactory, policyFactory);
- try {
- // Load the Spring Implementation information from its application context file...
- springLoader.load(springImplementation, resolver);
- } catch (ContributionReadException e) {
- ContributionResolveException ce = new ContributionResolveException(e);
- error("ContributionResolveException", resolver, ce);
- throw ce;
- }
-
- ComponentType ct = springImplementation.getComponentType();
- if (ct.isUnresolved()) {
- // If the introspection fails to resolve, try to find a side file...
- ComponentType componentType = resolver.resolveModel(ComponentType.class, ct);
- if (componentType.isUnresolved()) {
- error("UnableToResolveComponentType", resolver);
- //throw new ContributionResolveException("SpringArtifactProcessor: unable to resolve componentType for Spring component");
- } else {
- springImplementation.setComponentType(componentType);
- springImplementation.setUnresolved(false);
- }
-
- } // end if
-
- } // end method resolve
-
- public QName getArtifactType() {
- return IMPLEMENTATION_SPRING_QNAME;
- }
-
- public Class<SpringImplementation> getModelType() {
- return SpringImplementation.class;
- }
-
-} // end class SpringArtifactProcessor
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.spring.xml;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.assembly.xml.PolicySubjectProcessor;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.implementation.spring.SpringImplementation;
+import org.apache.tuscany.sca.implementation.spring.introspect.SpringXMLComponentTypeLoader;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
+import org.apache.tuscany.sca.policy.PolicyFactory;
+
+/**
+ * SpringArtifactProcessor is responsible for processing the XML of an <implementation.spring.../>
+ * element in an SCA SCDL file.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SpringImplementationProcessor implements StAXArtifactProcessor<SpringImplementation> {
+
+ private static final String LOCATION = "location";
+ private static final String IMPLEMENTATION_SPRING = "implementation.spring";
+ private static final QName IMPLEMENTATION_SPRING_QNAME = new QName(Constants.SCA11_NS, IMPLEMENTATION_SPRING);
+ private static final String MSG_LOCATION_MISSING = "Reading implementation.spring - location attribute missing";
+
+ private AssemblyFactory assemblyFactory;
+ private JavaInterfaceFactory javaFactory;
+ private PolicyFactory policyFactory;
+ private PolicySubjectProcessor policyProcessor;
+ private Monitor monitor;
+
+ private FactoryExtensionPoint factories;
+
+ public SpringImplementationProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
+ this.factories = modelFactories;
+ this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
+ this.javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
+ this.policyFactory = modelFactories.getFactory(PolicyFactory.class);
+ this.policyProcessor = new PolicySubjectProcessor(policyFactory);
+ this.monitor = monitor;
+ }
+
+ /**
+ * Report a exception.
+ *
+ * @param problems
+ * @param message
+ * @param model
+ */
+ private void error(String message, Object model, Exception ex) {
+ if (monitor != null) {
+ Problem problem = monitor.createProblem(this.getClass().getName(), "impl-spring-validation-messages", Severity.ERROR, model, message, ex);
+ monitor.problem(problem);
+ }
+ }
+
+ /**
+ * Report a error.
+ *
+ * @param problems
+ * @param message
+ * @param model
+ */
+ private void error(String message, Object model, Object... messageParameters) {
+ if (monitor != null) {
+ Problem problem = monitor.createProblem(this.getClass().getName(), "impl-spring-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+ monitor.problem(problem);
+ }
+ }
+
+ /*
+ * Read the XML and parse out the attributes.
+ *
+ * <implementation.spring.../> has a single required attribute:
+ * "location" - which is the target URI of of an archive file or a directory that contains the Spring
+ * application context files.
+ * If the resource identified by the location attribute is an archive file, then the file
+ * META-INF/MANIFEST.MF is read from the archive.
+ * If the location URI identifies a directory, then META-INF/MANIFEST.MF must exist
+ * underneath that directory.
+ * If the manifest file contains a header "Spring-Context" of the format:
+ * Spring-Context ::= path ( ';' path )*
+ *
+ * Where path is a relative path with respect to the location URI, then the set of paths
+ * specified in the header identify the context configuration files.
+ * If there is no MANIFEST.MF file or no Spring-Context header within that file,
+ * then the default behaviour is to build an application context using all the *.xml files
+ * in the METAINF/spring directory.
+ */
+ public SpringImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+
+ // Create the Spring implementation
+ SpringImplementation springImplementation = null;
+
+ // Read the location attribute for the spring implementation
+ String springLocation = reader.getAttributeValue(null, LOCATION);
+ if (springLocation != null) {
+ springImplementation = new SpringImplementation();
+ springImplementation.setLocation(springLocation);
+ springImplementation.setUnresolved(true);
+ processComponentType(springImplementation);
+ } else {
+ error("LocationAttributeMissing", reader);
+ //throw new ContributionReadException(MSG_LOCATION_MISSING);
+ }
+
+ // Read policies
+ policyProcessor.readPolicies(springImplementation, reader);
+
+ // Skip to end element
+ while (reader.hasNext()) {
+ if (reader.next() == END_ELEMENT && IMPLEMENTATION_SPRING_QNAME.equals(reader.getName())) {
+ break;
+ }
+ } // end while
+
+ return springImplementation;
+ } // end read
+
+ /*
+ * Handles the component type for the Spring implementation
+ * @param springImplementation - a Spring implementation. The component type information
+ * is created for this implementation
+ *
+ */
+ private void processComponentType(SpringImplementation springImplementation) {
+
+ // Create a ComponentType and mark it unresolved
+ ComponentType componentType = assemblyFactory.createComponentType();
+ componentType.setUnresolved(true);
+ springImplementation.setComponentType(componentType);
+ } // end processComponentType
+
+ /*
+ * Write out the XML representation of the Spring implementation
+ * <implementation.spring location="..." />
+ */
+ public void write(SpringImplementation springImplementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
+
+ // Write <implementation.spring>
+ policyProcessor.writePolicyPrefixes(springImplementation, writer);
+ writer.writeStartElement(Constants.SCA11_NS, IMPLEMENTATION_SPRING);
+ policyProcessor.writePolicyAttributes(springImplementation, writer);
+
+ if (springImplementation.getLocation() != null) {
+ writer.writeAttribute(LOCATION, springImplementation.getLocation());
+ }
+
+ writer.writeEndElement();
+
+ } // end write
+
+ /**
+ * Resolves the Spring implementation - loads the Spring application-context XML and
+ * derives the spring implementation componentType from it
+ */
+ public void resolve(SpringImplementation springImplementation, ModelResolver resolver)
+ throws ContributionResolveException {
+
+ if (springImplementation == null)
+ return;
+
+ /* Load the Spring component type by reading the Spring application context */
+ SpringXMLComponentTypeLoader springLoader =
+ new SpringXMLComponentTypeLoader(factories, assemblyFactory, javaFactory, policyFactory);
+ try {
+ // Load the Spring Implementation information from its application context file...
+ springLoader.load(springImplementation, resolver);
+ } catch (ContributionReadException e) {
+ ContributionResolveException ce = new ContributionResolveException(e);
+ error("ContributionResolveException", resolver, ce);
+ throw ce;
+ }
+
+ ComponentType ct = springImplementation.getComponentType();
+ if (ct.isUnresolved()) {
+ // If the introspection fails to resolve, try to find a side file...
+ ComponentType componentType = resolver.resolveModel(ComponentType.class, ct);
+ if (componentType.isUnresolved()) {
+ error("UnableToResolveComponentType", resolver);
+ //throw new ContributionResolveException("SpringArtifactProcessor: unable to resolve componentType for Spring component");
+ } else {
+ springImplementation.setComponentType(componentType);
+ springImplementation.setUnresolved(false);
+ }
+
+ } // end if
+
+ } // end method resolve
+
+ public QName getArtifactType() {
+ return IMPLEMENTATION_SPRING_QNAME;
+ }
+
+ public Class<SpringImplementation> getModelType() {
+ return SpringImplementation.class;
+ }
+
+} // end class SpringArtifactProcessor
diff --git a/java/sca/modules/implementation-spring/src/main/resources/impl-spring-validation-messages.properties b/java/sca/modules/implementation-spring/src/main/resources/impl-spring-validation-messages.properties
index a348225d31..6fce02664a 100644
--- a/java/sca/modules/implementation-spring/src/main/resources/impl-spring-validation-messages.properties
+++ b/java/sca/modules/implementation-spring/src/main/resources/impl-spring-validation-messages.properties
@@ -1,23 +1,23 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-LocationAttributeMissing = Reading implementation.spring - location attribute missing
-ContributionResolveException = ContributionResolveException occured due to:
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#
+LocationAttributeMissing = Reading implementation.spring - location attribute missing
+ContributionResolveException = ContributionResolveException occured due to:
UnableToResolveComponentType = SpringArtifactProcessor: unable to resolve componentType for Spring component \ No newline at end of file
diff --git a/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java b/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java
index 663af52877..c0186d6a83 100644
--- a/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java
+++ b/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/WebImplementationProviderFactory.java
@@ -1,68 +1,68 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.web.runtime;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.host.http.ServletHost;
-import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
-import org.apache.tuscany.sca.implementation.web.WebImplementation;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.invocation.Invoker;
-import org.apache.tuscany.sca.provider.ImplementationProvider;
-import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.tuscany.sca.runtime.RuntimeComponentService;
-
-public class WebImplementationProviderFactory implements ImplementationProviderFactory<WebImplementation> {
-
- private ServletHost servletHost;
-
- public WebImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
- ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
- List<ServletHost> hosts = servletHosts.getServletHosts();
- if (!hosts.isEmpty()) {
- this.servletHost = hosts.get(0);
- }
- }
-
- public ImplementationProvider createImplementationProvider(RuntimeComponent component, WebImplementation implementation) {
- servletHost.setAttribute("org.apache.tuscany.sca.implementation.web.RuntimeComponent", component);
-
- return new ImplementationProvider() {
-
- public Invoker createInvoker(RuntimeComponentService arg0, Operation arg1) {
- throw new UnsupportedOperationException("Components using implementation.web have no services");
- }
- public void start() {
- }
- public void stop() {
- }
- public boolean supportsOneWayInvocation() {
- return false;
- }
- };
- }
-
- public Class<WebImplementation> getModelType() {
- return WebImplementation.class;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.web.runtime;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.host.http.ServletHost;
+import org.apache.tuscany.sca.host.http.ServletHostExtensionPoint;
+import org.apache.tuscany.sca.implementation.web.WebImplementation;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.Invoker;
+import org.apache.tuscany.sca.provider.ImplementationProvider;
+import org.apache.tuscany.sca.provider.ImplementationProviderFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+
+public class WebImplementationProviderFactory implements ImplementationProviderFactory<WebImplementation> {
+
+ private ServletHost servletHost;
+
+ public WebImplementationProviderFactory(ExtensionPointRegistry extensionPoints) {
+ ServletHostExtensionPoint servletHosts = extensionPoints.getExtensionPoint(ServletHostExtensionPoint.class);
+ List<ServletHost> hosts = servletHosts.getServletHosts();
+ if (!hosts.isEmpty()) {
+ this.servletHost = hosts.get(0);
+ }
+ }
+
+ public ImplementationProvider createImplementationProvider(RuntimeComponent component, WebImplementation implementation) {
+ servletHost.setAttribute("org.apache.tuscany.sca.implementation.web.RuntimeComponent", component);
+
+ return new ImplementationProvider() {
+
+ public Invoker createInvoker(RuntimeComponentService arg0, Operation arg1) {
+ throw new UnsupportedOperationException("Components using implementation.web have no services");
+ }
+ public void start() {
+ }
+ public void stop() {
+ }
+ public boolean supportsOneWayInvocation() {
+ return false;
+ }
+ };
+ }
+
+ public Class<WebImplementation> getModelType() {
+ return WebImplementation.class;
+ }
+
+}
diff --git a/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/jsp/ReferenceTEI.java b/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/jsp/ReferenceTEI.java
index 95d082a3b4..2ba7944326 100644
--- a/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/jsp/ReferenceTEI.java
+++ b/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/jsp/ReferenceTEI.java
@@ -1,45 +1,45 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.web.runtime.jsp;
-
-import javax.servlet.jsp.tagext.TagData;
-import javax.servlet.jsp.tagext.TagExtraInfo;
-import javax.servlet.jsp.tagext.VariableInfo;
-
-/**
- * TagExtraInfo class for the SCA reference tags
- * <sca:reference name="service" type="test.MyService" scope="1" />
- *
- * @version $Rev: 685532 $ $Date: 2008-08-13 14:03:50 +0100 (Wed, 13 Aug 2008) $
- */
-public class ReferenceTEI extends TagExtraInfo {
-
- @Override
- public VariableInfo[] getVariableInfo(TagData data) {
- VariableInfo info1
- = new VariableInfo(
- data.getAttributeString("name"),
- data.getAttributeString("type"),
- true,
- VariableInfo.AT_END);
- VariableInfo[] info = { info1 } ;
- return info;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.web.runtime.jsp;
+
+import javax.servlet.jsp.tagext.TagData;
+import javax.servlet.jsp.tagext.TagExtraInfo;
+import javax.servlet.jsp.tagext.VariableInfo;
+
+/**
+ * TagExtraInfo class for the SCA reference tags
+ * <sca:reference name="service" type="test.MyService" scope="1" />
+ *
+ * @version $Rev$ $Date$
+ */
+public class ReferenceTEI extends TagExtraInfo {
+
+ @Override
+ public VariableInfo[] getVariableInfo(TagData data) {
+ VariableInfo info1
+ = new VariableInfo(
+ data.getAttributeString("name"),
+ data.getAttributeString("type"),
+ true,
+ VariableInfo.AT_END);
+ VariableInfo[] info = { info1 } ;
+ return info;
+ }
+}
diff --git a/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/jsp/ReferenceTag.java b/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/jsp/ReferenceTag.java
index a82b33fc2d..46c5b89459 100644
--- a/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/jsp/ReferenceTag.java
+++ b/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/jsp/ReferenceTag.java
@@ -1,94 +1,94 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.web.runtime.jsp;
-
-import javax.servlet.ServletContext;
-import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.PageContext;
-import javax.servlet.jsp.tagext.TagSupport;
-
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.oasisopen.sca.ServiceReference;
-
-/**
- * Tag to handle SCA references
- * <sca:reference name="service" type="test.MyService" scope="1" />
- *
- * @version $Rev: 738490 $ $Date: 2009-01-28 14:07:54 +0000 (Wed, 28 Jan 2009) $
- */
-public class ReferenceTag extends TagSupport {
- private static final long serialVersionUID = 1L;
-
- protected String name;
- protected String type;
- protected Integer scope = PageContext.PAGE_SCOPE;
-
- @Override
- public int doStartTag() throws JspException {
- return SKIP_BODY;
- }
-
- @Override
- public int doEndTag() throws JspException {
-
- ServletContext servletContext = pageContext.getServletContext();
- RuntimeComponent component = (RuntimeComponent)servletContext.getAttribute("org.apache.tuscany.sca.implementation.web.RuntimeComponent");
-
- Class<?> typeClass;
- try {
- typeClass = Class.forName(type, true, Thread.currentThread().getContextClassLoader());
- } catch (ClassNotFoundException e) {
- throw new JspException("Reference '" + name + "' type class not found: " + type);
- }
-
- ServiceReference<?> sr = component.getComponentContext().getServiceReference(typeClass, name);
- if (sr == null) {
- throw new JspException("Reference '" + name + "' undefined");
- }
-
- pageContext.setAttribute(name, sr.getService(), scope);
-
- return EVAL_PAGE;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Integer getScope() {
- return scope;
- }
-
- public void setScope(Integer scope) {
- this.scope = scope;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.web.runtime.jsp;
+
+import javax.servlet.ServletContext;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
+import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.oasisopen.sca.ServiceReference;
+
+/**
+ * Tag to handle SCA references
+ * <sca:reference name="service" type="test.MyService" scope="1" />
+ *
+ * @version $Rev$ $Date$
+ */
+public class ReferenceTag extends TagSupport {
+ private static final long serialVersionUID = 1L;
+
+ protected String name;
+ protected String type;
+ protected Integer scope = PageContext.PAGE_SCOPE;
+
+ @Override
+ public int doStartTag() throws JspException {
+ return SKIP_BODY;
+ }
+
+ @Override
+ public int doEndTag() throws JspException {
+
+ ServletContext servletContext = pageContext.getServletContext();
+ RuntimeComponent component = (RuntimeComponent)servletContext.getAttribute("org.apache.tuscany.sca.implementation.web.RuntimeComponent");
+
+ Class<?> typeClass;
+ try {
+ typeClass = Class.forName(type, true, Thread.currentThread().getContextClassLoader());
+ } catch (ClassNotFoundException e) {
+ throw new JspException("Reference '" + name + "' type class not found: " + type);
+ }
+
+ ServiceReference<?> sr = component.getComponentContext().getServiceReference(typeClass, name);
+ if (sr == null) {
+ throw new JspException("Reference '" + name + "' undefined");
+ }
+
+ pageContext.setAttribute(name, sr.getService(), scope);
+
+ return EVAL_PAGE;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Integer getScope() {
+ return scope;
+ }
+
+ public void setScope(Integer scope) {
+ this.scope = scope;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+}
diff --git a/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/utils/ContextHelper.java b/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/utils/ContextHelper.java
index a7c03be2ae..423e906d6b 100644
--- a/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/utils/ContextHelper.java
+++ b/java/sca/modules/implementation-web-runtime/src/main/java/org/apache/tuscany/sca/implementation/web/runtime/utils/ContextHelper.java
@@ -1,133 +1,133 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.web.runtime.utils;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import javax.servlet.ServletContext;
-
-import org.apache.tuscany.sca.assembly.ComponentProperty;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.oasisopen.sca.ComponentContext;
-import org.oasisopen.sca.ServiceReference;
-import org.oasisopen.sca.ServiceRuntimeException;
-import org.oasisopen.sca.annotation.ComponentName;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-
-public class ContextHelper {
-
- public static final String COMPONENT_ATTR = "org.apache.tuscany.sca.implementation.web.RuntimeComponent";
-
- public static ComponentContext getComponentContext(ServletContext sc) {
- RuntimeComponent rc = (RuntimeComponent)sc.getAttribute(COMPONENT_ATTR);
- return rc.getComponentContext();
- }
-
- public static <T> T getReference(String name, Class<T> type, ServletContext sc) {
- ServiceReference<T> sr = getComponentContext(sc).getServiceReference(type, name);
- if (sr == null) {
- throw new ServiceRuntimeException("Reference '" + name + "' undefined");
- }
- return sr.getService();
- }
-
- public static Object getProperty(String name, ServletContext sc) {
- RuntimeComponent rc = (RuntimeComponent)sc.getAttribute(COMPONENT_ATTR);
- for (ComponentProperty p : rc.getProperties()) {
- if (name.equals(p.getName())) {
- return p.getValue();
- }
- }
- return null;
- }
-
- public static void inject(Object instance, ServletContext sc) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
-
- Class<?> clazz = instance.getClass();
- for (Field field : clazz.getDeclaredFields()) {
- if (field.isAnnotationPresent(Reference.class)) {
- Reference ref = field.getAnnotation(Reference.class);
- String name = ref.name() != null && !ref.name().equals("") ? ref.name() : field.getName();
- Object value = getReference(name, field.getType(), sc);
- setField(instance, field, value);
- } else if (field.isAnnotationPresent(Property.class)) {
- Property prop = field.getAnnotation(Property.class);
- String name = prop.name() != null && !prop.name().equals("") ? prop.name() : field.getName();
- Object value = getProperty(name, sc);
- setField(instance, field, value);
- } else if (field.isAnnotationPresent(ComponentName.class)) {
- RuntimeComponent rc = (RuntimeComponent)sc.getAttribute(COMPONENT_ATTR);
- setField(instance, field, rc.getName());
- } else if (field.isAnnotationPresent(Context.class)) {
- setField(instance, field, getComponentContext(sc));
- }
- }
-
- for (Method method : clazz.getDeclaredMethods()) {
- if (!method.getName().startsWith("set") || method.getParameterTypes().length != 1) {
- continue;
- }
- String targetName = method.getName().substring(3);
- Class<?> type = method.getParameterTypes()[0];
-
- if (method.isAnnotationPresent(Reference.class)) {
- Reference ref = method.getAnnotation(Reference.class);
- String name = ref.name() != null && !ref.name().equals("") ? ref.name() : targetName;
- Object value = getReference(name, type, sc);
- setMethod(instance, method, value);
- } else if (method.isAnnotationPresent(Property.class)) {
- Property prop = method.getAnnotation(Property.class);
- String name = prop.name() != null && !prop.name().equals("") ? prop.name() : targetName;
- Object value = getProperty(name, sc);
- setMethod(instance, method, value);
- } else if (method.isAnnotationPresent(ComponentName.class)) {
- RuntimeComponent rc = (RuntimeComponent)sc.getAttribute(COMPONENT_ATTR);
- setMethod(instance, method, rc.getName());
- } else if (method.isAnnotationPresent(Context.class)) {
- setMethod(instance, method, getComponentContext(sc));
- }
- }
- }
-
- private static void setMethod(Object instance, Method method, Object value) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
- if (method.isAccessible()) {
- method.invoke(instance, new Object[] {value});
- } else {
- method.setAccessible(true);
- method.invoke(instance, new Object[] {value});
- method.setAccessible(false);
- }
- }
-
- private static void setField(Object instance, Field field, Object value) throws IllegalArgumentException, IllegalAccessException {
- if (field.isAccessible()) {
- field.set(instance, value);
- } else {
- field.setAccessible(true);
- field.set(instance, value);
- field.setAccessible(false);
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.web.runtime.utils;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import javax.servlet.ServletContext;
+
+import org.apache.tuscany.sca.assembly.ComponentProperty;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.oasisopen.sca.ComponentContext;
+import org.oasisopen.sca.ServiceReference;
+import org.oasisopen.sca.ServiceRuntimeException;
+import org.oasisopen.sca.annotation.ComponentName;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.Property;
+import org.oasisopen.sca.annotation.Reference;
+
+public class ContextHelper {
+
+ public static final String COMPONENT_ATTR = "org.apache.tuscany.sca.implementation.web.RuntimeComponent";
+
+ public static ComponentContext getComponentContext(ServletContext sc) {
+ RuntimeComponent rc = (RuntimeComponent)sc.getAttribute(COMPONENT_ATTR);
+ return rc.getComponentContext();
+ }
+
+ public static <T> T getReference(String name, Class<T> type, ServletContext sc) {
+ ServiceReference<T> sr = getComponentContext(sc).getServiceReference(type, name);
+ if (sr == null) {
+ throw new ServiceRuntimeException("Reference '" + name + "' undefined");
+ }
+ return sr.getService();
+ }
+
+ public static Object getProperty(String name, ServletContext sc) {
+ RuntimeComponent rc = (RuntimeComponent)sc.getAttribute(COMPONENT_ATTR);
+ for (ComponentProperty p : rc.getProperties()) {
+ if (name.equals(p.getName())) {
+ return p.getValue();
+ }
+ }
+ return null;
+ }
+
+ public static void inject(Object instance, ServletContext sc) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
+
+ Class<?> clazz = instance.getClass();
+ for (Field field : clazz.getDeclaredFields()) {
+ if (field.isAnnotationPresent(Reference.class)) {
+ Reference ref = field.getAnnotation(Reference.class);
+ String name = ref.name() != null && !ref.name().equals("") ? ref.name() : field.getName();
+ Object value = getReference(name, field.getType(), sc);
+ setField(instance, field, value);
+ } else if (field.isAnnotationPresent(Property.class)) {
+ Property prop = field.getAnnotation(Property.class);
+ String name = prop.name() != null && !prop.name().equals("") ? prop.name() : field.getName();
+ Object value = getProperty(name, sc);
+ setField(instance, field, value);
+ } else if (field.isAnnotationPresent(ComponentName.class)) {
+ RuntimeComponent rc = (RuntimeComponent)sc.getAttribute(COMPONENT_ATTR);
+ setField(instance, field, rc.getName());
+ } else if (field.isAnnotationPresent(Context.class)) {
+ setField(instance, field, getComponentContext(sc));
+ }
+ }
+
+ for (Method method : clazz.getDeclaredMethods()) {
+ if (!method.getName().startsWith("set") || method.getParameterTypes().length != 1) {
+ continue;
+ }
+ String targetName = method.getName().substring(3);
+ Class<?> type = method.getParameterTypes()[0];
+
+ if (method.isAnnotationPresent(Reference.class)) {
+ Reference ref = method.getAnnotation(Reference.class);
+ String name = ref.name() != null && !ref.name().equals("") ? ref.name() : targetName;
+ Object value = getReference(name, type, sc);
+ setMethod(instance, method, value);
+ } else if (method.isAnnotationPresent(Property.class)) {
+ Property prop = method.getAnnotation(Property.class);
+ String name = prop.name() != null && !prop.name().equals("") ? prop.name() : targetName;
+ Object value = getProperty(name, sc);
+ setMethod(instance, method, value);
+ } else if (method.isAnnotationPresent(ComponentName.class)) {
+ RuntimeComponent rc = (RuntimeComponent)sc.getAttribute(COMPONENT_ATTR);
+ setMethod(instance, method, rc.getName());
+ } else if (method.isAnnotationPresent(Context.class)) {
+ setMethod(instance, method, getComponentContext(sc));
+ }
+ }
+ }
+
+ private static void setMethod(Object instance, Method method, Object value) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
+ if (method.isAccessible()) {
+ method.invoke(instance, new Object[] {value});
+ } else {
+ method.setAccessible(true);
+ method.invoke(instance, new Object[] {value});
+ method.setAccessible(false);
+ }
+ }
+
+ private static void setField(Object instance, Field field, Object value) throws IllegalArgumentException, IllegalAccessException {
+ if (field.isAccessible()) {
+ field.set(instance, value);
+ } else {
+ field.setAccessible(true);
+ field.set(instance, value);
+ field.setAccessible(false);
+ }
+ }
+
+}
diff --git a/java/sca/modules/implementation-web/pom.xml b/java/sca/modules/implementation-web/pom.xml
index f7d33f92a3..c6328c0e11 100644
--- a/java/sca/modules/implementation-web/pom.xml
+++ b/java/sca/modules/implementation-web/pom.xml
@@ -1,87 +1,87 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-implementation-web</artifactId>
- <name>Apache Tuscany SCA Web Implementation Model</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-monitor</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-definitions</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-implementation-web</artifactId>
+ <name>Apache Tuscany SCA Web Implementation Model</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xml</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-spi</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-monitor</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-definitions</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java
index 86af3d7204..258ca32676 100644
--- a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java
+++ b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementation.java
@@ -1,42 +1,42 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.web;
-
-import org.apache.tuscany.sca.assembly.Implementation;
-
-
-
-/**
- * The model representing an Web implementation in an SCA assembly model.
- */
-public interface WebImplementation extends Implementation {
-
- /**
- * Returns the webapp URI.
- * @return the webapp URI
- */
- String getWebURI();
-
- /**
- * Sets the Webapp URI.
- * @param uri the webapp URI
- */
- void setWebURI(String webappURI);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.web;
+
+import org.apache.tuscany.sca.assembly.Implementation;
+
+
+
+/**
+ * The model representing an Web implementation in an SCA assembly model.
+ */
+public interface WebImplementation extends Implementation {
+
+ /**
+ * Returns the webapp URI.
+ * @return the webapp URI
+ */
+ String getWebURI();
+
+ /**
+ * Sets the Webapp URI.
+ * @param uri the webapp URI
+ */
+ void setWebURI(String webappURI);
+
+}
diff --git a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementationFactory.java b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementationFactory.java
index 0cb80de03e..df2e6c5520 100644
--- a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementationFactory.java
+++ b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/WebImplementationFactory.java
@@ -1,34 +1,34 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.web;
-
-
-/**
- * Factory for the Web implementation model.
- */
-public interface WebImplementationFactory {
-
- /**
- * Creates a new Web implementation.
- * @return a new Web implementation
- */
- WebImplementation createWebImplementation();
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.web;
+
+
+/**
+ * Factory for the Web implementation model.
+ */
+public interface WebImplementationFactory {
+
+ /**
+ * Creates a new Web implementation.
+ * @return a new Web implementation
+ */
+ WebImplementation createWebImplementation();
+
+}
diff --git a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationFactoryImpl.java b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationFactoryImpl.java
index 744fefc39b..daff2d23a1 100644
--- a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationFactoryImpl.java
+++ b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationFactoryImpl.java
@@ -1,37 +1,37 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.web.impl;
-
-import org.apache.tuscany.sca.implementation.web.WebImplementation;
-import org.apache.tuscany.sca.implementation.web.WebImplementationFactory;
-
-/**
- * Factory for the Web implementation model.
- */
-public class WebImplementationFactoryImpl implements WebImplementationFactory {
-
- public WebImplementationFactoryImpl() {
- }
-
- public WebImplementation createWebImplementation() {
- return new WebImplementationImpl();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.web.impl;
+
+import org.apache.tuscany.sca.implementation.web.WebImplementation;
+import org.apache.tuscany.sca.implementation.web.WebImplementationFactory;
+
+/**
+ * Factory for the Web implementation model.
+ */
+public class WebImplementationFactoryImpl implements WebImplementationFactory {
+
+ public WebImplementationFactoryImpl() {
+ }
+
+ public WebImplementation createWebImplementation() {
+ return new WebImplementationImpl();
+ }
+
+}
diff --git a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
index d8a5935bea..c3244aa750 100644
--- a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
+++ b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
@@ -1,165 +1,165 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.web.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.Property;
-import org.apache.tuscany.sca.assembly.Reference;
-import org.apache.tuscany.sca.assembly.Service;
-import org.apache.tuscany.sca.assembly.builder.ComponentPreProcessor;
-import org.apache.tuscany.sca.assembly.impl.ImplementationImpl;
-import org.apache.tuscany.sca.implementation.web.WebImplementation;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-
-
-/**
- * The model representing an Web implementation in an SCA assembly model.
- */
-class WebImplementationImpl extends ImplementationImpl implements WebImplementation, ComponentPreProcessor {
- private static final QName TYPE = new QName(SCA11_NS, "implementation.web");
-
- private List<Property> properties = new ArrayList<Property>();
- private List<Reference> references = new ArrayList<Reference>();
- private String uri;
- private boolean unresolved;
-
- private String webURI;
-
- /**
- * Constructs a new Web implementation.
- */
- WebImplementationImpl() {
- super(TYPE);
- }
-
- public ConstrainingType getConstrainingType() {
- // The Web implementation does not support constrainingTypes
- return null;
- }
-
- public List<Property> getProperties() {
- return properties;
- }
-
- public List<Service> getServices() {
- // The Web implementation does not offer services
- return Collections.emptyList();
- }
-
- public List<Reference> getReferences() {
- return references;
- }
-
- public void setConstrainingType(ConstrainingType constrainingType) {
- // The Web implementation does not support constrainingTypes
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- public String getWebURI() {
- return webURI;
- }
-
- public void setWebURI(String webURI) {
- this.webURI = webURI;
- }
-
- /**
- * Use preProcess to add any references and properties dynamically
- * TODO: also support introspection and handle WEB-INF/web.componentType (spec line 503)
- */
- public void preProcess(Component component) {
- if (!(component instanceof RuntimeComponent)) {
- return;
- }
- RuntimeComponent rtc = (RuntimeComponent) component;
-
- for (Reference reference : rtc.getReferences()) {
- if (getReference(reference.getName()) == null) {
- getReferences().add(createReference(reference));
- }
- }
-
- for (Property property : rtc.getProperties()) {
- if (getProperty(property.getName()) == null) {
- getProperties().add(createProperty(property));
- }
- }
- }
-
- protected Reference getReference(String name) {
- for (Reference reference : getReferences()) {
- if (reference.getName().equals(name)) {
- return reference;
- }
- }
- return null;
- }
-
- protected Reference createReference(Reference reference) {
- Reference newReference;
- try {
- newReference = (Reference)reference.clone();
- } catch (CloneNotSupportedException e) {
- throw new AssertionError(e); // should not ever happen
- }
- return newReference;
- }
-
- protected Property getProperty(String name) {
- for (Property property : getProperties()) {
- if (property.getName().equals(name)) {
- return property;
- }
- }
- return null;
- }
-
- protected Property createProperty(Property property) {
- Property newProperty;
- try {
- newProperty = (Property)property.clone();
- } catch (CloneNotSupportedException e) {
- throw new AssertionError(e); // should not ever happen
- }
- return newProperty;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.web.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ConstrainingType;
+import org.apache.tuscany.sca.assembly.Property;
+import org.apache.tuscany.sca.assembly.Reference;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.assembly.builder.ComponentPreProcessor;
+import org.apache.tuscany.sca.assembly.impl.ImplementationImpl;
+import org.apache.tuscany.sca.implementation.web.WebImplementation;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+
+
+/**
+ * The model representing an Web implementation in an SCA assembly model.
+ */
+class WebImplementationImpl extends ImplementationImpl implements WebImplementation, ComponentPreProcessor {
+ private static final QName TYPE = new QName(SCA11_NS, "implementation.web");
+
+ private List<Property> properties = new ArrayList<Property>();
+ private List<Reference> references = new ArrayList<Reference>();
+ private String uri;
+ private boolean unresolved;
+
+ private String webURI;
+
+ /**
+ * Constructs a new Web implementation.
+ */
+ WebImplementationImpl() {
+ super(TYPE);
+ }
+
+ public ConstrainingType getConstrainingType() {
+ // The Web implementation does not support constrainingTypes
+ return null;
+ }
+
+ public List<Property> getProperties() {
+ return properties;
+ }
+
+ public List<Service> getServices() {
+ // The Web implementation does not offer services
+ return Collections.emptyList();
+ }
+
+ public List<Reference> getReferences() {
+ return references;
+ }
+
+ public void setConstrainingType(ConstrainingType constrainingType) {
+ // The Web implementation does not support constrainingTypes
+ }
+
+ public String getURI() {
+ return uri;
+ }
+
+ public void setURI(String uri) {
+ this.uri = uri;
+ }
+
+ public boolean isUnresolved() {
+ return unresolved;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ this.unresolved = unresolved;
+ }
+
+ public String getWebURI() {
+ return webURI;
+ }
+
+ public void setWebURI(String webURI) {
+ this.webURI = webURI;
+ }
+
+ /**
+ * Use preProcess to add any references and properties dynamically
+ * TODO: also support introspection and handle WEB-INF/web.componentType (spec line 503)
+ */
+ public void preProcess(Component component) {
+ if (!(component instanceof RuntimeComponent)) {
+ return;
+ }
+ RuntimeComponent rtc = (RuntimeComponent) component;
+
+ for (Reference reference : rtc.getReferences()) {
+ if (getReference(reference.getName()) == null) {
+ getReferences().add(createReference(reference));
+ }
+ }
+
+ for (Property property : rtc.getProperties()) {
+ if (getProperty(property.getName()) == null) {
+ getProperties().add(createProperty(property));
+ }
+ }
+ }
+
+ protected Reference getReference(String name) {
+ for (Reference reference : getReferences()) {
+ if (reference.getName().equals(name)) {
+ return reference;
+ }
+ }
+ return null;
+ }
+
+ protected Reference createReference(Reference reference) {
+ Reference newReference;
+ try {
+ newReference = (Reference)reference.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new AssertionError(e); // should not ever happen
+ }
+ return newReference;
+ }
+
+ protected Property getProperty(String name) {
+ for (Property property : getProperties()) {
+ if (property.getName().equals(name)) {
+ return property;
+ }
+ }
+ return null;
+ }
+
+ protected Property createProperty(Property property) {
+ Property newProperty;
+ try {
+ newProperty = (Property)property.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new AssertionError(e); // should not ever happen
+ }
+ return newProperty;
+ }
+
+}
diff --git a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java
index d636dd04ae..39e7a7a6f3 100644
--- a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java
+++ b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/xml/WebImplementationProcessor.java
@@ -1,120 +1,120 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.implementation.web.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.xml.Constants;
-import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.implementation.web.WebImplementation;
-import org.apache.tuscany.sca.implementation.web.WebImplementationFactory;
-import org.apache.tuscany.sca.implementation.web.impl.WebImplementationFactoryImpl;
-
-/**
- * Implements a StAX artifact processor for Web implementations.
- */
-public class WebImplementationProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<WebImplementation> {
- private static final QName IMPLEMENTATION_WEB = new QName(Constants.SCA11_NS, "implementation.web");
-
- private AssemblyFactory assemblyFactory;
- private WebImplementationFactory implementationFactory;
-
- public WebImplementationProcessor(ExtensionPointRegistry extensionPoints) {
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
- this.implementationFactory = new WebImplementationFactoryImpl();
- }
-
- public QName getArtifactType() {
- // Returns the QName of the XML element processed by this processor
- return IMPLEMENTATION_WEB;
- }
-
- public Class<WebImplementation> getModelType() {
- // Returns the type of model processed by this processor
- return WebImplementation.class;
- }
-
- public WebImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- // Read an <implementation.web> element
- WebImplementation implementation = implementationFactory.createWebImplementation();
- implementation.setUnresolved(true);
-
- // Read the webapp uri attribute
- String webURI = getString(reader, "web-uri");
- if (webURI != null) {
- implementation.setWebURI(webURI);
-
- // Set the URI of the component type
- implementation.setURI(webURI);
- }
-
- // Skip to end element
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && IMPLEMENTATION_WEB.equals(reader.getName())) {
- break;
- }
- }
-
- return implementation;
- }
-
- public void resolve(WebImplementation implementation, ModelResolver resolver) throws ContributionResolveException {
-
- // Resolve the component type
- String uri = implementation.getURI();
- if (uri != null) {
- ComponentType componentType = assemblyFactory.createComponentType();
- componentType.setURI("web.componentType");
- componentType = resolver.resolveModel(ComponentType.class, componentType);
- if (!componentType.isUnresolved()) {
-
- // Initialize the implementation's services, references and properties
- implementation.getServices().addAll(componentType.getServices());
- implementation.getReferences().addAll(componentType.getReferences());
- implementation.getProperties().addAll(componentType.getProperties());
- }
- }
- implementation.setUnresolved(false);
- }
-
- public void write(WebImplementation implementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
- // Write <implementation.web>
- writeStart(writer, IMPLEMENTATION_WEB.getNamespaceURI(), IMPLEMENTATION_WEB.getLocalPart(),
- new XAttr("web-uri", implementation.getWebURI()));
-
- writeEnd(writer);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.implementation.web.xml;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.implementation.web.WebImplementation;
+import org.apache.tuscany.sca.implementation.web.WebImplementationFactory;
+import org.apache.tuscany.sca.implementation.web.impl.WebImplementationFactoryImpl;
+
+/**
+ * Implements a StAX artifact processor for Web implementations.
+ */
+public class WebImplementationProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor<WebImplementation> {
+ private static final QName IMPLEMENTATION_WEB = new QName(Constants.SCA11_NS, "implementation.web");
+
+ private AssemblyFactory assemblyFactory;
+ private WebImplementationFactory implementationFactory;
+
+ public WebImplementationProcessor(ExtensionPointRegistry extensionPoints) {
+ FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
+ this.assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
+ this.implementationFactory = new WebImplementationFactoryImpl();
+ }
+
+ public QName getArtifactType() {
+ // Returns the QName of the XML element processed by this processor
+ return IMPLEMENTATION_WEB;
+ }
+
+ public Class<WebImplementation> getModelType() {
+ // Returns the type of model processed by this processor
+ return WebImplementation.class;
+ }
+
+ public WebImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+
+ // Read an <implementation.web> element
+ WebImplementation implementation = implementationFactory.createWebImplementation();
+ implementation.setUnresolved(true);
+
+ // Read the webapp uri attribute
+ String webURI = getString(reader, "web-uri");
+ if (webURI != null) {
+ implementation.setWebURI(webURI);
+
+ // Set the URI of the component type
+ implementation.setURI(webURI);
+ }
+
+ // Skip to end element
+ while (reader.hasNext()) {
+ if (reader.next() == END_ELEMENT && IMPLEMENTATION_WEB.equals(reader.getName())) {
+ break;
+ }
+ }
+
+ return implementation;
+ }
+
+ public void resolve(WebImplementation implementation, ModelResolver resolver) throws ContributionResolveException {
+
+ // Resolve the component type
+ String uri = implementation.getURI();
+ if (uri != null) {
+ ComponentType componentType = assemblyFactory.createComponentType();
+ componentType.setURI("web.componentType");
+ componentType = resolver.resolveModel(ComponentType.class, componentType);
+ if (!componentType.isUnresolved()) {
+
+ // Initialize the implementation's services, references and properties
+ implementation.getServices().addAll(componentType.getServices());
+ implementation.getReferences().addAll(componentType.getReferences());
+ implementation.getProperties().addAll(componentType.getProperties());
+ }
+ }
+ implementation.setUnresolved(false);
+ }
+
+ public void write(WebImplementation implementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
+
+ // Write <implementation.web>
+ writeStart(writer, IMPLEMENTATION_WEB.getNamespaceURI(), IMPLEMENTATION_WEB.getLocalPart(),
+ new XAttr("web-uri", implementation.getWebURI()));
+
+ writeEnd(writer);
+ }
+}
diff --git a/java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/ReadTestCase.java b/java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/ReadTestCase.java
index b23d24656a..4f195950a4 100644
--- a/java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/ReadTestCase.java
+++ b/java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/ReadTestCase.java
@@ -1,68 +1,68 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.web.xml;
-
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.implementation.web.WebImplementation;
-
-/**
- * Test reading Web implementations.
- */
-public class ReadTestCase extends TestCase {
-
- private XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private CompositeBuilder compositeBuilder;
-
- @Override
- public void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
- compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
- }
-
- public void testReadComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("TestWeb.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite composite = (Composite) staxProcessor.read(reader);
- assertNotNull(composite);
-
- compositeBuilder.build(composite, null, null);
-
- assertTrue(((WebImplementation) composite.getComponents().get(0).getImplementation()).getWebURI().equals("MyWebapp"));
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.web.xml;
+
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
+import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.implementation.web.WebImplementation;
+
+/**
+ * Test reading Web implementations.
+ */
+public class ReadTestCase extends TestCase {
+
+ private XMLInputFactory inputFactory;
+ private StAXArtifactProcessor<Object> staxProcessor;
+ private CompositeBuilder compositeBuilder;
+
+ @Override
+ public void setUp() throws Exception {
+ DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+ inputFactory = XMLInputFactory.newInstance();
+ StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
+ staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
+ compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
+ }
+
+ public void testReadComposite() throws Exception {
+ InputStream is = getClass().getResourceAsStream("TestWeb.composite");
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
+ Composite composite = (Composite) staxProcessor.read(reader);
+ assertNotNull(composite);
+
+ compositeBuilder.build(composite, null, null);
+
+ assertTrue(((WebImplementation) composite.getComponents().get(0).getImplementation()).getWebURI().equals("MyWebapp"));
+ }
+
+}
diff --git a/java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java b/java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java
index 723672270d..7c872a784c 100644
--- a/java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java
+++ b/java/sca/modules/implementation-web/src/test/java/org/apache/tuscany/sca/implementation/web/xml/WriteTestCase.java
@@ -1,66 +1,66 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.implementation.web.xml;
-
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-
-import junit.framework.TestCase;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-
-/**
- * Test reading/write Web implementations.
- */
-public class WriteTestCase extends TestCase {
-
- private XMLInputFactory inputFactory;
- private XMLOutputFactory outputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
-
- @Override
- public void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- outputFactory = XMLOutputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
- }
-
- public void testReadWriteComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("TestWeb.composite");
- Composite composite = (Composite) staxProcessor.read(inputFactory.createXMLStreamReader(is));
- assertNotNull(composite);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(composite, outputFactory.createXMLStreamWriter(bos));
-
- assertTrue(bos.toString().contains("web-uri=\"MyWebapp\""));
-
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.implementation.web.xml;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+
+/**
+ * Test reading/write Web implementations.
+ */
+public class WriteTestCase extends TestCase {
+
+ private XMLInputFactory inputFactory;
+ private XMLOutputFactory outputFactory;
+ private StAXArtifactProcessor<Object> staxProcessor;
+
+ @Override
+ public void setUp() throws Exception {
+ DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+ inputFactory = XMLInputFactory.newInstance();
+ outputFactory = XMLOutputFactory.newInstance();
+ StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
+ staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
+ }
+
+ public void testReadWriteComposite() throws Exception {
+ InputStream is = getClass().getResourceAsStream("TestWeb.composite");
+ Composite composite = (Composite) staxProcessor.read(inputFactory.createXMLStreamReader(is));
+ assertNotNull(composite);
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ staxProcessor.write(composite, outputFactory.createXMLStreamWriter(bos));
+
+ assertTrue(bos.toString().contains("web-uri=\"MyWebapp\""));
+
+ }
+
+}
diff --git a/java/sca/modules/implementation-web/src/test/resources/org/apache/tuscany/sca/implementation/web/xml/TestWeb.composite b/java/sca/modules/implementation-web/src/test/resources/org/apache/tuscany/sca/implementation/web/xml/TestWeb.composite
index dddcaf0a23..864318b22e 100644
--- a/java/sca/modules/implementation-web/src/test/resources/org/apache/tuscany/sca/implementation/web/xml/TestWeb.composite
+++ b/java/sca/modules/implementation-web/src/test/resources/org/apache/tuscany/sca/implementation/web/xml/TestWeb.composite
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://sample/web"
- xmlns:sc="http://sample/composite"
- name="TestWeb">
-
- <component name="TestWeb">
- <implementation.web web-uri="MyWebapp"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://sample/web"
+ xmlns:sc="http://sample/composite"
+ name="TestWeb">
+
+ <component name="TestWeb">
+ <implementation.web web-uri="MyWebapp"/>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl b/java/sca/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl
index 882408ade6..56a753f4ff 100644
--- a/java/sca/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl
+++ b/java/sca/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl
@@ -1,142 +1,142 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<wsdl:definitions targetNamespace="http://www.example.com/stock" xmlns:impl="http://www.example.com/stock"
- xmlns:tns="http://www.example.com/stock" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="StockExceptionTest">
- <wsdl:types>
- <schema targetNamespace="http://www.example.com/stock" xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <complexType name="StockOffer">
- <sequence>
- <element name="symbol" minOccurs="1" type="xsd:string" />
- <element name="price" minOccurs="1" type="xsd:float" nillable="true" /><!-- max price reqested, actual response -->
- <element name="name" minOccurs="0" type="xsd:string" />
- <element name="list" minOccurs="0" maxOccurs="unbounded" type="xsd:string" />
- </sequence>
- </complexType>
-
- <element name="stockQuoteOffer">
- <complexType>
- <sequence>
- <element name="input" minOccurs="0" maxOccurs="unbounded" type="tns:StockOffer" />
- </sequence>
- </complexType>
- </element>
- <element name="stockQuoteOfferResponse">
- <complexType>
- <sequence>
- <element name="stockQuoteOfferReturn" minOccurs="0" type="tns:StockOffer" />
- </sequence>
- </complexType>
- </element>
-
- <!-- Faults -->
- <element name="InvalidSymbolFault">
- <complexType>
- <sequence>
- <element name="message" minOccurs="1" type="xsd:string" />
- <element name="offer" minOccurs="1" type="tns:StockOffer" />
- </sequence>
- </complexType>
- </element>
-
- <element name="MarketClosedFault" type="xsd:int" />
-
- <element name="TestNotDeclaredAtSourceFault" type="xsd:string" />
-
- </schema>
- </wsdl:types>
-
-
- <wsdl:message name="stockQuoteOfferRequest">
- <wsdl:part element="tns:stockQuoteOffer" name="parameters" />
- </wsdl:message>
-
- <wsdl:message name="stockQuoteOfferResponse">
- <wsdl:part element="tns:stockQuoteOfferResponse" name="parameters" />
- </wsdl:message>
-
- <wsdl:message name="InvalidSymbolFault">
- <wsdl:part element="tns:InvalidSymbolFault" name="fault" />
- </wsdl:message>
-
- <wsdl:message name="MarketClosedFault">
- <wsdl:part element="tns:MarketClosedFault" name="fault" />
- </wsdl:message>
-
- <wsdl:message name="TestNotDeclaredAtSourceFault">
- <wsdl:part element="tns:TestNotDeclaredAtSourceFault" name="fault" />
- </wsdl:message>
-
-
- <wsdl:portType name="StockExceptionTest">
- <wsdl:operation name="stockQuoteOffer">
- <wsdl:input message="tns:stockQuoteOfferRequest" name="stockQuoteOfferRequest" />
-
- <wsdl:output message="tns:stockQuoteOfferResponse" name="stockQuoteOfferResponse" />
-
- <wsdl:fault message="tns:InvalidSymbolFault" name="InvalidSymbolException" />
-
- <wsdl:fault message="tns:MarketClosedFault" name="MarketClosedException" />
-
- <wsdl:fault message="tns:TestNotDeclaredAtSourceFault" name="TestNotDeclaredAtSourceException" />
- </wsdl:operation>
-
-
- </wsdl:portType>
-
- <wsdl:binding name="StockExceptionTestServiceSoapBinding" type="tns:StockExceptionTest">
- <!-- <wsaw:UsingAddressing wsdl:required="false" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/> -->
-
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
-
- <wsdl:operation name="stockQuoteOffer">
- <wsdlsoap:operation soapAction="" />
-
- <wsdl:input name="stockQuoteOfferRequest">
- <wsdlsoap:body use="literal" />
- </wsdl:input>
-
- <wsdl:output name="stockQuoteOfferResponse">
- <wsdlsoap:body use="literal" />
- </wsdl:output>
-
- <wsdl:fault name="InvalidSymbolException">
- <wsdlsoap:fault name="InvalidSymbolException" use="literal" />
- </wsdl:fault>
-
- <wsdl:fault name="MarketClosedException">
- <wsdlsoap:fault name="MarketClosedException" use="literal" />
- </wsdl:fault>
-
- <wsdl:fault name="TestNotDeclaredAtSourceException">
- <wsdlsoap:fault name="TestNotDeclaredAtSourceException" use="literal" />
- </wsdl:fault>
-
-
-
- </wsdl:operation>
-
-
- </wsdl:binding>
-
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions targetNamespace="http://www.example.com/stock" xmlns:impl="http://www.example.com/stock"
+ xmlns:tns="http://www.example.com/stock" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="StockExceptionTest">
+ <wsdl:types>
+ <schema targetNamespace="http://www.example.com/stock" xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <complexType name="StockOffer">
+ <sequence>
+ <element name="symbol" minOccurs="1" type="xsd:string" />
+ <element name="price" minOccurs="1" type="xsd:float" nillable="true" /><!-- max price reqested, actual response -->
+ <element name="name" minOccurs="0" type="xsd:string" />
+ <element name="list" minOccurs="0" maxOccurs="unbounded" type="xsd:string" />
+ </sequence>
+ </complexType>
+
+ <element name="stockQuoteOffer">
+ <complexType>
+ <sequence>
+ <element name="input" minOccurs="0" maxOccurs="unbounded" type="tns:StockOffer" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="stockQuoteOfferResponse">
+ <complexType>
+ <sequence>
+ <element name="stockQuoteOfferReturn" minOccurs="0" type="tns:StockOffer" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <!-- Faults -->
+ <element name="InvalidSymbolFault">
+ <complexType>
+ <sequence>
+ <element name="message" minOccurs="1" type="xsd:string" />
+ <element name="offer" minOccurs="1" type="tns:StockOffer" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="MarketClosedFault" type="xsd:int" />
+
+ <element name="TestNotDeclaredAtSourceFault" type="xsd:string" />
+
+ </schema>
+ </wsdl:types>
+
+
+ <wsdl:message name="stockQuoteOfferRequest">
+ <wsdl:part element="tns:stockQuoteOffer" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:message name="stockQuoteOfferResponse">
+ <wsdl:part element="tns:stockQuoteOfferResponse" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:message name="InvalidSymbolFault">
+ <wsdl:part element="tns:InvalidSymbolFault" name="fault" />
+ </wsdl:message>
+
+ <wsdl:message name="MarketClosedFault">
+ <wsdl:part element="tns:MarketClosedFault" name="fault" />
+ </wsdl:message>
+
+ <wsdl:message name="TestNotDeclaredAtSourceFault">
+ <wsdl:part element="tns:TestNotDeclaredAtSourceFault" name="fault" />
+ </wsdl:message>
+
+
+ <wsdl:portType name="StockExceptionTest">
+ <wsdl:operation name="stockQuoteOffer">
+ <wsdl:input message="tns:stockQuoteOfferRequest" name="stockQuoteOfferRequest" />
+
+ <wsdl:output message="tns:stockQuoteOfferResponse" name="stockQuoteOfferResponse" />
+
+ <wsdl:fault message="tns:InvalidSymbolFault" name="InvalidSymbolException" />
+
+ <wsdl:fault message="tns:MarketClosedFault" name="MarketClosedException" />
+
+ <wsdl:fault message="tns:TestNotDeclaredAtSourceFault" name="TestNotDeclaredAtSourceException" />
+ </wsdl:operation>
+
+
+ </wsdl:portType>
+
+ <wsdl:binding name="StockExceptionTestServiceSoapBinding" type="tns:StockExceptionTest">
+ <!-- <wsaw:UsingAddressing wsdl:required="false" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/> -->
+
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+
+ <wsdl:operation name="stockQuoteOffer">
+ <wsdlsoap:operation soapAction="" />
+
+ <wsdl:input name="stockQuoteOfferRequest">
+ <wsdlsoap:body use="literal" />
+ </wsdl:input>
+
+ <wsdl:output name="stockQuoteOfferResponse">
+ <wsdlsoap:body use="literal" />
+ </wsdl:output>
+
+ <wsdl:fault name="InvalidSymbolException">
+ <wsdlsoap:fault name="InvalidSymbolException" use="literal" />
+ </wsdl:fault>
+
+ <wsdl:fault name="MarketClosedException">
+ <wsdlsoap:fault name="MarketClosedException" use="literal" />
+ </wsdl:fault>
+
+ <wsdl:fault name="TestNotDeclaredAtSourceException">
+ <wsdlsoap:fault name="TestNotDeclaredAtSourceException" use="literal" />
+ </wsdl:fault>
+
+
+
+ </wsdl:operation>
+
+
+ </wsdl:binding>
+
+
</wsdl:definitions> \ No newline at end of file
diff --git a/java/sca/modules/interface-java-jaxws/src/test/resources/wsdl/StockExceptionTest.wsdl b/java/sca/modules/interface-java-jaxws/src/test/resources/wsdl/StockExceptionTest.wsdl
index e92409bfdb..494617f988 100644
--- a/java/sca/modules/interface-java-jaxws/src/test/resources/wsdl/StockExceptionTest.wsdl
+++ b/java/sca/modules/interface-java-jaxws/src/test/resources/wsdl/StockExceptionTest.wsdl
@@ -1,171 +1,171 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- -->
-<wsdl:definitions targetNamespace="http://www.example.com/stock" xmlns:impl="http://www.example.com/stock"
- xmlns:tns="http://www.example.com/stock" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="StockExceptionTest">
- <wsdl:types>
- <schema targetNamespace="http://www.example.com/stock" xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0">
- <complexType name="StockOffer">
- <sequence>
- <element name="symbol" minOccurs="1" type="xsd:string" />
- <element name="price" minOccurs="1" type="xsd:float" nillable="true" /> <!-- max price reqested, actual response -->
- <element name="name" minOccurs="0" type="xsd:string" />
- <element name="list" minOccurs="0" maxOccurs="unbounded" type="xsd:string" />
- </sequence>
- </complexType>
-
- <element name="stockQuoteOffer">
- <complexType>
- <sequence>
- <element name="input" minOccurs="0" maxOccurs="unbounded" type="tns:StockOffer" />
- </sequence>
- </complexType>
- </element>
- <!-- TUSCANY 2505, make the responseWrapper non-anonymous -->
- <element name="stockQuoteOfferResponse" type="tns:StockQuoteOfferResponseType">
- </element>
- <complexType name="StockQuoteOfferResponseType">
- <sequence>
- <element name="stockQuoteOfferReturn" minOccurs="0" type="tns:StockOffer" />
- </sequence>
- </complexType>
- <!-- Faults -->
- <element name="InvalidSymbolFault">
- <complexType>
- <sequence>
- <element name="message" minOccurs="1" type="xsd:string" />
- <element name="offer" minOccurs="1" type="tns:StockOffer" />
- </sequence>
- </complexType>
- </element>
-
- <element name="MarketClosedFault" type="xsd:int" />
-
- <element name="TestNotDeclaredAtSourceFault" type="xsd:string" />
-
- <element name="anyElement">
- <complexType>
- <sequence>
- <element name="first" type="anyType">
- <annotation>
- <appinfo>
- <jaxb:dom />
- </appinfo>
- </annotation>
- </element>
- <any maxOccurs="unbounded" processContents="skip">
- <annotation>
- <appinfo>
- <jaxb:dom />
- </appinfo>
- </annotation>
- </any>
- </sequence>
- </complexType>
- </element>
-
- </schema>
- </wsdl:types>
-
-
- <wsdl:message name="stockQuoteOfferRequest">
- <wsdl:part element="tns:stockQuoteOffer" name="parameters" />
- </wsdl:message>
-
- <wsdl:message name="stockQuoteOfferResponse">
- <wsdl:part element="tns:stockQuoteOfferResponse" name="parameters" />
- </wsdl:message>
-
- <wsdl:message name="InvalidSymbolFault">
- <wsdl:part element="tns:InvalidSymbolFault" name="fault" />
- </wsdl:message>
-
- <wsdl:message name="MarketClosedFault">
- <wsdl:part element="tns:MarketClosedFault" name="fault" />
- </wsdl:message>
-
- <wsdl:message name="TestNotDeclaredAtSourceFault">
- <wsdl:part element="tns:TestNotDeclaredAtSourceFault" name="fault" />
- </wsdl:message>
-
-
- <wsdl:portType name="StockExceptionTest">
- <wsdl:operation name="stockQuoteOffer">
- <wsdl:input message="tns:stockQuoteOfferRequest" name="stockQuoteOfferRequest" />
-
- <wsdl:output message="tns:stockQuoteOfferResponse" name="stockQuoteOfferResponse" />
-
- <wsdl:fault message="tns:InvalidSymbolFault" name="InvalidSymbolException" />
-
- <wsdl:fault message="tns:MarketClosedFault" name="MarketClosedException" />
-
- <wsdl:fault message="tns:TestNotDeclaredAtSourceFault" name="TestNotDeclaredAtSourceException" />
- </wsdl:operation>
-
-
- </wsdl:portType>
-
- <wsdl:binding name="StockExceptionTestServiceSoapBinding" type="tns:StockExceptionTest">
- <!-- <wsaw:UsingAddressing wsdl:required="false" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/> -->
-
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
-
- <wsdl:operation name="stockQuoteOffer">
- <wsdlsoap:operation soapAction="" />
-
- <wsdl:input name="stockQuoteOfferRequest">
- <wsdlsoap:body use="literal" />
- </wsdl:input>
-
- <wsdl:output name="stockQuoteOfferResponse">
- <wsdlsoap:body use="literal" />
- </wsdl:output>
-
- <wsdl:fault name="InvalidSymbolException">
- <wsdlsoap:fault name="InvalidSymbolException" use="literal" />
- </wsdl:fault>
-
- <wsdl:fault name="MarketClosedException">
- <wsdlsoap:fault name="MarketClosedException" use="literal" />
- </wsdl:fault>
-
- <wsdl:fault name="TestNotDeclaredAtSourceException">
- <wsdlsoap:fault name="TestNotDeclaredAtSourceException" use="literal" />
- </wsdl:fault>
-
-
-
- </wsdl:operation>
-
-
- </wsdl:binding>
-
- <wsdl:service name="StockExceptionTestService">
- <wsdl:port binding="tns:StockExceptionTestServiceSoapBinding" name="StockExceptionTestServiceSoapPort">
- <wsdlsoap:address location="http://localhost:8085/services/exchangeJaxbService" />
-
- </wsdl:port>
-
- </wsdl:service>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ -->
+<wsdl:definitions targetNamespace="http://www.example.com/stock" xmlns:impl="http://www.example.com/stock"
+ xmlns:tns="http://www.example.com/stock" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="StockExceptionTest">
+ <wsdl:types>
+ <schema targetNamespace="http://www.example.com/stock" xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0">
+ <complexType name="StockOffer">
+ <sequence>
+ <element name="symbol" minOccurs="1" type="xsd:string" />
+ <element name="price" minOccurs="1" type="xsd:float" nillable="true" /> <!-- max price reqested, actual response -->
+ <element name="name" minOccurs="0" type="xsd:string" />
+ <element name="list" minOccurs="0" maxOccurs="unbounded" type="xsd:string" />
+ </sequence>
+ </complexType>
+
+ <element name="stockQuoteOffer">
+ <complexType>
+ <sequence>
+ <element name="input" minOccurs="0" maxOccurs="unbounded" type="tns:StockOffer" />
+ </sequence>
+ </complexType>
+ </element>
+ <!-- TUSCANY 2505, make the responseWrapper non-anonymous -->
+ <element name="stockQuoteOfferResponse" type="tns:StockQuoteOfferResponseType">
+ </element>
+ <complexType name="StockQuoteOfferResponseType">
+ <sequence>
+ <element name="stockQuoteOfferReturn" minOccurs="0" type="tns:StockOffer" />
+ </sequence>
+ </complexType>
+ <!-- Faults -->
+ <element name="InvalidSymbolFault">
+ <complexType>
+ <sequence>
+ <element name="message" minOccurs="1" type="xsd:string" />
+ <element name="offer" minOccurs="1" type="tns:StockOffer" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="MarketClosedFault" type="xsd:int" />
+
+ <element name="TestNotDeclaredAtSourceFault" type="xsd:string" />
+
+ <element name="anyElement">
+ <complexType>
+ <sequence>
+ <element name="first" type="anyType">
+ <annotation>
+ <appinfo>
+ <jaxb:dom />
+ </appinfo>
+ </annotation>
+ </element>
+ <any maxOccurs="unbounded" processContents="skip">
+ <annotation>
+ <appinfo>
+ <jaxb:dom />
+ </appinfo>
+ </annotation>
+ </any>
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+ </wsdl:types>
+
+
+ <wsdl:message name="stockQuoteOfferRequest">
+ <wsdl:part element="tns:stockQuoteOffer" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:message name="stockQuoteOfferResponse">
+ <wsdl:part element="tns:stockQuoteOfferResponse" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:message name="InvalidSymbolFault">
+ <wsdl:part element="tns:InvalidSymbolFault" name="fault" />
+ </wsdl:message>
+
+ <wsdl:message name="MarketClosedFault">
+ <wsdl:part element="tns:MarketClosedFault" name="fault" />
+ </wsdl:message>
+
+ <wsdl:message name="TestNotDeclaredAtSourceFault">
+ <wsdl:part element="tns:TestNotDeclaredAtSourceFault" name="fault" />
+ </wsdl:message>
+
+
+ <wsdl:portType name="StockExceptionTest">
+ <wsdl:operation name="stockQuoteOffer">
+ <wsdl:input message="tns:stockQuoteOfferRequest" name="stockQuoteOfferRequest" />
+
+ <wsdl:output message="tns:stockQuoteOfferResponse" name="stockQuoteOfferResponse" />
+
+ <wsdl:fault message="tns:InvalidSymbolFault" name="InvalidSymbolException" />
+
+ <wsdl:fault message="tns:MarketClosedFault" name="MarketClosedException" />
+
+ <wsdl:fault message="tns:TestNotDeclaredAtSourceFault" name="TestNotDeclaredAtSourceException" />
+ </wsdl:operation>
+
+
+ </wsdl:portType>
+
+ <wsdl:binding name="StockExceptionTestServiceSoapBinding" type="tns:StockExceptionTest">
+ <!-- <wsaw:UsingAddressing wsdl:required="false" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/> -->
+
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+
+ <wsdl:operation name="stockQuoteOffer">
+ <wsdlsoap:operation soapAction="" />
+
+ <wsdl:input name="stockQuoteOfferRequest">
+ <wsdlsoap:body use="literal" />
+ </wsdl:input>
+
+ <wsdl:output name="stockQuoteOfferResponse">
+ <wsdlsoap:body use="literal" />
+ </wsdl:output>
+
+ <wsdl:fault name="InvalidSymbolException">
+ <wsdlsoap:fault name="InvalidSymbolException" use="literal" />
+ </wsdl:fault>
+
+ <wsdl:fault name="MarketClosedException">
+ <wsdlsoap:fault name="MarketClosedException" use="literal" />
+ </wsdl:fault>
+
+ <wsdl:fault name="TestNotDeclaredAtSourceException">
+ <wsdlsoap:fault name="TestNotDeclaredAtSourceException" use="literal" />
+ </wsdl:fault>
+
+
+
+ </wsdl:operation>
+
+
+ </wsdl:binding>
+
+ <wsdl:service name="StockExceptionTestService">
+ <wsdl:port binding="tns:StockExceptionTestServiceSoapBinding" name="StockExceptionTestServiceSoapPort">
+ <wsdlsoap:address location="http://localhost:8085/services/exchangeJaxbService" />
+
+ </wsdl:port>
+
+ </wsdl:service>
+
</wsdl:definitions> \ No newline at end of file
diff --git a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/BPELPartnerLinkTypeExt.java b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/BPELPartnerLinkTypeExt.java
index 0d6f23e732..26404958e8 100644
--- a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/BPELPartnerLinkTypeExt.java
+++ b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/BPELPartnerLinkTypeExt.java
@@ -1,79 +1,79 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.wsdl;
-
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.xml.namespace.QName;
-
-/**
- * A class to serve as the extensibility element for BPEL partnerLinkType elements
- *
- * @version $Rev$ $Date$
- */
-public class BPELPartnerLinkTypeExt implements ExtensibilityElement {
-
- private QName elementType = null;
- private String linkTypeName = null;
- private String[] roleNames = new String[2];
- private QName[] rolePortTypes = new QName[2];
-
- // -- methods required by the Extensibility Element interface
- public QName getElementType() {
- return elementType;
- }
-
- public Boolean getRequired() {
- return true;
- }
-
- public void setElementType(QName theName ) {
- elementType = theName;
- }
-
- public void setRequired(Boolean required) {
- // intentionally left blank
- }
-
- // -- other methods
-
- public void setName( String theName ) {
- linkTypeName = theName;
- }
-
- public String getName() {
- return linkTypeName;
- }
-
- public void setRole( int i, String name, QName portType ) {
- if( i > 1 ) return;
- roleNames[i] = name;
- rolePortTypes[i] = portType;
- }
-
- public String getRoleName( int i ) {
- if( i > 1 ) return null;
- return roleNames[i];
- }
-
- public QName getRolePortType( int i ) {
- if( i > 1 ) return null;
- return rolePortTypes[i];
- }
-
-} // end BPELPartnerLinkTypeExt
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.interfacedef.wsdl;
+
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.xml.namespace.QName;
+
+/**
+ * A class to serve as the extensibility element for BPEL partnerLinkType elements
+ *
+ * @version $Rev$ $Date$
+ */
+public class BPELPartnerLinkTypeExt implements ExtensibilityElement {
+
+ private QName elementType = null;
+ private String linkTypeName = null;
+ private String[] roleNames = new String[2];
+ private QName[] rolePortTypes = new QName[2];
+
+ // -- methods required by the Extensibility Element interface
+ public QName getElementType() {
+ return elementType;
+ }
+
+ public Boolean getRequired() {
+ return true;
+ }
+
+ public void setElementType(QName theName ) {
+ elementType = theName;
+ }
+
+ public void setRequired(Boolean required) {
+ // intentionally left blank
+ }
+
+ // -- other methods
+
+ public void setName( String theName ) {
+ linkTypeName = theName;
+ }
+
+ public String getName() {
+ return linkTypeName;
+ }
+
+ public void setRole( int i, String name, QName portType ) {
+ if( i > 1 ) return;
+ roleNames[i] = name;
+ rolePortTypes[i] = portType;
+ }
+
+ public String getRoleName( int i ) {
+ if( i > 1 ) return null;
+ return roleNames[i];
+ }
+
+ public QName getRolePortType( int i ) {
+ if( i > 1 ) return null;
+ return rolePortTypes[i];
+ }
+
+} // end BPELPartnerLinkTypeExt
diff --git a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java
index 0983c604b7..6007989321 100644
--- a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java
+++ b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/BPELExtensionHandler.java
@@ -1,142 +1,142 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.wsdl.xml;
-
-import java.io.PrintWriter;
-
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.ExtensionDeserializer;
-import javax.wsdl.extensions.ExtensionRegistry;
-import javax.wsdl.extensions.ExtensionSerializer;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.interfacedef.wsdl.BPELPartnerLinkTypeExt;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-/**
- * A WSDL extension processor for extension elements introduced by BPEL - in particular
- * the <partnerLinkType.../> elements
- *
- * Handles both BPEL 1.1 and BPEL 2.0 version of the <partnerLinkType/>
- * @version $Rev$ $Date$
- */
-public class BPELExtensionHandler implements ExtensionSerializer, ExtensionDeserializer {
-
- private final String localName = "partnerLinkType";
- private final String roleName = "role";
-
- /**
- * Marshals the BPEL partner link type extension element to XML
- * See (@link javax.wsdl.extensions.ExtensionSerializer)
- */
- @SuppressWarnings("unchecked")
- public void marshall(Class parentType, QName elementType, ExtensibilityElement theElement,
- PrintWriter writer, Definition def, ExtensionRegistry extReg)
- throws WSDLException {
- // The format of the Partner Link Type in XML is as follows:
- // <foo:partnerLinkType name="bar">
- // <foo:role name="somename" portType="xyz:portTypeName"/>
- // <foo:role name="othername" portType="xyz:portTypeName2"/>
- // <foo:partnerLinkType>
- BPELPartnerLinkTypeExt thePLinkType = (BPELPartnerLinkTypeExt) theElement;
- QName theType = thePLinkType.getElementType();
-
- writer.println("<" + theType.toString() +
- " name=\"" + thePLinkType.getName() + "\">");
- for( int i = 0; i < 2; i++ ) {
- if( thePLinkType.getRoleName( i ) != null ) {
- writer.println( "<" + theType.getPrefix() + ":role"
- + " name=\"" + thePLinkType.getRoleName(i) + "\" portType=\""
- + thePLinkType.getRolePortType(i) + "\">");
- } // end if
- } // end for
- writer.println("</" + theType.toString() + ">");
- } // end marshall
-
- /**
- * Unmarshals the BPEL partner link type element from XML
- * See (@link javax.wsdl.extensions.ExtensionDeserializer)
- * The format of the Partner Link Type in XML is as follows:
- * <foo:partnerLinkType name="bar">
- * <foo:role name="somename" portType="xyz:portTypeName"/>
- * <foo:role name="othername" portType="xyz:portTypeName2"/>
- * <foo:partnerLinkType>
- *
- * One role is mandatory, the second is optional.
- */
- @SuppressWarnings("unchecked")
- public ExtensibilityElement unmarshall(Class theClass, QName elementType,
- Element theElement, Definition def, ExtensionRegistry extReg)
- throws WSDLException {
-
- // Check that this elementType really is a partnerLinkType element
- if( !elementType.getLocalPart().equals(localName) ) return null;
- BPELPartnerLinkTypeExt theExtension = new BPELPartnerLinkTypeExt();
- theExtension.setElementType(elementType);
- theExtension.setName( theElement.getAttribute("name") );
-
- // Fetch the child "role" elements
- NodeList theRoles = theElement.getElementsByTagNameNS("*", roleName);
- for ( int i=0; i < theRoles.getLength(); i++ ) {
- if( i > 1 ) break;
- Element roleNode = (Element)theRoles.item(i);
- String roleName = roleNode.getAttribute("name");
- String portType = roleNode.getAttribute("portType");
- if (portType == null || portType.length() == 0) {
- // Fetch the child "portType" element
- NodeList portTypesNodes = roleNode.getElementsByTagNameNS("*", "portType");
- for (int p = 0; p < portTypesNodes.getLength(); p++) {
- Element portTypeNode = (Element)portTypesNodes.item(p);
- portType = portTypeNode.getAttribute("name");
- break;
- }
- }
- // The PortType attribute is a QName in prefix:localName format - convert to a QName
- QName rolePortType = getQNameValue( def, portType );
- theExtension.setRole( i, roleName, rolePortType );
- } // end for
- return theExtension;
- } // end unmarshall
-
-
- /**
- * Returns a QName from a string.
- * @param definition - a WSDL Definition
- * @param value - the String from which to form the QName in the form "pref:localName"
- * @return
- */
- protected QName getQNameValue(Definition definition, String value) {
- if (value != null && definition != null) {
- int index = value.indexOf(':');
- String prefix = index == -1 ? "" : value.substring(0, index);
- String localName = index == -1 ? value : value.substring(index + 1);
- String ns = definition.getNamespace(prefix);
- if (ns == null) {
- ns = "";
- }
- return new QName(ns, localName, prefix);
- } else {
- return null;
- }
- } // end getQNameValue
-
-} // end BPELExtensionHandler
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.interfacedef.wsdl.xml;
+
+import java.io.PrintWriter;
+
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.extensions.ExtensionDeserializer;
+import javax.wsdl.extensions.ExtensionRegistry;
+import javax.wsdl.extensions.ExtensionSerializer;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.interfacedef.wsdl.BPELPartnerLinkTypeExt;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * A WSDL extension processor for extension elements introduced by BPEL - in particular
+ * the <partnerLinkType.../> elements
+ *
+ * Handles both BPEL 1.1 and BPEL 2.0 version of the <partnerLinkType/>
+ * @version $Rev$ $Date$
+ */
+public class BPELExtensionHandler implements ExtensionSerializer, ExtensionDeserializer {
+
+ private final String localName = "partnerLinkType";
+ private final String roleName = "role";
+
+ /**
+ * Marshals the BPEL partner link type extension element to XML
+ * See (@link javax.wsdl.extensions.ExtensionSerializer)
+ */
+ @SuppressWarnings("unchecked")
+ public void marshall(Class parentType, QName elementType, ExtensibilityElement theElement,
+ PrintWriter writer, Definition def, ExtensionRegistry extReg)
+ throws WSDLException {
+ // The format of the Partner Link Type in XML is as follows:
+ // <foo:partnerLinkType name="bar">
+ // <foo:role name="somename" portType="xyz:portTypeName"/>
+ // <foo:role name="othername" portType="xyz:portTypeName2"/>
+ // <foo:partnerLinkType>
+ BPELPartnerLinkTypeExt thePLinkType = (BPELPartnerLinkTypeExt) theElement;
+ QName theType = thePLinkType.getElementType();
+
+ writer.println("<" + theType.toString() +
+ " name=\"" + thePLinkType.getName() + "\">");
+ for( int i = 0; i < 2; i++ ) {
+ if( thePLinkType.getRoleName( i ) != null ) {
+ writer.println( "<" + theType.getPrefix() + ":role"
+ + " name=\"" + thePLinkType.getRoleName(i) + "\" portType=\""
+ + thePLinkType.getRolePortType(i) + "\">");
+ } // end if
+ } // end for
+ writer.println("</" + theType.toString() + ">");
+ } // end marshall
+
+ /**
+ * Unmarshals the BPEL partner link type element from XML
+ * See (@link javax.wsdl.extensions.ExtensionDeserializer)
+ * The format of the Partner Link Type in XML is as follows:
+ * <foo:partnerLinkType name="bar">
+ * <foo:role name="somename" portType="xyz:portTypeName"/>
+ * <foo:role name="othername" portType="xyz:portTypeName2"/>
+ * <foo:partnerLinkType>
+ *
+ * One role is mandatory, the second is optional.
+ */
+ @SuppressWarnings("unchecked")
+ public ExtensibilityElement unmarshall(Class theClass, QName elementType,
+ Element theElement, Definition def, ExtensionRegistry extReg)
+ throws WSDLException {
+
+ // Check that this elementType really is a partnerLinkType element
+ if( !elementType.getLocalPart().equals(localName) ) return null;
+ BPELPartnerLinkTypeExt theExtension = new BPELPartnerLinkTypeExt();
+ theExtension.setElementType(elementType);
+ theExtension.setName( theElement.getAttribute("name") );
+
+ // Fetch the child "role" elements
+ NodeList theRoles = theElement.getElementsByTagNameNS("*", roleName);
+ for ( int i=0; i < theRoles.getLength(); i++ ) {
+ if( i > 1 ) break;
+ Element roleNode = (Element)theRoles.item(i);
+ String roleName = roleNode.getAttribute("name");
+ String portType = roleNode.getAttribute("portType");
+ if (portType == null || portType.length() == 0) {
+ // Fetch the child "portType" element
+ NodeList portTypesNodes = roleNode.getElementsByTagNameNS("*", "portType");
+ for (int p = 0; p < portTypesNodes.getLength(); p++) {
+ Element portTypeNode = (Element)portTypesNodes.item(p);
+ portType = portTypeNode.getAttribute("name");
+ break;
+ }
+ }
+ // The PortType attribute is a QName in prefix:localName format - convert to a QName
+ QName rolePortType = getQNameValue( def, portType );
+ theExtension.setRole( i, roleName, rolePortType );
+ } // end for
+ return theExtension;
+ } // end unmarshall
+
+
+ /**
+ * Returns a QName from a string.
+ * @param definition - a WSDL Definition
+ * @param value - the String from which to form the QName in the form "pref:localName"
+ * @return
+ */
+ protected QName getQNameValue(Definition definition, String value) {
+ if (value != null && definition != null) {
+ int index = value.indexOf(':');
+ String prefix = index == -1 ? "" : value.substring(0, index);
+ String localName = index == -1 ? value : value.substring(index + 1);
+ String ns = definition.getNamespace(prefix);
+ if (ns == null) {
+ ns = "";
+ }
+ return new QName(ns, localName, prefix);
+ } else {
+ return null;
+ }
+ } // end getQNameValue
+
+} // end BPELExtensionHandler
diff --git a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java
index 7d48dc62bd..b1c431c19d 100644
--- a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java
+++ b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLConstants.java
@@ -1,38 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.interfacedef.wsdl.xml;
-
-import javax.xml.namespace.QName;
-
-/**
- * Constants for WSDL.
- *
- * @version $Rev: 750765 $ $Date: 2009-03-06 04:36:04 +0000 (Fri, 06 Mar 2009) $
- */
-public interface WSDLConstants {
- String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
- String INTERFACE_WSDL = "interface.wsdl";
- QName INTERFACE_WSDL_QNAME = new QName(SCA11_NS, "interface.wsdl");
- String INTERFACE = "interface";
- String CALLBACK_INTERFACE = "callbackInterface";
- String WSDL_LOCATION = "wsdlLocation";
- String WSDLI_NS = "http://www.w3.org/2004/08/wsdl-instance";
- QName WSDL_LOCATION_QNAME = new QName(WSDLI_NS, WSDL_LOCATION);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.interfacedef.wsdl.xml;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Constants for WSDL.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface WSDLConstants {
+ String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
+ String INTERFACE_WSDL = "interface.wsdl";
+ QName INTERFACE_WSDL_QNAME = new QName(SCA11_NS, "interface.wsdl");
+ String INTERFACE = "interface";
+ String CALLBACK_INTERFACE = "callbackInterface";
+ String WSDL_LOCATION = "wsdlLocation";
+ String WSDLI_NS = "http://www.w3.org/2004/08/wsdl-instance";
+ QName WSDL_LOCATION_QNAME = new QName(WSDLI_NS, WSDL_LOCATION);
+
+}
diff --git a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java
index c169214e44..11e8472166 100644
--- a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java
+++ b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessor.java
@@ -1,233 +1,233 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl.xml;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.util.List;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Import;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-import org.apache.tuscany.sca.xsd.XSDFactory;
-import org.apache.tuscany.sca.xsd.XSDefinition;
-
-/**
- * An ArtifactProcessor for WSDL documents.
- *
- * @version $Rev: 709339 $ $Date: 2008-10-31 04:01:44 +0000 (Fri, 31 Oct 2008) $
- */
-public class WSDLDocumentProcessor implements URLArtifactProcessor<WSDLDefinition> {
-
- public static final QName WSDL11 = new QName("http://schemas.xmlsoap.org/wsdl/", "definitions");
- public static final QName WSDL11_IMPORT = new QName("http://schemas.xmlsoap.org/wsdl/", "import");
- public static final QName XSD = new QName("http://www.w3.org/2001/XMLSchema", "schema");
-
- private XMLInputFactory inputFactory;
-
- private WSDLFactory factory;
- private XSDFactory xsdFactory;
- private Monitor monitor;
-
- public WSDLDocumentProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.factory = modelFactories.getFactory(WSDLFactory.class);
- this.xsdFactory = modelFactories.getFactory(XSDFactory.class);
- this.inputFactory = modelFactories.getFactory(XMLInputFactory.class);
- this.monitor = monitor;
- }
-
- /**
- * Report a exception.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void error(String message, Object model, Exception ex) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "interface-wsdlxml-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- public WSDLDefinition read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException {
- try {
- WSDLDefinition definition = indexRead(artifactURL);
- definition.setURI(artifactURI);
- return definition;
- } catch (Exception e) {
- ContributionReadException ce = new ContributionReadException(e);
- error("ContributionReadException", artifactURL, ce);
- //throw ce;
- return null;
- }
- }
-
- public void resolve(WSDLDefinition model, ModelResolver resolver) throws ContributionResolveException {
- if (model == null) return;
-
- Definition definition = model.getDefinition();
- if (definition != null) {
- for (Object imports : definition.getImports().values()) {
- List importList = (List)imports;
- for (Object i : importList) {
- Import imp = (Import)i;
- if (imp.getDefinition() != null) {
- continue;
- }
- if (imp.getLocationURI() == null) {
- // FIXME: [rfeng] By the WSDL 1.1 Specification, the location attribute is required
- // We need to resolve it by QName
- WSDLDefinition proxy = factory.createWSDLDefinition();
- proxy.setUnresolved(true);
- proxy.setNamespace(imp.getNamespaceURI());
- WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, proxy);
- if (resolved != null && !resolved.isUnresolved()) {
- imp.setDefinition(resolved.getDefinition());
- if (!model.getImportedDefinitions().contains(resolved)) {
- model.getImportedDefinitions().add(resolved);
- }
- }
- } else {
- String location = imp.getLocationURI();
- if (location.indexOf(' ') != -1) {
- location = location.replace(" ", "%20");
- }
- URI uri = URI.create(location);
- if (uri.isAbsolute()) {
- WSDLDefinition resolved;
- try {
- resolved = read(null, uri, uri.toURL());
- imp.setDefinition(resolved.getDefinition());
- if (!model.getImportedDefinitions().contains(resolved)) {
- model.getImportedDefinitions().add(resolved);
- }
- } catch (Exception e) {
- ContributionResolveException ce = new ContributionResolveException(e);
- error("ContributionResolveException", resolver, ce);
- //throw ce;
- }
- } else {
- if (location.startsWith("/")) {
- // This is a relative URI against a contribution
- location = location.substring(1);
- // TODO: Need to resolve it against the contribution
- } else {
- // This is a relative URI against the WSDL document
- URI baseURI = URI.create(model.getDefinition().getDocumentBaseURI());
- URI locationURI = baseURI.resolve(location);
- WSDLDefinition resolved;
- try {
- resolved = read(null, locationURI, locationURI.toURL());
- imp.setDefinition(resolved.getDefinition());
- if (!model.getImportedDefinitions().contains(resolved)) {
- model.getImportedDefinitions().add(resolved);
- }
- } catch (Exception e) {
- ContributionResolveException ce = new ContributionResolveException(e);
- error("ContributionResolveException", resolver, ce);
- //throw ce;
- }
- }
- }
- }
- }
- }
- }
- }
-
- public String getArtifactType() {
- return ".wsdl";
- }
-
- public Class<WSDLDefinition> getModelType() {
- return WSDLDefinition.class;
- }
-
- /**
- * Read the namespace for the WSDL definition and inline schemas
- *
- * @param doc
- * @return
- * @throws IOException
- * @throws XMLStreamException
- */
- protected WSDLDefinition indexRead(URL doc) throws Exception {
- WSDLDefinition wsdlDefinition = factory.createWSDLDefinition();
- wsdlDefinition.setUnresolved(true);
- wsdlDefinition.setLocation(doc.toURI());
-
- InputStream is = doc.openStream();
- try {
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- int eventType = reader.getEventType();
- int index = 0;
- while (true) {
- if (eventType == XMLStreamConstants.START_ELEMENT) {
- if (WSDL11.equals(reader.getName())) {
- String tns = reader.getAttributeValue(null, "targetNamespace");
- wsdlDefinition.setNamespace(tns);
- // The definition is marked as resolved but not loaded
- wsdlDefinition.setUnresolved(false);
- wsdlDefinition.setDefinition(null);
- }
- if (XSD.equals(reader.getName())) {
- String tns = reader.getAttributeValue(null, "targetNamespace");
- XSDefinition xsd = xsdFactory.createXSDefinition();
- xsd.setUnresolved(true);
- xsd.setNamespace(tns);
- xsd.setLocation(URI.create(doc.toURI() + "#" + index));
- index++;
- // The definition is marked as resolved but not loaded
- xsd.setUnresolved(false);
- xsd.setSchema(null);
- wsdlDefinition.getXmlSchemas().add(xsd);
- }
- }
- if (reader.hasNext()) {
- eventType = reader.next();
- } else {
- break;
- }
- }
- return wsdlDefinition;
- } finally {
- is.close();
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.interfacedef.wsdl.xml;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Import;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
+import org.apache.tuscany.sca.xsd.XSDFactory;
+import org.apache.tuscany.sca.xsd.XSDefinition;
+
+/**
+ * An ArtifactProcessor for WSDL documents.
+ *
+ * @version $Rev$ $Date$
+ */
+public class WSDLDocumentProcessor implements URLArtifactProcessor<WSDLDefinition> {
+
+ public static final QName WSDL11 = new QName("http://schemas.xmlsoap.org/wsdl/", "definitions");
+ public static final QName WSDL11_IMPORT = new QName("http://schemas.xmlsoap.org/wsdl/", "import");
+ public static final QName XSD = new QName("http://www.w3.org/2001/XMLSchema", "schema");
+
+ private XMLInputFactory inputFactory;
+
+ private WSDLFactory factory;
+ private XSDFactory xsdFactory;
+ private Monitor monitor;
+
+ public WSDLDocumentProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
+ this.factory = modelFactories.getFactory(WSDLFactory.class);
+ this.xsdFactory = modelFactories.getFactory(XSDFactory.class);
+ this.inputFactory = modelFactories.getFactory(XMLInputFactory.class);
+ this.monitor = monitor;
+ }
+
+ /**
+ * Report a exception.
+ *
+ * @param problems
+ * @param message
+ * @param model
+ */
+ private void error(String message, Object model, Exception ex) {
+ if (monitor != null) {
+ Problem problem = monitor.createProblem(this.getClass().getName(), "interface-wsdlxml-validation-messages", Severity.ERROR, model, message, ex);
+ monitor.problem(problem);
+ }
+ }
+
+ public WSDLDefinition read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException {
+ try {
+ WSDLDefinition definition = indexRead(artifactURL);
+ definition.setURI(artifactURI);
+ return definition;
+ } catch (Exception e) {
+ ContributionReadException ce = new ContributionReadException(e);
+ error("ContributionReadException", artifactURL, ce);
+ //throw ce;
+ return null;
+ }
+ }
+
+ public void resolve(WSDLDefinition model, ModelResolver resolver) throws ContributionResolveException {
+ if (model == null) return;
+
+ Definition definition = model.getDefinition();
+ if (definition != null) {
+ for (Object imports : definition.getImports().values()) {
+ List importList = (List)imports;
+ for (Object i : importList) {
+ Import imp = (Import)i;
+ if (imp.getDefinition() != null) {
+ continue;
+ }
+ if (imp.getLocationURI() == null) {
+ // FIXME: [rfeng] By the WSDL 1.1 Specification, the location attribute is required
+ // We need to resolve it by QName
+ WSDLDefinition proxy = factory.createWSDLDefinition();
+ proxy.setUnresolved(true);
+ proxy.setNamespace(imp.getNamespaceURI());
+ WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, proxy);
+ if (resolved != null && !resolved.isUnresolved()) {
+ imp.setDefinition(resolved.getDefinition());
+ if (!model.getImportedDefinitions().contains(resolved)) {
+ model.getImportedDefinitions().add(resolved);
+ }
+ }
+ } else {
+ String location = imp.getLocationURI();
+ if (location.indexOf(' ') != -1) {
+ location = location.replace(" ", "%20");
+ }
+ URI uri = URI.create(location);
+ if (uri.isAbsolute()) {
+ WSDLDefinition resolved;
+ try {
+ resolved = read(null, uri, uri.toURL());
+ imp.setDefinition(resolved.getDefinition());
+ if (!model.getImportedDefinitions().contains(resolved)) {
+ model.getImportedDefinitions().add(resolved);
+ }
+ } catch (Exception e) {
+ ContributionResolveException ce = new ContributionResolveException(e);
+ error("ContributionResolveException", resolver, ce);
+ //throw ce;
+ }
+ } else {
+ if (location.startsWith("/")) {
+ // This is a relative URI against a contribution
+ location = location.substring(1);
+ // TODO: Need to resolve it against the contribution
+ } else {
+ // This is a relative URI against the WSDL document
+ URI baseURI = URI.create(model.getDefinition().getDocumentBaseURI());
+ URI locationURI = baseURI.resolve(location);
+ WSDLDefinition resolved;
+ try {
+ resolved = read(null, locationURI, locationURI.toURL());
+ imp.setDefinition(resolved.getDefinition());
+ if (!model.getImportedDefinitions().contains(resolved)) {
+ model.getImportedDefinitions().add(resolved);
+ }
+ } catch (Exception e) {
+ ContributionResolveException ce = new ContributionResolveException(e);
+ error("ContributionResolveException", resolver, ce);
+ //throw ce;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public String getArtifactType() {
+ return ".wsdl";
+ }
+
+ public Class<WSDLDefinition> getModelType() {
+ return WSDLDefinition.class;
+ }
+
+ /**
+ * Read the namespace for the WSDL definition and inline schemas
+ *
+ * @param doc
+ * @return
+ * @throws IOException
+ * @throws XMLStreamException
+ */
+ protected WSDLDefinition indexRead(URL doc) throws Exception {
+ WSDLDefinition wsdlDefinition = factory.createWSDLDefinition();
+ wsdlDefinition.setUnresolved(true);
+ wsdlDefinition.setLocation(doc.toURI());
+
+ InputStream is = doc.openStream();
+ try {
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
+ int eventType = reader.getEventType();
+ int index = 0;
+ while (true) {
+ if (eventType == XMLStreamConstants.START_ELEMENT) {
+ if (WSDL11.equals(reader.getName())) {
+ String tns = reader.getAttributeValue(null, "targetNamespace");
+ wsdlDefinition.setNamespace(tns);
+ // The definition is marked as resolved but not loaded
+ wsdlDefinition.setUnresolved(false);
+ wsdlDefinition.setDefinition(null);
+ }
+ if (XSD.equals(reader.getName())) {
+ String tns = reader.getAttributeValue(null, "targetNamespace");
+ XSDefinition xsd = xsdFactory.createXSDefinition();
+ xsd.setUnresolved(true);
+ xsd.setNamespace(tns);
+ xsd.setLocation(URI.create(doc.toURI() + "#" + index));
+ index++;
+ // The definition is marked as resolved but not loaded
+ xsd.setUnresolved(false);
+ xsd.setSchema(null);
+ wsdlDefinition.getXmlSchemas().add(xsd);
+ }
+ }
+ if (reader.hasNext()) {
+ eventType = reader.next();
+ } else {
+ break;
+ }
+ }
+ return wsdlDefinition;
+ } finally {
+ is.close();
+ }
+ }
+
+}
diff --git a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
index cfba9f3519..d33f52b1dc 100644
--- a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
+++ b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLInterfaceProcessor.java
@@ -1,284 +1,284 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-
-import javax.wsdl.PortType;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLObject;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.Problem;
-import org.apache.tuscany.sca.monitor.Problem.Severity;
-
-/**
- *
- * @version $Rev: 750323 $ $Date: 2009-03-05 05:52:01 +0000 (Thu, 05 Mar 2009) $
- */
-public class WSDLInterfaceProcessor implements StAXArtifactProcessor<WSDLInterfaceContract>, WSDLConstants {
-
- private WSDLFactory wsdlFactory;
- private Monitor monitor;
-
- public WSDLInterfaceProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
- this.monitor = monitor;
- }
-
- /**
- * Report a warning.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void warning(String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "interface-wsdlxml-validation-messages", Severity.WARNING, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- /**
- * Report a error.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void error(String message, Object model, Object... messageParameters) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "interface-wsdlxml-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
- monitor.problem(problem);
- }
- }
-
- /**
- * Report a exception.
- *
- * @param problems
- * @param message
- * @param model
- */
- private void error(String message, Object model, Exception ex) {
- if (monitor != null) {
- Problem problem = monitor.createProblem(this.getClass().getName(), "interface-wsdlxml-validation-messages", Severity.ERROR, model, message, ex);
- monitor.problem(problem);
- }
- }
-
- /**
- * Create a WSDL interface from a URI.
- * @param uri - the URI in the form nameSpace#wsdl.interface(porttypeName) or nameSpace#wsdl.porttype(porttypeName)
- * @return a WSDLInterface object
- * @throws ContributionReadException
- */
- private static String FRAGMENT_INTERFACE = "wsdl.interface";
- private static String FRAGMENT_PORTTYPE = "wsdl.porttype";
- private WSDLInterface createWSDLInterface(String uri) throws ContributionReadException {
-
- WSDLInterface wsdlInterface = null;
-
- // Read a QName in the form:
- // namespace#wsdl.interface(name)
- int index = uri.indexOf('#');
- if (index == -1) {
- error("InvalidWSDLInterfaceAttr", wsdlFactory, uri);
- //throw new ContributionReadException("Invalid WSDL interface attribute: " + uri);
- } else {
- // Read the URI and extract namespace and fragment
- String namespace = uri.substring(0, index);
- String name = uri.substring(index + 1);
- String porttype = null;
- if( name.contains(FRAGMENT_INTERFACE)) {
- // Deal with the case where #wsdl.interface is used
- porttype = name.substring("wsdl.interface(".length(), name.length() - 1);
- } // end if
- if( name.contains(FRAGMENT_PORTTYPE)) {
- // Deal with the case where #wsdl.porttype is used
- porttype = name.substring("wsdl.porttype(".length(), name.length() - 1);
- } // end if
- if( porttype == null ) {
- error("InvalidWSDLInterfaceAttr", wsdlFactory, uri);
- return null;
- } // end if
- wsdlInterface = wsdlFactory.createWSDLInterface();
- wsdlInterface.setUnresolved(true);
- wsdlInterface.setName(new QName(namespace, porttype));
- } // end if
-
- return wsdlInterface;
- } // end method createWSDLInterface
-
- /**
- * Creates a WSDLInterfaceContract from a <interface.wsdl/> element in a SCDL file
- *
- * The form of the <interface.wsdl/> element is as follows:
- *
- * <interface.wsdl interface="http://sampleNamespace#wsdl.interface(porttypeName)"
- * callbackInterface="http://sampleNamespace#wsdl.porttype(callbackPorttypeName)"/>
- * where interface = URI pointing to the WSDL document containing a WSDL interface or porttype for the forward call interface
- * callbackInterface = URI pointing to the WSDL document containing a WSDL interface or porttype for the callback interface
- *
- * @param reader - XMLStreamReader holding the <interface.wsdl/> element
- * @return - the WSDLInterfaceContract
- */
- public WSDLInterfaceContract read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
- // Read an <interface.wsdl>
- WSDLInterfaceContract wsdlInterfaceContract = wsdlFactory.createWSDLInterfaceContract();
-
- // Read wsdlLocation
- String location = reader.getAttributeValue(WSDLI_NS, WSDL_LOCATION);
- wsdlInterfaceContract.setLocation(location);
-
- String uri = reader.getAttributeValue(null, INTERFACE);
- if (uri != null) {
- WSDLInterface wsdlInterface = createWSDLInterface(uri);
- if (wsdlInterface != null)
- wsdlInterfaceContract.setInterface(wsdlInterface);
- }
-
- uri = reader.getAttributeValue(null, CALLBACK_INTERFACE);
- if (uri != null) {
- WSDLInterface wsdlCallbackInterface = createWSDLInterface(uri);
- if (wsdlCallbackInterface != null)
- wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface);
- }
-
- // Skip to end element
- while (reader.hasNext()) {
- if (reader.next() == END_ELEMENT && INTERFACE_WSDL_QNAME.equals(reader.getName())) {
- break;
- }
- }
- return wsdlInterfaceContract;
- }
-
- public void write(WSDLInterfaceContract wsdlInterfaceContract, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
- // Write an <interface.wsdl>
- writer.writeStartElement(WSDLConstants.SCA11_NS, INTERFACE_WSDL);
-
- // Write interface name
- WSDLInterface wsdlInterface = (WSDLInterface)wsdlInterfaceContract.getInterface();
- if (wsdlInterface != null) {
- QName qname = wsdlInterface.getName();
- String uri = qname.getNamespaceURI() + "#wsdl.interface(" + qname.getLocalPart() + ")";
- writer.writeAttribute(INTERFACE, uri);
- }
-
- WSDLInterface wsdlCallbackInterface = (WSDLInterface)wsdlInterfaceContract.getCallbackInterface();
- if (wsdlCallbackInterface != null) {
- QName qname = wsdlCallbackInterface.getName();
- String uri = qname.getNamespaceURI() + "#wsdl.interface(" + qname.getLocalPart() + ")";
- writer.writeAttribute(CALLBACK_INTERFACE, uri);
- }
-
- // Write location
- if (wsdlInterfaceContract.getLocation() != null) {
- writer.writeAttribute(WSDLI_NS, WSDL_LOCATION, wsdlInterfaceContract.getLocation());
- }
-
- writer.writeEndElement();
- }
-
- private WSDLInterface resolveWSDLInterface(WSDLInterface wsdlInterface, ModelResolver resolver) throws ContributionResolveException {
-
- if (wsdlInterface != null && wsdlInterface.isUnresolved()) {
-
- // Resolve the WSDL interface
- wsdlInterface = resolver.resolveModel(WSDLInterface.class, wsdlInterface);
- if (wsdlInterface.isUnresolved()) {
-
- // If the WSDL interface has never been resolved yet, do it now
- // First, resolve the WSDL definition for the given namespace
- WSDLDefinition wsdlDefinition = wsdlFactory.createWSDLDefinition();
- wsdlDefinition.setUnresolved(true);
- wsdlDefinition.setNamespace(wsdlInterface.getName().getNamespaceURI());
- WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition);
- if (!resolved.isUnresolved()) {
- wsdlDefinition.setDefinition(resolved.getDefinition());
- wsdlDefinition.setLocation(resolved.getLocation());
- wsdlDefinition.setURI(resolved.getURI());
- wsdlDefinition.getImportedDefinitions().addAll(resolved.getImportedDefinitions());
- wsdlDefinition.getXmlSchemas().addAll(resolved.getXmlSchemas());
- wsdlDefinition.setUnresolved(false);
- WSDLObject<PortType> portType = wsdlDefinition.getWSDLObject(PortType.class, wsdlInterface.getName());
- if (portType != null) {
- // Introspect the WSDL portType and add the resulting
- // WSDLInterface to the resolver
- try {
- wsdlDefinition.setDefinition(portType.getDefinition());
- wsdlInterface = wsdlFactory.createWSDLInterface(portType.getElement(), wsdlDefinition, resolver);
- wsdlInterface.setWsdlDefinition(wsdlDefinition);
- resolver.addModel(wsdlInterface);
- } catch (InvalidInterfaceException e) {
- ContributionResolveException ce = new ContributionResolveException("Invalid interface when resolving " +
- portType.toString(), e);
- error("ContributionResolveException", wsdlFactory, ce);
- //throw ce;
- }
- }
- else {
- warning("WsdlInterfaceDoesNotMatch", wsdlDefinition, wsdlInterface.getName());
- } // end if
- } else {
- // If we get here, the WSDLDefinition is unresolved...
- ContributionResolveException ce = new ContributionResolveException("WSDLDefinition unresolved " +
- wsdlInterface.getName().getNamespaceURI() );
- error("ContributionResolveException", wsdlFactory, ce);
- }// end if
- } // end if
- } // end if
- return wsdlInterface;
- }
-
- public void resolve(WSDLInterfaceContract wsdlInterfaceContract, ModelResolver resolver) throws ContributionResolveException {
-
- // Resolve the interface and callback interface
- WSDLInterface wsdlInterface = resolveWSDLInterface((WSDLInterface)wsdlInterfaceContract.getInterface(), resolver);
- wsdlInterfaceContract.setInterface(wsdlInterface);
-
- WSDLInterface wsdlCallbackInterface = resolveWSDLInterface((WSDLInterface)wsdlInterfaceContract.getCallbackInterface(), resolver);
- wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface);
- }
-
- public QName getArtifactType() {
- return WSDLConstants.INTERFACE_WSDL_QNAME;
- }
-
- public Class<WSDLInterfaceContract> getModelType() {
- return WSDLInterfaceContract.class;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.interfacedef.wsdl.xml;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLObject;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.Problem;
+import org.apache.tuscany.sca.monitor.Problem.Severity;
+
+/**
+ *
+ * @version $Rev$ $Date$
+ */
+public class WSDLInterfaceProcessor implements StAXArtifactProcessor<WSDLInterfaceContract>, WSDLConstants {
+
+ private WSDLFactory wsdlFactory;
+ private Monitor monitor;
+
+ public WSDLInterfaceProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
+ this.wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
+ this.monitor = monitor;
+ }
+
+ /**
+ * Report a warning.
+ *
+ * @param problems
+ * @param message
+ * @param model
+ */
+ private void warning(String message, Object model, Object... messageParameters) {
+ if (monitor != null) {
+ Problem problem = monitor.createProblem(this.getClass().getName(), "interface-wsdlxml-validation-messages", Severity.WARNING, model, message, (Object[])messageParameters);
+ monitor.problem(problem);
+ }
+ }
+
+ /**
+ * Report a error.
+ *
+ * @param problems
+ * @param message
+ * @param model
+ */
+ private void error(String message, Object model, Object... messageParameters) {
+ if (monitor != null) {
+ Problem problem = monitor.createProblem(this.getClass().getName(), "interface-wsdlxml-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters);
+ monitor.problem(problem);
+ }
+ }
+
+ /**
+ * Report a exception.
+ *
+ * @param problems
+ * @param message
+ * @param model
+ */
+ private void error(String message, Object model, Exception ex) {
+ if (monitor != null) {
+ Problem problem = monitor.createProblem(this.getClass().getName(), "interface-wsdlxml-validation-messages", Severity.ERROR, model, message, ex);
+ monitor.problem(problem);
+ }
+ }
+
+ /**
+ * Create a WSDL interface from a URI.
+ * @param uri - the URI in the form nameSpace#wsdl.interface(porttypeName) or nameSpace#wsdl.porttype(porttypeName)
+ * @return a WSDLInterface object
+ * @throws ContributionReadException
+ */
+ private static String FRAGMENT_INTERFACE = "wsdl.interface";
+ private static String FRAGMENT_PORTTYPE = "wsdl.porttype";
+ private WSDLInterface createWSDLInterface(String uri) throws ContributionReadException {
+
+ WSDLInterface wsdlInterface = null;
+
+ // Read a QName in the form:
+ // namespace#wsdl.interface(name)
+ int index = uri.indexOf('#');
+ if (index == -1) {
+ error("InvalidWSDLInterfaceAttr", wsdlFactory, uri);
+ //throw new ContributionReadException("Invalid WSDL interface attribute: " + uri);
+ } else {
+ // Read the URI and extract namespace and fragment
+ String namespace = uri.substring(0, index);
+ String name = uri.substring(index + 1);
+ String porttype = null;
+ if( name.contains(FRAGMENT_INTERFACE)) {
+ // Deal with the case where #wsdl.interface is used
+ porttype = name.substring("wsdl.interface(".length(), name.length() - 1);
+ } // end if
+ if( name.contains(FRAGMENT_PORTTYPE)) {
+ // Deal with the case where #wsdl.porttype is used
+ porttype = name.substring("wsdl.porttype(".length(), name.length() - 1);
+ } // end if
+ if( porttype == null ) {
+ error("InvalidWSDLInterfaceAttr", wsdlFactory, uri);
+ return null;
+ } // end if
+ wsdlInterface = wsdlFactory.createWSDLInterface();
+ wsdlInterface.setUnresolved(true);
+ wsdlInterface.setName(new QName(namespace, porttype));
+ } // end if
+
+ return wsdlInterface;
+ } // end method createWSDLInterface
+
+ /**
+ * Creates a WSDLInterfaceContract from a <interface.wsdl/> element in a SCDL file
+ *
+ * The form of the <interface.wsdl/> element is as follows:
+ *
+ * <interface.wsdl interface="http://sampleNamespace#wsdl.interface(porttypeName)"
+ * callbackInterface="http://sampleNamespace#wsdl.porttype(callbackPorttypeName)"/>
+ * where interface = URI pointing to the WSDL document containing a WSDL interface or porttype for the forward call interface
+ * callbackInterface = URI pointing to the WSDL document containing a WSDL interface or porttype for the callback interface
+ *
+ * @param reader - XMLStreamReader holding the <interface.wsdl/> element
+ * @return - the WSDLInterfaceContract
+ */
+ public WSDLInterfaceContract read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+ // Read an <interface.wsdl>
+ WSDLInterfaceContract wsdlInterfaceContract = wsdlFactory.createWSDLInterfaceContract();
+
+ // Read wsdlLocation
+ String location = reader.getAttributeValue(WSDLI_NS, WSDL_LOCATION);
+ wsdlInterfaceContract.setLocation(location);
+
+ String uri = reader.getAttributeValue(null, INTERFACE);
+ if (uri != null) {
+ WSDLInterface wsdlInterface = createWSDLInterface(uri);
+ if (wsdlInterface != null)
+ wsdlInterfaceContract.setInterface(wsdlInterface);
+ }
+
+ uri = reader.getAttributeValue(null, CALLBACK_INTERFACE);
+ if (uri != null) {
+ WSDLInterface wsdlCallbackInterface = createWSDLInterface(uri);
+ if (wsdlCallbackInterface != null)
+ wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface);
+ }
+
+ // Skip to end element
+ while (reader.hasNext()) {
+ if (reader.next() == END_ELEMENT && INTERFACE_WSDL_QNAME.equals(reader.getName())) {
+ break;
+ }
+ }
+ return wsdlInterfaceContract;
+ }
+
+ public void write(WSDLInterfaceContract wsdlInterfaceContract, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
+ // Write an <interface.wsdl>
+ writer.writeStartElement(WSDLConstants.SCA11_NS, INTERFACE_WSDL);
+
+ // Write interface name
+ WSDLInterface wsdlInterface = (WSDLInterface)wsdlInterfaceContract.getInterface();
+ if (wsdlInterface != null) {
+ QName qname = wsdlInterface.getName();
+ String uri = qname.getNamespaceURI() + "#wsdl.interface(" + qname.getLocalPart() + ")";
+ writer.writeAttribute(INTERFACE, uri);
+ }
+
+ WSDLInterface wsdlCallbackInterface = (WSDLInterface)wsdlInterfaceContract.getCallbackInterface();
+ if (wsdlCallbackInterface != null) {
+ QName qname = wsdlCallbackInterface.getName();
+ String uri = qname.getNamespaceURI() + "#wsdl.interface(" + qname.getLocalPart() + ")";
+ writer.writeAttribute(CALLBACK_INTERFACE, uri);
+ }
+
+ // Write location
+ if (wsdlInterfaceContract.getLocation() != null) {
+ writer.writeAttribute(WSDLI_NS, WSDL_LOCATION, wsdlInterfaceContract.getLocation());
+ }
+
+ writer.writeEndElement();
+ }
+
+ private WSDLInterface resolveWSDLInterface(WSDLInterface wsdlInterface, ModelResolver resolver) throws ContributionResolveException {
+
+ if (wsdlInterface != null && wsdlInterface.isUnresolved()) {
+
+ // Resolve the WSDL interface
+ wsdlInterface = resolver.resolveModel(WSDLInterface.class, wsdlInterface);
+ if (wsdlInterface.isUnresolved()) {
+
+ // If the WSDL interface has never been resolved yet, do it now
+ // First, resolve the WSDL definition for the given namespace
+ WSDLDefinition wsdlDefinition = wsdlFactory.createWSDLDefinition();
+ wsdlDefinition.setUnresolved(true);
+ wsdlDefinition.setNamespace(wsdlInterface.getName().getNamespaceURI());
+ WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, wsdlDefinition);
+ if (!resolved.isUnresolved()) {
+ wsdlDefinition.setDefinition(resolved.getDefinition());
+ wsdlDefinition.setLocation(resolved.getLocation());
+ wsdlDefinition.setURI(resolved.getURI());
+ wsdlDefinition.getImportedDefinitions().addAll(resolved.getImportedDefinitions());
+ wsdlDefinition.getXmlSchemas().addAll(resolved.getXmlSchemas());
+ wsdlDefinition.setUnresolved(false);
+ WSDLObject<PortType> portType = wsdlDefinition.getWSDLObject(PortType.class, wsdlInterface.getName());
+ if (portType != null) {
+ // Introspect the WSDL portType and add the resulting
+ // WSDLInterface to the resolver
+ try {
+ wsdlDefinition.setDefinition(portType.getDefinition());
+ wsdlInterface = wsdlFactory.createWSDLInterface(portType.getElement(), wsdlDefinition, resolver);
+ wsdlInterface.setWsdlDefinition(wsdlDefinition);
+ resolver.addModel(wsdlInterface);
+ } catch (InvalidInterfaceException e) {
+ ContributionResolveException ce = new ContributionResolveException("Invalid interface when resolving " +
+ portType.toString(), e);
+ error("ContributionResolveException", wsdlFactory, ce);
+ //throw ce;
+ }
+ }
+ else {
+ warning("WsdlInterfaceDoesNotMatch", wsdlDefinition, wsdlInterface.getName());
+ } // end if
+ } else {
+ // If we get here, the WSDLDefinition is unresolved...
+ ContributionResolveException ce = new ContributionResolveException("WSDLDefinition unresolved " +
+ wsdlInterface.getName().getNamespaceURI() );
+ error("ContributionResolveException", wsdlFactory, ce);
+ }// end if
+ } // end if
+ } // end if
+ return wsdlInterface;
+ }
+
+ public void resolve(WSDLInterfaceContract wsdlInterfaceContract, ModelResolver resolver) throws ContributionResolveException {
+
+ // Resolve the interface and callback interface
+ WSDLInterface wsdlInterface = resolveWSDLInterface((WSDLInterface)wsdlInterfaceContract.getInterface(), resolver);
+ wsdlInterfaceContract.setInterface(wsdlInterface);
+
+ WSDLInterface wsdlCallbackInterface = resolveWSDLInterface((WSDLInterface)wsdlInterfaceContract.getCallbackInterface(), resolver);
+ wsdlInterfaceContract.setCallbackInterface(wsdlCallbackInterface);
+ }
+
+ public QName getArtifactType() {
+ return WSDLConstants.INTERFACE_WSDL_QNAME;
+ }
+
+ public Class<WSDLInterfaceContract> getModelType() {
+ return WSDLInterfaceContract.class;
+ }
+}
diff --git a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java
index 35b4c4f240..2e14c4885c 100644
--- a/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java
+++ b/java/sca/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java
@@ -73,7 +73,7 @@ import org.xml.sax.InputSource;
/**
* A Model Resolver for WSDL models.
*
- * @version $Rev: 557916 $ $Date: 2007-07-20 01:04:40 -0700 (Fri, 20 Jul 2007) $
+ * @version $Rev$ $Date$
*/
public class WSDLModelResolver implements ModelResolver {
//Schema element names
diff --git a/java/sca/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties b/java/sca/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties
index 5af757be4b..2f8c3e0500 100644
--- a/java/sca/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties
+++ b/java/sca/modules/interface-wsdl/src/main/resources/interface-wsdlxml-validation-messages.properties
@@ -1,24 +1,24 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-ContributionReadException = ContributionReadException occured due to :
-ContributionResolveException = ContributionResolveException occured due to :
-InvalidWSDLInterfaceAttr = Invalid WSDL interface attribute: {0}
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#
+ContributionReadException = ContributionReadException occured due to :
+ContributionResolveException = ContributionResolveException occured due to :
+InvalidWSDLInterfaceAttr = Invalid WSDL interface attribute: {0}
WsdlInterfaceDoesNotMatch = The #wsdl.interface({0}) specified does not match with WSDL Definitions \ No newline at end of file
diff --git a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java
index bd8f1c5e56..1fff109389 100644
--- a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java
+++ b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java
@@ -1,83 +1,83 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl.introspect;
-
-import java.net.URI;
-import java.net.URL;
-import java.util.List;
-
-import javax.wsdl.PortType;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
-import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test case for InterfaceWSDLIntrospectorImpl.
- *
- * @version $Rev: 656600 $ $Date: 2008-05-15 12:57:26 +0100 (Thu, 15 May 2008) $
- */
-public class WSDLInterfaceIntrospectorTestCase extends AbstractWSDLTestCase {
- private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
-
- private PortType portType;
- private WSDLDefinition definition;
-
- @Override
- @Before
- public void setUp() throws Exception {
- super.setUp();
-
- URL url = getClass().getResource("../xml/stockquote.wsdl");
- definition = (WSDLDefinition)documentProcessor.read(null, new URI("stockquote.wsdl"), url);
- resolver.addModel(definition);
- definition = resolver.resolveModel(WSDLDefinition.class, definition);
- portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
- }
-
- @Test
- @SuppressWarnings("unchecked")
- public final void testIntrospectPortType() throws InvalidInterfaceException {
- WSDLInterface contract = wsdlFactory.createWSDLInterface(portType, definition, resolver);
- Assert.assertEquals(contract.getName().getLocalPart(), "StockQuotePortType");
- List<Operation> operations = contract.getOperations();
- Assert.assertEquals(1, operations.size());
- Operation operation = operations.get(0);
- Assert.assertEquals("getLastTradePrice", operation.getName());
- DataType<List<DataType>> inputType = operation.getInputType();
- Assert.assertEquals(1, inputType.getLogical().size());
- DataType<XMLType> returnType = operation.getOutputType();
- Assert.assertNotNull(returnType);
- Assert.assertEquals(0, operation.getFaultTypes().size());
- // Assert.assertEquals(1,
- // operation.getWrapper().getInputChildElements().size());
- // Assert.assertEquals(1,
- // operation.getWrapper().getOutputChildElements().size());
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.interfacedef.wsdl.introspect;
+
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.interfacedef.DataType;
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.util.XMLType;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test case for InterfaceWSDLIntrospectorImpl.
+ *
+ * @version $Rev$ $Date$
+ */
+public class WSDLInterfaceIntrospectorTestCase extends AbstractWSDLTestCase {
+ private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
+
+ private PortType portType;
+ private WSDLDefinition definition;
+
+ @Override
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+
+ URL url = getClass().getResource("../xml/stockquote.wsdl");
+ definition = (WSDLDefinition)documentProcessor.read(null, new URI("stockquote.wsdl"), url);
+ resolver.addModel(definition);
+ definition = resolver.resolveModel(WSDLDefinition.class, definition);
+ portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
+ }
+
+ @Test
+ @SuppressWarnings("unchecked")
+ public final void testIntrospectPortType() throws InvalidInterfaceException {
+ WSDLInterface contract = wsdlFactory.createWSDLInterface(portType, definition, resolver);
+ Assert.assertEquals(contract.getName().getLocalPart(), "StockQuotePortType");
+ List<Operation> operations = contract.getOperations();
+ Assert.assertEquals(1, operations.size());
+ Operation operation = operations.get(0);
+ Assert.assertEquals("getLastTradePrice", operation.getName());
+ DataType<List<DataType>> inputType = operation.getInputType();
+ Assert.assertEquals(1, inputType.getLogical().size());
+ DataType<XMLType> returnType = operation.getOutputType();
+ Assert.assertNotNull(returnType);
+ Assert.assertEquals(0, operation.getFaultTypes().size());
+ // Assert.assertEquals(1,
+ // operation.getWrapper().getInputChildElements().size());
+ // Assert.assertEquals(1,
+ // operation.getWrapper().getOutputChildElements().size());
+ }
+
+}
diff --git a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
index 666763fe71..338d24cbfd 100644
--- a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
+++ b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
@@ -1,121 +1,121 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl.introspect;
-
-import static org.junit.Assert.fail;
-
-import java.net.URI;
-import java.net.URL;
-import java.util.List;
-
-import javax.wsdl.PortType;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.interfacedef.DataType;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.util.XMLType;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation;
-import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * Test case for WSDLOperation.
- *
- * @version $Rev: 660340 $ $Date: 2008-05-27 01:08:32 +0100 (Tue, 27 May 2008) $
- */
-public class WSDLOperationIntrospectorTestCase extends AbstractWSDLTestCase {
- private static final QName PORTTYPE_NAME =
- new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
-
-
- @SuppressWarnings("unchecked")
- @Test
- public final void testWrappedOperation() throws Exception {
- URL url = getClass().getResource("../xml/stockquote.wsdl");
- WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("stockquote.wsdl"), url);
- resolver.addModel(definition);
- definition = resolver.resolveModel(WSDLDefinition.class, definition);
- PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
-
- WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver);
- WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);
-
- DataType<List<DataType>> inputType = op.getInputType();
- Assert.assertEquals(1, inputType.getLogical().size());
- DataType<XMLType> type = inputType.getLogical().get(0);
- Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePrice"), type.getLogical().getElementName());
-
- DataType<XMLType> outputType = op.getOutputType();
- Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePriceResponse"),
- outputType.getLogical().getElementName());
- Assert.assertTrue(op.isWrapperStyle());
-
- DataType<List<DataType>> unwrappedInputType = op.getWrapper().getUnwrappedInputType();
- List<DataType> childTypes = unwrappedInputType.getLogical();
- Assert.assertEquals(1, childTypes.size());
- DataType<XMLType> childType = childTypes.get(0);
- Assert.assertEquals(new QName(null, "tickerSymbol"), childType.getLogical().getElementName());
-
- childType = op.getWrapper().getUnwrappedOutputType();
- Assert.assertEquals(new QName(null, "price"), childType.getLogical().getElementName());
- }
-
- @Test
- public final void testUnwrappedOperation() throws Exception {
- URL url = getClass().getResource("../xml/unwrapped-stockquote.wsdl");
- WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("unwrapped-stockquote.wsdl"), url);
- resolver.addModel(definition);
- definition = resolver.resolveModel(WSDLDefinition.class, definition);
- PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
-
- WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver);
- WSDLOperation op = (WSDLOperation) wi.getOperations().get(1);
- Assert.assertFalse(op.isWrapperStyle());
- Assert.assertEquals(1, op.getInputType().getLogical().size());
-
- op = (WSDLOperation) wi.getOperations().get(2);
- Assert.assertFalse(op.isWrapperStyle());
- Assert.assertEquals(2, op.getInputType().getLogical().size());
- }
-
- @Test
- public final void testInvalidWSDL() throws Exception {
- URL url = getClass().getResource("../xml/invalid-stockquote.wsdl");
- WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("invalid-stockquote.wsdl"), url);
- resolver.addModel(definition);
- definition = resolver.resolveModel(WSDLDefinition.class, definition);
- PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
-
- try {
- WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver);
- WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);
-
- op.isWrapperStyle();
- fail("InvalidWSDLException should have been thrown");
- } catch (InvalidInterfaceException e) {
- // Expected
- }
-
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.interfacedef.wsdl.introspect;
+
+import static org.junit.Assert.fail;
+
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.interfacedef.DataType;
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.util.XMLType;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation;
+import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Test case for WSDLOperation.
+ *
+ * @version $Rev$ $Date$
+ */
+public class WSDLOperationIntrospectorTestCase extends AbstractWSDLTestCase {
+ private static final QName PORTTYPE_NAME =
+ new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
+
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public final void testWrappedOperation() throws Exception {
+ URL url = getClass().getResource("../xml/stockquote.wsdl");
+ WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("stockquote.wsdl"), url);
+ resolver.addModel(definition);
+ definition = resolver.resolveModel(WSDLDefinition.class, definition);
+ PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
+
+ WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver);
+ WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);
+
+ DataType<List<DataType>> inputType = op.getInputType();
+ Assert.assertEquals(1, inputType.getLogical().size());
+ DataType<XMLType> type = inputType.getLogical().get(0);
+ Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePrice"), type.getLogical().getElementName());
+
+ DataType<XMLType> outputType = op.getOutputType();
+ Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePriceResponse"),
+ outputType.getLogical().getElementName());
+ Assert.assertTrue(op.isWrapperStyle());
+
+ DataType<List<DataType>> unwrappedInputType = op.getWrapper().getUnwrappedInputType();
+ List<DataType> childTypes = unwrappedInputType.getLogical();
+ Assert.assertEquals(1, childTypes.size());
+ DataType<XMLType> childType = childTypes.get(0);
+ Assert.assertEquals(new QName(null, "tickerSymbol"), childType.getLogical().getElementName());
+
+ childType = op.getWrapper().getUnwrappedOutputType();
+ Assert.assertEquals(new QName(null, "price"), childType.getLogical().getElementName());
+ }
+
+ @Test
+ public final void testUnwrappedOperation() throws Exception {
+ URL url = getClass().getResource("../xml/unwrapped-stockquote.wsdl");
+ WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("unwrapped-stockquote.wsdl"), url);
+ resolver.addModel(definition);
+ definition = resolver.resolveModel(WSDLDefinition.class, definition);
+ PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
+
+ WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver);
+ WSDLOperation op = (WSDLOperation) wi.getOperations().get(1);
+ Assert.assertFalse(op.isWrapperStyle());
+ Assert.assertEquals(1, op.getInputType().getLogical().size());
+
+ op = (WSDLOperation) wi.getOperations().get(2);
+ Assert.assertFalse(op.isWrapperStyle());
+ Assert.assertEquals(2, op.getInputType().getLogical().size());
+ }
+
+ @Test
+ public final void testInvalidWSDL() throws Exception {
+ URL url = getClass().getResource("../xml/invalid-stockquote.wsdl");
+ WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("invalid-stockquote.wsdl"), url);
+ resolver.addModel(definition);
+ definition = resolver.resolveModel(WSDLDefinition.class, definition);
+ PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
+
+ try {
+ WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver);
+ WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);
+
+ op.isWrapperStyle();
+ fail("InvalidWSDLException should have been thrown");
+ } catch (InvalidInterfaceException e) {
+ // Expected
+ }
+
+ }
+
+}
diff --git a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java
index 877ca60c13..282144c635 100644
--- a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java
+++ b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java
@@ -1,86 +1,86 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl.introspect;
-
-import java.net.URI;
-import java.net.URL;
-
-import javax.wsdl.PortType;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.interfacedef.ConversationSequence;
-import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
-import org.apache.tuscany.sca.interfacedef.Operation;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
-import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
-import org.apache.tuscany.sca.policy.Intent;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test case for InterfaceWSDLIntrospectorImpl.
- *
- * @version $Rev: 665985 $ $Date: 2008-06-10 06:35:33 +0100 (Tue, 10 Jun 2008) $
- */
-public class WSDLPolicyAnnotatedInterfaceIntrospectorTestCase extends AbstractWSDLTestCase {
- private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
- private static final QName INTENT = new QName("http://example.com/stockquote.wsdl", "PolicyIntent");
-
- private PortType portType;
- private WSDLDefinition definition;
-
- @Before
- @Override
- public void setUp() throws Exception {
- super.setUp();
-
- URL url = getClass().getResource("/policy/stockquote_policy.wsdl");
- definition = (WSDLDefinition)documentProcessor.read(null, new URI("stockquote.wsdl"), url);
- resolver.addModel(definition);
- definition = resolver.resolveModel(WSDLDefinition.class, definition);
- portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
- }
-
- @Test
- public final void testIntrospectPortType() throws InvalidInterfaceException {
- WSDLInterface contract = wsdlFactory.createWSDLInterface(portType, definition, resolver);
- Assert.assertEquals(contract.getName().getLocalPart(), "StockQuotePortType");
- Assert.assertTrue(contract.isConversational());
-
- boolean foundIntent = false;
-
- for(Intent intent : contract.getRequiredIntents()) {
- if(INTENT.equals(intent.getName())) {
- foundIntent = true;
- }
- }
-
- Assert.assertTrue(foundIntent);
-
- for(Operation operation : contract.getOperations()) {
- if(operation.getName().equals("cancel")) {
- Assert.assertEquals(operation.getConversationSequence(), ConversationSequence.CONVERSATION_END);
- }
- }
-
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.interfacedef.wsdl.introspect;
+
+import java.net.URI;
+import java.net.URL;
+
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.interfacedef.ConversationSequence;
+import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
+import org.apache.tuscany.sca.policy.Intent;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test case for InterfaceWSDLIntrospectorImpl.
+ *
+ * @version $Rev$ $Date$
+ */
+public class WSDLPolicyAnnotatedInterfaceIntrospectorTestCase extends AbstractWSDLTestCase {
+ private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
+ private static final QName INTENT = new QName("http://example.com/stockquote.wsdl", "PolicyIntent");
+
+ private PortType portType;
+ private WSDLDefinition definition;
+
+ @Before
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+
+ URL url = getClass().getResource("/policy/stockquote_policy.wsdl");
+ definition = (WSDLDefinition)documentProcessor.read(null, new URI("stockquote.wsdl"), url);
+ resolver.addModel(definition);
+ definition = resolver.resolveModel(WSDLDefinition.class, definition);
+ portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
+ }
+
+ @Test
+ public final void testIntrospectPortType() throws InvalidInterfaceException {
+ WSDLInterface contract = wsdlFactory.createWSDLInterface(portType, definition, resolver);
+ Assert.assertEquals(contract.getName().getLocalPart(), "StockQuotePortType");
+ Assert.assertTrue(contract.isConversational());
+
+ boolean foundIntent = false;
+
+ for(Intent intent : contract.getRequiredIntents()) {
+ if(INTENT.equals(intent.getName())) {
+ foundIntent = true;
+ }
+ }
+
+ Assert.assertTrue(foundIntent);
+
+ for(Operation operation : contract.getOperations()) {
+ if(operation.getName().equals("cancel")) {
+ Assert.assertEquals(operation.getConversationSequence(), ConversationSequence.CONVERSATION_END);
+ }
+ }
+
+ }
+}
diff --git a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
index f03d7d6628..a974bdb89c 100644
--- a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
+++ b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
@@ -1,71 +1,71 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl.introspect;
-
-import java.net.URI;
-import java.net.URL;
-
-import javax.wsdl.PortType;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation;
-import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * Test case for WSDLOperation.
- *
- * @version $Rev: 660340 $ $Date: 2008-05-27 01:08:32 +0100 (Tue, 27 May 2008) $
- */
-public class WrapperStyleOperationTestCase extends AbstractWSDLTestCase {
- private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
-
- @Test
- public final void testWrappedOperation() throws Exception {
- URL url = getClass().getResource("../xml/stockquote.wsdl");
- WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("stockquote.wsdl"), url);
- resolver.addModel(definition);
- definition = resolver.resolveModel(WSDLDefinition.class, definition);
- PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
- WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver);
- WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);
- Assert.assertTrue(op.isWrapperStyle());
- Assert.assertEquals(1, op.getWrapper().getInputChildElements().size());
- Assert.assertEquals(1, op.getWrapper().getOutputChildElements().size());
- }
-
- @Test
- public final void testUnwrappedOperation() throws Exception {
- URL url = getClass().getResource("../xml/unwrapped-stockquote.wsdl");
- WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("unwrapped-stockquote.wsdl"), url);
- resolver.addModel(definition);
- definition = resolver.resolveModel(WSDLDefinition.class, definition);
- PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
- WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver);
- WSDLOperation op = (WSDLOperation) wi.getOperations().get(1);
- Assert.assertFalse(op.isWrapperStyle());
- op = (WSDLOperation) wi.getOperations().get(2);
- Assert.assertFalse(op.isWrapperStyle());
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.interfacedef.wsdl.introspect;
+
+import java.net.URI;
+import java.net.URL;
+
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation;
+import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Test case for WSDLOperation.
+ *
+ * @version $Rev$ $Date$
+ */
+public class WrapperStyleOperationTestCase extends AbstractWSDLTestCase {
+ private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
+
+ @Test
+ public final void testWrappedOperation() throws Exception {
+ URL url = getClass().getResource("../xml/stockquote.wsdl");
+ WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("stockquote.wsdl"), url);
+ resolver.addModel(definition);
+ definition = resolver.resolveModel(WSDLDefinition.class, definition);
+ PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
+ WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver);
+ WSDLOperation op = (WSDLOperation) wi.getOperations().get(0);
+ Assert.assertTrue(op.isWrapperStyle());
+ Assert.assertEquals(1, op.getWrapper().getInputChildElements().size());
+ Assert.assertEquals(1, op.getWrapper().getOutputChildElements().size());
+ }
+
+ @Test
+ public final void testUnwrappedOperation() throws Exception {
+ URL url = getClass().getResource("../xml/unwrapped-stockquote.wsdl");
+ WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("unwrapped-stockquote.wsdl"), url);
+ resolver.addModel(definition);
+ definition = resolver.resolveModel(WSDLDefinition.class, definition);
+ PortType portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
+ WSDLInterface wi = wsdlFactory.createWSDLInterface(portType, definition, resolver);
+ WSDLOperation op = (WSDLOperation) wi.getOperations().get(1);
+ Assert.assertFalse(op.isWrapperStyle());
+ op = (WSDLOperation) wi.getOperations().get(2);
+ Assert.assertFalse(op.isWrapperStyle());
+ }
+
+}
diff --git a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java
index a50af074cc..d91e206183 100644
--- a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java
+++ b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java
@@ -1,65 +1,65 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl.xml;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
-import org.apache.tuscany.sca.xsd.XSDFactory;
-import org.junit.Before;
-
-/**
- * Test case for WSDLOperation.
- *
- * @version $Rev: 723274 $ $Date: 2008-12-04 10:14:09 +0000 (Thu, 04 Dec 2008) $
- */
-public abstract class AbstractWSDLTestCase {
- protected URLArtifactProcessor<Object> documentProcessor;
- protected ModelResolver resolver;
- protected WSDLFactory wsdlFactory;
- protected XSDFactory xsdFactory;
-
- @Before
- public void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
- xsdFactory = modelFactories.getFactory(XSDFactory.class);
-
- ContributionFactory contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- Contribution contribution = contributionFactory.createContribution();
- ModelResolverExtensionPoint modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
- resolver = new ExtensibleModelResolver(contribution, modelResolvers, modelFactories);
- contribution.setModelResolver(resolver);
-
- URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors, null);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.interfacedef.wsdl.xml;
+
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.ContributionFactory;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
+import org.apache.tuscany.sca.xsd.XSDFactory;
+import org.junit.Before;
+
+/**
+ * Test case for WSDLOperation.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class AbstractWSDLTestCase {
+ protected URLArtifactProcessor<Object> documentProcessor;
+ protected ModelResolver resolver;
+ protected WSDLFactory wsdlFactory;
+ protected XSDFactory xsdFactory;
+
+ @Before
+ public void setUp() throws Exception {
+ ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+ FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
+ wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
+ xsdFactory = modelFactories.getFactory(XSDFactory.class);
+
+ ContributionFactory contributionFactory = modelFactories.getFactory(ContributionFactory.class);
+ Contribution contribution = contributionFactory.createContribution();
+ ModelResolverExtensionPoint modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
+ resolver = new ExtensibleModelResolver(contribution, modelResolvers, modelFactories);
+ contribution.setModelResolver(resolver);
+
+ URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
+ documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors, null);
+ }
+
+}
diff --git a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java
index 7cebc84af3..d2a019f47d 100644
--- a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java
+++ b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/ReadTestCase.java
@@ -1,91 +1,91 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl.xml;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
-import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test reading WSDL interfaces.
- *
- * @version $Rev: 723270 $ $Date: 2008-12-04 09:48:12 +0000 (Thu, 04 Dec 2008) $
- */
-public class ReadTestCase {
-
- private XMLInputFactory inputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
- private CompositeBuilder compositeBuilder;
-
- @Before
- public void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
-
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
- }
-
- @Test
- public void testReadComponentType() throws Exception {
- InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- ComponentType componentType = (ComponentType)staxProcessor.read(reader);
- assertNotNull(componentType);
- }
-
- @Test
- public void testReadConstrainingType() throws Exception {
- InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- ConstrainingType constrainingType = (ConstrainingType)staxProcessor.read(reader);
- assertNotNull(constrainingType);
- }
-
- @Test
- public void testReadComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("Calculator.composite");
- XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
- Composite composite = (Composite)staxProcessor.read(reader);
- assertNotNull(composite);
-
- compositeBuilder.build(composite, null, null);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.interfacedef.wsdl.xml;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.ConstrainingType;
+import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
+import org.apache.tuscany.sca.assembly.builder.CompositeBuilderExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test reading WSDL interfaces.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ReadTestCase {
+
+ private XMLInputFactory inputFactory;
+ private StAXArtifactProcessor<Object> staxProcessor;
+ private CompositeBuilder compositeBuilder;
+
+ @Before
+ public void setUp() throws Exception {
+ DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+ inputFactory = XMLInputFactory.newInstance();
+ StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
+ staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
+
+ FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
+ compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
+ }
+
+ @Test
+ public void testReadComponentType() throws Exception {
+ InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType");
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
+ ComponentType componentType = (ComponentType)staxProcessor.read(reader);
+ assertNotNull(componentType);
+ }
+
+ @Test
+ public void testReadConstrainingType() throws Exception {
+ InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType");
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
+ ConstrainingType constrainingType = (ConstrainingType)staxProcessor.read(reader);
+ assertNotNull(constrainingType);
+ }
+
+ @Test
+ public void testReadComposite() throws Exception {
+ InputStream is = getClass().getResourceAsStream("Calculator.composite");
+ XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
+ Composite composite = (Composite)staxProcessor.read(reader);
+ assertNotNull(composite);
+
+ compositeBuilder.build(composite, null, null);
+ }
+
+}
diff --git a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java
index 9b72e0d740..4f85bb8f1c 100644
--- a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java
+++ b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java
@@ -1,67 +1,67 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl.xml;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.net.URI;
-import java.net.URL;
-import java.util.List;
-
-import javax.wsdl.Import;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- * @version $Rev: 723274 $ $Date: 2008-12-04 10:14:09 +0000 (Thu, 04 Dec 2008) $
- */
-public class WSDLDocumentProcessorTestCase extends AbstractWSDLTestCase {
-
- @Test
- public void testWSDL() throws Exception {
-
- URL url = getClass().getResource("/wsdl/helloworld-service.wsdl");
- WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, URI.create("wsdl/helloworld-service.wsdl"), url);
-
- Assert.assertNull(definition.getDefinition());
- Assert.assertEquals("http://helloworld", definition.getNamespace());
- URL url1 = getClass().getResource("/wsdl/helloworld-interface.wsdl");
- WSDLDefinition definition1 = (WSDLDefinition)documentProcessor.read(null, URI.create("wsdl/helloworld-interface.wsdl"), url1);
- Assert.assertNull(definition1.getDefinition());
- Assert.assertEquals("http://helloworld", definition1.getNamespace());
-
- resolver.addModel(definition);
- resolver.addModel(definition1);
- resolver.resolveModel(WSDLDefinition.class, definition);
- resolver.resolveModel(WSDLDefinition.class, definition1);
- WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, definition);
- List imports = (List)definition.getDefinition().getImports().get("http://helloworld");
- Assert.assertNotNull(imports);
- Assert.assertNotNull(((Import)imports.get(0)).getDefinition());
- Assert.assertNotNull(resolved.getDefinition().getPortType(new QName("http://helloworld", "HelloWorld")));
- Assert.assertNotNull(resolved.getDefinition().getService(new QName("http://helloworld", "HelloWorldService")));
-
- assertNotNull(resolved.getXmlSchemaType(new QName("http://greeting", "Name")));
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.interfacedef.wsdl.xml;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+
+import javax.wsdl.Import;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class WSDLDocumentProcessorTestCase extends AbstractWSDLTestCase {
+
+ @Test
+ public void testWSDL() throws Exception {
+
+ URL url = getClass().getResource("/wsdl/helloworld-service.wsdl");
+ WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, URI.create("wsdl/helloworld-service.wsdl"), url);
+
+ Assert.assertNull(definition.getDefinition());
+ Assert.assertEquals("http://helloworld", definition.getNamespace());
+ URL url1 = getClass().getResource("/wsdl/helloworld-interface.wsdl");
+ WSDLDefinition definition1 = (WSDLDefinition)documentProcessor.read(null, URI.create("wsdl/helloworld-interface.wsdl"), url1);
+ Assert.assertNull(definition1.getDefinition());
+ Assert.assertEquals("http://helloworld", definition1.getNamespace());
+
+ resolver.addModel(definition);
+ resolver.addModel(definition1);
+ resolver.resolveModel(WSDLDefinition.class, definition);
+ resolver.resolveModel(WSDLDefinition.class, definition1);
+ WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, definition);
+ List imports = (List)definition.getDefinition().getImports().get("http://helloworld");
+ Assert.assertNotNull(imports);
+ Assert.assertNotNull(((Import)imports.get(0)).getDefinition());
+ Assert.assertNotNull(resolved.getDefinition().getPortType(new QName("http://helloworld", "HelloWorld")));
+ Assert.assertNotNull(resolved.getDefinition().getService(new QName("http://helloworld", "HelloWorldService")));
+
+ assertNotNull(resolved.getXmlSchemaType(new QName("http://greeting", "Name")));
+ }
+
+}
diff --git a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java
index 502d0a8a2d..de98befd9b 100644
--- a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java
+++ b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLTestCase.java
@@ -1,123 +1,123 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl.xml;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionFactory;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test reading WSDL interfaces.
- *
- * @version $Rev: 723270 $ $Date: 2008-12-04 09:48:12 +0000 (Thu, 04 Dec 2008) $
- */
-public class WSDLTestCase {
-
- private ExtensibleURLArtifactProcessor documentProcessor;
- private ContributionFactory contributionFactory;
- private WSDLModelResolver wsdlResolver;
- private ModelResolver resolver;
-
- @Before
- public void setUp() throws Exception {
- ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
- documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors, null);
-
- FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
- contributionFactory = modelFactories.getFactory(ContributionFactory.class);
- Contribution contribution = contributionFactory.createContribution();
- ModelResolverExtensionPoint modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
- resolver = new ExtensibleModelResolver(contribution, modelResolvers, modelFactories);
- contribution.setModelResolver(resolver);
- wsdlResolver = new WSDLModelResolver(contribution, modelFactories);
- }
-
- @Test
- public void testReadWSDLDocument() throws Exception {
- URL url = getClass().getResource("example.wsdl");
- WSDLDefinition definition = documentProcessor.read(null, new URI("example.wsdl"), url, WSDLDefinition.class);
- assertNotNull(definition);
- assertNull(definition.getDefinition());
- assertEquals(definition.getNamespace(), "http://www.example.org");
- }
-
- @Test
- public void testReadWSDLImports() throws Exception {
- QName aBinding = new QName("http://helloworld", "HelloWorldSoapBinding");
- QName aPortType = new QName("http://helloworld", "HelloWorld");
-
- URL url = getClass().getResource("test1.wsdl");
- WSDLDefinition test1Defn = documentProcessor.read(null, new URI("test1.wsdl"), url, WSDLDefinition.class);
- assertNotNull(test1Defn);
- wsdlResolver.addModel(test1Defn);
- test1Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test1Defn);
- //binding is a part of test1.wsdl
- assertNotNull(test1Defn.getDefinition().getBinding(aBinding));
- //porttype is part of test2.wsdl
- assertNotNull(test1Defn.getDefinition().getPortType(aPortType));
- }
-
- @Test
- public void testReadSameNamespaceWSDLDocument() throws Exception {
- QName aBinding = new QName("http://helloworld", "HelloWorldSoapBinding");
- QName aPortType = new QName("http://helloworld", "HelloWorld");
-
- URL url = getClass().getResource("test2.wsdl");
- WSDLDefinition test2Defn = documentProcessor.read(null, new URI("test2.wsdl"), url, WSDLDefinition.class);
- assertNotNull(test2Defn);
- wsdlResolver.addModel(test2Defn);
- test2Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test2Defn);
-
- //bindings are a part of test1.wsdl so should not be found
- assertNull(test2Defn.getDefinition().getBinding(aBinding));
- assertNotNull(test2Defn.getDefinition().getPortType(aPortType));
-
- url = getClass().getResource("test1.wsdl");
- WSDLDefinition test1Defn = documentProcessor.read(null, new URI("test1.wsdl"), url, WSDLDefinition.class);
- assertNotNull(test1Defn);
- wsdlResolver.addModel(test1Defn);
-
- test1Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test1Defn);
-
- assertNotNull(test1Defn.getDefinition().getPortType(aPortType));
- assertNotNull(test1Defn.getDefinition().getBinding(aBinding));
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.interfacedef.wsdl.xml;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import java.net.URI;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.ContributionFactory;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test reading WSDL interfaces.
+ *
+ * @version $Rev$ $Date$
+ */
+public class WSDLTestCase {
+
+ private ExtensibleURLArtifactProcessor documentProcessor;
+ private ContributionFactory contributionFactory;
+ private WSDLModelResolver wsdlResolver;
+ private ModelResolver resolver;
+
+ @Before
+ public void setUp() throws Exception {
+ ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+ URLArtifactProcessorExtensionPoint documentProcessors = extensionPoints.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
+ documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors, null);
+
+ FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
+ contributionFactory = modelFactories.getFactory(ContributionFactory.class);
+ Contribution contribution = contributionFactory.createContribution();
+ ModelResolverExtensionPoint modelResolvers = extensionPoints.getExtensionPoint(ModelResolverExtensionPoint.class);
+ resolver = new ExtensibleModelResolver(contribution, modelResolvers, modelFactories);
+ contribution.setModelResolver(resolver);
+ wsdlResolver = new WSDLModelResolver(contribution, modelFactories);
+ }
+
+ @Test
+ public void testReadWSDLDocument() throws Exception {
+ URL url = getClass().getResource("example.wsdl");
+ WSDLDefinition definition = documentProcessor.read(null, new URI("example.wsdl"), url, WSDLDefinition.class);
+ assertNotNull(definition);
+ assertNull(definition.getDefinition());
+ assertEquals(definition.getNamespace(), "http://www.example.org");
+ }
+
+ @Test
+ public void testReadWSDLImports() throws Exception {
+ QName aBinding = new QName("http://helloworld", "HelloWorldSoapBinding");
+ QName aPortType = new QName("http://helloworld", "HelloWorld");
+
+ URL url = getClass().getResource("test1.wsdl");
+ WSDLDefinition test1Defn = documentProcessor.read(null, new URI("test1.wsdl"), url, WSDLDefinition.class);
+ assertNotNull(test1Defn);
+ wsdlResolver.addModel(test1Defn);
+ test1Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test1Defn);
+ //binding is a part of test1.wsdl
+ assertNotNull(test1Defn.getDefinition().getBinding(aBinding));
+ //porttype is part of test2.wsdl
+ assertNotNull(test1Defn.getDefinition().getPortType(aPortType));
+ }
+
+ @Test
+ public void testReadSameNamespaceWSDLDocument() throws Exception {
+ QName aBinding = new QName("http://helloworld", "HelloWorldSoapBinding");
+ QName aPortType = new QName("http://helloworld", "HelloWorld");
+
+ URL url = getClass().getResource("test2.wsdl");
+ WSDLDefinition test2Defn = documentProcessor.read(null, new URI("test2.wsdl"), url, WSDLDefinition.class);
+ assertNotNull(test2Defn);
+ wsdlResolver.addModel(test2Defn);
+ test2Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test2Defn);
+
+ //bindings are a part of test1.wsdl so should not be found
+ assertNull(test2Defn.getDefinition().getBinding(aBinding));
+ assertNotNull(test2Defn.getDefinition().getPortType(aPortType));
+
+ url = getClass().getResource("test1.wsdl");
+ WSDLDefinition test1Defn = documentProcessor.read(null, new URI("test1.wsdl"), url, WSDLDefinition.class);
+ assertNotNull(test1Defn);
+ wsdlResolver.addModel(test1Defn);
+
+ test1Defn = wsdlResolver.resolveModel(WSDLDefinition.class, test1Defn);
+
+ assertNotNull(test1Defn.getDefinition().getPortType(aPortType));
+ assertNotNull(test1Defn.getDefinition().getBinding(aBinding));
+ }
+
+}
diff --git a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java
index 4992013862..a11eb1017f 100644
--- a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java
+++ b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WriteTestCase.java
@@ -1,88 +1,88 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl.xml;
-
-import static org.junit.Assert.assertNotNull;
-
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-
-import org.apache.tuscany.sca.assembly.ComponentType;
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.ConstrainingType;
-import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Test reading/write WSDL interfaces.
- *
- * @version $Rev: 723270 $ $Date: 2008-12-04 09:48:12 +0000 (Thu, 04 Dec 2008) $
- */
-public class WriteTestCase {
-
- private XMLInputFactory inputFactory;
- private XMLOutputFactory outputFactory;
- private StAXArtifactProcessor<Object> staxProcessor;
-
- @Before
- public void setUp() throws Exception {
- DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
- inputFactory = XMLInputFactory.newInstance();
- outputFactory = XMLOutputFactory.newInstance();
- StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
- staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
- }
-
- @Test
- public void testReadWriteComponentType() throws Exception {
- InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType");
- ComponentType componentType = (ComponentType)staxProcessor.read(inputFactory.createXMLStreamReader(is));
- assertNotNull(componentType);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(componentType, outputFactory.createXMLStreamWriter(bos));
- }
-
- @Test
- public void testReadWriteConstrainingType() throws Exception {
- InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType");
- ConstrainingType constrainingType = (ConstrainingType)staxProcessor.read(inputFactory.createXMLStreamReader(is));
- assertNotNull(constrainingType);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(constrainingType, outputFactory.createXMLStreamWriter(bos));
- }
-
- @Test
- public void testReadWriteComposite() throws Exception {
- InputStream is = getClass().getResourceAsStream("Calculator.composite");
- Composite composite = (Composite)staxProcessor.read(inputFactory.createXMLStreamReader(is));
- assertNotNull(composite);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- staxProcessor.write(composite, outputFactory.createXMLStreamWriter(bos));
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.interfacedef.wsdl.xml;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+
+import org.apache.tuscany.sca.assembly.ComponentType;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.ConstrainingType;
+import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test reading/write WSDL interfaces.
+ *
+ * @version $Rev$ $Date$
+ */
+public class WriteTestCase {
+
+ private XMLInputFactory inputFactory;
+ private XMLOutputFactory outputFactory;
+ private StAXArtifactProcessor<Object> staxProcessor;
+
+ @Before
+ public void setUp() throws Exception {
+ DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
+ inputFactory = XMLInputFactory.newInstance();
+ outputFactory = XMLOutputFactory.newInstance();
+ StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
+ staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
+ }
+
+ @Test
+ public void testReadWriteComponentType() throws Exception {
+ InputStream is = getClass().getResourceAsStream("CalculatorImpl.componentType");
+ ComponentType componentType = (ComponentType)staxProcessor.read(inputFactory.createXMLStreamReader(is));
+ assertNotNull(componentType);
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ staxProcessor.write(componentType, outputFactory.createXMLStreamWriter(bos));
+ }
+
+ @Test
+ public void testReadWriteConstrainingType() throws Exception {
+ InputStream is = getClass().getResourceAsStream("CalculatorComponent.constrainingType");
+ ConstrainingType constrainingType = (ConstrainingType)staxProcessor.read(inputFactory.createXMLStreamReader(is));
+ assertNotNull(constrainingType);
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ staxProcessor.write(constrainingType, outputFactory.createXMLStreamWriter(bos));
+ }
+
+ @Test
+ public void testReadWriteComposite() throws Exception {
+ InputStream is = getClass().getResourceAsStream("Calculator.composite");
+ Composite composite = (Composite)staxProcessor.read(inputFactory.createXMLStreamReader(is));
+ assertNotNull(composite);
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ staxProcessor.write(composite, outputFactory.createXMLStreamWriter(bos));
+ }
+
+}
diff --git a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java
index 1efeb6a514..4558bafdb8 100644
--- a/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java
+++ b/java/sca/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/XMLDocumentHelperTestCase.java
@@ -1,52 +1,52 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.interfacedef.wsdl.xml;
-
-import java.net.URL;
-
-import javax.xml.stream.XMLInputFactory;
-
-import org.apache.tuscany.sca.xsd.xml.XMLDocumentHelper;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @version $Rev: 723274 $ $Date: 2008-12-04 10:14:09 +0000 (Thu, 04 Dec 2008) $
- */
-public class XMLDocumentHelperTestCase {
- private URL wsdl;
- private URL xsd;
-
- /**
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- wsdl = getClass().getResource("/wsdl/helloworld-interface.wsdl");
- }
-
- @Test
- public void testReadTNS() throws Exception {
- String tns = XMLDocumentHelper.readTargetNamespace(wsdl, XMLDocumentHelper.WSDL11, true, "targetNamespace", XMLInputFactory.newInstance());
- Assert.assertEquals("http://helloworld", tns);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.interfacedef.wsdl.xml;
+
+import java.net.URL;
+
+import javax.xml.stream.XMLInputFactory;
+
+import org.apache.tuscany.sca.xsd.xml.XMLDocumentHelper;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class XMLDocumentHelperTestCase {
+ private URL wsdl;
+ private URL xsd;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ wsdl = getClass().getResource("/wsdl/helloworld-interface.wsdl");
+ }
+
+ @Test
+ public void testReadTNS() throws Exception {
+ String tns = XMLDocumentHelper.readTargetNamespace(wsdl, XMLDocumentHelper.WSDL11, true, "targetNamespace", XMLInputFactory.newInstance());
+ Assert.assertEquals("http://helloworld", tns);
+ }
+
+}
diff --git a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite
index 98ffd37232..fcdf69594b 100644
--- a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite
+++ b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/Calculator.composite
@@ -1,55 +1,55 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:calc="http://sample.calculator"
- targetNamespace="http://calc"
- xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
- name="Calculator">
-
- <service name="CalculatorService" promote="CalculatorServiceComponent">
- <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)"
- wsdli:wsdlLocation="http://tempuri.org"/>
- </service>
-
- <component name="CalculatorServiceComponent">
- <implementation.java class="calculator.CalculatorServiceImpl"/>
- <reference name="addService" target="AddServiceComponent"/>
- <reference name="subtractService" target="SubtractServiceComponent"/>
- <reference name="multiplyService" target="MultiplyServiceComponent"/>
- <reference name="divideService" target="DivideServiceComponent"/>
- </component>
-
- <component name="AddServiceComponent">
- <implementation.java class="calculator.AddServiceImpl"/>
- </component>
-
- <component name="SubtractServiceComponent">
- <implementation.java class="calculator.SubtractServiceImpl"/>
- </component>
-
- <component name="MultiplyServiceComponent">
- <implementation.java class="calculator.MultiplyServiceImpl"/>
- </component>
-
- <component name="DivideServiceComponent">
- <implementation.java class="calculator.DivideServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:calc="http://sample.calculator"
+ targetNamespace="http://calc"
+ xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance"
+ name="Calculator">
+
+ <service name="CalculatorService" promote="CalculatorServiceComponent">
+ <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)"
+ wsdli:wsdlLocation="http://tempuri.org"/>
+ </service>
+
+ <component name="CalculatorServiceComponent">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <reference name="addService" target="AddServiceComponent"/>
+ <reference name="subtractService" target="SubtractServiceComponent"/>
+ <reference name="multiplyService" target="MultiplyServiceComponent"/>
+ <reference name="divideService" target="DivideServiceComponent"/>
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType
index 2abafd96f8..35052dfd6d 100644
--- a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType
+++ b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/CalculatorImpl.componentType
@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance">
-
- <service name="CalculatorService">
- <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)"
- wsdli:wsdlLocation="http://tempuri.org"/>
- </service>
-
- <reference name="divideService">
- <interface.wsdl interface="http://sample/calculator#wsdl.interface(Divide)"/>
- </reference>
-
-</componentType>
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:wsdli="http://www.w3.org/2004/08/wsdl-instance">
+
+ <service name="CalculatorService">
+ <interface.wsdl interface="http://sample/calculator#wsdl.interface(Calculator)"
+ wsdli:wsdlLocation="http://tempuri.org"/>
+ </service>
+
+ <reference name="divideService">
+ <interface.wsdl interface="http://sample/calculator#wsdl.interface(Divide)"/>
+ </reference>
+
+</componentType>
\ No newline at end of file
diff --git a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl
index 747bb0b76d..5e8e5dad0d 100644
--- a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl
+++ b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/example.wsdl
@@ -1,26 +1,26 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<wsdl:definitions targetNamespace="http://www.example.org"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- name="example">
-
- <wsdl:portType name="HelloWorld">
- </wsdl:portType>
-</wsdl:definitions>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions targetNamespace="http://www.example.org"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ name="example">
+
+ <wsdl:portType name="HelloWorld">
+ </wsdl:portType>
+</wsdl:definitions>
diff --git a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl
index a08a546424..ad81fc7867 100644
--- a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl
+++ b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/invalid-stockquote.wsdl
@@ -1,58 +1,58 @@
-<?xml version="1.0"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<definitions name="StockQuote" targetNamespace="http://example.com/stockquote.wsdl"
- xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
- <schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2001/XMLSchema">
- <element name="getLastTradePrice1">
- <complexType>
- <sequence>
- <element name="tickerSymbol" type="string" />
- </sequence>
- </complexType>
- </element>
- <element name="getLastTradePriceResponse">
- <complexType>
- <sequence>
- <element name="price" type="float" />
- </sequence>
- </complexType>
- </element>
- </schema>
- </types>
-
- <message name="GetLastTradePriceInput">
- <part name="body" element="xsd1:getLastTradePrice" />
- </message>
-
- <message name="GetLastTradePriceOutput">
- <part name="body" element="xsd1:getLastTradePriceResponse" />
- </message>
-
- <portType name="StockQuotePortType">
- <operation name="getLastTradePrice">
- <input message="tns:GetLastTradePriceInput" />
- <output message="tns:GetLastTradePriceOutput" />
- </operation>
- </portType>
-
+<?xml version="1.0"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<definitions name="StockQuote" targetNamespace="http://example.com/stockquote.wsdl"
+ xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2001/XMLSchema">
+ <element name="getLastTradePrice1">
+ <complexType>
+ <sequence>
+ <element name="tickerSymbol" type="string" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="getLastTradePriceResponse">
+ <complexType>
+ <sequence>
+ <element name="price" type="float" />
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </types>
+
+ <message name="GetLastTradePriceInput">
+ <part name="body" element="xsd1:getLastTradePrice" />
+ </message>
+
+ <message name="GetLastTradePriceOutput">
+ <part name="body" element="xsd1:getLastTradePriceResponse" />
+ </message>
+
+ <portType name="StockQuotePortType">
+ <operation name="getLastTradePrice">
+ <input message="tns:GetLastTradePriceInput" />
+ <output message="tns:GetLastTradePriceOutput" />
+ </operation>
+ </portType>
+
</definitions> \ No newline at end of file
diff --git a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd
index db1b693448..241ec15d36 100644
--- a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd
+++ b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/ipo.xsd
@@ -1,136 +1,136 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<schema targetNamespace="http://www.example.com/IPO"
- xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ipo="http://www.example.com/IPO">
-
- <annotation>
- <documentation xml:lang="en">
- International Purchase order schema for Example.com
- Copyright 2000 Example.com. All rights reserved.
- </documentation>
- </annotation>
-
-
- <element name="purchaseOrder" type="ipo:PurchaseOrderType" />
-
- <element name="comment" type="string" />
-
- <complexType name="PurchaseOrderType">
- <sequence>
- <element name="shipTo" type="ipo:Address" />
- <element name="billTo" type="ipo:Address" />
- <element ref="ipo:comment" minOccurs="0" />
- <element name="items" type="ipo:Items" />
- </sequence>
- <attribute name="orderDate" type="date" />
- </complexType>
-
- <complexType name="Items">
- <sequence>
- <element name="item" minOccurs="0" maxOccurs="unbounded">
- <complexType>
- <sequence>
- <element name="productName" type="string" />
- <element name="quantity">
- <simpleType>
- <restriction base="positiveInteger">
- <maxExclusive value="100" />
- </restriction>
- </simpleType>
- </element>
- <element name="USPrice" type="decimal" />
- <element ref="ipo:comment" minOccurs="0" />
- <element name="shipDate" type="date"
- minOccurs="0" />
- </sequence>
- <attribute name="partNum" type="ipo:SKU"
- use="required" />
- </complexType>
- </element>
- </sequence>
- </complexType>
-
- <simpleType name="SKU">
- <restriction base="string">
- <pattern value="\d{3}-[A-Z]{2}" />
- </restriction>
- </simpleType>
-
- <complexType name="Address">
- <sequence>
- <element name="name" type="string" />
- <element name="street" type="string" />
- <element name="city" type="string" />
- </sequence>
- </complexType>
-
- <complexType name="USAddress">
- <complexContent>
- <extension base="ipo:Address">
- <sequence>
- <element name="state" type="ipo:USState" />
- <element name="zip" type="positiveInteger" />
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="UKAddress">
- <complexContent>
- <extension base="ipo:Address">
- <sequence>
- <element name="postcode" type="ipo:UKPostcode" />
- </sequence>
- <attribute name="exportCode" type="positiveInteger"
- fixed="1" />
- </extension>
- </complexContent>
- </complexType>
-
- <!-- other Address derivations for more countries -->
-
- <simpleType name="USState">
- <restriction base="string">
- <enumeration value="AK" />
- <enumeration value="AL" />
- <enumeration value="AR" />
- <enumeration value="CA" />
- <enumeration value="PA" />
- <!-- and so on ... -->
- </restriction>
- </simpleType>
-
- <simpleType name="Postcode">
- <restriction base="string">
- <length value="7" fixed="true" />
- </restriction>
- </simpleType>
-
-
- <simpleType name="UKPostcode">
- <restriction base="ipo:Postcode">
- <pattern value="[A-Z]{2}\d\s\d[A-Z]{2}" />
- </restriction>
- </simpleType>
-
-
-
-</schema>
-
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<schema targetNamespace="http://www.example.com/IPO"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ipo="http://www.example.com/IPO">
+
+ <annotation>
+ <documentation xml:lang="en">
+ International Purchase order schema for Example.com
+ Copyright 2000 Example.com. All rights reserved.
+ </documentation>
+ </annotation>
+
+
+ <element name="purchaseOrder" type="ipo:PurchaseOrderType" />
+
+ <element name="comment" type="string" />
+
+ <complexType name="PurchaseOrderType">
+ <sequence>
+ <element name="shipTo" type="ipo:Address" />
+ <element name="billTo" type="ipo:Address" />
+ <element ref="ipo:comment" minOccurs="0" />
+ <element name="items" type="ipo:Items" />
+ </sequence>
+ <attribute name="orderDate" type="date" />
+ </complexType>
+
+ <complexType name="Items">
+ <sequence>
+ <element name="item" minOccurs="0" maxOccurs="unbounded">
+ <complexType>
+ <sequence>
+ <element name="productName" type="string" />
+ <element name="quantity">
+ <simpleType>
+ <restriction base="positiveInteger">
+ <maxExclusive value="100" />
+ </restriction>
+ </simpleType>
+ </element>
+ <element name="USPrice" type="decimal" />
+ <element ref="ipo:comment" minOccurs="0" />
+ <element name="shipDate" type="date"
+ minOccurs="0" />
+ </sequence>
+ <attribute name="partNum" type="ipo:SKU"
+ use="required" />
+ </complexType>
+ </element>
+ </sequence>
+ </complexType>
+
+ <simpleType name="SKU">
+ <restriction base="string">
+ <pattern value="\d{3}-[A-Z]{2}" />
+ </restriction>
+ </simpleType>
+
+ <complexType name="Address">
+ <sequence>
+ <element name="name" type="string" />
+ <element name="street" type="string" />
+ <element name="city" type="string" />
+ </sequence>
+ </complexType>
+
+ <complexType name="USAddress">
+ <complexContent>
+ <extension base="ipo:Address">
+ <sequence>
+ <element name="state" type="ipo:USState" />
+ <element name="zip" type="positiveInteger" />
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="UKAddress">
+ <complexContent>
+ <extension base="ipo:Address">
+ <sequence>
+ <element name="postcode" type="ipo:UKPostcode" />
+ </sequence>
+ <attribute name="exportCode" type="positiveInteger"
+ fixed="1" />
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <!-- other Address derivations for more countries -->
+
+ <simpleType name="USState">
+ <restriction base="string">
+ <enumeration value="AK" />
+ <enumeration value="AL" />
+ <enumeration value="AR" />
+ <enumeration value="CA" />
+ <enumeration value="PA" />
+ <!-- and so on ... -->
+ </restriction>
+ </simpleType>
+
+ <simpleType name="Postcode">
+ <restriction base="string">
+ <length value="7" fixed="true" />
+ </restriction>
+ </simpleType>
+
+
+ <simpleType name="UKPostcode">
+ <restriction base="ipo:Postcode">
+ <pattern value="[A-Z]{2}\d\s\d[A-Z]{2}" />
+ </restriction>
+ </simpleType>
+
+
+
+</schema>
+
diff --git a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl
index 466ceb23da..39cd5547d9 100644
--- a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl
+++ b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/stockquote.wsdl
@@ -1,58 +1,58 @@
-<?xml version="1.0"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<definitions name="StockQuote" targetNamespace="http://example.com/stockquote.wsdl"
- xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
- <schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2001/XMLSchema">
- <element name="getLastTradePrice">
- <complexType>
- <sequence>
- <element name="tickerSymbol" type="string" />
- </sequence>
- </complexType>
- </element>
- <element name="getLastTradePriceResponse">
- <complexType>
- <sequence>
- <element name="price" type="float" />
- </sequence>
- </complexType>
- </element>
- </schema>
- </types>
-
- <message name="GetLastTradePriceInput">
- <part name="body" element="xsd1:getLastTradePrice" />
- </message>
-
- <message name="GetLastTradePriceOutput">
- <part name="body" element="xsd1:getLastTradePriceResponse" />
- </message>
-
- <portType name="StockQuotePortType">
- <operation name="getLastTradePrice">
- <input message="tns:GetLastTradePriceInput" />
- <output message="tns:GetLastTradePriceOutput" />
- </operation>
- </portType>
-
+<?xml version="1.0"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<definitions name="StockQuote" targetNamespace="http://example.com/stockquote.wsdl"
+ xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2001/XMLSchema">
+ <element name="getLastTradePrice">
+ <complexType>
+ <sequence>
+ <element name="tickerSymbol" type="string" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="getLastTradePriceResponse">
+ <complexType>
+ <sequence>
+ <element name="price" type="float" />
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </types>
+
+ <message name="GetLastTradePriceInput">
+ <part name="body" element="xsd1:getLastTradePrice" />
+ </message>
+
+ <message name="GetLastTradePriceOutput">
+ <part name="body" element="xsd1:getLastTradePriceResponse" />
+ </message>
+
+ <portType name="StockQuotePortType">
+ <operation name="getLastTradePrice">
+ <input message="tns:GetLastTradePriceInput" />
+ <output message="tns:GetLastTradePriceOutput" />
+ </operation>
+ </portType>
+
</definitions> \ No newline at end of file
diff --git a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl
index d39956af0a..8e26f7b4b5 100644
--- a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl
+++ b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.wsdl
@@ -1,45 +1,45 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld">
-
- <wsdl:import location="test2.wsdl" namespace="http://helloworld"></wsdl:import>
-
- <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getGreetings">
- <wsdlsoap:operation soapAction="" />
- <wsdl:input name="getGreetingsRequest">
- <wsdlsoap:body use="literal" />
- </wsdl:input>
- <wsdl:output name="getGreetingsResponse">
- <wsdlsoap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="HelloWorldService">
- <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
- <wsdlsoap:address location="http://localhost:8085/sample-helloworldws-1.0-SNAPSHOT/services/HelloWorldWebService" />
- </wsdl:port>
- </wsdl:service>
-
-</wsdl:definitions>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld">
+
+ <wsdl:import location="test2.wsdl" namespace="http://helloworld"></wsdl:import>
+
+ <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="getGreetings">
+ <wsdlsoap:operation soapAction="" />
+ <wsdl:input name="getGreetingsRequest">
+ <wsdlsoap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output name="getGreetingsResponse">
+ <wsdlsoap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="HelloWorldService">
+ <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
+ <wsdlsoap:address location="http://localhost:8085/sample-helloworldws-1.0-SNAPSHOT/services/HelloWorldWebService" />
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
diff --git a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd
index f3dbda1051..c2210f4a94 100644
--- a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd
+++ b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test1.xsd
@@ -1,33 +1,33 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<schema targetNamespace="http://www.example.com/Customer" xmlns="http://www.w3.org/2001/XMLSchema"
- xmlns:ipo="http://www.example.com/IPO" xmlns:tns="http://www.example.com/Customer">
- <import namespace="http://www.example.com/IPO" schemaLocation="ipo.xsd" />
-
- <complexType name="Customer">
- <sequence>
- <element name="customerID" type="string"></element>
- <element name="name" type="string"></element>
- <element name="order" type="ipo:PurchaseOrderType" />
- </sequence>
- </complexType>
- <element name="customer" type="tns:Customer"></element>
-
-</schema>
-
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<schema targetNamespace="http://www.example.com/Customer" xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:ipo="http://www.example.com/IPO" xmlns:tns="http://www.example.com/Customer">
+ <import namespace="http://www.example.com/IPO" schemaLocation="ipo.xsd" />
+
+ <complexType name="Customer">
+ <sequence>
+ <element name="customerID" type="string"></element>
+ <element name="name" type="string"></element>
+ <element name="order" type="ipo:PurchaseOrderType" />
+ </sequence>
+ </complexType>
+ <element name="customer" type="tns:Customer"></element>
+
+</schema>
+
diff --git a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl
index 0cd6819841..529b395fd5 100644
--- a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl
+++ b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/test2.wsdl
@@ -1,63 +1,63 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld">
-
- <wsdl:types>
- <schema elementFormDefault="qualified" targetNamespace="http://helloworld" xmlns="http://www.w3.org/2001/XMLSchema">
-
- <import namespace="http://www.example.com/IPO" schemaLocation="ipo.xsd" />
-
- <element name="getGreetings">
- <complexType>
- <sequence>
- <element name="name" type="xsd:string" />
- </sequence>
- </complexType>
- </element>
-
- <element name="getGreetingsResponse">
- <complexType>
- <sequence>
- <element name="getGreetingsReturn" type="xsd:string" />
- </sequence>
- </complexType>
- </element>
-
- </schema>
- </wsdl:types>
-
- <wsdl:message name="getGreetingsRequest">
- <wsdl:part element="tns:getGreetings" name="parameters" />
- </wsdl:message>
-
- <wsdl:message name="getGreetingsResponse">
- <wsdl:part element="tns:getGreetingsResponse" name="parameters" />
- </wsdl:message>
-
- <wsdl:portType name="HelloWorld">
- <wsdl:operation name="getGreetings">
- <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest" />
- <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse" />
- </wsdl:operation>
- </wsdl:portType>
-
-</wsdl:definitions>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified" targetNamespace="http://helloworld" xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <import namespace="http://www.example.com/IPO" schemaLocation="ipo.xsd" />
+
+ <element name="getGreetings">
+ <complexType>
+ <sequence>
+ <element name="name" type="xsd:string" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="getGreetingsResponse">
+ <complexType>
+ <sequence>
+ <element name="getGreetingsReturn" type="xsd:string" />
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetingsRequest">
+ <wsdl:part element="tns:getGreetings" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:message name="getGreetingsResponse">
+ <wsdl:part element="tns:getGreetingsResponse" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:portType name="HelloWorld">
+ <wsdl:operation name="getGreetings">
+ <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest" />
+ <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+</wsdl:definitions>
diff --git a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl
index b7beeed46d..666a7e4069 100644
--- a/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl
+++ b/java/sca/modules/interface-wsdl/src/test/resources/org/apache/tuscany/sca/interfacedef/wsdl/xml/unwrapped-stockquote.wsdl
@@ -1,76 +1,76 @@
-<?xml version="1.0"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<definitions name="StockQuote" targetNamespace="http://example.com/stockquote.wsdl"
- xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
- <schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2001/XMLSchema">
- <element name="getLastTradePrice">
- <complexType>
- <sequence>
- <element name="tickerSymbol" type="string" />
- </sequence>
- </complexType>
- </element>
- <element name="getLastTradePriceResponse">
- <complexType>
- <sequence>
- <element name="price" type="float" />
- </sequence>
- </complexType>
- </element>
- </schema>
- </types>
-
- <message name="GetLastTradePriceInput1">
- <part name="body" element="xsd1:getLastTradePrice" />
- </message>
-
- <message name="GetLastTradePriceOutput1">
- <part name="body" element="xsd1:getLastTradePriceResponse" />
- </message>
-
- <message name="GetLastTradePriceInput2">
- <part name="body" element="xsd1:getLastTradePrice" />
- <part name="other" type="xsd:string"/>
- </message>
-
- <message name="GetLastTradePriceOutput2">
- <part name="body" element="xsd1:getLastTradePriceResponse" />
- </message>
-
- <portType name="StockQuotePortType">
- <operation name="getLastTradePrice">
- <input message="tns:GetLastTradePriceInput1" />
- <output message="tns:GetLastTradePriceOutput1" />
- </operation>
- <operation name="getLastTradePrice1">
- <input message="tns:GetLastTradePriceInput1" />
- <output message="tns:GetLastTradePriceOutput1" />
- </operation>
- <operation name="getLastTradePrice2">
- <input message="tns:GetLastTradePriceInput2" />
- <output message="tns:GetLastTradePriceOutput2" />
- </operation>
- </portType>
-
+<?xml version="1.0"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<definitions name="StockQuote" targetNamespace="http://example.com/stockquote.wsdl"
+ xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2001/XMLSchema">
+ <element name="getLastTradePrice">
+ <complexType>
+ <sequence>
+ <element name="tickerSymbol" type="string" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="getLastTradePriceResponse">
+ <complexType>
+ <sequence>
+ <element name="price" type="float" />
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </types>
+
+ <message name="GetLastTradePriceInput1">
+ <part name="body" element="xsd1:getLastTradePrice" />
+ </message>
+
+ <message name="GetLastTradePriceOutput1">
+ <part name="body" element="xsd1:getLastTradePriceResponse" />
+ </message>
+
+ <message name="GetLastTradePriceInput2">
+ <part name="body" element="xsd1:getLastTradePrice" />
+ <part name="other" type="xsd:string"/>
+ </message>
+
+ <message name="GetLastTradePriceOutput2">
+ <part name="body" element="xsd1:getLastTradePriceResponse" />
+ </message>
+
+ <portType name="StockQuotePortType">
+ <operation name="getLastTradePrice">
+ <input message="tns:GetLastTradePriceInput1" />
+ <output message="tns:GetLastTradePriceOutput1" />
+ </operation>
+ <operation name="getLastTradePrice1">
+ <input message="tns:GetLastTradePriceInput1" />
+ <output message="tns:GetLastTradePriceOutput1" />
+ </operation>
+ <operation name="getLastTradePrice2">
+ <input message="tns:GetLastTradePriceInput2" />
+ <output message="tns:GetLastTradePriceOutput2" />
+ </operation>
+ </portType>
+
</definitions> \ No newline at end of file
diff --git a/java/sca/modules/interface-wsdl/src/test/resources/policy/stockquote_policy.wsdl b/java/sca/modules/interface-wsdl/src/test/resources/policy/stockquote_policy.wsdl
index b265831509..813d9e8291 100644
--- a/java/sca/modules/interface-wsdl/src/test/resources/policy/stockquote_policy.wsdl
+++ b/java/sca/modules/interface-wsdl/src/test/resources/policy/stockquote_policy.wsdl
@@ -1,62 +1,62 @@
-<?xml version="1.0"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<definitions name="StockQuote"
- targetNamespace="http://example.com/stockquote.wsdl"
- xmlns:tns="http://example.com/stockquote.wsdl"
- xmlns:xsd="http://example.com/stockquote.xsd"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
- <schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2001/XMLSchema">
- <element name="getLastTradePrice">
- <complexType>
- <sequence>
- <element name="tickerSymbol" type="string" />
- </sequence>
- </complexType>
- </element>
- <element name="getLastTradePriceResponse">
- <complexType>
- <sequence>
- <element name="price" type="float" />
- </sequence>
- </complexType>
- </element>
- </schema>
- </types>
-
- <message name="GetLastTradePriceInput">
- <part name="body" element="xsd:getLastTradePrice" />
- </message>
-
- <message name="GetLastTradePriceOutput">
- <part name="body" element="xsd:getLastTradePriceResponse" />
- </message>
-
- <portType name="StockQuotePortType" sca:requires="sca:conversational tns:PolicyIntent">
- <operation name="getLastTradePrice">
- <input message="tns:GetLastTradePriceInput" />
- <output message="tns:GetLastTradePriceOutput" />
- </operation>
- <operation name="cancel" sca:endsConversation="true"/>
- </portType>
-
+<?xml version="1.0"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<definitions name="StockQuote"
+ targetNamespace="http://example.com/stockquote.wsdl"
+ xmlns:tns="http://example.com/stockquote.wsdl"
+ xmlns:xsd="http://example.com/stockquote.xsd"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+ <types>
+ <schema targetNamespace="http://example.com/stockquote.xsd" xmlns="http://www.w3.org/2001/XMLSchema">
+ <element name="getLastTradePrice">
+ <complexType>
+ <sequence>
+ <element name="tickerSymbol" type="string" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="getLastTradePriceResponse">
+ <complexType>
+ <sequence>
+ <element name="price" type="float" />
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </types>
+
+ <message name="GetLastTradePriceInput">
+ <part name="body" element="xsd:getLastTradePrice" />
+ </message>
+
+ <message name="GetLastTradePriceOutput">
+ <part name="body" element="xsd:getLastTradePriceResponse" />
+ </message>
+
+ <portType name="StockQuotePortType" sca:requires="sca:conversational tns:PolicyIntent">
+ <operation name="getLastTradePrice">
+ <input message="tns:GetLastTradePriceInput" />
+ <output message="tns:GetLastTradePriceOutput" />
+ </operation>
+ <operation name="cancel" sca:endsConversation="true"/>
+ </portType>
+
</definitions> \ No newline at end of file
diff --git a/java/sca/modules/interface-wsdl/src/test/resources/wsdl/helloworld-interface.wsdl b/java/sca/modules/interface-wsdl/src/test/resources/wsdl/helloworld-interface.wsdl
index b0b6644e7f..9d9376ad6c 100644
--- a/java/sca/modules/interface-wsdl/src/test/resources/wsdl/helloworld-interface.wsdl
+++ b/java/sca/modules/interface-wsdl/src/test/resources/wsdl/helloworld-interface.wsdl
@@ -1,67 +1,67 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld">
-
- <wsdl:types>
- <schema elementFormDefault="qualified" targetNamespace="http://helloworld"
- xmlns="http://www.w3.org/2001/XMLSchema" xmlns:g="http://greeting">
-
- <!--
- <import namespace="http://greeting" schemaLocation="../xsd/greeting.xsd" />
- -->
- <include schemaLocation="../xsd/helloworld.xsd" />
-
- <element name="getGreetings">
- <complexType>
- <sequence>
- <element name="name" type="g:Name" />
- </sequence>
- </complexType>
- </element>
-
- <element name="getGreetingsResponse">
- <complexType>
- <sequence>
- <element name="getGreetingsReturn" type="g:Greeting" />
- </sequence>
- </complexType>
- </element>
-
- </schema>
- </wsdl:types>
-
- <wsdl:message name="getGreetingsRequest">
- <wsdl:part element="tns:getGreetings" name="parameters" />
- </wsdl:message>
-
- <wsdl:message name="getGreetingsResponse">
- <wsdl:part element="tns:getGreetingsResponse" name="parameters" />
- </wsdl:message>
-
- <wsdl:portType name="HelloWorld">
- <wsdl:operation name="getGreetings">
- <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest" />
- <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse" />
- </wsdl:operation>
- </wsdl:portType>
-
-</wsdl:definitions>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified" targetNamespace="http://helloworld"
+ xmlns="http://www.w3.org/2001/XMLSchema" xmlns:g="http://greeting">
+
+ <!--
+ <import namespace="http://greeting" schemaLocation="../xsd/greeting.xsd" />
+ -->
+ <include schemaLocation="../xsd/helloworld.xsd" />
+
+ <element name="getGreetings">
+ <complexType>
+ <sequence>
+ <element name="name" type="g:Name" />
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="getGreetingsResponse">
+ <complexType>
+ <sequence>
+ <element name="getGreetingsReturn" type="g:Greeting" />
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="getGreetingsRequest">
+ <wsdl:part element="tns:getGreetings" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:message name="getGreetingsResponse">
+ <wsdl:part element="tns:getGreetingsResponse" name="parameters" />
+ </wsdl:message>
+
+ <wsdl:portType name="HelloWorld">
+ <wsdl:operation name="getGreetings">
+ <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest" />
+ <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+</wsdl:definitions>
diff --git a/java/sca/modules/interface-wsdl/src/test/resources/wsdl/helloworld-service.wsdl b/java/sca/modules/interface-wsdl/src/test/resources/wsdl/helloworld-service.wsdl
index 0a7979e308..3885357625 100644
--- a/java/sca/modules/interface-wsdl/src/test/resources/wsdl/helloworld-service.wsdl
+++ b/java/sca/modules/interface-wsdl/src/test/resources/wsdl/helloworld-service.wsdl
@@ -1,49 +1,49 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld">
-
- <wsdl:import location="helloworld-interface.wsdl" namespace="http://helloworld"></wsdl:import>
- <!--
- <wsdl:import namespace="http://helloworld"></wsdl:import>
- -->
-
- <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getGreetings">
- <wsdlsoap:operation soapAction="" />
- <wsdl:input name="getGreetingsRequest">
- <wsdlsoap:body use="literal" />
- </wsdl:input>
- <wsdl:output name="getGreetingsResponse">
- <wsdlsoap:body use="literal" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="HelloWorldService">
- <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
- <wsdlsoap:address
- location="http://localhost:8085/sample-helloworldws-1.0-SNAPSHOT/services/HelloWorldWebService" />
- </wsdl:port>
- </wsdl:service>
-
-</wsdl:definitions>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="helloworld">
+
+ <wsdl:import location="helloworld-interface.wsdl" namespace="http://helloworld"></wsdl:import>
+ <!--
+ <wsdl:import namespace="http://helloworld"></wsdl:import>
+ -->
+
+ <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="getGreetings">
+ <wsdlsoap:operation soapAction="" />
+ <wsdl:input name="getGreetingsRequest">
+ <wsdlsoap:body use="literal" />
+ </wsdl:input>
+ <wsdl:output name="getGreetingsResponse">
+ <wsdlsoap:body use="literal" />
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="HelloWorldService">
+ <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
+ <wsdlsoap:address
+ location="http://localhost:8085/sample-helloworldws-1.0-SNAPSHOT/services/HelloWorldWebService" />
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
diff --git a/java/sca/modules/interface-wsdl/src/test/resources/xsd/greeting.xsd b/java/sca/modules/interface-wsdl/src/test/resources/xsd/greeting.xsd
index 160749bb18..635ca25bfc 100644
--- a/java/sca/modules/interface-wsdl/src/test/resources/xsd/greeting.xsd
+++ b/java/sca/modules/interface-wsdl/src/test/resources/xsd/greeting.xsd
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<schema targetNamespace="http://greeting" xmlns="http://www.w3.org/2001/XMLSchema">
- <include schemaLocation="name.xsd" />
- <complexType name="Greeting">
- <sequence>
- <element name="message" type="string" />
- <element name="name" type="Name" />
- </sequence>
- </complexType>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<schema targetNamespace="http://greeting" xmlns="http://www.w3.org/2001/XMLSchema">
+ <include schemaLocation="name.xsd" />
+ <complexType name="Greeting">
+ <sequence>
+ <element name="message" type="string" />
+ <element name="name" type="Name" />
+ </sequence>
+ </complexType>
+
</schema> \ No newline at end of file
diff --git a/java/sca/modules/interface-wsdl/src/test/resources/xsd/helloworld.xsd b/java/sca/modules/interface-wsdl/src/test/resources/xsd/helloworld.xsd
index e1f00fe0d5..bb0c9bc7b7 100644
--- a/java/sca/modules/interface-wsdl/src/test/resources/xsd/helloworld.xsd
+++ b/java/sca/modules/interface-wsdl/src/test/resources/xsd/helloworld.xsd
@@ -1,22 +1,22 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<schema targetNamespace="http://helloworld" xmlns="http://www.w3.org/2001/XMLSchema">
- <import namespace="http://greeting" schemaLocation="greeting.xsd" />
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<schema targetNamespace="http://helloworld" xmlns="http://www.w3.org/2001/XMLSchema">
+ <import namespace="http://greeting" schemaLocation="greeting.xsd" />
</schema> \ No newline at end of file
diff --git a/java/sca/modules/interface-wsdl/src/test/resources/xsd/name.xsd b/java/sca/modules/interface-wsdl/src/test/resources/xsd/name.xsd
index aed784c2f5..300de931ec 100644
--- a/java/sca/modules/interface-wsdl/src/test/resources/xsd/name.xsd
+++ b/java/sca/modules/interface-wsdl/src/test/resources/xsd/name.xsd
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<schema targetNamespace="http://greeting" xmlns="http://www.w3.org/2001/XMLSchema">
-
- <complexType name="Name">
- <sequence>
- <element name="firstName" type="string" />
- <element name="lastName" type="string" />
- </sequence>
- </complexType>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<schema targetNamespace="http://greeting" xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <complexType name="Name">
+ <sequence>
+ <element name="firstName" type="string" />
+ <element name="lastName" type="string" />
+ </sequence>
+ </complexType>
+
</schema> \ No newline at end of file
diff --git a/java/sca/modules/launcher/pom.xml b/java/sca/modules/launcher/pom.xml
index 4fcfdc4540..9dec07661d 100644
--- a/java/sca/modules/launcher/pom.xml
+++ b/java/sca/modules/launcher/pom.xml
@@ -1,35 +1,35 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-launcher</artifactId>
- <name>Apache Tuscany SCA Launcher</name>
-
- <dependencies>
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-launcher</artifactId>
+ <name>Apache Tuscany SCA Launcher</name>
+
+ <dependencies>
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java b/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java
index f4b657369c..41b3064d3f 100644
--- a/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java
+++ b/java/sca/modules/launcher/src/main/java/org/apache/tuscany/sca/launcher/LauncherMain.java
@@ -1,318 +1,318 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.launcher;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Properties;
-import java.util.Set;
-import java.util.jar.JarFile;
-
-public class LauncherMain {
-
- private static final String DEFAULT_PROPERTY_FILENAME = "default.config";
- private static final String CONFIG_CLASSPATH = "classpath";
- private static final String CONFIG_MAIN_CLASS = "mainClass";
- private static final String CONFIG_ARG_JAR_MAIN = "[firstArgJarManifestMainClass]";
- private static final String LAUNCHER_ARGS = "launcherArgs";
-
- public static void main(String[] args) throws SecurityException, IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, URISyntaxException, IOException {
- Properties launcherProperties = getLauncherProperties(args);
- setSystemProperties(launcherProperties);
- ClassLoader classLoader = getClassLoader(launcherProperties);
- String mainClassName = getMainClass(launcherProperties, classLoader);
- String[] mainArgs = getMainArgs(launcherProperties);
- invokeMainMethod(mainClassName, classLoader, mainArgs);
- }
-
- private static void setSystemProperties(Properties launcherProperties) throws URISyntaxException {
- for (Enumeration<?> e = launcherProperties.propertyNames(); e.hasMoreElements();) {
- String pn = (String) e.nextElement();
- if (pn.startsWith("-D")) {
- System.setProperty(pn.substring(2), keywordExpand(launcherProperties.getProperty(pn)));
- }
- }
- }
-
- private static String keywordExpand(String property) throws URISyntaxException {
- if (property.contains("{TUSCANY_HOME}")) {
- property = property.replace("{TUSCANY_HOME}", getLauncherFolder().getParentFile().getAbsolutePath());
- }
- return property;
- }
-
- private static String[] getMainArgs(Properties launcherProperties) {
- String[] mainArgs = (String[])launcherProperties.get(LAUNCHER_ARGS);
- if (mainArgs == null) {
- mainArgs = new String[0];
- }
- return mainArgs;
- }
-
- private static String getMainClass(Properties launcherProperties, ClassLoader classLoader) {
- String mainClassName;
- String[] args = getMainArgs(launcherProperties);
- if (args.length > 0) {
- try {
- Class.forName(args[0], true, classLoader);
- mainClassName = args[0];
- String[] args2 = new String[args.length-1];
- System.arraycopy(args, 1, args2, 0, args.length-1);
- launcherProperties.put(LAUNCHER_ARGS, args2);
- } catch (ClassNotFoundException e) {
- mainClassName = launcherProperties.getProperty(CONFIG_MAIN_CLASS);
- }
- } else {
- mainClassName = launcherProperties.getProperty(CONFIG_MAIN_CLASS);
- }
-
- if (mainClassName.startsWith(CONFIG_ARG_JAR_MAIN + "|")) {
- mainClassName = mainClassName.substring(CONFIG_ARG_JAR_MAIN.length()+1);
- }
-
- return mainClassName;
- }
-
- private static void invokeMainMethod(String className, ClassLoader classLoader, String[] args) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
- ClassLoader tccl = Thread.currentThread().getContextClassLoader();
- try {
-
- Thread.currentThread().setContextClassLoader(classLoader);
- Class mainClass = Class.forName(className, true, classLoader);
- Method m = mainClass.getMethod("main", new Class[]{ args.getClass() });
-
- m.invoke(null, new Object[]{args});
-
- } finally {
- Thread.currentThread().setContextClassLoader(tccl);
- }
- }
-
- private static ClassLoader getClassLoader(Properties launcherProperties) throws URISyntaxException, IOException {
- Set<URL> jarURLs = new HashSet<URL>();
- for (Enumeration<?> e = launcherProperties.propertyNames(); e.hasMoreElements();) {
- String pn = (String) e.nextElement();
- if (pn.startsWith(CONFIG_CLASSPATH)) {
- jarURLs.addAll(getJARs(launcherProperties.getProperty(pn), launcherProperties));
- } else if (pn.equals(CONFIG_MAIN_CLASS) && launcherProperties.getProperty(pn).startsWith(CONFIG_ARG_JAR_MAIN)) {
- if (firstArgJarHasManifestMainClass(launcherProperties)) {
- jarURLs.add(firstArgJarManifestMainClass(launcherProperties));
- }
- }
- }
- ClassLoader parentCL = Thread.currentThread().getContextClassLoader();
- if (parentCL == null) {
- parentCL = LauncherMain.class.getClassLoader();
- }
- return new URLClassLoader(jarURLs.toArray(new URL[]{}), parentCL);
- }
-
- private static URL firstArgJarManifestMainClass(Properties launcherProperties) throws IOException {
- String[] args = (String[])launcherProperties.get(LAUNCHER_ARGS);
- if (args.length < 1) {
- throw new IllegalArgumentException("must specifiy a jar file");
- }
- File f = new File(args[0]);
- if (!f.exists()) {
- throw new FileNotFoundException(args[0]);
- }
- JarFile jar = new JarFile(f);
- String mfc = jar.getManifest().getMainAttributes().getValue("Main-Class");
- if (mfc == null || mfc.length() < 1) {
- throw new IllegalArgumentException("first jar file missing manifest Main-Class attribute");
- }
- launcherProperties.setProperty(CONFIG_MAIN_CLASS, mfc);
-
- return f.toURL();
- }
-
- private static boolean firstArgJarHasManifestMainClass(Properties launcherProperties) throws IOException {
- String[] args = (String[])launcherProperties.get(LAUNCHER_ARGS);
- if (args.length < 1) {
- return false;
- }
- File f = new File(args[0]);
- if (!f.exists() || f.isDirectory()) {
- return false;
- }
- JarFile jar = new JarFile(f);
- String mfc = jar.getManifest().getMainAttributes().getValue("Main-Class");
- return mfc != null && mfc.length() > 0;
- }
- /**
- * Gets the jars matching a config classpath property
- * property values may be an explicit jar name or use an asterix wildcard for
- * all jars in a folder, or a double asterix '**' for all jars in a folder and its subfolders
- * @throws URISyntaxException
- */
- private static Set<URL> getJARs(String classpathValue, Properties launcherProperties) throws URISyntaxException {
- Set<URL> jarURLs = new HashSet<URL>();
-
- if (classpathValue.endsWith("**")) {
- File folder = new File(classpathValue.substring(0, classpathValue.length()-2));
- if (!folder.isAbsolute()) {
- folder = new File(getLauncherFolder().getParent(), folder.getName());
- }
- jarURLs.addAll(getFolderJars(folder));
- jarURLs.addAll(getSubFolderJars(folder));
- } else if (classpathValue.endsWith("*")) {
- File folder = new File(classpathValue.substring(0, classpathValue.length()-1));
- if (!folder.isAbsolute()) {
- folder = new File(getLauncherFolder(), folder.getName());
- }
- jarURLs.addAll(getFolderJars(folder));
- } else {
- File f = new File(classpathValue);
- if (!f.isAbsolute()) {
- f = new File(getLauncherFolder(), classpathValue);
- }
- try {
- jarURLs.add(f.toURI().toURL());
- } catch (MalformedURLException e) {
- throw new RuntimeException("Exception getting JAR URL", e);
- }
- }
- return jarURLs;
- }
-
- /**
- * Gets all the jars in a folder
- */
- private static Set<URL> getFolderJars(File folder) {
- Set<URL> jarURLs = new HashSet<URL>();
- if (folder.exists() && folder.isDirectory()) {
- File[] files = folder.listFiles(new FilenameFilter(){
- public boolean accept(File dir, String name) {
- return name.endsWith(".jar");
- }});
- for (File f : files) {
- try {
- jarURLs.add(f.toURI().toURL());
- } catch (MalformedURLException e) {
- throw new RuntimeException("Exception getting JAR URL", e);
- }
- }
- }
- return jarURLs;
- }
-
- /**
- * Recursively gets all the jars in a folder and its subfolders
- */
- private static Set<URL> getSubFolderJars(File folder) {
- Set<URL> jarURLs = new HashSet<URL>();
- if (folder.exists() && folder.isDirectory()) {
- File[] files = folder.listFiles(new FileFilter(){
- public boolean accept(File pathname) {
- return pathname.isDirectory();
- }});
- for (File f : files) {
- jarURLs.addAll(getFolderJars(f));
- jarURLs.addAll(getSubFolderJars(f));
- }
- }
- return jarURLs;
- }
-
- /**
- * Read the config properties for this launcher invocation
- * (Either default.config or the 1st cmd line argument suffixed with ".config" if that file exists
- */
- private static Properties getLauncherProperties(String[] args) throws URISyntaxException, FileNotFoundException {
-
- Properties properties = new Properties();
-
- File f;
- if (args.length > 0) {
- f = new File(getLauncherFolder(), args[0] + ".config");
- if (f.exists()) {
- String[] args2 = new String[args.length-1];
- System.arraycopy(args, 1, args2, 0, args.length-1);
- args = args2;
- } else {
- f = new File(getLauncherFolder(), DEFAULT_PROPERTY_FILENAME);
- }
- } else {
- f = new File(getLauncherFolder(), DEFAULT_PROPERTY_FILENAME);
- }
-
- if (!f.exists()) {
- throw new FileNotFoundException(f.getName());
- }
-
- try {
- FileInputStream fis = new FileInputStream(f);
- properties.load(fis);
- fis.close();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
-
- properties.put(LAUNCHER_ARGS, args);
-
- return properties;
- }
-
- /**
- * Find the folder that contains the launcher jar
- */
- private static File getLauncherFolder() throws URISyntaxException {
-
- File folder = null;
-
- String resource = LauncherMain.class.getName().replace('.', '/') + ".class";
- URL url = LauncherMain.class.getClassLoader().getResource(resource);
- if (url != null) {
- URI uri = url.toURI();
- String scheme = uri.getScheme();
- if (uri.getScheme().equals("jar")) {
- String path = uri.toString().substring(4);
- int i = path.indexOf("!/");
- if (i != -1) {
- path = path.substring(0, i);
- uri = URI.create(path);
- }
-
- File file = new File(uri);
- if (file.exists()) {
- File jarDirectory = file.getParentFile();
- if (jarDirectory != null && jarDirectory.exists()) {
- folder = file;
- }
- }
- }
- }
- folder = folder.getParentFile();
- return folder;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.launcher;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+import java.util.jar.JarFile;
+
+public class LauncherMain {
+
+ private static final String DEFAULT_PROPERTY_FILENAME = "default.config";
+ private static final String CONFIG_CLASSPATH = "classpath";
+ private static final String CONFIG_MAIN_CLASS = "mainClass";
+ private static final String CONFIG_ARG_JAR_MAIN = "[firstArgJarManifestMainClass]";
+ private static final String LAUNCHER_ARGS = "launcherArgs";
+
+ public static void main(String[] args) throws SecurityException, IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, URISyntaxException, IOException {
+ Properties launcherProperties = getLauncherProperties(args);
+ setSystemProperties(launcherProperties);
+ ClassLoader classLoader = getClassLoader(launcherProperties);
+ String mainClassName = getMainClass(launcherProperties, classLoader);
+ String[] mainArgs = getMainArgs(launcherProperties);
+ invokeMainMethod(mainClassName, classLoader, mainArgs);
+ }
+
+ private static void setSystemProperties(Properties launcherProperties) throws URISyntaxException {
+ for (Enumeration<?> e = launcherProperties.propertyNames(); e.hasMoreElements();) {
+ String pn = (String) e.nextElement();
+ if (pn.startsWith("-D")) {
+ System.setProperty(pn.substring(2), keywordExpand(launcherProperties.getProperty(pn)));
+ }
+ }
+ }
+
+ private static String keywordExpand(String property) throws URISyntaxException {
+ if (property.contains("{TUSCANY_HOME}")) {
+ property = property.replace("{TUSCANY_HOME}", getLauncherFolder().getParentFile().getAbsolutePath());
+ }
+ return property;
+ }
+
+ private static String[] getMainArgs(Properties launcherProperties) {
+ String[] mainArgs = (String[])launcherProperties.get(LAUNCHER_ARGS);
+ if (mainArgs == null) {
+ mainArgs = new String[0];
+ }
+ return mainArgs;
+ }
+
+ private static String getMainClass(Properties launcherProperties, ClassLoader classLoader) {
+ String mainClassName;
+ String[] args = getMainArgs(launcherProperties);
+ if (args.length > 0) {
+ try {
+ Class.forName(args[0], true, classLoader);
+ mainClassName = args[0];
+ String[] args2 = new String[args.length-1];
+ System.arraycopy(args, 1, args2, 0, args.length-1);
+ launcherProperties.put(LAUNCHER_ARGS, args2);
+ } catch (ClassNotFoundException e) {
+ mainClassName = launcherProperties.getProperty(CONFIG_MAIN_CLASS);
+ }
+ } else {
+ mainClassName = launcherProperties.getProperty(CONFIG_MAIN_CLASS);
+ }
+
+ if (mainClassName.startsWith(CONFIG_ARG_JAR_MAIN + "|")) {
+ mainClassName = mainClassName.substring(CONFIG_ARG_JAR_MAIN.length()+1);
+ }
+
+ return mainClassName;
+ }
+
+ private static void invokeMainMethod(String className, ClassLoader classLoader, String[] args) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
+ ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+ try {
+
+ Thread.currentThread().setContextClassLoader(classLoader);
+ Class mainClass = Class.forName(className, true, classLoader);
+ Method m = mainClass.getMethod("main", new Class[]{ args.getClass() });
+
+ m.invoke(null, new Object[]{args});
+
+ } finally {
+ Thread.currentThread().setContextClassLoader(tccl);
+ }
+ }
+
+ private static ClassLoader getClassLoader(Properties launcherProperties) throws URISyntaxException, IOException {
+ Set<URL> jarURLs = new HashSet<URL>();
+ for (Enumeration<?> e = launcherProperties.propertyNames(); e.hasMoreElements();) {
+ String pn = (String) e.nextElement();
+ if (pn.startsWith(CONFIG_CLASSPATH)) {
+ jarURLs.addAll(getJARs(launcherProperties.getProperty(pn), launcherProperties));
+ } else if (pn.equals(CONFIG_MAIN_CLASS) && launcherProperties.getProperty(pn).startsWith(CONFIG_ARG_JAR_MAIN)) {
+ if (firstArgJarHasManifestMainClass(launcherProperties)) {
+ jarURLs.add(firstArgJarManifestMainClass(launcherProperties));
+ }
+ }
+ }
+ ClassLoader parentCL = Thread.currentThread().getContextClassLoader();
+ if (parentCL == null) {
+ parentCL = LauncherMain.class.getClassLoader();
+ }
+ return new URLClassLoader(jarURLs.toArray(new URL[]{}), parentCL);
+ }
+
+ private static URL firstArgJarManifestMainClass(Properties launcherProperties) throws IOException {
+ String[] args = (String[])launcherProperties.get(LAUNCHER_ARGS);
+ if (args.length < 1) {
+ throw new IllegalArgumentException("must specifiy a jar file");
+ }
+ File f = new File(args[0]);
+ if (!f.exists()) {
+ throw new FileNotFoundException(args[0]);
+ }
+ JarFile jar = new JarFile(f);
+ String mfc = jar.getManifest().getMainAttributes().getValue("Main-Class");
+ if (mfc == null || mfc.length() < 1) {
+ throw new IllegalArgumentException("first jar file missing manifest Main-Class attribute");
+ }
+ launcherProperties.setProperty(CONFIG_MAIN_CLASS, mfc);
+
+ return f.toURL();
+ }
+
+ private static boolean firstArgJarHasManifestMainClass(Properties launcherProperties) throws IOException {
+ String[] args = (String[])launcherProperties.get(LAUNCHER_ARGS);
+ if (args.length < 1) {
+ return false;
+ }
+ File f = new File(args[0]);
+ if (!f.exists() || f.isDirectory()) {
+ return false;
+ }
+ JarFile jar = new JarFile(f);
+ String mfc = jar.getManifest().getMainAttributes().getValue("Main-Class");
+ return mfc != null && mfc.length() > 0;
+ }
+ /**
+ * Gets the jars matching a config classpath property
+ * property values may be an explicit jar name or use an asterix wildcard for
+ * all jars in a folder, or a double asterix '**' for all jars in a folder and its subfolders
+ * @throws URISyntaxException
+ */
+ private static Set<URL> getJARs(String classpathValue, Properties launcherProperties) throws URISyntaxException {
+ Set<URL> jarURLs = new HashSet<URL>();
+
+ if (classpathValue.endsWith("**")) {
+ File folder = new File(classpathValue.substring(0, classpathValue.length()-2));
+ if (!folder.isAbsolute()) {
+ folder = new File(getLauncherFolder().getParent(), folder.getName());
+ }
+ jarURLs.addAll(getFolderJars(folder));
+ jarURLs.addAll(getSubFolderJars(folder));
+ } else if (classpathValue.endsWith("*")) {
+ File folder = new File(classpathValue.substring(0, classpathValue.length()-1));
+ if (!folder.isAbsolute()) {
+ folder = new File(getLauncherFolder(), folder.getName());
+ }
+ jarURLs.addAll(getFolderJars(folder));
+ } else {
+ File f = new File(classpathValue);
+ if (!f.isAbsolute()) {
+ f = new File(getLauncherFolder(), classpathValue);
+ }
+ try {
+ jarURLs.add(f.toURI().toURL());
+ } catch (MalformedURLException e) {
+ throw new RuntimeException("Exception getting JAR URL", e);
+ }
+ }
+ return jarURLs;
+ }
+
+ /**
+ * Gets all the jars in a folder
+ */
+ private static Set<URL> getFolderJars(File folder) {
+ Set<URL> jarURLs = new HashSet<URL>();
+ if (folder.exists() && folder.isDirectory()) {
+ File[] files = folder.listFiles(new FilenameFilter(){
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".jar");
+ }});
+ for (File f : files) {
+ try {
+ jarURLs.add(f.toURI().toURL());
+ } catch (MalformedURLException e) {
+ throw new RuntimeException("Exception getting JAR URL", e);
+ }
+ }
+ }
+ return jarURLs;
+ }
+
+ /**
+ * Recursively gets all the jars in a folder and its subfolders
+ */
+ private static Set<URL> getSubFolderJars(File folder) {
+ Set<URL> jarURLs = new HashSet<URL>();
+ if (folder.exists() && folder.isDirectory()) {
+ File[] files = folder.listFiles(new FileFilter(){
+ public boolean accept(File pathname) {
+ return pathname.isDirectory();
+ }});
+ for (File f : files) {
+ jarURLs.addAll(getFolderJars(f));
+ jarURLs.addAll(getSubFolderJars(f));
+ }
+ }
+ return jarURLs;
+ }
+
+ /**
+ * Read the config properties for this launcher invocation
+ * (Either default.config or the 1st cmd line argument suffixed with ".config" if that file exists
+ */
+ private static Properties getLauncherProperties(String[] args) throws URISyntaxException, FileNotFoundException {
+
+ Properties properties = new Properties();
+
+ File f;
+ if (args.length > 0) {
+ f = new File(getLauncherFolder(), args[0] + ".config");
+ if (f.exists()) {
+ String[] args2 = new String[args.length-1];
+ System.arraycopy(args, 1, args2, 0, args.length-1);
+ args = args2;
+ } else {
+ f = new File(getLauncherFolder(), DEFAULT_PROPERTY_FILENAME);
+ }
+ } else {
+ f = new File(getLauncherFolder(), DEFAULT_PROPERTY_FILENAME);
+ }
+
+ if (!f.exists()) {
+ throw new FileNotFoundException(f.getName());
+ }
+
+ try {
+ FileInputStream fis = new FileInputStream(f);
+ properties.load(fis);
+ fis.close();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+
+ properties.put(LAUNCHER_ARGS, args);
+
+ return properties;
+ }
+
+ /**
+ * Find the folder that contains the launcher jar
+ */
+ private static File getLauncherFolder() throws URISyntaxException {
+
+ File folder = null;
+
+ String resource = LauncherMain.class.getName().replace('.', '/') + ".class";
+ URL url = LauncherMain.class.getClassLoader().getResource(resource);
+ if (url != null) {
+ URI uri = url.toURI();
+ String scheme = uri.getScheme();
+ if (uri.getScheme().equals("jar")) {
+ String path = uri.toString().substring(4);
+ int i = path.indexOf("!/");
+ if (i != -1) {
+ path = path.substring(0, i);
+ uri = URI.create(path);
+ }
+
+ File file = new File(uri);
+ if (file.exists()) {
+ File jarDirectory = file.getParentFile();
+ if (jarDirectory != null && jarDirectory.exists()) {
+ folder = file;
+ }
+ }
+ }
+ }
+ folder = folder.getParentFile();
+ return folder;
+ }
+}
diff --git a/java/sca/modules/myfaces/pom.xml b/java/sca/modules/myfaces/pom.xml
index c911016783..9e6f742ce3 100644
--- a/java/sca/modules/myfaces/pom.xml
+++ b/java/sca/modules/myfaces/pom.xml
@@ -1,76 +1,76 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-myfaces</artifactId>
- <name>Apache Tuscany SCA MyFaces JSF Integration</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-webapp</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.myfaces.core</groupId>
- <artifactId>myfaces-api</artifactId>
- <version>1.2.2</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.myfaces.core</groupId>
- <artifactId>myfaces-impl</artifactId>
- <version>1.2.2</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <version>1.1.2</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-myfaces</artifactId>
+ <name>Apache Tuscany SCA MyFaces JSF Integration</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-webapp</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>1.2.2</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>1.2.2</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.1.2</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/myfaces/src/main/java/org/apache/tuscany/sca/myfaces/TuscanyAnnotationLifecycleProvider.java b/java/sca/modules/myfaces/src/main/java/org/apache/tuscany/sca/myfaces/TuscanyAnnotationLifecycleProvider.java
index 1ab88d722f..b1ef8eb3ed 100644
--- a/java/sca/modules/myfaces/src/main/java/org/apache/tuscany/sca/myfaces/TuscanyAnnotationLifecycleProvider.java
+++ b/java/sca/modules/myfaces/src/main/java/org/apache/tuscany/sca/myfaces/TuscanyAnnotationLifecycleProvider.java
@@ -1,69 +1,69 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.myfaces;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.logging.Logger;
-
-import javax.faces.context.ExternalContext;
-import javax.naming.NamingException;
-import javax.servlet.ServletContext;
-
-import org.apache.myfaces.config.annotation.DiscoverableLifecycleProvider;
-import org.apache.myfaces.shared_impl.util.ClassUtils;
-
-public class TuscanyAnnotationLifecycleProvider implements DiscoverableLifecycleProvider {
- private static final Logger logger = Logger.getLogger(TuscanyAnnotationLifecycleProvider.class.getName());
-
- private TuscanyAnnotationProcessor annotationProcessor;
- private ServletContext servletContext;
-
-
- public TuscanyAnnotationLifecycleProvider(ExternalContext externalContext) {
- this.servletContext = (ServletContext)externalContext.getContext();
-
- // TODO: Should this use any existing AnnotationProcessor?
- // Tomcat based runtimes may use an org.apache.AnnotationProcessor which
- // if exists this could delegate to so as to support both SCA and other annotations
- // AnnotationProcessor existingAnnotationProcessor = (AnnotationProcessor)
- // servletContext.getAttribute(org.apache.AnnotationProcessor.class.getName());
- // annotationProcessor = new TuscanyAnnotationProcessor(existingAnnotationProcessor);
- annotationProcessor = new TuscanyAnnotationProcessor();
- }
-
- public Object newInstance(String className) throws InstantiationException, IllegalAccessException, InvocationTargetException, NamingException, ClassNotFoundException {
- logger.info("Creating instance of " + className);
- Class<?> clazz = ClassUtils.classForName(className);
- Object object = clazz.newInstance();
- annotationProcessor.processAnnotations(object, servletContext);
- annotationProcessor.postConstruct(object);
- return object;
- }
-
- public boolean isAvailable() {
- return true;
- }
-
- public void destroyInstance(Object o) throws IllegalAccessException, InvocationTargetException {
- logger.info("Destroy instance of " + o.getClass().getName());
- annotationProcessor.preDestroy(o);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.myfaces;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.logging.Logger;
+
+import javax.faces.context.ExternalContext;
+import javax.naming.NamingException;
+import javax.servlet.ServletContext;
+
+import org.apache.myfaces.config.annotation.DiscoverableLifecycleProvider;
+import org.apache.myfaces.shared_impl.util.ClassUtils;
+
+public class TuscanyAnnotationLifecycleProvider implements DiscoverableLifecycleProvider {
+ private static final Logger logger = Logger.getLogger(TuscanyAnnotationLifecycleProvider.class.getName());
+
+ private TuscanyAnnotationProcessor annotationProcessor;
+ private ServletContext servletContext;
+
+
+ public TuscanyAnnotationLifecycleProvider(ExternalContext externalContext) {
+ this.servletContext = (ServletContext)externalContext.getContext();
+
+ // TODO: Should this use any existing AnnotationProcessor?
+ // Tomcat based runtimes may use an org.apache.AnnotationProcessor which
+ // if exists this could delegate to so as to support both SCA and other annotations
+ // AnnotationProcessor existingAnnotationProcessor = (AnnotationProcessor)
+ // servletContext.getAttribute(org.apache.AnnotationProcessor.class.getName());
+ // annotationProcessor = new TuscanyAnnotationProcessor(existingAnnotationProcessor);
+ annotationProcessor = new TuscanyAnnotationProcessor();
+ }
+
+ public Object newInstance(String className) throws InstantiationException, IllegalAccessException, InvocationTargetException, NamingException, ClassNotFoundException {
+ logger.info("Creating instance of " + className);
+ Class<?> clazz = ClassUtils.classForName(className);
+ Object object = clazz.newInstance();
+ annotationProcessor.processAnnotations(object, servletContext);
+ annotationProcessor.postConstruct(object);
+ return object;
+ }
+
+ public boolean isAvailable() {
+ return true;
+ }
+
+ public void destroyInstance(Object o) throws IllegalAccessException, InvocationTargetException {
+ logger.info("Destroy instance of " + o.getClass().getName());
+ annotationProcessor.preDestroy(o);
+ }
+
+}
diff --git a/java/sca/modules/myfaces/src/main/java/org/apache/tuscany/sca/myfaces/TuscanyAnnotationProcessor.java b/java/sca/modules/myfaces/src/main/java/org/apache/tuscany/sca/myfaces/TuscanyAnnotationProcessor.java
index aef91bdccb..4a05fa5856 100644
--- a/java/sca/modules/myfaces/src/main/java/org/apache/tuscany/sca/myfaces/TuscanyAnnotationProcessor.java
+++ b/java/sca/modules/myfaces/src/main/java/org/apache/tuscany/sca/myfaces/TuscanyAnnotationProcessor.java
@@ -1,53 +1,53 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.myfaces;
-
-import java.lang.reflect.InvocationTargetException;
-
-import javax.naming.NamingException;
-import javax.servlet.ServletContext;
-
-import org.apache.tuscany.sca.implementation.web.runtime.utils.ContextHelper;
-
-//public class TuscanyAnnotationProcessor implements org.apache.AnnotationProcessor {
-public class TuscanyAnnotationProcessor {
-
-// private AnnotationProcessor annotationProcessor;
-
- public TuscanyAnnotationProcessor() {
- }
-
- public void postConstruct(Object arg0) throws IllegalAccessException, InvocationTargetException {
-// annotationProcessor.postConstruct(arg0);
- }
-
- public void preDestroy(Object arg0) throws IllegalAccessException, InvocationTargetException {
-// annotationProcessor.preDestroy(arg0);
- }
-
- public void processAnnotations(Object arg0, ServletContext servletContext) throws IllegalAccessException, InvocationTargetException, NamingException {
- ContextHelper.inject(arg0, servletContext);
-// annotationProcessor.processAnnotations(arg0);
- }
-
- public void processAnnotations(Object arg0) throws IllegalAccessException, InvocationTargetException, NamingException {
-// annotationProcessor.processAnnotations(arg0);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.myfaces;
+
+import java.lang.reflect.InvocationTargetException;
+
+import javax.naming.NamingException;
+import javax.servlet.ServletContext;
+
+import org.apache.tuscany.sca.implementation.web.runtime.utils.ContextHelper;
+
+//public class TuscanyAnnotationProcessor implements org.apache.AnnotationProcessor {
+public class TuscanyAnnotationProcessor {
+
+// private AnnotationProcessor annotationProcessor;
+
+ public TuscanyAnnotationProcessor() {
+ }
+
+ public void postConstruct(Object arg0) throws IllegalAccessException, InvocationTargetException {
+// annotationProcessor.postConstruct(arg0);
+ }
+
+ public void preDestroy(Object arg0) throws IllegalAccessException, InvocationTargetException {
+// annotationProcessor.preDestroy(arg0);
+ }
+
+ public void processAnnotations(Object arg0, ServletContext servletContext) throws IllegalAccessException, InvocationTargetException, NamingException {
+ ContextHelper.inject(arg0, servletContext);
+// annotationProcessor.processAnnotations(arg0);
+ }
+
+ public void processAnnotations(Object arg0) throws IllegalAccessException, InvocationTargetException, NamingException {
+// annotationProcessor.processAnnotations(arg0);
+ }
+}
diff --git a/java/sca/modules/node-api/pom.xml b/java/sca/modules/node-api/pom.xml
index 050c187484..2de9c088a6 100644
--- a/java/sca/modules/node-api/pom.xml
+++ b/java/sca/modules/node-api/pom.xml
@@ -1,41 +1,41 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-node-api</artifactId>
- <name>Apache Tuscany SCA Node API</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-node-api</artifactId>
+ <name>Apache Tuscany SCA Node API</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFinder.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFinder.java
index 27926a0115..53b2bca3f9 100644
--- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFinder.java
+++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeFinder.java
@@ -1,58 +1,58 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class NodeFinder {
-
- private static Map<URI, List<Node>> nodes = new HashMap<URI, List<Node>>();
-
- public static void addNode(URI domainName, Node node) {
- List<Node> domainNodes = nodes.get(domainName);
- if (domainNodes == null) {
- domainNodes = new ArrayList<Node>();
- }
- domainNodes.add(node);
- nodes.put(domainName, domainNodes);
- }
-
- public static Node removeNode(Node node) {
- for (List<Node> domainNodes : nodes.values()) {
- if (domainNodes.contains(node)) {
- domainNodes.remove(node);
- if (domainNodes.size() < 1) {
- nodes.remove(domainNodes);
- }
- return node;
- }
- }
- return null;
- }
-
- public static List<Node> getNodes(URI domainURI) {
- return nodes.get(domainURI);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class NodeFinder {
+
+ private static Map<URI, List<Node>> nodes = new HashMap<URI, List<Node>>();
+
+ public static void addNode(URI domainName, Node node) {
+ List<Node> domainNodes = nodes.get(domainName);
+ if (domainNodes == null) {
+ domainNodes = new ArrayList<Node>();
+ }
+ domainNodes.add(node);
+ nodes.put(domainName, domainNodes);
+ }
+
+ public static Node removeNode(Node node) {
+ for (List<Node> domainNodes : nodes.values()) {
+ if (domainNodes.contains(node)) {
+ domainNodes.remove(node);
+ if (domainNodes.size() < 1) {
+ nodes.remove(domainNodes);
+ }
+ return node;
+ }
+ }
+ return null;
+ }
+
+ public static List<Node> getNodes(URI domainURI) {
+ return nodes.get(domainURI);
+ }
+
+}
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeMain2.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeMain2.java
index 9bbf77a2a9..6ffdde2634 100644
--- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeMain2.java
+++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/NodeMain2.java
@@ -1,56 +1,56 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node;
-
-import java.io.File;
-
-public class NodeMain2 {
-
- /**
- * Start an SCA node
- * @param args a list of contribution jars for the node to run
- */
- public static void main(String[] args) throws Exception {
-
- Contribution[] contributions = new Contribution[args.length];
- for (int i = 0; i < args.length; i++) {
- File f = new File(args[i]);
- if (!f.exists()) {
- System.err.println("contribution not found: " + f);
- System.exit(1);
- }
- contributions[i] = new Contribution(f.toURI().toString(), f.toURI().toString());
- }
-
- Node node = NodeFactory.newInstance().createNode(contributions).start();
-
- System.out.println("Hit enter to stop node...");
- if (System.in.read() == -1) {
- // no sysin so wait for ever letting caller do the terminate
- Object lock = new Object();
- synchronized (lock) {
- lock.wait();
- }
- }
-
- node.stop();
- node.destroy();
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node;
+
+import java.io.File;
+
+public class NodeMain2 {
+
+ /**
+ * Start an SCA node
+ * @param args a list of contribution jars for the node to run
+ */
+ public static void main(String[] args) throws Exception {
+
+ Contribution[] contributions = new Contribution[args.length];
+ for (int i = 0; i < args.length; i++) {
+ File f = new File(args[i]);
+ if (!f.exists()) {
+ System.err.println("contribution not found: " + f);
+ System.exit(1);
+ }
+ contributions[i] = new Contribution(f.toURI().toString(), f.toURI().toString());
+ }
+
+ Node node = NodeFactory.newInstance().createNode(contributions).start();
+
+ System.out.println("Hit enter to stop node...");
+ if (System.in.read() == -1) {
+ // no sysin so wait for ever letting caller do the terminate
+ Object lock = new Object();
+ synchronized (lock) {
+ lock.wait();
+ }
+ }
+
+ node.stop();
+ node.destroy();
+ }
+}
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/BindingConfiguration.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/BindingConfiguration.java
index f3be7c5c35..a6dab059a3 100644
--- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/BindingConfiguration.java
+++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/BindingConfiguration.java
@@ -1,55 +1,55 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.configuration;
-
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-/**
- * Configuration for bindings used by an SCA node
- */
-public interface BindingConfiguration {
- /**
- * Get the QName of the binding type
- * @return the QName of the binding type
- */
- QName getBindingType();
-
- /**
- * Set the type of the binding
- * @param type The QName of the binding type
- */
- BindingConfiguration setBindingType(QName type);
-
- /**
- * Get a list of base URIs for the binding. For each protocol supported by the binding,
- * one base URI can be configured
- * @return A list of base URIs
- */
- List<String> getBaseURIs();
-
- /**
- * Add a base URI
- * @param baseURI
- * @return
- */
- BindingConfiguration addBaseURI(String baseURI);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Configuration for bindings used by an SCA node
+ */
+public interface BindingConfiguration {
+ /**
+ * Get the QName of the binding type
+ * @return the QName of the binding type
+ */
+ QName getBindingType();
+
+ /**
+ * Set the type of the binding
+ * @param type The QName of the binding type
+ */
+ BindingConfiguration setBindingType(QName type);
+
+ /**
+ * Get a list of base URIs for the binding. For each protocol supported by the binding,
+ * one base URI can be configured
+ * @return A list of base URIs
+ */
+ List<String> getBaseURIs();
+
+ /**
+ * Add a base URI
+ * @param baseURI
+ * @return
+ */
+ BindingConfiguration addBaseURI(String baseURI);
+}
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java
index 3e9946fe80..05c718dbd0 100644
--- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java
+++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java
@@ -1,102 +1,102 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.configuration;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.net.URI;
-import java.net.URL;
-import java.util.List;
-
-/**
- * Configuration for an SCA contribution used by the SCA node
- */
-public interface ContributionConfiguration {
- /**
- * Get the URI of the contribution
- * @return The URI of the contribution
- */
- String getURI();
-
- /**
- * Set the URI of the contribution
- * @param uri The URI of the contribution
- */
- ContributionConfiguration setURI(String uri);
-
- /**
- * Get the location of the contribution
- * @return The location of the contribution
- */
- String getLocation();
-
- /**
- * Set the location of the contribution
- * @param location The location of the contribution
- */
- ContributionConfiguration setLocation(String location);
-
- /**
- * Get the list of deployment composites that are attached to the contribution
- * @return A list of deployment composites
- */
- List<DeploymentComposite> getDeploymentComposites();
-
- /**
- * Add a deployment composite to this contribution
- * @param deploymentComposite The deployment composite
- * @return
- */
- ContributionConfiguration addDeploymentComposite(DeploymentComposite deploymentComposite);
-
- /**
- * Create a deployment composite and add it to the contribution configuration
- * @param location The location is either relative to the contribution or
- * @return
- */
- ContributionConfiguration addDeploymentComposite(URI location);
-
- /**
- * Attach a deployment composite to this contribution
- * @param location
- * @return
- */
- ContributionConfiguration addDeploymentComposite(URL location);
-
- /**
- * Attach a deployment composite to this contribution
- * @param content The string that contains the XML description of the SCA composite
- * @return
- */
- ContributionConfiguration addDeploymentComposite(String content);
-
- /**
- * Attach a deployment composite to this contribution
- * @param content The XML description of the SCA composite from a reader
- * @return
- */
- ContributionConfiguration addDeploymentComposite(Reader content);
- /**
- * Attach a deployment composite to this contribution
- * @param content The XML description of the SCA composite from an input stream
- * @return
- */
- ContributionConfiguration addDeploymentComposite(InputStream content);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+
+/**
+ * Configuration for an SCA contribution used by the SCA node
+ */
+public interface ContributionConfiguration {
+ /**
+ * Get the URI of the contribution
+ * @return The URI of the contribution
+ */
+ String getURI();
+
+ /**
+ * Set the URI of the contribution
+ * @param uri The URI of the contribution
+ */
+ ContributionConfiguration setURI(String uri);
+
+ /**
+ * Get the location of the contribution
+ * @return The location of the contribution
+ */
+ String getLocation();
+
+ /**
+ * Set the location of the contribution
+ * @param location The location of the contribution
+ */
+ ContributionConfiguration setLocation(String location);
+
+ /**
+ * Get the list of deployment composites that are attached to the contribution
+ * @return A list of deployment composites
+ */
+ List<DeploymentComposite> getDeploymentComposites();
+
+ /**
+ * Add a deployment composite to this contribution
+ * @param deploymentComposite The deployment composite
+ * @return
+ */
+ ContributionConfiguration addDeploymentComposite(DeploymentComposite deploymentComposite);
+
+ /**
+ * Create a deployment composite and add it to the contribution configuration
+ * @param location The location is either relative to the contribution or
+ * @return
+ */
+ ContributionConfiguration addDeploymentComposite(URI location);
+
+ /**
+ * Attach a deployment composite to this contribution
+ * @param location
+ * @return
+ */
+ ContributionConfiguration addDeploymentComposite(URL location);
+
+ /**
+ * Attach a deployment composite to this contribution
+ * @param content The string that contains the XML description of the SCA composite
+ * @return
+ */
+ ContributionConfiguration addDeploymentComposite(String content);
+
+ /**
+ * Attach a deployment composite to this contribution
+ * @param content The XML description of the SCA composite from a reader
+ * @return
+ */
+ ContributionConfiguration addDeploymentComposite(Reader content);
+ /**
+ * Attach a deployment composite to this contribution
+ * @param content The XML description of the SCA composite from an input stream
+ * @return
+ */
+ ContributionConfiguration addDeploymentComposite(InputStream content);
+}
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/DefaultNodeConfigurationFactory.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/DefaultNodeConfigurationFactory.java
index 8bc4b7d493..a23cef7e81 100644
--- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/DefaultNodeConfigurationFactory.java
+++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/DefaultNodeConfigurationFactory.java
@@ -1,46 +1,46 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.configuration;
-
-import org.apache.tuscany.sca.node.configuration.impl.NodeConfigurationFactoryImpl;
-
-/**
- * Default NodeConfigurationFactory
- */
-public class DefaultNodeConfigurationFactory implements NodeConfigurationFactory {
- private NodeConfigurationFactory factory = new NodeConfigurationFactoryImpl();
-
- public BindingConfiguration createBindingConfiguration() {
- return factory.createBindingConfiguration();
- }
-
- public ContributionConfiguration createContributionConfiguration() {
- return factory.createContributionConfiguration();
- }
-
- public DeploymentComposite createDeploymentComposite() {
- return factory.createDeploymentComposite();
- }
-
- public NodeConfiguration createNodeConfiguration() {
- return factory.createNodeConfiguration();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration;
+
+import org.apache.tuscany.sca.node.configuration.impl.NodeConfigurationFactoryImpl;
+
+/**
+ * Default NodeConfigurationFactory
+ */
+public class DefaultNodeConfigurationFactory implements NodeConfigurationFactory {
+ private NodeConfigurationFactory factory = new NodeConfigurationFactoryImpl();
+
+ public BindingConfiguration createBindingConfiguration() {
+ return factory.createBindingConfiguration();
+ }
+
+ public ContributionConfiguration createContributionConfiguration() {
+ return factory.createContributionConfiguration();
+ }
+
+ public DeploymentComposite createDeploymentComposite() {
+ return factory.createDeploymentComposite();
+ }
+
+ public NodeConfiguration createNodeConfiguration() {
+ return factory.createNodeConfiguration();
+ }
+
+}
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/DeploymentComposite.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/DeploymentComposite.java
index 65337abdfb..18fecf8044 100644
--- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/DeploymentComposite.java
+++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/DeploymentComposite.java
@@ -1,64 +1,64 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.configuration;
-
-
-/**
- * Configuration for a deployment composite
- */
-public interface DeploymentComposite {
- /**
- * Get the location of the deployment composite, it can be relative to the owning
- * contribution or an external resource
- * @return
- */
- String getLocation();
-
- /**
- * Set the location of the deployment composite
- * @param location
- */
- DeploymentComposite setLocation(String location);
-
- /**
- * Get string content of the deployment composite (XML)
- * @return
- */
- String getContent();
-
- /**
- * Set the XML content for the composite
- * @param compositeXML
- */
- DeploymentComposite setContent(String compositeXML);
-
- /**
- * Get the URI of the contribution that the deployment composite is attached to
- * @return the URI of the contribution that the deployment composite is attached to
- */
- String getContributionURI();
-
- /**
- * Set the URI of the contribution that the deployment composite is attached to
- * @param contributionURI
- */
- DeploymentComposite setContributionURI(String contributionURI);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration;
+
+
+/**
+ * Configuration for a deployment composite
+ */
+public interface DeploymentComposite {
+ /**
+ * Get the location of the deployment composite, it can be relative to the owning
+ * contribution or an external resource
+ * @return
+ */
+ String getLocation();
+
+ /**
+ * Set the location of the deployment composite
+ * @param location
+ */
+ DeploymentComposite setLocation(String location);
+
+ /**
+ * Get string content of the deployment composite (XML)
+ * @return
+ */
+ String getContent();
+
+ /**
+ * Set the XML content for the composite
+ * @param compositeXML
+ */
+ DeploymentComposite setContent(String compositeXML);
+
+ /**
+ * Get the URI of the contribution that the deployment composite is attached to
+ * @return the URI of the contribution that the deployment composite is attached to
+ */
+ String getContributionURI();
+
+ /**
+ * Set the URI of the contribution that the deployment composite is attached to
+ * @param contributionURI
+ */
+ DeploymentComposite setContributionURI(String contributionURI);
+
+}
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java
index 221ef1cfab..ad46b33af0 100644
--- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java
+++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java
@@ -1,93 +1,93 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.configuration;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.net.URI;
-import java.net.URL;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-/**
- * The configuration for a Node which represents the deployment of an SCA composite application
- */
-public interface NodeConfiguration {
- String DEFAULT_DOMAIN_URI = "http://tuscany.apache.org/sca/1.1/domains/default";
- String DEFAULT_NODE_URI = "http://tuscany.apache.org/sca/1.1/nodes/default";
- /**
- * Get the URI of the SCA domain that manages the composite application
- * @return The URI of the SCA domain
- */
- String getDomainURI();
-
- /**
- * Get the name of the SCA domain
- * @return The name of the SCA domain
- */
- String getDomainName();
-
- /**
- * Set the URI of the SCA domain
- * @param domainURI The URI of the SCA domain
- */
- NodeConfiguration setDomainURI(String domainURI);
-
- /**
- * Get the URI of the node. It uniquely identifies a node within the SCA domain
- * @return The URI of the node
- */
- String getURI();
-
- /**
- * Set the URI of the node
- * @param uri The URI of the node
- */
- NodeConfiguration setURI(String uri);
-
- /**
- * Get a list of confiurations for SCA contributions
- * @return A list of configurations for SCA contributions
- */
- List<ContributionConfiguration> getContributions();
-
- /**
- * Get a list of configurations for SCA bindings
- * @return A list of configurations for SCA bindings
- */
- List<BindingConfiguration> getBindings();
-
- NodeConfiguration addContribution(ContributionConfiguration contribution);
- NodeConfiguration addContribution(String contributionURI, String location);
- NodeConfiguration addContribution(String contributionURI, URL location);
- NodeConfiguration addContribution(URI contributionURI, URL location);
- NodeConfiguration addContribution(URL...location);
-
- NodeConfiguration addDeploymentComposite(String contributionURI, String location);
- NodeConfiguration addDeploymentComposite(String contributionURI, Reader content);
- NodeConfiguration addDeploymentComposite(String contributionURI, InputStream content);
-
- NodeConfiguration addBinding(BindingConfiguration binding);
- NodeConfiguration addBinding(QName bindingType, String...baseURIs);
- NodeConfiguration addBinding(QName bindingType, URI...baseURIs);
-
- List<Object> getExtensions();
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.net.URI;
+import java.net.URL;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+/**
+ * The configuration for a Node which represents the deployment of an SCA composite application
+ */
+public interface NodeConfiguration {
+ String DEFAULT_DOMAIN_URI = "http://tuscany.apache.org/sca/1.1/domains/default";
+ String DEFAULT_NODE_URI = "http://tuscany.apache.org/sca/1.1/nodes/default";
+ /**
+ * Get the URI of the SCA domain that manages the composite application
+ * @return The URI of the SCA domain
+ */
+ String getDomainURI();
+
+ /**
+ * Get the name of the SCA domain
+ * @return The name of the SCA domain
+ */
+ String getDomainName();
+
+ /**
+ * Set the URI of the SCA domain
+ * @param domainURI The URI of the SCA domain
+ */
+ NodeConfiguration setDomainURI(String domainURI);
+
+ /**
+ * Get the URI of the node. It uniquely identifies a node within the SCA domain
+ * @return The URI of the node
+ */
+ String getURI();
+
+ /**
+ * Set the URI of the node
+ * @param uri The URI of the node
+ */
+ NodeConfiguration setURI(String uri);
+
+ /**
+ * Get a list of confiurations for SCA contributions
+ * @return A list of configurations for SCA contributions
+ */
+ List<ContributionConfiguration> getContributions();
+
+ /**
+ * Get a list of configurations for SCA bindings
+ * @return A list of configurations for SCA bindings
+ */
+ List<BindingConfiguration> getBindings();
+
+ NodeConfiguration addContribution(ContributionConfiguration contribution);
+ NodeConfiguration addContribution(String contributionURI, String location);
+ NodeConfiguration addContribution(String contributionURI, URL location);
+ NodeConfiguration addContribution(URI contributionURI, URL location);
+ NodeConfiguration addContribution(URL...location);
+
+ NodeConfiguration addDeploymentComposite(String contributionURI, String location);
+ NodeConfiguration addDeploymentComposite(String contributionURI, Reader content);
+ NodeConfiguration addDeploymentComposite(String contributionURI, InputStream content);
+
+ NodeConfiguration addBinding(BindingConfiguration binding);
+ NodeConfiguration addBinding(QName bindingType, String...baseURIs);
+ NodeConfiguration addBinding(QName bindingType, URI...baseURIs);
+
+ List<Object> getExtensions();
+}
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfigurationFactory.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfigurationFactory.java
index f03a895114..71833bc7e7 100644
--- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfigurationFactory.java
+++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfigurationFactory.java
@@ -1,50 +1,50 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.configuration;
-
-
-/**
- * The factory to create java models related to the node configuration
- */
-public interface NodeConfigurationFactory {
- /**
- * Create a new instance of NodeConfiguration
- * @return
- */
- NodeConfiguration createNodeConfiguration();
-
- /**
- * Create a new instance of ContributionConfiguration
- * @return
- */
- ContributionConfiguration createContributionConfiguration();
-
- /**
- * Create a new instance of BindingConfiguration
- * @return
- */
- BindingConfiguration createBindingConfiguration();
-
- /**
- * Create a new instance of DeploymentComposite
- * @return
- */
- DeploymentComposite createDeploymentComposite();
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration;
+
+
+/**
+ * The factory to create java models related to the node configuration
+ */
+public interface NodeConfigurationFactory {
+ /**
+ * Create a new instance of NodeConfiguration
+ * @return
+ */
+ NodeConfiguration createNodeConfiguration();
+
+ /**
+ * Create a new instance of ContributionConfiguration
+ * @return
+ */
+ ContributionConfiguration createContributionConfiguration();
+
+ /**
+ * Create a new instance of BindingConfiguration
+ * @return
+ */
+ BindingConfiguration createBindingConfiguration();
+
+ /**
+ * Create a new instance of DeploymentComposite
+ * @return
+ */
+ DeploymentComposite createDeploymentComposite();
+}
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/BindingConfigurationImpl.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/BindingConfigurationImpl.java
index 8fba4ee6a3..5658187c4f 100644
--- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/BindingConfigurationImpl.java
+++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/BindingConfigurationImpl.java
@@ -1,54 +1,54 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.configuration.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.node.configuration.BindingConfiguration;
-
-/**
- * Default implementation of BindingConfiguration
- */
-public class BindingConfigurationImpl implements BindingConfiguration {
- private QName type;
- private List<String> baseURIs = new ArrayList<String>();
-
- public List<String> getBaseURIs() {
- return baseURIs;
- }
-
- public QName getBindingType() {
- return type;
- }
-
- public BindingConfiguration setBindingType(QName type) {
- this.type = type;
- return this;
- }
-
- public BindingConfiguration addBaseURI(String baseURI) {
- baseURIs.add(baseURI);
- return this;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.node.configuration.BindingConfiguration;
+
+/**
+ * Default implementation of BindingConfiguration
+ */
+public class BindingConfigurationImpl implements BindingConfiguration {
+ private QName type;
+ private List<String> baseURIs = new ArrayList<String>();
+
+ public List<String> getBaseURIs() {
+ return baseURIs;
+ }
+
+ public QName getBindingType() {
+ return type;
+ }
+
+ public BindingConfiguration setBindingType(QName type) {
+ this.type = type;
+ return this;
+ }
+
+ public BindingConfiguration addBaseURI(String baseURI) {
+ baseURIs.add(baseURI);
+ return this;
+ }
+
+}
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/ContributionConfigurationImpl.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/ContributionConfigurationImpl.java
index b08a4e6cff..5229801731 100644
--- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/ContributionConfigurationImpl.java
+++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/ContributionConfigurationImpl.java
@@ -1,155 +1,155 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.configuration.impl;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.StringWriter;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tuscany.sca.node.configuration.ContributionConfiguration;
-import org.apache.tuscany.sca.node.configuration.DeploymentComposite;
-
-/**
- * Configuration for an SCA contribution used by the SCA node
- */
-public class ContributionConfigurationImpl implements ContributionConfiguration {
- private List<DeploymentComposite> deploymentComposites = new ArrayList<DeploymentComposite>();
- private String uri;
- private String location;
-
- public ContributionConfigurationImpl() {
- super();
- }
-
- public ContributionConfigurationImpl(String uri, String location) {
- super();
- this.uri = uri;
- this.location = location;
- }
-
- public ContributionConfigurationImpl(String location) {
- super();
- this.uri = location;
- this.location = location;
- }
-
- /**
- * Get the URI of the contribution
- * @return The URI of the contribution
- */
- public String getURI() {
- return uri;
- }
-
- /**
- * Set the URI of the contribution
- * @param uri The URI of the contribution
- */
- public ContributionConfiguration setURI(String uri) {
- this.uri = uri;
- return this;
- }
-
- /**
- * Get the location of the contribution
- * @return The location of the contribution
- */
- public String getLocation() {
- return location;
- }
-
- /**
- * Set the location of the contribution
- * @param location The location of the contribution
- */
- public ContributionConfiguration setLocation(String location) {
- this.location = location;
- return this;
- }
-
- /**
- * Get the list of deployment composites that are attached to the contribution
- * @return
- */
- public List<DeploymentComposite> getDeploymentComposites() {
- return deploymentComposites;
- }
-
- public ContributionConfiguration addDeploymentComposite(DeploymentComposite deploymentComposite) {
- deploymentComposites.add(deploymentComposite);
- if (uri != null) {
- deploymentComposite.setContributionURI(uri);
- }
- return this;
- }
-
- public ContributionConfiguration addDeploymentComposite(Reader reader) {
- try {
- DeploymentComposite composite = new DeploymentCompositeImpl();
- char[] buf = new char[8192];
- StringWriter sw = new StringWriter();
- int size = 0;
- while (size >= 0) {
- size = reader.read(buf);
- if (size > 0) {
- sw.write(buf, 0, size);
- }
- }
- reader.close();
- composite.setContent(sw.toString());
- return addDeploymentComposite(composite);
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- public ContributionConfiguration addDeploymentComposite(InputStream content) {
- try {
- InputStreamReader reader = new InputStreamReader(content, "UTF-8");
- return addDeploymentComposite(reader);
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
- }
- }
-
- public ContributionConfiguration addDeploymentComposite(String content) {
- DeploymentComposite composite = new DeploymentCompositeImpl();
- composite.setContent(content);
- return addDeploymentComposite(composite);
- }
-
- public ContributionConfiguration addDeploymentComposite(URI location) {
- DeploymentComposite composite = new DeploymentCompositeImpl();
- composite.setLocation(location.toString());
- return addDeploymentComposite(composite);
- }
-
- public ContributionConfiguration addDeploymentComposite(URL location) {
- DeploymentComposite composite = new DeploymentCompositeImpl();
- composite.setLocation(location.toString());
- return addDeploymentComposite(composite);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration.impl;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringWriter;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.sca.node.configuration.ContributionConfiguration;
+import org.apache.tuscany.sca.node.configuration.DeploymentComposite;
+
+/**
+ * Configuration for an SCA contribution used by the SCA node
+ */
+public class ContributionConfigurationImpl implements ContributionConfiguration {
+ private List<DeploymentComposite> deploymentComposites = new ArrayList<DeploymentComposite>();
+ private String uri;
+ private String location;
+
+ public ContributionConfigurationImpl() {
+ super();
+ }
+
+ public ContributionConfigurationImpl(String uri, String location) {
+ super();
+ this.uri = uri;
+ this.location = location;
+ }
+
+ public ContributionConfigurationImpl(String location) {
+ super();
+ this.uri = location;
+ this.location = location;
+ }
+
+ /**
+ * Get the URI of the contribution
+ * @return The URI of the contribution
+ */
+ public String getURI() {
+ return uri;
+ }
+
+ /**
+ * Set the URI of the contribution
+ * @param uri The URI of the contribution
+ */
+ public ContributionConfiguration setURI(String uri) {
+ this.uri = uri;
+ return this;
+ }
+
+ /**
+ * Get the location of the contribution
+ * @return The location of the contribution
+ */
+ public String getLocation() {
+ return location;
+ }
+
+ /**
+ * Set the location of the contribution
+ * @param location The location of the contribution
+ */
+ public ContributionConfiguration setLocation(String location) {
+ this.location = location;
+ return this;
+ }
+
+ /**
+ * Get the list of deployment composites that are attached to the contribution
+ * @return
+ */
+ public List<DeploymentComposite> getDeploymentComposites() {
+ return deploymentComposites;
+ }
+
+ public ContributionConfiguration addDeploymentComposite(DeploymentComposite deploymentComposite) {
+ deploymentComposites.add(deploymentComposite);
+ if (uri != null) {
+ deploymentComposite.setContributionURI(uri);
+ }
+ return this;
+ }
+
+ public ContributionConfiguration addDeploymentComposite(Reader reader) {
+ try {
+ DeploymentComposite composite = new DeploymentCompositeImpl();
+ char[] buf = new char[8192];
+ StringWriter sw = new StringWriter();
+ int size = 0;
+ while (size >= 0) {
+ size = reader.read(buf);
+ if (size > 0) {
+ sw.write(buf, 0, size);
+ }
+ }
+ reader.close();
+ composite.setContent(sw.toString());
+ return addDeploymentComposite(composite);
+ } catch (IOException e) {
+ throw new IllegalArgumentException(e);
+ }
+ }
+
+ public ContributionConfiguration addDeploymentComposite(InputStream content) {
+ try {
+ InputStreamReader reader = new InputStreamReader(content, "UTF-8");
+ return addDeploymentComposite(reader);
+ } catch (IOException e) {
+ throw new IllegalArgumentException(e);
+ }
+ }
+
+ public ContributionConfiguration addDeploymentComposite(String content) {
+ DeploymentComposite composite = new DeploymentCompositeImpl();
+ composite.setContent(content);
+ return addDeploymentComposite(composite);
+ }
+
+ public ContributionConfiguration addDeploymentComposite(URI location) {
+ DeploymentComposite composite = new DeploymentCompositeImpl();
+ composite.setLocation(location.toString());
+ return addDeploymentComposite(composite);
+ }
+
+ public ContributionConfiguration addDeploymentComposite(URL location) {
+ DeploymentComposite composite = new DeploymentCompositeImpl();
+ composite.setLocation(location.toString());
+ return addDeploymentComposite(composite);
+ }
+}
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/DeploymentCompositeImpl.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/DeploymentCompositeImpl.java
index e94f195931..518c4ff246 100644
--- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/DeploymentCompositeImpl.java
+++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/DeploymentCompositeImpl.java
@@ -1,59 +1,59 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.configuration.impl;
-
-import org.apache.tuscany.sca.node.configuration.DeploymentComposite;
-
-/**
- * Configuration for a deployment composite
- */
-public class DeploymentCompositeImpl implements DeploymentComposite {
- private String location;
- private String content;
- private String contributionURI;
-
- public String getLocation() {
- return location;
- }
-
- public DeploymentComposite setLocation(String location) {
- this.location = location;
- return this;
- }
-
- public String getContent() {
- return content;
- }
-
- public DeploymentComposite setContent(String content) {
- this.content = content;
- return this;
- }
-
- public String getContributionURI() {
- return contributionURI;
- }
-
- public DeploymentComposite setContributionURI(String contributionURI) {
- this.contributionURI = contributionURI;
- return this;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration.impl;
+
+import org.apache.tuscany.sca.node.configuration.DeploymentComposite;
+
+/**
+ * Configuration for a deployment composite
+ */
+public class DeploymentCompositeImpl implements DeploymentComposite {
+ private String location;
+ private String content;
+ private String contributionURI;
+
+ public String getLocation() {
+ return location;
+ }
+
+ public DeploymentComposite setLocation(String location) {
+ this.location = location;
+ return this;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public DeploymentComposite setContent(String content) {
+ this.content = content;
+ return this;
+ }
+
+ public String getContributionURI() {
+ return contributionURI;
+ }
+
+ public DeploymentComposite setContributionURI(String contributionURI) {
+ this.contributionURI = contributionURI;
+ return this;
+ }
+
+}
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationFactoryImpl.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationFactoryImpl.java
index 9396adc87d..86096c9aee 100644
--- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationFactoryImpl.java
+++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationFactoryImpl.java
@@ -1,63 +1,63 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.configuration.impl;
-
-import org.apache.tuscany.sca.node.configuration.BindingConfiguration;
-import org.apache.tuscany.sca.node.configuration.ContributionConfiguration;
-import org.apache.tuscany.sca.node.configuration.DeploymentComposite;
-import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
-import org.apache.tuscany.sca.node.configuration.NodeConfigurationFactory;
-
-/**
- * The factory to create java models related to the node configuration
- */
-public class NodeConfigurationFactoryImpl implements NodeConfigurationFactory {
- /**
- * Create a new instance of NodeConfiguration
- * @return
- */
- public NodeConfiguration createNodeConfiguration() {
- return new NodeConfigurationImpl();
- }
-
- /**
- * Create a new instance of ContributionConfiguration
- * @return
- */
- public ContributionConfiguration createContributionConfiguration() {
- return new ContributionConfigurationImpl();
- }
-
- /**
- * Create a new instance of BindingConfiguration
- * @return
- */
- public BindingConfiguration createBindingConfiguration() {
- return new BindingConfigurationImpl();
- }
-
- /**
- * Create a new instance of DeploymentComposite
- * @return
- */
- public DeploymentComposite createDeploymentComposite() {
- return new DeploymentCompositeImpl();
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration.impl;
+
+import org.apache.tuscany.sca.node.configuration.BindingConfiguration;
+import org.apache.tuscany.sca.node.configuration.ContributionConfiguration;
+import org.apache.tuscany.sca.node.configuration.DeploymentComposite;
+import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
+import org.apache.tuscany.sca.node.configuration.NodeConfigurationFactory;
+
+/**
+ * The factory to create java models related to the node configuration
+ */
+public class NodeConfigurationFactoryImpl implements NodeConfigurationFactory {
+ /**
+ * Create a new instance of NodeConfiguration
+ * @return
+ */
+ public NodeConfiguration createNodeConfiguration() {
+ return new NodeConfigurationImpl();
+ }
+
+ /**
+ * Create a new instance of ContributionConfiguration
+ * @return
+ */
+ public ContributionConfiguration createContributionConfiguration() {
+ return new ContributionConfigurationImpl();
+ }
+
+ /**
+ * Create a new instance of BindingConfiguration
+ * @return
+ */
+ public BindingConfiguration createBindingConfiguration() {
+ return new BindingConfigurationImpl();
+ }
+
+ /**
+ * Create a new instance of DeploymentComposite
+ * @return
+ */
+ public DeploymentComposite createDeploymentComposite() {
+ return new DeploymentCompositeImpl();
+ }
+}
diff --git a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationImpl.java b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationImpl.java
index 2c49d6d9ca..9a9a0d6cb5 100644
--- a/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationImpl.java
+++ b/java/sca/modules/node-api/src/main/java/org/apache/tuscany/sca/node/configuration/impl/NodeConfigurationImpl.java
@@ -1,176 +1,176 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.configuration.impl;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.node.configuration.BindingConfiguration;
-import org.apache.tuscany.sca.node.configuration.ContributionConfiguration;
-import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
-
-/**
- * Default implementation of NodeConfiguration
- */
-public class NodeConfigurationImpl implements NodeConfiguration {
- private String uri = DEFAULT_NODE_URI;
- private String domainURI = DEFAULT_DOMAIN_URI;
- private List<ContributionConfiguration> contributions = new ArrayList<ContributionConfiguration>();
- private List<BindingConfiguration> bindings = new ArrayList<BindingConfiguration>();
- private List<Object> extensions = new ArrayList<Object>();
-
- public String getURI() {
- return uri;
- }
-
- public NodeConfiguration setURI(String uri) {
- this.uri = uri;
- return this;
- }
-
- public String getDomainURI() {
- return domainURI;
- }
-
- public String getDomainName() {
- if (domainURI != null) {
- URI uri = URI.create(domainURI);
- if (uri.getHost() != null) {
- return uri.getHost();
- }
- }
- return domainURI;
- }
-
- public NodeConfiguration setDomainURI(String domainURI) {
- this.domainURI = domainURI;
- return this;
- }
-
- public List<ContributionConfiguration> getContributions() {
- return contributions;
- }
-
- public List<BindingConfiguration> getBindings() {
- return bindings;
- }
-
- public NodeConfiguration addBinding(BindingConfiguration bindingConfiguration) {
- for (BindingConfiguration bc : bindings) {
- // Try to merge first by QName
- if (bc.getBindingType().equals(bindingConfiguration.getBindingType())) {
- bc.getBaseURIs().addAll(bindingConfiguration.getBaseURIs());
- return this;
- }
- }
- bindings.add(bindingConfiguration);
- return this;
- }
-
- public NodeConfiguration addContribution(ContributionConfiguration contributionConfiguration) {
- contributions.add(contributionConfiguration);
- return this;
- }
-
- public NodeConfiguration addBinding(QName bindingType, String... baseURIs) {
- BindingConfiguration binding = new BindingConfigurationImpl().setBindingType(bindingType);
- for (String u : baseURIs) {
- String[] uris = u.split("(\\s)+");
- for (String uri : uris) {
- if (uri.length() > 0) {
- binding.addBaseURI(uri);
- }
- }
- }
- return addBinding(binding);
- }
-
- public NodeConfiguration addBinding(QName bindingType, URI... baseURIs) {
- BindingConfiguration binding = new BindingConfigurationImpl().setBindingType(bindingType);
- for (URI u : baseURIs) {
- binding.addBaseURI(u.toString());
- }
- return addBinding(binding);
- }
-
- public NodeConfiguration addContribution(String contributionURI, String location) {
- ContributionConfiguration contribution = new ContributionConfigurationImpl(contributionURI, location);
- return addContribution(contribution);
- }
-
- public NodeConfiguration addContribution(String contributionURI, URL location) {
- return addContribution(contributionURI, location.toString());
- }
-
- public NodeConfiguration addContribution(URI contributionURI, URL location) {
- return addContribution(contributionURI.toString(), location.toString());
- }
-
- public NodeConfiguration addContribution(URL... locations) {
- for (URL url : locations) {
- ContributionConfiguration contribution = new ContributionConfigurationImpl(url.toString(), url.toString());
- addContribution(contribution);
- }
- return this;
- }
-
- public NodeConfiguration addDeploymentComposite(String contributionURI, InputStream content) {
- findContribution(contributionURI).addDeploymentComposite(content);
- return this;
- }
-
- public NodeConfiguration addDeploymentComposite(String contributionURI, Reader content) {
- findContribution(contributionURI).addDeploymentComposite(content);
- return this;
- }
-
- public NodeConfiguration addDeploymentComposite(String contributionURI, String location) {
- findContribution(contributionURI).addDeploymentComposite(URI.create(location));
- return this;
- }
-
- private ContributionConfiguration findContribution(String uri) {
- for (ContributionConfiguration c : contributions) {
- if (c.getURI() != null && c.getURI().equals(uri)) {
- return c;
- }
- }
- throw new IllegalArgumentException("Contribution is not found (uri=" + uri + ")");
- }
-
- public String toString() {
- if (domainURI != null) {
- return "{" + domainURI + "}" + uri;
- } else {
- return uri;
- }
- }
-
- public List<Object> getExtensions() {
- return extensions;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration.impl;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.node.configuration.BindingConfiguration;
+import org.apache.tuscany.sca.node.configuration.ContributionConfiguration;
+import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
+
+/**
+ * Default implementation of NodeConfiguration
+ */
+public class NodeConfigurationImpl implements NodeConfiguration {
+ private String uri = DEFAULT_NODE_URI;
+ private String domainURI = DEFAULT_DOMAIN_URI;
+ private List<ContributionConfiguration> contributions = new ArrayList<ContributionConfiguration>();
+ private List<BindingConfiguration> bindings = new ArrayList<BindingConfiguration>();
+ private List<Object> extensions = new ArrayList<Object>();
+
+ public String getURI() {
+ return uri;
+ }
+
+ public NodeConfiguration setURI(String uri) {
+ this.uri = uri;
+ return this;
+ }
+
+ public String getDomainURI() {
+ return domainURI;
+ }
+
+ public String getDomainName() {
+ if (domainURI != null) {
+ URI uri = URI.create(domainURI);
+ if (uri.getHost() != null) {
+ return uri.getHost();
+ }
+ }
+ return domainURI;
+ }
+
+ public NodeConfiguration setDomainURI(String domainURI) {
+ this.domainURI = domainURI;
+ return this;
+ }
+
+ public List<ContributionConfiguration> getContributions() {
+ return contributions;
+ }
+
+ public List<BindingConfiguration> getBindings() {
+ return bindings;
+ }
+
+ public NodeConfiguration addBinding(BindingConfiguration bindingConfiguration) {
+ for (BindingConfiguration bc : bindings) {
+ // Try to merge first by QName
+ if (bc.getBindingType().equals(bindingConfiguration.getBindingType())) {
+ bc.getBaseURIs().addAll(bindingConfiguration.getBaseURIs());
+ return this;
+ }
+ }
+ bindings.add(bindingConfiguration);
+ return this;
+ }
+
+ public NodeConfiguration addContribution(ContributionConfiguration contributionConfiguration) {
+ contributions.add(contributionConfiguration);
+ return this;
+ }
+
+ public NodeConfiguration addBinding(QName bindingType, String... baseURIs) {
+ BindingConfiguration binding = new BindingConfigurationImpl().setBindingType(bindingType);
+ for (String u : baseURIs) {
+ String[] uris = u.split("(\\s)+");
+ for (String uri : uris) {
+ if (uri.length() > 0) {
+ binding.addBaseURI(uri);
+ }
+ }
+ }
+ return addBinding(binding);
+ }
+
+ public NodeConfiguration addBinding(QName bindingType, URI... baseURIs) {
+ BindingConfiguration binding = new BindingConfigurationImpl().setBindingType(bindingType);
+ for (URI u : baseURIs) {
+ binding.addBaseURI(u.toString());
+ }
+ return addBinding(binding);
+ }
+
+ public NodeConfiguration addContribution(String contributionURI, String location) {
+ ContributionConfiguration contribution = new ContributionConfigurationImpl(contributionURI, location);
+ return addContribution(contribution);
+ }
+
+ public NodeConfiguration addContribution(String contributionURI, URL location) {
+ return addContribution(contributionURI, location.toString());
+ }
+
+ public NodeConfiguration addContribution(URI contributionURI, URL location) {
+ return addContribution(contributionURI.toString(), location.toString());
+ }
+
+ public NodeConfiguration addContribution(URL... locations) {
+ for (URL url : locations) {
+ ContributionConfiguration contribution = new ContributionConfigurationImpl(url.toString(), url.toString());
+ addContribution(contribution);
+ }
+ return this;
+ }
+
+ public NodeConfiguration addDeploymentComposite(String contributionURI, InputStream content) {
+ findContribution(contributionURI).addDeploymentComposite(content);
+ return this;
+ }
+
+ public NodeConfiguration addDeploymentComposite(String contributionURI, Reader content) {
+ findContribution(contributionURI).addDeploymentComposite(content);
+ return this;
+ }
+
+ public NodeConfiguration addDeploymentComposite(String contributionURI, String location) {
+ findContribution(contributionURI).addDeploymentComposite(URI.create(location));
+ return this;
+ }
+
+ private ContributionConfiguration findContribution(String uri) {
+ for (ContributionConfiguration c : contributions) {
+ if (c.getURI() != null && c.getURI().equals(uri)) {
+ return c;
+ }
+ }
+ throw new IllegalArgumentException("Contribution is not found (uri=" + uri + ")");
+ }
+
+ public String toString() {
+ if (domainURI != null) {
+ return "{" + domainURI + "}" + uri;
+ } else {
+ return uri;
+ }
+ }
+
+ public List<Object> getExtensions() {
+ return extensions;
+ }
+
+}
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/AbstractDiscoveryService.java b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/AbstractDiscoveryService.java
index 780fd73c95..fa60ed0ed2 100644
--- a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/AbstractDiscoveryService.java
+++ b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/AbstractDiscoveryService.java
@@ -1,344 +1,344 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.dosgi.discovery;
-
-import static org.osgi.service.discovery.DiscoveredServiceNotification.AVAILABLE;
-import static org.osgi.service.discovery.DiscoveredServiceTracker.FILTER_MATCH_CRITERIA;
-import static org.osgi.service.discovery.DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Dictionary;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.logging.Logger;
-
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.apache.tuscany.sca.node.impl.NodeFactoryImpl;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Filter;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.discovery.DiscoveredServiceNotification;
-import org.osgi.service.discovery.DiscoveredServiceTracker;
-import org.osgi.service.discovery.Discovery;
-import org.osgi.service.discovery.ServiceEndpointDescription;
-import org.osgi.service.discovery.ServicePublication;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- *
- */
-public abstract class AbstractDiscoveryService implements Discovery {
- private final static Logger logger = Logger.getLogger(AbstractDiscoveryService.class.getName());
-
- protected BundleContext context;
- protected ExtensionPointRegistry registry;
-
- private Map<String, List<DiscoveredServiceTracker>> filtersToTrackers =
- new HashMap<String, List<DiscoveredServiceTracker>>();
- private Map<String, List<DiscoveredServiceTracker>> interfacesToTrackers =
- new HashMap<String, List<DiscoveredServiceTracker>>();
- // this is effectively a set which allows for multiple service descriptions with the
- // same interface name but different properties and takes care of itself with respect to concurrency
- protected Map<ServiceEndpointDescription, Bundle> servicesInfo =
- new ConcurrentHashMap<ServiceEndpointDescription, Bundle>();
- private Map<DiscoveredServiceTracker, Collection<String>> trackersToFilters =
- new HashMap<DiscoveredServiceTracker, Collection<String>>();
- private Map<DiscoveredServiceTracker, Collection<String>> trackersToInterfaces =
- new HashMap<DiscoveredServiceTracker, Collection<String>>();
- private ServiceTracker trackerTracker;
-
- public AbstractDiscoveryService(BundleContext context) {
- super();
- this.context = context;
-
- // track the registration of DiscoveredServiceTrackers
- trackerTracker = new ServiceTracker(context, DiscoveredServiceTracker.class.getName(), null) {
- public Object addingService(ServiceReference reference) {
- Object result = super.addingService(reference);
- cacheTracker(reference, result);
- return result;
- }
-
- public void modifiedService(ServiceReference reference, Object service) {
- super.modifiedService(reference, service);
- updateTracker(reference, service);
- }
-
- public void removedService(ServiceReference reference, Object service) {
- super.removedService(reference, service);
- clearTracker(service);
- }
- };
-
- trackerTracker.open();
-
- }
-
- public void stop() {
- trackerTracker.close();
- }
-
- protected ExtensionPointRegistry getExtensionPointRegistry() {
- NodeFactoryImpl factory = (NodeFactoryImpl) NodeFactory.newInstance();
- factory.init();
- ServiceTracker tracker = new ServiceTracker(context, ExtensionPointRegistry.class.getName(), null);
- tracker.open();
- // tracker.waitForService(1000);
- registry = (ExtensionPointRegistry)tracker.getService();
- tracker.close();
- return registry;
- }
-
- private synchronized void cacheTracker(ServiceReference reference, Object service) {
- if (service instanceof DiscoveredServiceTracker) {
- DiscoveredServiceTracker tracker = (DiscoveredServiceTracker)service;
- Collection<String> interfaces =
- addTracker(reference, tracker, INTERFACE_MATCH_CRITERIA, interfacesToTrackers, trackersToInterfaces);
- Collection<String> filters =
- addTracker(reference, tracker, FILTER_MATCH_CRITERIA, filtersToTrackers, trackersToFilters);
-
- triggerCallbacks(null, interfaces, tracker, false);
- triggerCallbacks(null, filters, tracker, true);
- }
- }
-
- private synchronized void clearTracker(Object service) {
- if (service instanceof DiscoveredServiceTracker) {
- removeTracker((DiscoveredServiceTracker)service, interfacesToTrackers, trackersToInterfaces);
- removeTracker((DiscoveredServiceTracker)service, filtersToTrackers, trackersToFilters);
- }
- }
-
- private synchronized void updateTracker(ServiceReference reference, Object service) {
- if (service instanceof DiscoveredServiceTracker) {
- DiscoveredServiceTracker tracker = (DiscoveredServiceTracker)service;
- logger.info("updating tracker: " + tracker);
- Collection<String> oldInterfaces = removeTracker(tracker, interfacesToTrackers, trackersToInterfaces);
- Collection<String> oldFilters = removeTracker(tracker, filtersToTrackers, trackersToFilters);
-
- Collection<String> newInterfaces =
- addTracker(reference, tracker, INTERFACE_MATCH_CRITERIA, interfacesToTrackers, trackersToInterfaces);
- Collection<String> newFilters =
- addTracker(reference, tracker, FILTER_MATCH_CRITERIA, filtersToTrackers, trackersToFilters);
-
- triggerCallbacks(oldInterfaces, newInterfaces, tracker, false);
- triggerCallbacks(oldFilters, newFilters, tracker, true);
- }
- }
-
- private void triggerCallbacks(Collection<String> oldInterest,
- Collection<String> newInterest,
- DiscoveredServiceTracker tracker,
- boolean isFilter) {
- // compute delta between old & new interfaces/filters and
- // trigger callbacks for any entries in servicesInfo that
- // match any *additional* interface/filters
- Collection<String> deltaInterest = new ArrayList<String>();
- if (!isEmpty(newInterest)) {
- if (isEmpty(oldInterest)) {
- deltaInterest.addAll(newInterest);
- } else {
- Iterator<String> i = newInterest.iterator();
- while (i.hasNext()) {
- String next = (String)i.next();
- if (!oldInterest.contains(next)) {
- deltaInterest.add(next);
- }
- }
- }
- }
-
- if (servicesInfo.size() > 0) {
- logger.info("search for matches to trigger callbacks with delta: " + deltaInterest);
- } else {
- logger.info("nothing to search for matches to trigger callbacks with delta: " + deltaInterest);
- }
- Iterator<String> i = deltaInterest.iterator();
- while (i.hasNext()) {
- String next = i.next();
- for (ServiceEndpointDescription sd : servicesInfo.keySet()) {
- triggerCallbacks(tracker, next, isFilter, sd, AVAILABLE);
- }
- }
- }
-
- private void triggerCallbacks(DiscoveredServiceTracker tracker,
- String toMatch,
- boolean isFilter,
- ServiceEndpointDescription sd,
- int type) {
- logger.fine("check if string: " + toMatch
- + (isFilter ? " matches " : " contained by ")
- + sd.getProvidedInterfaces());
-
- DiscoveredServiceNotification notification =
- isFilter ? (filterMatches(toMatch, sd) ? new DiscoveredServiceNotificationImpl(sd, true, toMatch, type)
- : null) : (sd.getProvidedInterfaces().contains(toMatch)
- ? new DiscoveredServiceNotificationImpl(sd, false, toMatch, type) : null);
-
- if (notification != null) {
- tracker.serviceChanged(notification);
- }
- }
-
- private boolean filterMatches(String filterValue, ServiceEndpointDescription sd) {
- Filter filter = createFilter(filterValue);
- return filter != null ? filter.match(getServiceProperties(null, sd)) : false;
- }
-
- private Filter createFilter(String filterValue) {
-
- if (filterValue == null) {
- return null;
- }
-
- try {
- return context.createFilter(filterValue);
- } catch (InvalidSyntaxException ex) {
- System.out.println("Invalid filter expression " + filterValue);
- } catch (Exception ex) {
- System.out.println("Problem creating a Filter from " + filterValue);
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- private Dictionary<String, Object> getServiceProperties(String interfaceName, ServiceEndpointDescription sd) {
- Dictionary<String, Object> d = new Hashtable<String, Object>(sd.getProperties());
-
- String[] interfaceNames = getProvidedInterfaces(sd, interfaceName);
- if (interfaceNames != null) {
- d.put(INTERFACE_MATCH_CRITERIA, interfaceNames);
- }
- return d;
- }
-
- @SuppressWarnings("unchecked")
- private static String[] getProvidedInterfaces(ServiceEndpointDescription sd, String interfaceName) {
-
- Collection<String> interfaceNames = sd.getProvidedInterfaces();
- if (interfaceName == null) {
- return null;
- }
-
- Iterator<String> iNames = interfaceNames.iterator();
- while (iNames.hasNext()) {
- if (iNames.next().equals(interfaceName)) {
- return new String[] {interfaceName};
- }
- }
- return null;
- }
-
- static Collection<String> removeTracker(DiscoveredServiceTracker tracker,
- Map<String, List<DiscoveredServiceTracker>> forwardMap,
- Map<DiscoveredServiceTracker, Collection<String>> reverseMap) {
- Collection<String> collection = reverseMap.get(tracker);
- if (!isEmpty(collection)) {
- reverseMap.remove(tracker);
- Iterator<String> i = collection.iterator();
- while (i.hasNext()) {
- String element = i.next();
- if (forwardMap.containsKey(element)) {
- forwardMap.get(element).remove(tracker);
- } else {
- // if the element wasn't on the forwardmap, its a new element and
- // shouldn't be returned as part of the collection of old ones
- i.remove();
- }
- }
- }
- return collection;
- }
-
- private static boolean isEmpty(Collection<?> c) {
- return c == null || c.isEmpty();
- }
-
- @SuppressWarnings("unchecked")
- static Collection<String> addTracker(ServiceReference reference,
- DiscoveredServiceTracker tracker,
- String property,
- Map<String, List<DiscoveredServiceTracker>> forwardMap,
- Map<DiscoveredServiceTracker, Collection<String>> reverseMap) {
- Collection<String> collection = (Collection<String>)reference.getProperty(property);
- logger.info("adding tracker: " + tracker
- + " collection: "
- + collection
- + " registered against prop: "
- + property);
- if (!isEmpty(collection)) {
- reverseMap.put(tracker, new ArrayList<String>(collection));
- Iterator<String> i = collection.iterator();
- while (i.hasNext()) {
- String element = i.next();
- if (forwardMap.containsKey(element)) {
- forwardMap.get(element).add(tracker);
- } else {
- List<DiscoveredServiceTracker> trackerList = new ArrayList<DiscoveredServiceTracker>();
- trackerList.add(tracker);
- forwardMap.put(element, trackerList);
- }
- }
- }
- return collection;
- }
-
- protected void discoveredServiceChanged(ServiceEndpointDescription sd, int type) {
- for (Map.Entry<DiscoveredServiceTracker, Collection<String>> entry : trackersToInterfaces.entrySet()) {
- for (String match : entry.getValue()) {
- triggerCallbacks(entry.getKey(), match, false, sd, type);
- }
- }
- for (Map.Entry<DiscoveredServiceTracker, Collection<String>> entry : trackersToFilters.entrySet()) {
- for (String match : entry.getValue()) {
- triggerCallbacks(entry.getKey(), match, true, sd, type);
- }
- }
- }
-
- /**
- * Publish the OSGi services that are exposed to SCA. For SCA, the replicated endpoint registry
- * serves are the discovery protocol. The OSGi services are added to endpoint registry first before
- * the ServicePublication services are registered so that othe Discovery services can see them.
- * @param ref
- * @param endpoint
- * @return
- */
- protected ServiceRegistration localServicePublished(ServiceReference ref, Endpoint endpoint) {
- EndpointPublication publication = new EndpointPublication(ref, endpoint);
- ServiceRegistration registration =
- ref.getBundle().getBundleContext().registerService(ServicePublication.class.getName(),
- publication,
- publication.getProperties());
- return registration;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.dosgi.discovery;
+
+import static org.osgi.service.discovery.DiscoveredServiceNotification.AVAILABLE;
+import static org.osgi.service.discovery.DiscoveredServiceTracker.FILTER_MATCH_CRITERIA;
+import static org.osgi.service.discovery.DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.logging.Logger;
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.impl.NodeFactoryImpl;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.discovery.DiscoveredServiceNotification;
+import org.osgi.service.discovery.DiscoveredServiceTracker;
+import org.osgi.service.discovery.Discovery;
+import org.osgi.service.discovery.ServiceEndpointDescription;
+import org.osgi.service.discovery.ServicePublication;
+import org.osgi.util.tracker.ServiceTracker;
+
+/**
+ *
+ */
+public abstract class AbstractDiscoveryService implements Discovery {
+ private final static Logger logger = Logger.getLogger(AbstractDiscoveryService.class.getName());
+
+ protected BundleContext context;
+ protected ExtensionPointRegistry registry;
+
+ private Map<String, List<DiscoveredServiceTracker>> filtersToTrackers =
+ new HashMap<String, List<DiscoveredServiceTracker>>();
+ private Map<String, List<DiscoveredServiceTracker>> interfacesToTrackers =
+ new HashMap<String, List<DiscoveredServiceTracker>>();
+ // this is effectively a set which allows for multiple service descriptions with the
+ // same interface name but different properties and takes care of itself with respect to concurrency
+ protected Map<ServiceEndpointDescription, Bundle> servicesInfo =
+ new ConcurrentHashMap<ServiceEndpointDescription, Bundle>();
+ private Map<DiscoveredServiceTracker, Collection<String>> trackersToFilters =
+ new HashMap<DiscoveredServiceTracker, Collection<String>>();
+ private Map<DiscoveredServiceTracker, Collection<String>> trackersToInterfaces =
+ new HashMap<DiscoveredServiceTracker, Collection<String>>();
+ private ServiceTracker trackerTracker;
+
+ public AbstractDiscoveryService(BundleContext context) {
+ super();
+ this.context = context;
+
+ // track the registration of DiscoveredServiceTrackers
+ trackerTracker = new ServiceTracker(context, DiscoveredServiceTracker.class.getName(), null) {
+ public Object addingService(ServiceReference reference) {
+ Object result = super.addingService(reference);
+ cacheTracker(reference, result);
+ return result;
+ }
+
+ public void modifiedService(ServiceReference reference, Object service) {
+ super.modifiedService(reference, service);
+ updateTracker(reference, service);
+ }
+
+ public void removedService(ServiceReference reference, Object service) {
+ super.removedService(reference, service);
+ clearTracker(service);
+ }
+ };
+
+ trackerTracker.open();
+
+ }
+
+ public void stop() {
+ trackerTracker.close();
+ }
+
+ protected ExtensionPointRegistry getExtensionPointRegistry() {
+ NodeFactoryImpl factory = (NodeFactoryImpl) NodeFactory.newInstance();
+ factory.init();
+ ServiceTracker tracker = new ServiceTracker(context, ExtensionPointRegistry.class.getName(), null);
+ tracker.open();
+ // tracker.waitForService(1000);
+ registry = (ExtensionPointRegistry)tracker.getService();
+ tracker.close();
+ return registry;
+ }
+
+ private synchronized void cacheTracker(ServiceReference reference, Object service) {
+ if (service instanceof DiscoveredServiceTracker) {
+ DiscoveredServiceTracker tracker = (DiscoveredServiceTracker)service;
+ Collection<String> interfaces =
+ addTracker(reference, tracker, INTERFACE_MATCH_CRITERIA, interfacesToTrackers, trackersToInterfaces);
+ Collection<String> filters =
+ addTracker(reference, tracker, FILTER_MATCH_CRITERIA, filtersToTrackers, trackersToFilters);
+
+ triggerCallbacks(null, interfaces, tracker, false);
+ triggerCallbacks(null, filters, tracker, true);
+ }
+ }
+
+ private synchronized void clearTracker(Object service) {
+ if (service instanceof DiscoveredServiceTracker) {
+ removeTracker((DiscoveredServiceTracker)service, interfacesToTrackers, trackersToInterfaces);
+ removeTracker((DiscoveredServiceTracker)service, filtersToTrackers, trackersToFilters);
+ }
+ }
+
+ private synchronized void updateTracker(ServiceReference reference, Object service) {
+ if (service instanceof DiscoveredServiceTracker) {
+ DiscoveredServiceTracker tracker = (DiscoveredServiceTracker)service;
+ logger.info("updating tracker: " + tracker);
+ Collection<String> oldInterfaces = removeTracker(tracker, interfacesToTrackers, trackersToInterfaces);
+ Collection<String> oldFilters = removeTracker(tracker, filtersToTrackers, trackersToFilters);
+
+ Collection<String> newInterfaces =
+ addTracker(reference, tracker, INTERFACE_MATCH_CRITERIA, interfacesToTrackers, trackersToInterfaces);
+ Collection<String> newFilters =
+ addTracker(reference, tracker, FILTER_MATCH_CRITERIA, filtersToTrackers, trackersToFilters);
+
+ triggerCallbacks(oldInterfaces, newInterfaces, tracker, false);
+ triggerCallbacks(oldFilters, newFilters, tracker, true);
+ }
+ }
+
+ private void triggerCallbacks(Collection<String> oldInterest,
+ Collection<String> newInterest,
+ DiscoveredServiceTracker tracker,
+ boolean isFilter) {
+ // compute delta between old & new interfaces/filters and
+ // trigger callbacks for any entries in servicesInfo that
+ // match any *additional* interface/filters
+ Collection<String> deltaInterest = new ArrayList<String>();
+ if (!isEmpty(newInterest)) {
+ if (isEmpty(oldInterest)) {
+ deltaInterest.addAll(newInterest);
+ } else {
+ Iterator<String> i = newInterest.iterator();
+ while (i.hasNext()) {
+ String next = (String)i.next();
+ if (!oldInterest.contains(next)) {
+ deltaInterest.add(next);
+ }
+ }
+ }
+ }
+
+ if (servicesInfo.size() > 0) {
+ logger.info("search for matches to trigger callbacks with delta: " + deltaInterest);
+ } else {
+ logger.info("nothing to search for matches to trigger callbacks with delta: " + deltaInterest);
+ }
+ Iterator<String> i = deltaInterest.iterator();
+ while (i.hasNext()) {
+ String next = i.next();
+ for (ServiceEndpointDescription sd : servicesInfo.keySet()) {
+ triggerCallbacks(tracker, next, isFilter, sd, AVAILABLE);
+ }
+ }
+ }
+
+ private void triggerCallbacks(DiscoveredServiceTracker tracker,
+ String toMatch,
+ boolean isFilter,
+ ServiceEndpointDescription sd,
+ int type) {
+ logger.fine("check if string: " + toMatch
+ + (isFilter ? " matches " : " contained by ")
+ + sd.getProvidedInterfaces());
+
+ DiscoveredServiceNotification notification =
+ isFilter ? (filterMatches(toMatch, sd) ? new DiscoveredServiceNotificationImpl(sd, true, toMatch, type)
+ : null) : (sd.getProvidedInterfaces().contains(toMatch)
+ ? new DiscoveredServiceNotificationImpl(sd, false, toMatch, type) : null);
+
+ if (notification != null) {
+ tracker.serviceChanged(notification);
+ }
+ }
+
+ private boolean filterMatches(String filterValue, ServiceEndpointDescription sd) {
+ Filter filter = createFilter(filterValue);
+ return filter != null ? filter.match(getServiceProperties(null, sd)) : false;
+ }
+
+ private Filter createFilter(String filterValue) {
+
+ if (filterValue == null) {
+ return null;
+ }
+
+ try {
+ return context.createFilter(filterValue);
+ } catch (InvalidSyntaxException ex) {
+ System.out.println("Invalid filter expression " + filterValue);
+ } catch (Exception ex) {
+ System.out.println("Problem creating a Filter from " + filterValue);
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ private Dictionary<String, Object> getServiceProperties(String interfaceName, ServiceEndpointDescription sd) {
+ Dictionary<String, Object> d = new Hashtable<String, Object>(sd.getProperties());
+
+ String[] interfaceNames = getProvidedInterfaces(sd, interfaceName);
+ if (interfaceNames != null) {
+ d.put(INTERFACE_MATCH_CRITERIA, interfaceNames);
+ }
+ return d;
+ }
+
+ @SuppressWarnings("unchecked")
+ private static String[] getProvidedInterfaces(ServiceEndpointDescription sd, String interfaceName) {
+
+ Collection<String> interfaceNames = sd.getProvidedInterfaces();
+ if (interfaceName == null) {
+ return null;
+ }
+
+ Iterator<String> iNames = interfaceNames.iterator();
+ while (iNames.hasNext()) {
+ if (iNames.next().equals(interfaceName)) {
+ return new String[] {interfaceName};
+ }
+ }
+ return null;
+ }
+
+ static Collection<String> removeTracker(DiscoveredServiceTracker tracker,
+ Map<String, List<DiscoveredServiceTracker>> forwardMap,
+ Map<DiscoveredServiceTracker, Collection<String>> reverseMap) {
+ Collection<String> collection = reverseMap.get(tracker);
+ if (!isEmpty(collection)) {
+ reverseMap.remove(tracker);
+ Iterator<String> i = collection.iterator();
+ while (i.hasNext()) {
+ String element = i.next();
+ if (forwardMap.containsKey(element)) {
+ forwardMap.get(element).remove(tracker);
+ } else {
+ // if the element wasn't on the forwardmap, its a new element and
+ // shouldn't be returned as part of the collection of old ones
+ i.remove();
+ }
+ }
+ }
+ return collection;
+ }
+
+ private static boolean isEmpty(Collection<?> c) {
+ return c == null || c.isEmpty();
+ }
+
+ @SuppressWarnings("unchecked")
+ static Collection<String> addTracker(ServiceReference reference,
+ DiscoveredServiceTracker tracker,
+ String property,
+ Map<String, List<DiscoveredServiceTracker>> forwardMap,
+ Map<DiscoveredServiceTracker, Collection<String>> reverseMap) {
+ Collection<String> collection = (Collection<String>)reference.getProperty(property);
+ logger.info("adding tracker: " + tracker
+ + " collection: "
+ + collection
+ + " registered against prop: "
+ + property);
+ if (!isEmpty(collection)) {
+ reverseMap.put(tracker, new ArrayList<String>(collection));
+ Iterator<String> i = collection.iterator();
+ while (i.hasNext()) {
+ String element = i.next();
+ if (forwardMap.containsKey(element)) {
+ forwardMap.get(element).add(tracker);
+ } else {
+ List<DiscoveredServiceTracker> trackerList = new ArrayList<DiscoveredServiceTracker>();
+ trackerList.add(tracker);
+ forwardMap.put(element, trackerList);
+ }
+ }
+ }
+ return collection;
+ }
+
+ protected void discoveredServiceChanged(ServiceEndpointDescription sd, int type) {
+ for (Map.Entry<DiscoveredServiceTracker, Collection<String>> entry : trackersToInterfaces.entrySet()) {
+ for (String match : entry.getValue()) {
+ triggerCallbacks(entry.getKey(), match, false, sd, type);
+ }
+ }
+ for (Map.Entry<DiscoveredServiceTracker, Collection<String>> entry : trackersToFilters.entrySet()) {
+ for (String match : entry.getValue()) {
+ triggerCallbacks(entry.getKey(), match, true, sd, type);
+ }
+ }
+ }
+
+ /**
+ * Publish the OSGi services that are exposed to SCA. For SCA, the replicated endpoint registry
+ * serves are the discovery protocol. The OSGi services are added to endpoint registry first before
+ * the ServicePublication services are registered so that othe Discovery services can see them.
+ * @param ref
+ * @param endpoint
+ * @return
+ */
+ protected ServiceRegistration localServicePublished(ServiceReference ref, Endpoint endpoint) {
+ EndpointPublication publication = new EndpointPublication(ref, endpoint);
+ ServiceRegistration registration =
+ ref.getBundle().getBundleContext().registerService(ServicePublication.class.getName(),
+ publication,
+ publication.getProperties());
+ return registration;
+ }
+
+}
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/DiscoveredServiceNotificationImpl.java b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/DiscoveredServiceNotificationImpl.java
index a110fa9528..a50721fbfc 100644
--- a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/DiscoveredServiceNotificationImpl.java
+++ b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/DiscoveredServiceNotificationImpl.java
@@ -1,67 +1,67 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.dosgi.discovery;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-
-import org.osgi.service.discovery.DiscoveredServiceNotification;
-import org.osgi.service.discovery.ServiceEndpointDescription;
-
-public class DiscoveredServiceNotificationImpl implements DiscoveredServiceNotification {
-
- private ServiceEndpointDescription discription;
- private Collection<String> interfaces;
- private Collection<String> filters;
- private int type;
-
- public DiscoveredServiceNotificationImpl(ServiceEndpointDescription sd, boolean isFilter, String match, int type) {
- this.discription = sd;
- if (isFilter) {
- filters = new ArrayList<String>();
- filters.add(match);
- interfaces = Collections.emptySet();
- } else {
- interfaces = new HashSet<String>();
- interfaces.add(match);
- filters = Collections.emptyList();
- }
-
- this.type = type;
- }
-
- public ServiceEndpointDescription getServiceEndpointDescription() {
- return discription;
- }
-
- public int getType() {
- return type;
- }
-
- public Collection<String> getInterfaces() {
- return interfaces;
- }
-
- public Collection<String> getFilters() {
- return filters;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.dosgi.discovery;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+
+import org.osgi.service.discovery.DiscoveredServiceNotification;
+import org.osgi.service.discovery.ServiceEndpointDescription;
+
+public class DiscoveredServiceNotificationImpl implements DiscoveredServiceNotification {
+
+ private ServiceEndpointDescription discription;
+ private Collection<String> interfaces;
+ private Collection<String> filters;
+ private int type;
+
+ public DiscoveredServiceNotificationImpl(ServiceEndpointDescription sd, boolean isFilter, String match, int type) {
+ this.discription = sd;
+ if (isFilter) {
+ filters = new ArrayList<String>();
+ filters.add(match);
+ interfaces = Collections.emptySet();
+ } else {
+ interfaces = new HashSet<String>();
+ interfaces.add(match);
+ filters = Collections.emptyList();
+ }
+
+ this.type = type;
+ }
+
+ public ServiceEndpointDescription getServiceEndpointDescription() {
+ return discription;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public Collection<String> getInterfaces() {
+ return interfaces;
+ }
+
+ public Collection<String> getFilters() {
+ return filters;
+ }
+}
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/DiscoveryActivator.java b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/DiscoveryActivator.java
index 9497619b5b..92951321d0 100644
--- a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/DiscoveryActivator.java
+++ b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/DiscoveryActivator.java
@@ -1,58 +1,58 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.dosgi.discovery;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.discovery.Discovery;
-
-public class DiscoveryActivator implements BundleActivator {
- private List<AbstractDiscoveryService> discoveryServices = new ArrayList<AbstractDiscoveryService>();
- private List<ServiceRegistration> discoveryServiceRegistrations = new ArrayList<ServiceRegistration>();
-
- public void start(BundleContext context) {
- discoveryServices.add(new LocalDiscoveryService(context));
-
- discoveryServices.add(new DomainDiscoveryService(context));
-
- for (AbstractDiscoveryService service : discoveryServices) {
- Hashtable<String, Object> props = new Hashtable<String, Object>();
- props.put(Discovery.PRODUCT_NAME, "Apache Tuscany SCA");
- props.put(Discovery.PRODUCT_VERSION, "2.0.0");
- props.put(Discovery.VENDOR_NAME, "Apache Software Foundation");
- ServiceRegistration registration =
- context.registerService(Discovery.class.getName(), service, props);
- discoveryServiceRegistrations.add(registration);
- }
- }
-
- public void stop(BundleContext context) {
- for (ServiceRegistration registration : discoveryServiceRegistrations) {
- registration.unregister();
- }
- for (AbstractDiscoveryService service : discoveryServices) {
- service.stop();
- }
- }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.dosgi.discovery;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.discovery.Discovery;
+
+public class DiscoveryActivator implements BundleActivator {
+ private List<AbstractDiscoveryService> discoveryServices = new ArrayList<AbstractDiscoveryService>();
+ private List<ServiceRegistration> discoveryServiceRegistrations = new ArrayList<ServiceRegistration>();
+
+ public void start(BundleContext context) {
+ discoveryServices.add(new LocalDiscoveryService(context));
+
+ discoveryServices.add(new DomainDiscoveryService(context));
+
+ for (AbstractDiscoveryService service : discoveryServices) {
+ Hashtable<String, Object> props = new Hashtable<String, Object>();
+ props.put(Discovery.PRODUCT_NAME, "Apache Tuscany SCA");
+ props.put(Discovery.PRODUCT_VERSION, "2.0.0");
+ props.put(Discovery.VENDOR_NAME, "Apache Software Foundation");
+ ServiceRegistration registration =
+ context.registerService(Discovery.class.getName(), service, props);
+ discoveryServiceRegistrations.add(registration);
+ }
+ }
+
+ public void stop(BundleContext context) {
+ for (ServiceRegistration registration : discoveryServiceRegistrations) {
+ registration.unregister();
+ }
+ for (AbstractDiscoveryService service : discoveryServices) {
+ service.stop();
+ }
+ }
+}
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/DomainDiscoveryService.java b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/DomainDiscoveryService.java
index 3136c4cbc9..5f63e3c92d 100644
--- a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/DomainDiscoveryService.java
+++ b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/DomainDiscoveryService.java
@@ -1,122 +1,122 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.dosgi.discovery;
-
-import static org.osgi.service.discovery.DiscoveredServiceNotification.AVAILABLE;
-import static org.osgi.service.discovery.DiscoveredServiceNotification.UNAVAILABLE;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.Implementation;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.implementation.osgi.OSGiImplementation;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-import org.apache.tuscany.sca.runtime.EndpointListener;
-import org.apache.tuscany.sca.runtime.EndpointRegistry;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.discovery.ServiceEndpointDescription;
-
-/**
- * Discovery service based on the distributed SCA domain
- */
-public class DomainDiscoveryService extends AbstractDiscoveryService implements EndpointListener {
- private EndpointRegistry endpointRegistry;
-
- private Map<String, ServiceRegistration> endpointRegistrations =
- new ConcurrentHashMap<String, ServiceRegistration>();
-
- public DomainDiscoveryService(BundleContext context) {
- super(context);
- init();
- }
-
- private void init() {
- getExtensionPointRegistry();
- this.endpointRegistry =
- registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(EndpointRegistry.class);
- this.endpointRegistry.addListener(this);
- }
-
- public void endpointAdded(Endpoint endpoint) {
- Implementation impl = endpoint.getComponent().getImplementation();
- if (!(impl instanceof OSGiImplementation)) {
- return;
- }
-
- OSGiImplementation osgiImpl = (OSGiImplementation)impl;
- BundleContext bundleContext = osgiImpl.getBundle().getBundleContext();
-
- if (!endpoint.isRemote()) {
-
- Interface intf = endpoint.getService().getInterfaceContract().getInterface();
- JavaInterface javaInterface = (JavaInterface)intf;
- // String filter = getOSGiFilter(provider.getOSGiProperties(service));
- // FIXME: What is the filter?
- String filter = "(!(sca.reference=*))";
- // "(sca.service=" + component.getURI() + "#service-name\\(" + service.getName() + "\\))";
- ServiceReference ref = null;
- try {
- ref = bundleContext.getServiceReferences(javaInterface.getName(), filter)[0];
- } catch (InvalidSyntaxException e) {
- // Ignore
- }
- if (ref != null) {
- ServiceRegistration registration = localServicePublished(ref, endpoint);
- endpointRegistrations.put(endpoint.getURI(), registration);
- }
- } else {
- // Remote endpoints
- ServiceEndpointDescription description = new EndpointDescription(endpoint);
- discoveredServiceChanged(description, AVAILABLE);
- }
- }
-
- public void endpointRemoved(Endpoint endpoint) {
- if (!endpoint.isRemote()) {
- // unregister the ServicePublication here
- ServiceRegistration registration = endpointRegistrations.get(endpoint.getURI());
- if (registration != null) {
- registration.unregister();
- }
- } else {
- // Remote endpoints
- ServiceEndpointDescription description = new EndpointDescription(endpoint);
- discoveredServiceChanged(description, UNAVAILABLE);
- }
- }
-
- public void endpointUpdated(Endpoint oldEndpoint, Endpoint newEndpoint) {
- // FIXME: This is a quick and dirty way for the update
- endpointRemoved(oldEndpoint);
- endpointAdded(newEndpoint);
- }
-
- public void stop() {
- endpointRegistry.removeListener(this);
- super.stop();
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.dosgi.discovery;
+
+import static org.osgi.service.discovery.DiscoveredServiceNotification.AVAILABLE;
+import static org.osgi.service.discovery.DiscoveredServiceNotification.UNAVAILABLE;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.Implementation;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.implementation.osgi.OSGiImplementation;
+import org.apache.tuscany.sca.interfacedef.Interface;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.runtime.EndpointListener;
+import org.apache.tuscany.sca.runtime.EndpointRegistry;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.discovery.ServiceEndpointDescription;
+
+/**
+ * Discovery service based on the distributed SCA domain
+ */
+public class DomainDiscoveryService extends AbstractDiscoveryService implements EndpointListener {
+ private EndpointRegistry endpointRegistry;
+
+ private Map<String, ServiceRegistration> endpointRegistrations =
+ new ConcurrentHashMap<String, ServiceRegistration>();
+
+ public DomainDiscoveryService(BundleContext context) {
+ super(context);
+ init();
+ }
+
+ private void init() {
+ getExtensionPointRegistry();
+ this.endpointRegistry =
+ registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(EndpointRegistry.class);
+ this.endpointRegistry.addListener(this);
+ }
+
+ public void endpointAdded(Endpoint endpoint) {
+ Implementation impl = endpoint.getComponent().getImplementation();
+ if (!(impl instanceof OSGiImplementation)) {
+ return;
+ }
+
+ OSGiImplementation osgiImpl = (OSGiImplementation)impl;
+ BundleContext bundleContext = osgiImpl.getBundle().getBundleContext();
+
+ if (!endpoint.isRemote()) {
+
+ Interface intf = endpoint.getService().getInterfaceContract().getInterface();
+ JavaInterface javaInterface = (JavaInterface)intf;
+ // String filter = getOSGiFilter(provider.getOSGiProperties(service));
+ // FIXME: What is the filter?
+ String filter = "(!(sca.reference=*))";
+ // "(sca.service=" + component.getURI() + "#service-name\\(" + service.getName() + "\\))";
+ ServiceReference ref = null;
+ try {
+ ref = bundleContext.getServiceReferences(javaInterface.getName(), filter)[0];
+ } catch (InvalidSyntaxException e) {
+ // Ignore
+ }
+ if (ref != null) {
+ ServiceRegistration registration = localServicePublished(ref, endpoint);
+ endpointRegistrations.put(endpoint.getURI(), registration);
+ }
+ } else {
+ // Remote endpoints
+ ServiceEndpointDescription description = new EndpointDescription(endpoint);
+ discoveredServiceChanged(description, AVAILABLE);
+ }
+ }
+
+ public void endpointRemoved(Endpoint endpoint) {
+ if (!endpoint.isRemote()) {
+ // unregister the ServicePublication here
+ ServiceRegistration registration = endpointRegistrations.get(endpoint.getURI());
+ if (registration != null) {
+ registration.unregister();
+ }
+ } else {
+ // Remote endpoints
+ ServiceEndpointDescription description = new EndpointDescription(endpoint);
+ discoveredServiceChanged(description, UNAVAILABLE);
+ }
+ }
+
+ public void endpointUpdated(Endpoint oldEndpoint, Endpoint newEndpoint) {
+ // FIXME: This is a quick and dirty way for the update
+ endpointRemoved(oldEndpoint);
+ endpointAdded(newEndpoint);
+ }
+
+ public void stop() {
+ endpointRegistry.removeListener(this);
+ super.stop();
+ }
+
+}
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/EndpointDescription.java b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/EndpointDescription.java
index 3f47183a56..5cdb0a4a8a 100644
--- a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/EndpointDescription.java
+++ b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/EndpointDescription.java
@@ -1,69 +1,69 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.dosgi.discovery;
-
-import static org.osgi.service.discovery.ServicePublication.ENDPOINT_ID;
-import static org.osgi.service.discovery.ServicePublication.ENDPOINT_LOCATION;
-
-import java.net.URI;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.interfacedef.Interface;
-import org.apache.tuscany.sca.interfacedef.InterfaceContract;
-import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
-
-/**
- *
- */
-public class EndpointDescription extends ServiceEndpointDescriptionImpl {
- public EndpointDescription(Endpoint endpoint) {
- super(Collections.singleton(getInterfaceName(endpoint)), getServiceProperties(endpoint));
- }
-
- static String getInterfaceName(Endpoint endpoint) {
- ComponentService service = endpoint.getService();
- if (service == null) {
- return null;
- }
- InterfaceContract contract = service.getInterfaceContract();
- if (contract == null) {
- return null;
- }
- Interface intf = contract.getInterface();
- if (intf instanceof JavaInterface) {
- JavaInterface javaInterface = (JavaInterface)intf;
- return javaInterface.getName();
- }
-
- return null;
- }
-
- static Map<String, Object> getServiceProperties(Endpoint endpoint) {
- Map<String, Object> serviceProps = new HashMap<String, Object>();
- serviceProps.put(ENDPOINT_ID, endpoint.getURI());
- serviceProps.put(ENDPOINT_LOCATION, URI.create(endpoint.getBinding().getURI()));
- // TODO: Populate the properties from the Endpoint object
- return serviceProps;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.dosgi.discovery;
+
+import static org.osgi.service.discovery.ServicePublication.ENDPOINT_ID;
+import static org.osgi.service.discovery.ServicePublication.ENDPOINT_LOCATION;
+
+import java.net.URI;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.interfacedef.Interface;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+
+/**
+ *
+ */
+public class EndpointDescription extends ServiceEndpointDescriptionImpl {
+ public EndpointDescription(Endpoint endpoint) {
+ super(Collections.singleton(getInterfaceName(endpoint)), getServiceProperties(endpoint));
+ }
+
+ static String getInterfaceName(Endpoint endpoint) {
+ ComponentService service = endpoint.getService();
+ if (service == null) {
+ return null;
+ }
+ InterfaceContract contract = service.getInterfaceContract();
+ if (contract == null) {
+ return null;
+ }
+ Interface intf = contract.getInterface();
+ if (intf instanceof JavaInterface) {
+ JavaInterface javaInterface = (JavaInterface)intf;
+ return javaInterface.getName();
+ }
+
+ return null;
+ }
+
+ static Map<String, Object> getServiceProperties(Endpoint endpoint) {
+ Map<String, Object> serviceProps = new HashMap<String, Object>();
+ serviceProps.put(ENDPOINT_ID, endpoint.getURI());
+ serviceProps.put(ENDPOINT_LOCATION, URI.create(endpoint.getBinding().getURI()));
+ // TODO: Populate the properties from the Endpoint object
+ return serviceProps;
+ }
+}
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/EndpointPublication.java b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/EndpointPublication.java
index 184d3a12bf..4c7cbee649 100644
--- a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/EndpointPublication.java
+++ b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/EndpointPublication.java
@@ -1,63 +1,63 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.dosgi.discovery;
-
-import java.util.Collections;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.discovery.ServicePublication;
-
-/**
- * Publication of an SCA endpoint
- */
-public class EndpointPublication implements ServicePublication {
- private Endpoint endpoint;
- private ServiceReference reference;
-
- /**
- * Create a publication for the endpoint
- * @param reference The OSGi service reference for the given endpoint. The SCA endpoint
- * is pointing to a local service in the OSGi service registry
- */
- public EndpointPublication(ServiceReference reference, Endpoint endpoint) {
- super();
- this.reference = reference;
- this.endpoint = endpoint;
- }
-
- public ServiceReference getReference() {
- return reference;
- }
-
- public Dictionary<String, Object> getProperties() {
- Dictionary<String, Object> props = new Hashtable<String, Object>();
- Map<String, Object> serviceProps = EndpointDescription.getServiceProperties(endpoint);
- props.put(SERVICE_PROPERTIES, serviceProps);
- // TODO: Populate the properties from the Endpoint object
- String name = EndpointDescription.getInterfaceName(endpoint);
- props.put(ENDPOINT_INTERFACE_NAME, Collections.singleton(name));
- return props;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.dosgi.discovery;
+
+import java.util.Collections;
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.Map;
+
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.discovery.ServicePublication;
+
+/**
+ * Publication of an SCA endpoint
+ */
+public class EndpointPublication implements ServicePublication {
+ private Endpoint endpoint;
+ private ServiceReference reference;
+
+ /**
+ * Create a publication for the endpoint
+ * @param reference The OSGi service reference for the given endpoint. The SCA endpoint
+ * is pointing to a local service in the OSGi service registry
+ */
+ public EndpointPublication(ServiceReference reference, Endpoint endpoint) {
+ super();
+ this.reference = reference;
+ this.endpoint = endpoint;
+ }
+
+ public ServiceReference getReference() {
+ return reference;
+ }
+
+ public Dictionary<String, Object> getProperties() {
+ Dictionary<String, Object> props = new Hashtable<String, Object>();
+ Map<String, Object> serviceProps = EndpointDescription.getServiceProperties(endpoint);
+ props.put(SERVICE_PROPERTIES, serviceProps);
+ // TODO: Populate the properties from the Endpoint object
+ String name = EndpointDescription.getInterfaceName(endpoint);
+ props.put(ENDPOINT_INTERFACE_NAME, Collections.singleton(name));
+ return props;
+ }
+
+}
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/LocalDiscoveryService.java b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/LocalDiscoveryService.java
index 43a19f98cc..543298600d 100644
--- a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/LocalDiscoveryService.java
+++ b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/LocalDiscoveryService.java
@@ -1,122 +1,122 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.dosgi.discovery;
-
-import static org.osgi.framework.Bundle.ACTIVE;
-import static org.osgi.framework.BundleEvent.STARTED;
-import static org.osgi.framework.BundleEvent.STOPPING;
-import static org.osgi.service.discovery.DiscoveredServiceNotification.AVAILABLE;
-import static org.osgi.service.discovery.DiscoveredServiceNotification.UNAVAILABLE;
-
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.tuscany.sca.implementation.osgi.ServiceDescriptions;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleEvent;
-import org.osgi.framework.BundleListener;
-import org.osgi.service.discovery.ServiceEndpointDescription;
-
-public class LocalDiscoveryService extends AbstractDiscoveryService implements BundleListener {
-
- public LocalDiscoveryService(BundleContext context) {
- super(context);
- init();
- }
-
- private void init() {
- context.addBundleListener(this);
- getExtensionPointRegistry();
- processExistingBundles();
- }
-
- public void bundleChanged(BundleEvent event) {
- switch (event.getType()) {
- case STARTED:
- discover(event.getBundle());
- break;
- case STOPPING:
- removeServicesDeclaredInBundle(event.getBundle());
- break;
- }
- }
-
- private void processExistingBundles() {
- Bundle[] bundles = context.getBundles();
- if (bundles == null) {
- return;
- }
-
- for (Bundle b : bundles) {
- if (b.getState() == ACTIVE) {
- discover(b);
- }
- }
- }
-
- private void discover(Bundle b) {
- String path = (String)b.getHeaders().get(ServiceDescriptions.REMOTE_SERVICE_HEADER);
- if (path == null) {
- Enumeration files = b.findEntries(ServiceDescriptions.REMOTE_SERVICE_FOLDER, "*.xml", false);
- if (files == null || !files.hasMoreElements()) {
- return;
- }
- }
-
- ServiceDescriptions descriptions = null;
-
- // TODO: Use SCA contribution to load the service discription files
- List<ServiceEndpointDescription> refs = Collections.emptyList();
- for (ServiceEndpointDescription sed : refs) {
- servicesInfo.put(sed, b);
- serviceDescriptionAdded(sed);
- }
- // throw new RuntimeException("To be implemented");
- }
-
- private void removeServicesDeclaredInBundle(Bundle bundle) {
- for (Iterator<Map.Entry<ServiceEndpointDescription, Bundle>> i = servicesInfo.entrySet().iterator(); i
- .hasNext();) {
- Entry<ServiceEndpointDescription, Bundle> entry = i.next();
- if (entry.getValue().equals(bundle)) {
- serviceDescriptionRemoved(entry.getKey());
- i.remove();
- }
- }
- }
-
- private void serviceDescriptionAdded(ServiceEndpointDescription sd) {
- discoveredServiceChanged(sd, AVAILABLE);
- }
-
- private void serviceDescriptionRemoved(ServiceEndpointDescription sd) {
- discoveredServiceChanged(sd, UNAVAILABLE);
- }
-
- public void stop() {
- context.removeBundleListener(this);
- super.stop();
- }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.dosgi.discovery;
+
+import static org.osgi.framework.Bundle.ACTIVE;
+import static org.osgi.framework.BundleEvent.STARTED;
+import static org.osgi.framework.BundleEvent.STOPPING;
+import static org.osgi.service.discovery.DiscoveredServiceNotification.AVAILABLE;
+import static org.osgi.service.discovery.DiscoveredServiceNotification.UNAVAILABLE;
+
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.tuscany.sca.implementation.osgi.ServiceDescriptions;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleEvent;
+import org.osgi.framework.BundleListener;
+import org.osgi.service.discovery.ServiceEndpointDescription;
+
+public class LocalDiscoveryService extends AbstractDiscoveryService implements BundleListener {
+
+ public LocalDiscoveryService(BundleContext context) {
+ super(context);
+ init();
+ }
+
+ private void init() {
+ context.addBundleListener(this);
+ getExtensionPointRegistry();
+ processExistingBundles();
+ }
+
+ public void bundleChanged(BundleEvent event) {
+ switch (event.getType()) {
+ case STARTED:
+ discover(event.getBundle());
+ break;
+ case STOPPING:
+ removeServicesDeclaredInBundle(event.getBundle());
+ break;
+ }
+ }
+
+ private void processExistingBundles() {
+ Bundle[] bundles = context.getBundles();
+ if (bundles == null) {
+ return;
+ }
+
+ for (Bundle b : bundles) {
+ if (b.getState() == ACTIVE) {
+ discover(b);
+ }
+ }
+ }
+
+ private void discover(Bundle b) {
+ String path = (String)b.getHeaders().get(ServiceDescriptions.REMOTE_SERVICE_HEADER);
+ if (path == null) {
+ Enumeration files = b.findEntries(ServiceDescriptions.REMOTE_SERVICE_FOLDER, "*.xml", false);
+ if (files == null || !files.hasMoreElements()) {
+ return;
+ }
+ }
+
+ ServiceDescriptions descriptions = null;
+
+ // TODO: Use SCA contribution to load the service discription files
+ List<ServiceEndpointDescription> refs = Collections.emptyList();
+ for (ServiceEndpointDescription sed : refs) {
+ servicesInfo.put(sed, b);
+ serviceDescriptionAdded(sed);
+ }
+ // throw new RuntimeException("To be implemented");
+ }
+
+ private void removeServicesDeclaredInBundle(Bundle bundle) {
+ for (Iterator<Map.Entry<ServiceEndpointDescription, Bundle>> i = servicesInfo.entrySet().iterator(); i
+ .hasNext();) {
+ Entry<ServiceEndpointDescription, Bundle> entry = i.next();
+ if (entry.getValue().equals(bundle)) {
+ serviceDescriptionRemoved(entry.getKey());
+ i.remove();
+ }
+ }
+ }
+
+ private void serviceDescriptionAdded(ServiceEndpointDescription sd) {
+ discoveredServiceChanged(sd, AVAILABLE);
+ }
+
+ private void serviceDescriptionRemoved(ServiceEndpointDescription sd) {
+ discoveredServiceChanged(sd, UNAVAILABLE);
+ }
+
+ public void stop() {
+ context.removeBundleListener(this);
+ super.stop();
+ }
+
+}
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/ServiceEndpointDescriptionImpl.java b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/ServiceEndpointDescriptionImpl.java
index 949405472f..cd3b8e7543 100644
--- a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/ServiceEndpointDescriptionImpl.java
+++ b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/dosgi/discovery/ServiceEndpointDescriptionImpl.java
@@ -1,135 +1,135 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.dosgi.discovery;
-
-import static org.osgi.service.discovery.ServicePublication.ENDPOINT_ID;
-import static org.osgi.service.discovery.ServicePublication.ENDPOINT_LOCATION;
-import static org.osgi.service.discovery.ServicePublication.SERVICE_INTERFACE_NAME;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Logger;
-
-import org.osgi.service.discovery.ServiceEndpointDescription;
-
-public class ServiceEndpointDescriptionImpl implements ServiceEndpointDescription {
-
- private static final Logger logger = Logger.getLogger(ServiceEndpointDescriptionImpl.class.getName());
-
- private Set<String> interfaces;
- private Map<String, Object> properties;
-
- public ServiceEndpointDescriptionImpl(Collection<String> interfaceNames) {
- this(interfaceNames, Collections.<String, Object> singletonMap(SERVICE_INTERFACE_NAME,
- interfaceNames));
- }
-
- public ServiceEndpointDescriptionImpl(Collection<String> interfaceNames, Map<String, Object> remoteProperties) {
- this.interfaces = new HashSet<String>(interfaceNames);
- this.properties = remoteProperties;
- }
-
- public ServiceEndpointDescriptionImpl(String interfaceName) {
- this(Collections.singleton(interfaceName));
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- ServiceEndpointDescriptionImpl other = (ServiceEndpointDescriptionImpl)obj;
- if (interfaces == null) {
- if (other.interfaces != null)
- return false;
- } else if (!interfaces.equals(other.interfaces))
- return false;
- if (properties == null) {
- if (other.properties != null)
- return false;
- } else if (!properties.equals(other.properties))
- return false;
- return true;
- }
-
- public String getEndpointID() {
- Object val = properties.get(ENDPOINT_ID);
- if (val == null) {
- return null;
- } else {
- return val.toString();
- }
- }
-
- public String getEndpointInterfaceName(String interfaceName) {
- return interfaceName;
- }
-
- public URI getLocation() {
- Object value = properties.get(ENDPOINT_LOCATION);
- if (value == null) {
- return null;
- }
-
- try {
- return new URI(value.toString());
- } catch (URISyntaxException ex) {
- logger.warning("Service document URL is malformed : " + value.toString());
- }
-
- return null;
- }
-
- public Map<String, Object> getProperties() {
- return Collections.unmodifiableMap(properties);
- }
-
- public Object getProperty(String key) {
- return properties.get(key);
- }
-
- public Collection<String> getPropertyKeys() {
- return getProperties().keySet();
- }
-
- public Collection<String> getProvidedInterfaces() {
- return interfaces;
- }
-
- public String getVersion(String interfaceName) {
- return "0.0";
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((interfaces == null) ? 0 : interfaces.hashCode());
- result = prime * result + ((properties == null) ? 0 : properties.hashCode());
- return result;
- }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.dosgi.discovery;
+
+import static org.osgi.service.discovery.ServicePublication.ENDPOINT_ID;
+import static org.osgi.service.discovery.ServicePublication.ENDPOINT_LOCATION;
+import static org.osgi.service.discovery.ServicePublication.SERVICE_INTERFACE_NAME;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import org.osgi.service.discovery.ServiceEndpointDescription;
+
+public class ServiceEndpointDescriptionImpl implements ServiceEndpointDescription {
+
+ private static final Logger logger = Logger.getLogger(ServiceEndpointDescriptionImpl.class.getName());
+
+ private Set<String> interfaces;
+ private Map<String, Object> properties;
+
+ public ServiceEndpointDescriptionImpl(Collection<String> interfaceNames) {
+ this(interfaceNames, Collections.<String, Object> singletonMap(SERVICE_INTERFACE_NAME,
+ interfaceNames));
+ }
+
+ public ServiceEndpointDescriptionImpl(Collection<String> interfaceNames, Map<String, Object> remoteProperties) {
+ this.interfaces = new HashSet<String>(interfaceNames);
+ this.properties = remoteProperties;
+ }
+
+ public ServiceEndpointDescriptionImpl(String interfaceName) {
+ this(Collections.singleton(interfaceName));
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ServiceEndpointDescriptionImpl other = (ServiceEndpointDescriptionImpl)obj;
+ if (interfaces == null) {
+ if (other.interfaces != null)
+ return false;
+ } else if (!interfaces.equals(other.interfaces))
+ return false;
+ if (properties == null) {
+ if (other.properties != null)
+ return false;
+ } else if (!properties.equals(other.properties))
+ return false;
+ return true;
+ }
+
+ public String getEndpointID() {
+ Object val = properties.get(ENDPOINT_ID);
+ if (val == null) {
+ return null;
+ } else {
+ return val.toString();
+ }
+ }
+
+ public String getEndpointInterfaceName(String interfaceName) {
+ return interfaceName;
+ }
+
+ public URI getLocation() {
+ Object value = properties.get(ENDPOINT_LOCATION);
+ if (value == null) {
+ return null;
+ }
+
+ try {
+ return new URI(value.toString());
+ } catch (URISyntaxException ex) {
+ logger.warning("Service document URL is malformed : " + value.toString());
+ }
+
+ return null;
+ }
+
+ public Map<String, Object> getProperties() {
+ return Collections.unmodifiableMap(properties);
+ }
+
+ public Object getProperty(String key) {
+ return properties.get(key);
+ }
+
+ public Collection<String> getPropertyKeys() {
+ return getProperties().keySet();
+ }
+
+ public Collection<String> getProvidedInterfaces() {
+ return interfaces;
+ }
+
+ public String getVersion(String interfaceName) {
+ return "0.0";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((interfaces == null) ? 0 : interfaces.hashCode());
+ result = prime * result + ((properties == null) ? 0 : properties.hashCode());
+ return result;
+ }
+}
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeUtil.java b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeUtil.java
index fccd30d8ff..3df50597b6 100644
--- a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeUtil.java
+++ b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/NodeUtil.java
@@ -32,7 +32,7 @@ import org.apache.tuscany.sca.contribution.ContributionFactory;
/**
* NodeUtil
*
- * @version $Rev: $ $Date: $
+ * @version $Rev$ $Date$
*/
public class NodeUtil {
private NodeUtil() {
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/OSGiServiceExporter.java b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/OSGiServiceExporter.java
index 67fa384b4a..d4a6580842 100644
--- a/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/OSGiServiceExporter.java
+++ b/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/node/osgi/impl/OSGiServiceExporter.java
@@ -1,138 +1,138 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.osgi.impl;
-
-import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SERVICE_EXPORTED_CONFIGS;
-import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SERVICE_EXPORTED_INTERFACES;
-import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SERVICE_IMPORTED;
-
-import java.util.Collections;
-
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.implementation.osgi.introspection.ExportedServiceIntrospector;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
-import org.apache.tuscany.sca.node.impl.NodeFactoryImpl;
-import org.apache.tuscany.sca.node.impl.NodeImpl;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.Filter;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
-import org.osgi.util.tracker.ServiceTrackerCustomizer;
-
-/**
- * Watching and exporting OSGi services
- */
-public class OSGiServiceExporter implements ServiceTrackerCustomizer {
- private ExtensionPointRegistry registry;
- private BundleContext context;
- private ServiceTracker serviceTracker;
- private NodeFactoryImpl nodeFactory;
- private ExportedServiceIntrospector introspector;
-
- /**
- * @param context
- * @param clazz
- * @param customizer
- */
- public OSGiServiceExporter(BundleContext context) {
- this.context = context;
- }
-
- private synchronized void init() {
- if (nodeFactory == null) {
- this.nodeFactory = (NodeFactoryImpl)NodeFactory.newInstance();
- this.nodeFactory.init();
- this.introspector = new ExportedServiceIntrospector(getExtensionPointRegistry());
- }
- }
-
- public void start() {
- String filterStr =
- "(& (" + SERVICE_EXPORTED_CONFIGS
- + "=sca) ("
- + SERVICE_EXPORTED_INTERFACES
- + "=*) (!("
- + SERVICE_IMPORTED
- + "=*)) )";
- try {
- Filter filter = context.createFilter(filterStr);
- serviceTracker = new ServiceTracker(context, filter, this);
- serviceTracker.open(true);
- } catch (InvalidSyntaxException e) {
- // Ignore
- }
- }
-
- public void stop() {
- if (serviceTracker != null) {
- serviceTracker.close();
- serviceTracker = null;
- }
- }
-
- public Object addingService(ServiceReference reference) {
- init();
- try {
- Contribution contribution = introspector.introspect(reference);
- if (contribution != null) {
-
- NodeConfiguration configuration = nodeFactory.createNodeConfiguration();
- configuration.setURI("osgi.service." + String.valueOf(reference.getProperty(Constants.SERVICE_ID)));
- configuration.getExtensions().add(reference.getBundle());
- // FIXME: Configure the domain and node URI
- NodeImpl node = new NodeImpl(nodeFactory, configuration, Collections.singletonList(contribution));
- return node.start();
- } else {
- return null;
- }
- } catch (Exception e) {
- e.printStackTrace();
- return null;
- }
- }
-
- public void modifiedService(ServiceReference reference, Object service) {
- Node node = (Node)service;
- node.stop();
- node.start();
- }
-
- public void removedService(ServiceReference reference, Object service) {
- Node node = (Node)service;
- node.stop();
- }
-
- protected ExtensionPointRegistry getExtensionPointRegistry() {
- if (registry == null) {
- ServiceTracker tracker = new ServiceTracker(context, ExtensionPointRegistry.class.getName(), null);
- tracker.open();
- // tracker.waitForService(1000);
- registry = (ExtensionPointRegistry)tracker.getService();
- tracker.close();
- }
- return registry;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.osgi.impl;
+
+import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SERVICE_EXPORTED_CONFIGS;
+import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SERVICE_EXPORTED_INTERFACES;
+import static org.apache.tuscany.sca.implementation.osgi.OSGiProperty.SERVICE_IMPORTED;
+
+import java.util.Collections;
+
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.implementation.osgi.introspection.ExportedServiceIntrospector;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
+import org.apache.tuscany.sca.node.impl.NodeFactoryImpl;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+import org.osgi.util.tracker.ServiceTrackerCustomizer;
+
+/**
+ * Watching and exporting OSGi services
+ */
+public class OSGiServiceExporter implements ServiceTrackerCustomizer {
+ private ExtensionPointRegistry registry;
+ private BundleContext context;
+ private ServiceTracker serviceTracker;
+ private NodeFactoryImpl nodeFactory;
+ private ExportedServiceIntrospector introspector;
+
+ /**
+ * @param context
+ * @param clazz
+ * @param customizer
+ */
+ public OSGiServiceExporter(BundleContext context) {
+ this.context = context;
+ }
+
+ private synchronized void init() {
+ if (nodeFactory == null) {
+ this.nodeFactory = (NodeFactoryImpl)NodeFactory.newInstance();
+ this.nodeFactory.init();
+ this.introspector = new ExportedServiceIntrospector(getExtensionPointRegistry());
+ }
+ }
+
+ public void start() {
+ String filterStr =
+ "(& (" + SERVICE_EXPORTED_CONFIGS
+ + "=sca) ("
+ + SERVICE_EXPORTED_INTERFACES
+ + "=*) (!("
+ + SERVICE_IMPORTED
+ + "=*)) )";
+ try {
+ Filter filter = context.createFilter(filterStr);
+ serviceTracker = new ServiceTracker(context, filter, this);
+ serviceTracker.open(true);
+ } catch (InvalidSyntaxException e) {
+ // Ignore
+ }
+ }
+
+ public void stop() {
+ if (serviceTracker != null) {
+ serviceTracker.close();
+ serviceTracker = null;
+ }
+ }
+
+ public Object addingService(ServiceReference reference) {
+ init();
+ try {
+ Contribution contribution = introspector.introspect(reference);
+ if (contribution != null) {
+
+ NodeConfiguration configuration = nodeFactory.createNodeConfiguration();
+ configuration.setURI("osgi.service." + String.valueOf(reference.getProperty(Constants.SERVICE_ID)));
+ configuration.getExtensions().add(reference.getBundle());
+ // FIXME: Configure the domain and node URI
+ NodeImpl node = new NodeImpl(nodeFactory, configuration, Collections.singletonList(contribution));
+ return node.start();
+ } else {
+ return null;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ public void modifiedService(ServiceReference reference, Object service) {
+ Node node = (Node)service;
+ node.stop();
+ node.start();
+ }
+
+ public void removedService(ServiceReference reference, Object service) {
+ Node node = (Node)service;
+ node.stop();
+ }
+
+ protected ExtensionPointRegistry getExtensionPointRegistry() {
+ if (registry == null) {
+ ServiceTracker tracker = new ServiceTracker(context, ExtensionPointRegistry.class.getName(), null);
+ tracker.open();
+ // tracker.waitForService(1000);
+ registry = (ExtensionPointRegistry)tracker.getService();
+ tracker.close();
+ }
+ return registry;
+ }
+
+}
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/DiscoveredServiceNotification.java b/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/DiscoveredServiceNotification.java
index 57de9c7c9d..d4431954b8 100644
--- a/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/DiscoveredServiceNotification.java
+++ b/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/DiscoveredServiceNotification.java
@@ -1,107 +1,107 @@
-/*
- * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.osgi.service.discovery;
-
-import java.util.Collection;
-
-/**
- * Interface for notification on discovered services.
- * <p>
- * <code>DiscoveredServiceNotification</code> objects are immutable.
- *
- * @Immutable
- */
-public interface DiscoveredServiceNotification {
-
- /**
- * Notification indicating that a service matching the listening criteria
- * has been discovered.
- * <p>
- * The value of <code>AVAILABLE</code> is 0x00000001.
- */
- public final static int AVAILABLE = 0x00000001;
-
- /**
- * Notification indicating that the properties of a previously discovered
- * service have changed.
- * <p>
- * The value of <code>MODIFIED</code> is 0x00000002.
- */
- public final static int MODIFIED = 0x00000002;
-
- /**
- * Notification indicating that a previously discovered service is no longer
- * known to <code>Discovery</code>.
- * <p>
- * The value of <code>UNAVAILABLE</code> is 0x00000004.
- */
- public final static int UNAVAILABLE = 0x00000004;
-
- /**
- * Notification indicating that the properties of a previously discovered
- * service have changed and the new properties no longer match the
- * listener's filter.
- * <p>
- * The value of <code>MODIFIED_ENDMATCH</code> is 0x00000008.
- */
- public final static int MODIFIED_ENDMATCH = 0x00000008;
-
- /**
- * Returns information currently known to <code>Discovery</code> regarding
- * the service endpoint.
- *
- * @return metadata of the service <code>Discovery</code> notifies about. Is
- * never <code>null</code>.
- */
- ServiceEndpointDescription getServiceEndpointDescription();
-
- /**
- * Returns the type of notification. The type values are:
- * <ul>
- * <li>{@link #AVAILABLE}</li>
- * <li>{@link #MODIFIED}</li>
- * <li>{@link #MODIFIED_ENDMATCH}</li>
- * <li>{@link #UNAVAILABLE}</li>
- * </ul>
- *
- * @return Type of notification regarding known service metadata.
- */
- int getType();
-
- /**
- * Returns interface name criteria of the {@link DiscoveredServiceTracker}
- * object matching with the interfaces of the
- * <code>ServiceEndpointDescription</code> and thus caused the notification.
- *
- * @return <code>Collection (&lt;? extends String&gt;)</code> of matching interface name criteria of the
- * <code>DiscoveredServiceTracker</code> object being notified, or
- * an empty collection if notification hasn't been caused by a
- * matching interface name criteria.
- */
- Collection/* <? extends String> */getInterfaces();
-
- /**
- * Returns filters of the <code>DiscoveredServiceTracker</code> object
- * matching with the properties of the
- * <code>ServiceEndpointDescription</code> and thus caused the notification.
- *
- * @return <code>Collection (&lt;? extends String&gt;)</code> of matching filters of the <code>DiscoveredServiceTracker</code>
- * object being notified, or an empty collection if notification
- * hasn't been caused by a matching filter criteria.
- */
- Collection/* <? extends String> */getFilters();
-}
+/*
+ * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.osgi.service.discovery;
+
+import java.util.Collection;
+
+/**
+ * Interface for notification on discovered services.
+ * <p>
+ * <code>DiscoveredServiceNotification</code> objects are immutable.
+ *
+ * @Immutable
+ */
+public interface DiscoveredServiceNotification {
+
+ /**
+ * Notification indicating that a service matching the listening criteria
+ * has been discovered.
+ * <p>
+ * The value of <code>AVAILABLE</code> is 0x00000001.
+ */
+ public final static int AVAILABLE = 0x00000001;
+
+ /**
+ * Notification indicating that the properties of a previously discovered
+ * service have changed.
+ * <p>
+ * The value of <code>MODIFIED</code> is 0x00000002.
+ */
+ public final static int MODIFIED = 0x00000002;
+
+ /**
+ * Notification indicating that a previously discovered service is no longer
+ * known to <code>Discovery</code>.
+ * <p>
+ * The value of <code>UNAVAILABLE</code> is 0x00000004.
+ */
+ public final static int UNAVAILABLE = 0x00000004;
+
+ /**
+ * Notification indicating that the properties of a previously discovered
+ * service have changed and the new properties no longer match the
+ * listener's filter.
+ * <p>
+ * The value of <code>MODIFIED_ENDMATCH</code> is 0x00000008.
+ */
+ public final static int MODIFIED_ENDMATCH = 0x00000008;
+
+ /**
+ * Returns information currently known to <code>Discovery</code> regarding
+ * the service endpoint.
+ *
+ * @return metadata of the service <code>Discovery</code> notifies about. Is
+ * never <code>null</code>.
+ */
+ ServiceEndpointDescription getServiceEndpointDescription();
+
+ /**
+ * Returns the type of notification. The type values are:
+ * <ul>
+ * <li>{@link #AVAILABLE}</li>
+ * <li>{@link #MODIFIED}</li>
+ * <li>{@link #MODIFIED_ENDMATCH}</li>
+ * <li>{@link #UNAVAILABLE}</li>
+ * </ul>
+ *
+ * @return Type of notification regarding known service metadata.
+ */
+ int getType();
+
+ /**
+ * Returns interface name criteria of the {@link DiscoveredServiceTracker}
+ * object matching with the interfaces of the
+ * <code>ServiceEndpointDescription</code> and thus caused the notification.
+ *
+ * @return <code>Collection (&lt;? extends String&gt;)</code> of matching interface name criteria of the
+ * <code>DiscoveredServiceTracker</code> object being notified, or
+ * an empty collection if notification hasn't been caused by a
+ * matching interface name criteria.
+ */
+ Collection/* <? extends String> */getInterfaces();
+
+ /**
+ * Returns filters of the <code>DiscoveredServiceTracker</code> object
+ * matching with the properties of the
+ * <code>ServiceEndpointDescription</code> and thus caused the notification.
+ *
+ * @return <code>Collection (&lt;? extends String&gt;)</code> of matching filters of the <code>DiscoveredServiceTracker</code>
+ * object being notified, or an empty collection if notification
+ * hasn't been caused by a matching filter criteria.
+ */
+ Collection/* <? extends String> */getFilters();
+}
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/DiscoveredServiceTracker.java b/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/DiscoveredServiceTracker.java
index efd158a2f5..0cfa023d95 100644
--- a/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/DiscoveredServiceTracker.java
+++ b/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/DiscoveredServiceTracker.java
@@ -1,81 +1,81 @@
-/*
- * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.osgi.service.discovery;
-
-/**
- * Interface of trackers for discovered remote services.
- * <p>
- * When a service implementing this interface is registered with the framework,
- * then <code>Discovery</code> will notify it about remote services matching one
- * of the provided criteria and will keep notifying it on changes of information
- * known to Discovery regarding this services.
- *
- * <code>Discovery</code> may deliver notifications on discovered services to a
- * <code>DiscoveredServiceTracker</code> out of order and may concurrently call
- * and/or reenter a <code>DiscoveredServiceTracker</code>.
- *
- * @ThreadSafe
- */
-public interface DiscoveredServiceTracker {
-
- /**
- * Optional ServiceRegistration property which contains service interfaces
- * this tracker is interested in.
- * <p>
- * Value of this property is of type
- * <code>Collection (&lt;? extends String&gt;)</code>. May be
- * <code>null</code> or empty.
- */
- public static final String INTERFACE_MATCH_CRITERIA = "osgi.remote.discovery.interest.interfaces";
-
- /**
- * Optional ServiceRegistration property which contains filters for services
- * this tracker is interested in.
- * <p>
- * Note that these filters need to take into account service publication
- * properties which are not necessarily the same as properties under which a
- * service is registered. See {@link ServicePublication} for some standard
- * properties used to publish service metadata.
- * <p>
- * The following sample filter will make <code>Discovery</code> notify the
- * <code>DiscoveredServiceTracker</code> about services providing interface
- * 'my.company.foo' of version '1.0.1.3':
- * <code>"(&amp;(service.interface=my.company.foo)(service.interface.version=my.company.foo|1.0.1.3))"</code>.
- * <p>
- * Value of this property is of type
- * <code>Collection (&lt;? extends String&gt;)</code>. May be
- * <code>null</code>. or empty
- */
- public static final String FILTER_MATCH_CRITERIA = "osgi.remote.discovery.interest.filters";
-
- /**
- * Receives notification that information known to <code>Discovery</code>
- * regarding a remote service has changed.
- * <p>
- * The tracker is only notified about remote services which fulfill the
- * matching criteria, either one of the interfaces or one of the filters,
- * provided as properties of this service.
- * <p>
- * If multiple criteria match, then the tracker is notified about each of
- * them. This can be done either by a single notification callback or by
- * multiple subsequent ones.
- *
- * @param notification the <code>DiscoveredServiceNotification</code> object
- * describing the change. Is never <code>null</code>.
- */
- void serviceChanged(DiscoveredServiceNotification notification);
-}
+/*
+ * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.osgi.service.discovery;
+
+/**
+ * Interface of trackers for discovered remote services.
+ * <p>
+ * When a service implementing this interface is registered with the framework,
+ * then <code>Discovery</code> will notify it about remote services matching one
+ * of the provided criteria and will keep notifying it on changes of information
+ * known to Discovery regarding this services.
+ *
+ * <code>Discovery</code> may deliver notifications on discovered services to a
+ * <code>DiscoveredServiceTracker</code> out of order and may concurrently call
+ * and/or reenter a <code>DiscoveredServiceTracker</code>.
+ *
+ * @ThreadSafe
+ */
+public interface DiscoveredServiceTracker {
+
+ /**
+ * Optional ServiceRegistration property which contains service interfaces
+ * this tracker is interested in.
+ * <p>
+ * Value of this property is of type
+ * <code>Collection (&lt;? extends String&gt;)</code>. May be
+ * <code>null</code> or empty.
+ */
+ public static final String INTERFACE_MATCH_CRITERIA = "osgi.remote.discovery.interest.interfaces";
+
+ /**
+ * Optional ServiceRegistration property which contains filters for services
+ * this tracker is interested in.
+ * <p>
+ * Note that these filters need to take into account service publication
+ * properties which are not necessarily the same as properties under which a
+ * service is registered. See {@link ServicePublication} for some standard
+ * properties used to publish service metadata.
+ * <p>
+ * The following sample filter will make <code>Discovery</code> notify the
+ * <code>DiscoveredServiceTracker</code> about services providing interface
+ * 'my.company.foo' of version '1.0.1.3':
+ * <code>"(&amp;(service.interface=my.company.foo)(service.interface.version=my.company.foo|1.0.1.3))"</code>.
+ * <p>
+ * Value of this property is of type
+ * <code>Collection (&lt;? extends String&gt;)</code>. May be
+ * <code>null</code>. or empty
+ */
+ public static final String FILTER_MATCH_CRITERIA = "osgi.remote.discovery.interest.filters";
+
+ /**
+ * Receives notification that information known to <code>Discovery</code>
+ * regarding a remote service has changed.
+ * <p>
+ * The tracker is only notified about remote services which fulfill the
+ * matching criteria, either one of the interfaces or one of the filters,
+ * provided as properties of this service.
+ * <p>
+ * If multiple criteria match, then the tracker is notified about each of
+ * them. This can be done either by a single notification callback or by
+ * multiple subsequent ones.
+ *
+ * @param notification the <code>DiscoveredServiceNotification</code> object
+ * describing the change. Is never <code>null</code>.
+ */
+ void serviceChanged(DiscoveredServiceNotification notification);
+}
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/Discovery.java b/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/Discovery.java
index cca766a032..fd99b0282c 100644
--- a/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/Discovery.java
+++ b/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/Discovery.java
@@ -1,66 +1,66 @@
-/*
- * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.osgi.service.discovery;
-
-/**
- * Every Discovery Provider registers a service implementing this interface.
- * This service is registered with extra properties identified at the beginning
- * of this interface to denote the name of the product providing Discovery
- * functionality, its version, vendor, used protocols etc..
- * <p>
- * Discovery allows to publish services exposed for remote access as well as to
- * search for remote services. Register a {@link ServicePublication} service in
- * order to publish service metadata and or a {@link DiscoveredServiceTracker}
- * service in order to search for remote services.
- * <p>
- * Discovery service implementations usually rely on some discovery protocols or
- * other information distribution means.
- *
- * @ThreadSafe
- */
-public interface Discovery {
-
- /**
- * ServiceRegistration property for the name of the Discovery product.
- * <p>
- * Value of this property is of type <code>String</code>.
- */
- static final String PRODUCT_NAME = "osgi.remote.discovery.product";
-
- /**
- * ServiceRegistration property for the version of the Discovery product.
- * <p>
- * Value of this property is of type <code>String</code>.
- */
- static final String PRODUCT_VERSION = "osgi.remote.discovery.product.version";
-
- /**
- * ServiceRegistration property for the Discovery product vendor name.
- * <p>
- * Value of this property is of type <code>String</code>.
- */
- static final String VENDOR_NAME = "osgi.remote.discovery.vendor";
-
- /**
- * ServiceRegistration property that lists the discovery protocols used by
- * this Discovery service.
- * <p>
- * Value of this property is of type
- * <code>Collection (&lt;? extends String&gt;)</code>.
- */
- static final String SUPPORTED_PROTOCOLS = "osgi.remote.discovery.supported_protocols";
-}
+/*
+ * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.osgi.service.discovery;
+
+/**
+ * Every Discovery Provider registers a service implementing this interface.
+ * This service is registered with extra properties identified at the beginning
+ * of this interface to denote the name of the product providing Discovery
+ * functionality, its version, vendor, used protocols etc..
+ * <p>
+ * Discovery allows to publish services exposed for remote access as well as to
+ * search for remote services. Register a {@link ServicePublication} service in
+ * order to publish service metadata and or a {@link DiscoveredServiceTracker}
+ * service in order to search for remote services.
+ * <p>
+ * Discovery service implementations usually rely on some discovery protocols or
+ * other information distribution means.
+ *
+ * @ThreadSafe
+ */
+public interface Discovery {
+
+ /**
+ * ServiceRegistration property for the name of the Discovery product.
+ * <p>
+ * Value of this property is of type <code>String</code>.
+ */
+ static final String PRODUCT_NAME = "osgi.remote.discovery.product";
+
+ /**
+ * ServiceRegistration property for the version of the Discovery product.
+ * <p>
+ * Value of this property is of type <code>String</code>.
+ */
+ static final String PRODUCT_VERSION = "osgi.remote.discovery.product.version";
+
+ /**
+ * ServiceRegistration property for the Discovery product vendor name.
+ * <p>
+ * Value of this property is of type <code>String</code>.
+ */
+ static final String VENDOR_NAME = "osgi.remote.discovery.vendor";
+
+ /**
+ * ServiceRegistration property that lists the discovery protocols used by
+ * this Discovery service.
+ * <p>
+ * Value of this property is of type
+ * <code>Collection (&lt;? extends String&gt;)</code>.
+ */
+ static final String SUPPORTED_PROTOCOLS = "osgi.remote.discovery.supported_protocols";
+}
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/ServiceEndpointDescription.java b/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/ServiceEndpointDescription.java
index e1f389ea78..8f8b5d9f16 100644
--- a/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/ServiceEndpointDescription.java
+++ b/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/ServiceEndpointDescription.java
@@ -1,128 +1,128 @@
-/*
- * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.osgi.service.discovery;
-
-import java.net.URI;
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * This interface describes an endpoint of a service. This class can be
- * considered as a wrapper around the property map of a published service and
- * its endpoint. It provides an API to conveniently access the most important
- * properties of the service.
- * <p>
- * <code>ServiceEndpointDescription</code> objects are immutable.
- *
- * @Immutable
- */
-public interface ServiceEndpointDescription {
-
- /**
- * Returns the value of the property with key
- * {@link ServicePublication#SERVICE_INTERFACE_NAME}.
- *
- * @return <code>Collection (&lt;? extends String&gt;)</code> of service
- * interface names provided by the advertised service endpoint. The
- * collection is never <code>null</code> or empty but contains at
- * least one service interface.
- */
- Collection /* <? extends String> */getProvidedInterfaces();
-
- /**
- * Returns non-Java endpoint interface name associated with the given
- * interface.
- * <p>
- * Value of the property with key
- * {@link ServicePublication#ENDPOINT_INTERFACE_NAME} is used by this
- * operation.
- *
- * @param interfaceName for which its non-Java endpoint interface name
- * should be returned.
- * @return non-Java endpoint interface name, or <code>null</code> if it
- * hasn't been provided or if given interface name is
- * <code>null</code>.
- */
- String getEndpointInterfaceName(String interfaceName);
-
- /**
- * Returns version of the given interface.
- * <p>
- * Value of the property with key
- * {@link ServicePublication#SERVICE_INTERFACE_VERSION} is used by this
- * operation.
- *
- * @param interfaceName for which its version should be returned.
- * @return Version of given service interface, or <code>null</code> if it
- * hasn't been provided or if given interface name is
- * <code>null</code>.
- */
- String getVersion(String interfaceName);
-
- /**
- * Returns the value of the property with key
- * {@link ServicePublication#ENDPOINT_LOCATION}.
- *
- * @return The url of the service location, or <code>null</code> if it
- * hasn't been provided.
- */
- URI getLocation();
-
- /**
- * Returns the value of the property with key
- * {@link ServicePublication#ENDPOINT_ID}.
- *
- * @return Unique id of service endpoint, or <code>null</code> if it hasn't
- * been provided.
- */
- String getEndpointID();
-
- /**
- * Getter method for the property value of a given key.
- *
- * @param key Name of the property
- * @return The property value, or <code>null</code> if none is found for the
- * given key or if provided key is <code>null</code>.
- */
- Object getProperty(String key);
-
- /**
- * Returns all names of service endpoint properties.
- *
- * @return a <code>Collection (&lt;? extends String&gt;)</code> of property
- * names available in the ServiceEndpointDescription. The collection
- * is never <code>null</code> or empty but contains at least names
- * of mandatory <code>ServicePublication</code> properties. Since
- * <code>ServiceEndpointDescription</code> objects are immutable,
- * the returned collection is also not going to be updated at a
- * later point of time.
- */
- Collection/* <? extends String> */getPropertyKeys();
-
- /**
- * Returns all service endpoint properties.
- *
- * @return all properties of the service as a
- * <code>Map (&lt;String, Object&gt;)</code>. The map is never
- * <code>null</code> or empty but contains at least mandatory
- * <code>ServicePublication</code> properties. Since
- * <code>ServiceEndpointDescription</code> objects are immutable,
- * the returned map is also not going to be updated at a later point
- * of time.
- */
- Map/* <String, Object> */getProperties();
-}
+/*
+ * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.osgi.service.discovery;
+
+import java.net.URI;
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * This interface describes an endpoint of a service. This class can be
+ * considered as a wrapper around the property map of a published service and
+ * its endpoint. It provides an API to conveniently access the most important
+ * properties of the service.
+ * <p>
+ * <code>ServiceEndpointDescription</code> objects are immutable.
+ *
+ * @Immutable
+ */
+public interface ServiceEndpointDescription {
+
+ /**
+ * Returns the value of the property with key
+ * {@link ServicePublication#SERVICE_INTERFACE_NAME}.
+ *
+ * @return <code>Collection (&lt;? extends String&gt;)</code> of service
+ * interface names provided by the advertised service endpoint. The
+ * collection is never <code>null</code> or empty but contains at
+ * least one service interface.
+ */
+ Collection /* <? extends String> */getProvidedInterfaces();
+
+ /**
+ * Returns non-Java endpoint interface name associated with the given
+ * interface.
+ * <p>
+ * Value of the property with key
+ * {@link ServicePublication#ENDPOINT_INTERFACE_NAME} is used by this
+ * operation.
+ *
+ * @param interfaceName for which its non-Java endpoint interface name
+ * should be returned.
+ * @return non-Java endpoint interface name, or <code>null</code> if it
+ * hasn't been provided or if given interface name is
+ * <code>null</code>.
+ */
+ String getEndpointInterfaceName(String interfaceName);
+
+ /**
+ * Returns version of the given interface.
+ * <p>
+ * Value of the property with key
+ * {@link ServicePublication#SERVICE_INTERFACE_VERSION} is used by this
+ * operation.
+ *
+ * @param interfaceName for which its version should be returned.
+ * @return Version of given service interface, or <code>null</code> if it
+ * hasn't been provided or if given interface name is
+ * <code>null</code>.
+ */
+ String getVersion(String interfaceName);
+
+ /**
+ * Returns the value of the property with key
+ * {@link ServicePublication#ENDPOINT_LOCATION}.
+ *
+ * @return The url of the service location, or <code>null</code> if it
+ * hasn't been provided.
+ */
+ URI getLocation();
+
+ /**
+ * Returns the value of the property with key
+ * {@link ServicePublication#ENDPOINT_ID}.
+ *
+ * @return Unique id of service endpoint, or <code>null</code> if it hasn't
+ * been provided.
+ */
+ String getEndpointID();
+
+ /**
+ * Getter method for the property value of a given key.
+ *
+ * @param key Name of the property
+ * @return The property value, or <code>null</code> if none is found for the
+ * given key or if provided key is <code>null</code>.
+ */
+ Object getProperty(String key);
+
+ /**
+ * Returns all names of service endpoint properties.
+ *
+ * @return a <code>Collection (&lt;? extends String&gt;)</code> of property
+ * names available in the ServiceEndpointDescription. The collection
+ * is never <code>null</code> or empty but contains at least names
+ * of mandatory <code>ServicePublication</code> properties. Since
+ * <code>ServiceEndpointDescription</code> objects are immutable,
+ * the returned collection is also not going to be updated at a
+ * later point of time.
+ */
+ Collection/* <? extends String> */getPropertyKeys();
+
+ /**
+ * Returns all service endpoint properties.
+ *
+ * @return all properties of the service as a
+ * <code>Map (&lt;String, Object&gt;)</code>. The map is never
+ * <code>null</code> or empty but contains at least mandatory
+ * <code>ServicePublication</code> properties. Since
+ * <code>ServiceEndpointDescription</code> objects are immutable,
+ * the returned map is also not going to be updated at a later point
+ * of time.
+ */
+ Map/* <String, Object> */getProperties();
+}
diff --git a/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/ServicePublication.java b/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/ServicePublication.java
index 9b4cb4c905..d490394bc3 100644
--- a/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/ServicePublication.java
+++ b/java/sca/modules/node-impl-osgi/src/main/java/org/osgi/service/discovery/ServicePublication.java
@@ -1,147 +1,147 @@
-/*
- * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.osgi.service.discovery;
-
-import org.osgi.framework.ServiceReference;
-
-/**
- * Register a service implementing the <code>ServicePublication</code> interface
- * in order to publish metadata of a particular service (endpoint) via
- * Discovery. Metadata which has to be published is given in form of properties
- * at registration.
- * <p>
- * In order to update published service metadata, update the properties
- * registered with the <code>ServicePublication</code> service. Depending on
- * Discovery's implementation and underlying protocol it may result in an update
- * or new re-publication of the service.
- * <p>
- * In order to unpublish the previously published service metadata, unregister
- * the <code>ServicePublication</code> service.
- * <p>
- * Please note that providing the {@link #SERVICE_INTERFACE_NAME} property is
- * mandatory when a <code>ServicePublication</code> service is registered. Note
- * also that a Discovery implementation may require provision of additional
- * properties, e.g. some of the standard properties defined below, or may make
- * special use of them in case they are provided. For example an SLP-based
- * Discovery might use the value provided with the {@link #ENDPOINT_LOCATION}
- * property for construction of a SLP-URL used to publish the service.
- * <p>
- * Also important is that it's not guaranteed that after registering a
- * <code>ServicePublication</code> object its service metadata is actually
- * published. Beside the fact that at least one Discovery service has to be
- * present, the provided properties have to be valid, e.g. shouldn't contain
- * case variants of the same key name, and the actual publication via Discovery
- * mechanisms has to succeed.
- *
- * @ThreadSafe
- */
-public interface ServicePublication {
-
- /**
- * Mandatory ServiceRegistration property which contains a collection of
- * full qualified interface names offered by the advertised service
- * endpoint.
- * <p>
- * Value of this property is of type
- * <code>Collection (&lt;? extends String&gt;)</code>.
- */
- public static final String SERVICE_INTERFACE_NAME = "osgi.remote.service.interfaces";
-
- /**
- * Optional ServiceRegistration property which contains a collection of
- * interface names with their associated version attributes separated by
- * {@link #SEPARATOR} e.g. ["my.company.foo|1.3.5", "my.company.zoo|2.3.5"].
- * In case no version has been provided for an interface, Discovery may use
- * the String-value of <code>org.osgi.framework.Version.emptyVersion</code>
- * constant.
- * <p>
- * Value of this property is of type
- * <code>Collection (&lt;? extends String&gt;)</code>, may be
- * <code>null</code> or empty.
- */
- public static final String SERVICE_INTERFACE_VERSION = "osgi.remote.service.interfaces.version";
-
- /**
- * Optional ServiceRegistration property which contains a collection of
- * interface names with their associated (non-Java) endpoint interface names
- * separated by {@link #SEPARATOR} e.g.:<br>
- * ["my.company.foo|MyWebService", "my.company.zoo|MyWebService"].
- * <p>
- * This (non-Java) endpoint interface name is usually a communication
- * protocol specific interface, for instance a web service interface name.
- * Though this information is usually contained in accompanying properties
- * e.g. a wsdl file, Discovery usually doesn't read and interprets such
- * service meta-data. Providing this information explicitly, might allow
- * external non-Java applications find services based on this endpoint
- * interface.
- * <p>
- * Value of this property is of type
- * <code>Collection (&lt;? extends String&gt;)</code>, may be
- * <code>null</code> or empty.
- */
- public static final String ENDPOINT_INTERFACE_NAME = "osgi.remote.endpoint.interfaces";
-
- /**
- * Optional ServiceRegistration property which contains a map of properties
- * of the published service.
- * <p>
- * Property keys are handled in a case insensitive manner (as OSGi Framework
- * does).
- * <p>
- * Value of this property is of type <code>Map (String, Object)</code>, may
- * be <code>null</code> or empty.
- */
- public static final String SERVICE_PROPERTIES = "osgi.remote.discovery.publication.service.properties";
-
- /**
- * Optional property of the published service identifying its location. This
- * property is provided as part of the service property map referenced by
- * the {@link #SERVICE_PROPERTIES} ServiceRegistration property.
- * <p>
- * Value of this property is of type <code>java.net.URI</code>, may be
- * <code>null</code>.
- */
- public static final String ENDPOINT_LOCATION = "osgi.remote.endpoint.location";
-
- /**
- * Optional property of the published service uniquely identifying its
- * endpoint. This property is provided as part of the service property map
- * referenced by the {@link #SERVICE_PROPERTIES} ServiceRegistration
- * property.
- * <p>
- * Value of this property is of type <code>String</code>, may be
- * <code>null</code>.
- */
- public static final String ENDPOINT_ID = "osgi.remote.endpoint.id";
-
- /**
- * Separator constant for association of interface-specific values with the
- * particular interface name. See also {@link #SERVICE_INTERFACE_VERSION}
- * and {@link #ENDPOINT_INTERFACE_NAME} properties which describe such
- * interface-specific values.
- */
- public static final String SEPARATOR = "|";
-
- /**
- * Returns the <code>ServiceReference</code> this publication metadata is
- * associated with.
- *
- * @return the <code>ServiceReference</code> being published. Is never
- * <code>null</code>.
- */
- ServiceReference getReference();
-}
+/*
+ * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.osgi.service.discovery;
+
+import org.osgi.framework.ServiceReference;
+
+/**
+ * Register a service implementing the <code>ServicePublication</code> interface
+ * in order to publish metadata of a particular service (endpoint) via
+ * Discovery. Metadata which has to be published is given in form of properties
+ * at registration.
+ * <p>
+ * In order to update published service metadata, update the properties
+ * registered with the <code>ServicePublication</code> service. Depending on
+ * Discovery's implementation and underlying protocol it may result in an update
+ * or new re-publication of the service.
+ * <p>
+ * In order to unpublish the previously published service metadata, unregister
+ * the <code>ServicePublication</code> service.
+ * <p>
+ * Please note that providing the {@link #SERVICE_INTERFACE_NAME} property is
+ * mandatory when a <code>ServicePublication</code> service is registered. Note
+ * also that a Discovery implementation may require provision of additional
+ * properties, e.g. some of the standard properties defined below, or may make
+ * special use of them in case they are provided. For example an SLP-based
+ * Discovery might use the value provided with the {@link #ENDPOINT_LOCATION}
+ * property for construction of a SLP-URL used to publish the service.
+ * <p>
+ * Also important is that it's not guaranteed that after registering a
+ * <code>ServicePublication</code> object its service metadata is actually
+ * published. Beside the fact that at least one Discovery service has to be
+ * present, the provided properties have to be valid, e.g. shouldn't contain
+ * case variants of the same key name, and the actual publication via Discovery
+ * mechanisms has to succeed.
+ *
+ * @ThreadSafe
+ */
+public interface ServicePublication {
+
+ /**
+ * Mandatory ServiceRegistration property which contains a collection of
+ * full qualified interface names offered by the advertised service
+ * endpoint.
+ * <p>
+ * Value of this property is of type
+ * <code>Collection (&lt;? extends String&gt;)</code>.
+ */
+ public static final String SERVICE_INTERFACE_NAME = "osgi.remote.service.interfaces";
+
+ /**
+ * Optional ServiceRegistration property which contains a collection of
+ * interface names with their associated version attributes separated by
+ * {@link #SEPARATOR} e.g. ["my.company.foo|1.3.5", "my.company.zoo|2.3.5"].
+ * In case no version has been provided for an interface, Discovery may use
+ * the String-value of <code>org.osgi.framework.Version.emptyVersion</code>
+ * constant.
+ * <p>
+ * Value of this property is of type
+ * <code>Collection (&lt;? extends String&gt;)</code>, may be
+ * <code>null</code> or empty.
+ */
+ public static final String SERVICE_INTERFACE_VERSION = "osgi.remote.service.interfaces.version";
+
+ /**
+ * Optional ServiceRegistration property which contains a collection of
+ * interface names with their associated (non-Java) endpoint interface names
+ * separated by {@link #SEPARATOR} e.g.:<br>
+ * ["my.company.foo|MyWebService", "my.company.zoo|MyWebService"].
+ * <p>
+ * This (non-Java) endpoint interface name is usually a communication
+ * protocol specific interface, for instance a web service interface name.
+ * Though this information is usually contained in accompanying properties
+ * e.g. a wsdl file, Discovery usually doesn't read and interprets such
+ * service meta-data. Providing this information explicitly, might allow
+ * external non-Java applications find services based on this endpoint
+ * interface.
+ * <p>
+ * Value of this property is of type
+ * <code>Collection (&lt;? extends String&gt;)</code>, may be
+ * <code>null</code> or empty.
+ */
+ public static final String ENDPOINT_INTERFACE_NAME = "osgi.remote.endpoint.interfaces";
+
+ /**
+ * Optional ServiceRegistration property which contains a map of properties
+ * of the published service.
+ * <p>
+ * Property keys are handled in a case insensitive manner (as OSGi Framework
+ * does).
+ * <p>
+ * Value of this property is of type <code>Map (String, Object)</code>, may
+ * be <code>null</code> or empty.
+ */
+ public static final String SERVICE_PROPERTIES = "osgi.remote.discovery.publication.service.properties";
+
+ /**
+ * Optional property of the published service identifying its location. This
+ * property is provided as part of the service property map referenced by
+ * the {@link #SERVICE_PROPERTIES} ServiceRegistration property.
+ * <p>
+ * Value of this property is of type <code>java.net.URI</code>, may be
+ * <code>null</code>.
+ */
+ public static final String ENDPOINT_LOCATION = "osgi.remote.endpoint.location";
+
+ /**
+ * Optional property of the published service uniquely identifying its
+ * endpoint. This property is provided as part of the service property map
+ * referenced by the {@link #SERVICE_PROPERTIES} ServiceRegistration
+ * property.
+ * <p>
+ * Value of this property is of type <code>String</code>, may be
+ * <code>null</code>.
+ */
+ public static final String ENDPOINT_ID = "osgi.remote.endpoint.id";
+
+ /**
+ * Separator constant for association of interface-specific values with the
+ * particular interface name. See also {@link #SERVICE_INTERFACE_VERSION}
+ * and {@link #ENDPOINT_INTERFACE_NAME} properties which describe such
+ * interface-specific values.
+ */
+ public static final String SEPARATOR = "|";
+
+ /**
+ * Returns the <code>ServiceReference</code> this publication metadata is
+ * associated with.
+ *
+ * @return the <code>ServiceReference</code> being published. Is never
+ * <code>null</code>.
+ */
+ ServiceReference getReference();
+}
diff --git a/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/bundle.componentType b/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/bundle.componentType
index 7860094626..bc9e4f6aaf 100644
--- a/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/bundle.componentType
+++ b/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/bundle.componentType
@@ -1,54 +1,54 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1">
- <!-- The service elment defines an SCA view of the OSGi service -->
- <service name="Calculator">
- <!-- The interface will be mapped into the OSGi service class -->
- <interface.java interface="calculator.dosgi.CalculatorService"/>
- <!-- The list of OSGi properties -->
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </service>
-
- <!-- The reference elment defines an SCA proxy to a remote OSGi service -->
- <reference name="addService">
- <interface.java interface="calculator.dosgi.operations.AddService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </reference>
- <reference name="subtractService">
- <interface.java interface="calculator.dosgi.operations.SubtractService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </reference>
- <reference name="multiplyService">
- <interface.java interface="calculator.dosgi.operations.MultiplyService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </reference>
- <reference name="divideService">
- <interface.java interface="calculator.dosgi.operations.DivideService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </reference>
-
-</componentType>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1">
+ <!-- The service elment defines an SCA view of the OSGi service -->
+ <service name="Calculator">
+ <!-- The interface will be mapped into the OSGi service class -->
+ <interface.java interface="calculator.dosgi.CalculatorService"/>
+ <!-- The list of OSGi properties -->
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </service>
+
+ <!-- The reference elment defines an SCA proxy to a remote OSGi service -->
+ <reference name="addService">
+ <interface.java interface="calculator.dosgi.operations.AddService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </reference>
+ <reference name="subtractService">
+ <interface.java interface="calculator.dosgi.operations.SubtractService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </reference>
+ <reference name="multiplyService">
+ <interface.java interface="calculator.dosgi.operations.MultiplyService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </reference>
+ <reference name="divideService">
+ <interface.java interface="calculator.dosgi.operations.DivideService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </reference>
+
+</componentType>
diff --git a/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/calculator.composite b/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/calculator.composite
index 3c77086c45..1ae44d0a0b 100644
--- a/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/calculator.composite
+++ b/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/calculator.composite
@@ -1,53 +1,53 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://calculator.dosgi"
- name="CalculatorComposite">
-
- <component name="CalculatorComponent">
- <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi" bundleVersion="1.0.0" />
- <reference name="addService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/>
- </reference>
- <reference name="subtractService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/>
- </reference>
- <reference name="multiplyService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/>
- </reference>
- <reference name="divideService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/>
- </reference>
-
- <!--
- <reference name="addService" target="OperationsComponent/AddService">
- </reference>
- <reference name="subtractService" target="OperationsComponent/SubtractService">
- </reference>
- <reference name="multiplyService" target="OperationsComponent/MultiplyService">
- </reference>
- <reference name="divideService" target="OperationsComponent/DivideService">
- </reference>
- -->
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://calculator.dosgi"
+ name="CalculatorComposite">
+
+ <component name="CalculatorComponent">
+ <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi" bundleVersion="1.0.0" />
+ <reference name="addService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/>
+ </reference>
+ <reference name="subtractService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/>
+ </reference>
+ <reference name="multiplyService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/>
+ </reference>
+ <reference name="divideService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/>
+ </reference>
+
+ <!--
+ <reference name="addService" target="OperationsComponent/AddService">
+ </reference>
+ <reference name="subtractService" target="OperationsComponent/SubtractService">
+ </reference>
+ <reference name="multiplyService" target="OperationsComponent/MultiplyService">
+ </reference>
+ <reference name="divideService" target="OperationsComponent/DivideService">
+ </reference>
+ -->
+ </component>
+
+</composite>
diff --git a/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/operations/bundle.componentType b/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/operations/bundle.componentType
index 6f6f4bdce6..72e2c339f1 100644
--- a/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/operations/bundle.componentType
+++ b/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/operations/bundle.componentType
@@ -1,47 +1,47 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1">
-
-
- <!-- The service elment defines an SCA proxy to a remote OSGi service -->
- <service name="AddService">
- <interface.java interface="calculator.dosgi.operations.AddService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </service>
- <service name="SubtractService">
- <interface.java interface="calculator.dosgi.operations.SubtractService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </service>
- <service name="MultiplyService">
- <interface.java interface="calculator.dosgi.operations.MultiplyService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </service>
- <service name="DivideService">
- <interface.java interface="calculator.dosgi.operations.DivideService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </service>
-
-</componentType>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1">
+
+
+ <!-- The service elment defines an SCA proxy to a remote OSGi service -->
+ <service name="AddService">
+ <interface.java interface="calculator.dosgi.operations.AddService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </service>
+ <service name="SubtractService">
+ <interface.java interface="calculator.dosgi.operations.SubtractService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </service>
+ <service name="MultiplyService">
+ <interface.java interface="calculator.dosgi.operations.MultiplyService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </service>
+ <service name="DivideService">
+ <interface.java interface="calculator.dosgi.operations.DivideService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </service>
+
+</componentType>
diff --git a/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/operations/operations.composite b/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/operations/operations.composite
index c9fb3818b8..253f7d0df1 100644
--- a/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/operations/operations.composite
+++ b/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/operations/operations.composite
@@ -1,43 +1,43 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://calculator.dosgi"
- name="OperationsComposite">
-
- <component name="OperationsComponent">
- <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi.operations" bundleVersion="1.0.0" />
- <service name="AddService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/>
- </service>
- <service name="SubtractService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/>
- </service>
- <service name="MultiplyService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/>
- </service>
- <service name="DivideService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/>
- </service>
-
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://calculator.dosgi"
+ name="OperationsComposite">
+
+ <component name="OperationsComponent">
+ <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi.operations" bundleVersion="1.0.0" />
+ <service name="AddService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/>
+ </service>
+ <service name="SubtractService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/>
+ </service>
+ <service name="MultiplyService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/>
+ </service>
+ <service name="DivideService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/>
+ </service>
+
+ </component>
+
+</composite>
diff --git a/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/sca/META-INF/sca-contribution.xml b/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/sca/META-INF/sca-contribution.xml
index 8ba4b85247..b14b3516f6 100644
--- a/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/sca/META-INF/sca-contribution.xml
+++ b/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/sca/META-INF/sca-contribution.xml
@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
--->
-
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:c="http://calculator.dosgi">
- <deployable composite="c:CalculatorComposite" />
-</contribution>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+-->
+
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:c="http://calculator.dosgi">
+ <deployable composite="c:CalculatorComposite" />
+</contribution>
diff --git a/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/sca/OSGI-INF/sca/calculator.composite b/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/sca/OSGI-INF/sca/calculator.composite
index ac7f0f470c..f48262bdb4 100644
--- a/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/sca/OSGI-INF/sca/calculator.composite
+++ b/java/sca/modules/node-impl-osgi/src/test/resources/calculator/dosgi/sca/OSGI-INF/sca/calculator.composite
@@ -1,70 +1,70 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://calculator.dosgi"
- name="CalculatorComposite">
-
- <component name="CalculatorComponent">
- <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi" bundleVersion="1.0.0" />
- <reference name="addService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/>
- </reference>
- <reference name="subtractService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/>
- </reference>
- <reference name="multiplyService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/>
- </reference>
- <reference name="divideService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/>
- </reference>
-
- <!--
- <reference name="addService" target="OperationsComponent/AddService">
- </reference>
- <reference name="subtractService" target="OperationsComponent/SubtractService">
- </reference>
- <reference name="multiplyService" target="OperationsComponent/MultiplyService">
- </reference>
- <reference name="divideService" target="OperationsComponent/DivideService">
- </reference>
- -->
-
- <component name="OperationsComponent">
- <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi.operations" bundleVersion="1.0.0" />
- <service name="AddService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/>
- </service>
- <service name="SubtractService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/>
- </service>
- <service name="MultiplyService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/>
- </service>
- <service name="DivideService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/>
- </service>
-
- </component>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://calculator.dosgi"
+ name="CalculatorComposite">
+
+ <component name="CalculatorComponent">
+ <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi" bundleVersion="1.0.0" />
+ <reference name="addService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/>
+ </reference>
+ <reference name="subtractService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/>
+ </reference>
+ <reference name="multiplyService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/>
+ </reference>
+ <reference name="divideService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/>
+ </reference>
+
+ <!--
+ <reference name="addService" target="OperationsComponent/AddService">
+ </reference>
+ <reference name="subtractService" target="OperationsComponent/SubtractService">
+ </reference>
+ <reference name="multiplyService" target="OperationsComponent/MultiplyService">
+ </reference>
+ <reference name="divideService" target="OperationsComponent/DivideService">
+ </reference>
+ -->
+
+ <component name="OperationsComponent">
+ <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi.operations" bundleVersion="1.0.0" />
+ <service name="AddService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/>
+ </service>
+ <service name="SubtractService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/>
+ </service>
+ <service name="MultiplyService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/>
+ </service>
+ <service name="DivideService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/>
+ </service>
+
+ </component>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationATOMProcessor.java b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationATOMProcessor.java
index d3d0c5d077..162670363a 100644
--- a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationATOMProcessor.java
+++ b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationATOMProcessor.java
@@ -1,160 +1,160 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.node.configuration.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.node.configuration.ContributionConfiguration;
-import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
-import org.apache.tuscany.sca.node.configuration.NodeConfigurationFactory;
-
-/**
- * Implements a StAX artifact processor for configured node implementations.
- *
- * @version $Rev: 704156 $ $Date: 2008-10-13 09:31:59 -0700 (Mon, 13 Oct 2008) $
- */
-public class NodeConfigurationATOMProcessor extends BaseStAXArtifactProcessor implements
- StAXArtifactProcessor<NodeConfiguration> {
-
- private static final String ATOM_NS = "http://www.w3.org/2005/Atom";
- private static final QName FEED_QNAME = new QName(ATOM_NS, "feed");
- private static final QName ENTRY_QNAME = new QName(ATOM_NS, "entry");
- private static final QName ID_QNAME = new QName(ATOM_NS, "id");
- private static final QName LINK_QNAME = new QName(ATOM_NS, "link");
- private static final QName CONTENT_QNAME = new QName(ATOM_NS, "content");
- private static final String HREF = "href";
-
- private NodeConfigurationFactory factory;
-
- public NodeConfigurationATOMProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
- this.factory = modelFactories.getFactory(NodeConfigurationFactory.class);
- }
-
- public QName getArtifactType() {
- return null;
- }
-
- public Class<NodeConfiguration> getModelType() {
- // Returns the type of model processed by this processor
- return NodeConfiguration.class;
- }
-
- public NodeConfiguration read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- NodeConfiguration config = factory.createNodeConfiguration();
-
- // Read a feed containing links to the composite and the contributions assigned to
- // the node
- ContributionConfiguration contribution = null;
- boolean id = false;
- QName name = null;
-
- while (reader.hasNext()) {
- int event = reader.getEventType();
- switch (event) {
-
- case START_ELEMENT:
- name = reader.getName();
-
- if (ENTRY_QNAME.equals(name)) {
-
- // Read an <entry>
- contribution = factory.createContributionConfiguration();
- } else if (ID_QNAME.equals(name)) {
-
- // Read an <id>
- id = true;
-
- } else if (LINK_QNAME.equals(name)) {
-
- // Read a <link>
- String href = getString(reader, HREF);
-
- if (contribution != null) {
- contribution.setLocation(href);
- }
- } else if (CONTENT_QNAME.equals(name)) {
- // Read a <content>
- } else if (FEED_QNAME.equals(name)) {
- // Read a <feed>
- }
- break;
-
- case XMLStreamConstants.CHARACTERS:
-
- // Read characters inside an <id> element
- if (id) {
- if (contribution != null) {
- contribution.setURI(reader.getText());
- }
- }
- break;
-
- case END_ELEMENT:
- name = reader.getName();
-
- // Clear current state when reading reaching end element
- if (ENTRY_QNAME.equals(name)) {
- if (contribution != null) {
- config.getContributions().add(contribution);
- }
-
- contribution = null;
-
- } else if (ID_QNAME.equals(name)) {
- id = false;
-
- } else if (FEED_QNAME.equals(name)) {
-
- // We've reached the end of the feed
- return config;
- }
- break;
- }
-
- // Read the next element
- if (reader.hasNext()) {
- reader.next();
- }
- }
- return config;
- }
-
- public void resolve(NodeConfiguration implementation, ModelResolver resolver) throws ContributionResolveException {
- }
-
- public void write(NodeConfiguration implementation, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.node.configuration.xml;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.node.configuration.ContributionConfiguration;
+import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
+import org.apache.tuscany.sca.node.configuration.NodeConfigurationFactory;
+
+/**
+ * Implements a StAX artifact processor for configured node implementations.
+ *
+ * @version $Rev$ $Date$
+ */
+public class NodeConfigurationATOMProcessor extends BaseStAXArtifactProcessor implements
+ StAXArtifactProcessor<NodeConfiguration> {
+
+ private static final String ATOM_NS = "http://www.w3.org/2005/Atom";
+ private static final QName FEED_QNAME = new QName(ATOM_NS, "feed");
+ private static final QName ENTRY_QNAME = new QName(ATOM_NS, "entry");
+ private static final QName ID_QNAME = new QName(ATOM_NS, "id");
+ private static final QName LINK_QNAME = new QName(ATOM_NS, "link");
+ private static final QName CONTENT_QNAME = new QName(ATOM_NS, "content");
+ private static final String HREF = "href";
+
+ private NodeConfigurationFactory factory;
+
+ public NodeConfigurationATOMProcessor(FactoryExtensionPoint modelFactories, Monitor monitor) {
+ this.factory = modelFactories.getFactory(NodeConfigurationFactory.class);
+ }
+
+ public QName getArtifactType() {
+ return null;
+ }
+
+ public Class<NodeConfiguration> getModelType() {
+ // Returns the type of model processed by this processor
+ return NodeConfiguration.class;
+ }
+
+ public NodeConfiguration read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+
+ NodeConfiguration config = factory.createNodeConfiguration();
+
+ // Read a feed containing links to the composite and the contributions assigned to
+ // the node
+ ContributionConfiguration contribution = null;
+ boolean id = false;
+ QName name = null;
+
+ while (reader.hasNext()) {
+ int event = reader.getEventType();
+ switch (event) {
+
+ case START_ELEMENT:
+ name = reader.getName();
+
+ if (ENTRY_QNAME.equals(name)) {
+
+ // Read an <entry>
+ contribution = factory.createContributionConfiguration();
+ } else if (ID_QNAME.equals(name)) {
+
+ // Read an <id>
+ id = true;
+
+ } else if (LINK_QNAME.equals(name)) {
+
+ // Read a <link>
+ String href = getString(reader, HREF);
+
+ if (contribution != null) {
+ contribution.setLocation(href);
+ }
+ } else if (CONTENT_QNAME.equals(name)) {
+ // Read a <content>
+ } else if (FEED_QNAME.equals(name)) {
+ // Read a <feed>
+ }
+ break;
+
+ case XMLStreamConstants.CHARACTERS:
+
+ // Read characters inside an <id> element
+ if (id) {
+ if (contribution != null) {
+ contribution.setURI(reader.getText());
+ }
+ }
+ break;
+
+ case END_ELEMENT:
+ name = reader.getName();
+
+ // Clear current state when reading reaching end element
+ if (ENTRY_QNAME.equals(name)) {
+ if (contribution != null) {
+ config.getContributions().add(contribution);
+ }
+
+ contribution = null;
+
+ } else if (ID_QNAME.equals(name)) {
+ id = false;
+
+ } else if (FEED_QNAME.equals(name)) {
+
+ // We've reached the end of the feed
+ return config;
+ }
+ break;
+ }
+
+ // Read the next element
+ if (reader.hasNext()) {
+ reader.next();
+ }
+ }
+ return config;
+ }
+
+ public void resolve(NodeConfiguration implementation, ModelResolver resolver) throws ContributionResolveException {
+ }
+
+ public void write(NodeConfiguration implementation, XMLStreamWriter writer) throws ContributionWriteException,
+ XMLStreamException {
+ }
+}
diff --git a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessor.java b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessor.java
index fb16cf461d..31f21ee09f 100644
--- a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessor.java
+++ b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessor.java
@@ -1,240 +1,240 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.node.configuration.xml;
-
-import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
-
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.StringTokenizer;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.node.configuration.BindingConfiguration;
-import org.apache.tuscany.sca.node.configuration.ContributionConfiguration;
-import org.apache.tuscany.sca.node.configuration.DeploymentComposite;
-import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
-import org.apache.tuscany.sca.node.configuration.NodeConfigurationFactory;
-
-/**
- * Implements a StAX artifact processor for node implementations.
- *
- * @version $Rev: 750323 $ $Date: 2009-03-04 21:52:01 -0800 (Wed, 04 Mar 2009) $
- */
-public class NodeConfigurationProcessor extends BaseStAXArtifactProcessor implements
- StAXArtifactProcessor<NodeConfiguration> {
- private static final String SCA11_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1";
- private static final QName NODE = new QName(SCA11_TUSCANY_NS, "node");
- private static final QName CONTRIBUTION = new QName(SCA11_TUSCANY_NS, "contribution");
- private static final QName BINDING = new QName(SCA11_TUSCANY_NS, "binding");
- private static final QName BASE_URI = new QName(SCA11_TUSCANY_NS, "baseURI");
- private static final QName DEPLOYMENT_COMPOSITE = new QName(SCA11_TUSCANY_NS, "deploymentComposite");
-
- private static final String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
- private static final QName COMPOSITE = new QName(SCA11_NS, "composite");
-
- private StAXArtifactProcessor processor;
- private NodeConfigurationFactory nodeConfigurationFactory;
- private XMLInputFactory xmlInputFactory;
- private XMLOutputFactory xmlOutputFactory;
-
- public NodeConfigurationProcessor(FactoryExtensionPoint modelFactories,
- StAXArtifactProcessor processor,
- Monitor monitor) {
- this.nodeConfigurationFactory = modelFactories.getFactory(NodeConfigurationFactory.class);
- this.processor = processor;
- this.xmlInputFactory = modelFactories.getFactory(XMLInputFactory.class);
- this.xmlOutputFactory = modelFactories.getFactory(XMLOutputFactory.class);
- }
-
- public NodeConfigurationProcessor(NodeConfigurationFactory nodeConfigurationFactory,
- XMLInputFactory xmlInputFactory,
- XMLOutputFactory xmlOutputFactory) {
- super();
- this.nodeConfigurationFactory = nodeConfigurationFactory;
- this.xmlInputFactory = xmlInputFactory;
- this.xmlOutputFactory = xmlOutputFactory;
- }
-
- public QName getArtifactType() {
- // Returns the QName of the XML element processed by this processor
- return NODE;
- }
-
- public Class<NodeConfiguration> getModelType() {
- // Returns the type of model processed by this processor
- return NodeConfiguration.class;
- }
-
- public NodeConfiguration read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
- NodeConfiguration node = null;
- ContributionConfiguration contribution = null;
- DeploymentComposite composite = null;
- BindingConfiguration binding = null;
-
- // Skip to end element
- while (true) {
- int event = reader.getEventType();
- switch (event) {
- case XMLStreamConstants.START_ELEMENT:
- QName name = reader.getName();
- if (NODE.equals(name)) {
- node = nodeConfigurationFactory.createNodeConfiguration();
- node.setURI(reader.getAttributeValue(null, "uri"));
- node.setDomainURI(reader.getAttributeValue(null, "domain"));
- } else if (CONTRIBUTION.equals(name)) {
- contribution = nodeConfigurationFactory.createContributionConfiguration();
- contribution.setURI(reader.getAttributeValue(null, "uri"));
- contribution.setLocation(reader.getAttributeValue(null, "location"));
- node.getContributions().add(contribution);
- } else if (BINDING.equals(name)) {
- binding = nodeConfigurationFactory.createBindingConfiguration();
- binding.setBindingType(getQName(reader, "name"));
- String baseURIs = reader.getAttributeValue(null, "baseURIs");
- if (baseURIs != null) {
- StringTokenizer tokenizer = new StringTokenizer(baseURIs);
- while (tokenizer.hasMoreTokens()) {
- binding.getBaseURIs().add(tokenizer.nextToken());
- }
- }
- node.getBindings().add(binding);
- } else if (DEPLOYMENT_COMPOSITE.equals(name)) {
- composite = nodeConfigurationFactory.createDeploymentComposite();
- composite.setLocation(reader.getAttributeValue(null, "location"));
- if (contribution != null) {
- contribution.getDeploymentComposites().add(composite);
- }
- } else if(BASE_URI.equals(name)) {
- // We also support <baseURI> element
- String baseURI = reader.getElementText();
- if (baseURI != null && binding != null) {
- baseURI = baseURI.trim();
- binding.addBaseURI(baseURI);
- }
- // getElementText() moves the event to END_ELEMENT
- continue;
- } else if (COMPOSITE.equals(name)) {
- /*
- Object model = processor.read(reader);
- if (model instanceof Composite) {
- // FIXME: We need to capture the text here
- // composite.setComposite((Composite)model);
- }
- */
- StringWriter sw = new StringWriter();
- XMLStreamWriter writer = xmlOutputFactory.createXMLStreamWriter(sw);
- new XMLStreamSerializer().serialize(reader, writer);
- writer.flush();
- composite.setContent(sw.toString());
- }
- break;
-
- case END_ELEMENT:
- name = reader.getName();
- if (NODE.equals(name)) {
- return node;
- } else if (CONTRIBUTION.equals(name)) {
- contribution = null;
- } else if (DEPLOYMENT_COMPOSITE.equals(name)) {
- composite = null;
- } else if (BINDING.equals(name)) {
- binding = null;
- }
- }
- if (reader.hasNext()) {
- reader.next();
- } else {
- break;
- }
- }
-
- return node;
- }
-
- public void resolve(NodeConfiguration node, ModelResolver resolver) throws ContributionResolveException {
- }
-
- public void write(NodeConfiguration node, XMLStreamWriter writer) throws ContributionWriteException,
- XMLStreamException {
-
- writeStart(writer,
- NODE.getNamespaceURI(),
- NODE.getLocalPart(),
- new XAttr("uri", node.getURI()),
- new XAttr("domain", node.getDomainURI()));
-
- for (ContributionConfiguration c : node.getContributions()) {
- writeStart(writer,
- CONTRIBUTION.getNamespaceURI(),
- CONTRIBUTION.getLocalPart(),
- new XAttr("uri", c.getURI()),
- new XAttr("location", c.getLocation()));
- for (DeploymentComposite dc : c.getDeploymentComposites()) {
- writeStart(writer,
- DEPLOYMENT_COMPOSITE.getNamespaceURI(),
- DEPLOYMENT_COMPOSITE.getLocalPart(),
- new XAttr("location", dc.getLocation()),
- new XAttr("contribution", dc.getContributionURI()));
- if (dc.getContent() != null) {
- XMLStreamReader reader = xmlInputFactory.createXMLStreamReader(new StringReader(dc.getContent()));
- reader.nextTag(); // Move to the first element
- new XMLStreamSerializer().serialize(reader, writer);
- reader.close();
- }
- writeEnd(writer);
- }
- writeEnd(writer);
- }
-
- for (BindingConfiguration b : node.getBindings()) {
- StringBuffer uris = new StringBuffer();
- for (String uri : b.getBaseURIs()) {
- uris.append(uri).append(' ');
- }
- if (uris.length() > 0) {
- uris.deleteCharAt(uris.length() - 1); // Remove the trailing space
- } else {
- uris = null;
- }
- writeStart(writer,
- BINDING.getNamespaceURI(),
- BINDING.getLocalPart(),
- new XAttr("name", b.getBindingType()),
- new XAttr("baseURIs", uris.toString()));
- writeEnd(writer);
- }
-
- writeEnd(writer);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.node.configuration.xml;
+
+import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.StringTokenizer;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.node.configuration.BindingConfiguration;
+import org.apache.tuscany.sca.node.configuration.ContributionConfiguration;
+import org.apache.tuscany.sca.node.configuration.DeploymentComposite;
+import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
+import org.apache.tuscany.sca.node.configuration.NodeConfigurationFactory;
+
+/**
+ * Implements a StAX artifact processor for node implementations.
+ *
+ * @version $Rev$ $Date$
+ */
+public class NodeConfigurationProcessor extends BaseStAXArtifactProcessor implements
+ StAXArtifactProcessor<NodeConfiguration> {
+ private static final String SCA11_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1";
+ private static final QName NODE = new QName(SCA11_TUSCANY_NS, "node");
+ private static final QName CONTRIBUTION = new QName(SCA11_TUSCANY_NS, "contribution");
+ private static final QName BINDING = new QName(SCA11_TUSCANY_NS, "binding");
+ private static final QName BASE_URI = new QName(SCA11_TUSCANY_NS, "baseURI");
+ private static final QName DEPLOYMENT_COMPOSITE = new QName(SCA11_TUSCANY_NS, "deploymentComposite");
+
+ private static final String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
+ private static final QName COMPOSITE = new QName(SCA11_NS, "composite");
+
+ private StAXArtifactProcessor processor;
+ private NodeConfigurationFactory nodeConfigurationFactory;
+ private XMLInputFactory xmlInputFactory;
+ private XMLOutputFactory xmlOutputFactory;
+
+ public NodeConfigurationProcessor(FactoryExtensionPoint modelFactories,
+ StAXArtifactProcessor processor,
+ Monitor monitor) {
+ this.nodeConfigurationFactory = modelFactories.getFactory(NodeConfigurationFactory.class);
+ this.processor = processor;
+ this.xmlInputFactory = modelFactories.getFactory(XMLInputFactory.class);
+ this.xmlOutputFactory = modelFactories.getFactory(XMLOutputFactory.class);
+ }
+
+ public NodeConfigurationProcessor(NodeConfigurationFactory nodeConfigurationFactory,
+ XMLInputFactory xmlInputFactory,
+ XMLOutputFactory xmlOutputFactory) {
+ super();
+ this.nodeConfigurationFactory = nodeConfigurationFactory;
+ this.xmlInputFactory = xmlInputFactory;
+ this.xmlOutputFactory = xmlOutputFactory;
+ }
+
+ public QName getArtifactType() {
+ // Returns the QName of the XML element processed by this processor
+ return NODE;
+ }
+
+ public Class<NodeConfiguration> getModelType() {
+ // Returns the type of model processed by this processor
+ return NodeConfiguration.class;
+ }
+
+ public NodeConfiguration read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+
+ NodeConfiguration node = null;
+ ContributionConfiguration contribution = null;
+ DeploymentComposite composite = null;
+ BindingConfiguration binding = null;
+
+ // Skip to end element
+ while (true) {
+ int event = reader.getEventType();
+ switch (event) {
+ case XMLStreamConstants.START_ELEMENT:
+ QName name = reader.getName();
+ if (NODE.equals(name)) {
+ node = nodeConfigurationFactory.createNodeConfiguration();
+ node.setURI(reader.getAttributeValue(null, "uri"));
+ node.setDomainURI(reader.getAttributeValue(null, "domain"));
+ } else if (CONTRIBUTION.equals(name)) {
+ contribution = nodeConfigurationFactory.createContributionConfiguration();
+ contribution.setURI(reader.getAttributeValue(null, "uri"));
+ contribution.setLocation(reader.getAttributeValue(null, "location"));
+ node.getContributions().add(contribution);
+ } else if (BINDING.equals(name)) {
+ binding = nodeConfigurationFactory.createBindingConfiguration();
+ binding.setBindingType(getQName(reader, "name"));
+ String baseURIs = reader.getAttributeValue(null, "baseURIs");
+ if (baseURIs != null) {
+ StringTokenizer tokenizer = new StringTokenizer(baseURIs);
+ while (tokenizer.hasMoreTokens()) {
+ binding.getBaseURIs().add(tokenizer.nextToken());
+ }
+ }
+ node.getBindings().add(binding);
+ } else if (DEPLOYMENT_COMPOSITE.equals(name)) {
+ composite = nodeConfigurationFactory.createDeploymentComposite();
+ composite.setLocation(reader.getAttributeValue(null, "location"));
+ if (contribution != null) {
+ contribution.getDeploymentComposites().add(composite);
+ }
+ } else if(BASE_URI.equals(name)) {
+ // We also support <baseURI> element
+ String baseURI = reader.getElementText();
+ if (baseURI != null && binding != null) {
+ baseURI = baseURI.trim();
+ binding.addBaseURI(baseURI);
+ }
+ // getElementText() moves the event to END_ELEMENT
+ continue;
+ } else if (COMPOSITE.equals(name)) {
+ /*
+ Object model = processor.read(reader);
+ if (model instanceof Composite) {
+ // FIXME: We need to capture the text here
+ // composite.setComposite((Composite)model);
+ }
+ */
+ StringWriter sw = new StringWriter();
+ XMLStreamWriter writer = xmlOutputFactory.createXMLStreamWriter(sw);
+ new XMLStreamSerializer().serialize(reader, writer);
+ writer.flush();
+ composite.setContent(sw.toString());
+ }
+ break;
+
+ case END_ELEMENT:
+ name = reader.getName();
+ if (NODE.equals(name)) {
+ return node;
+ } else if (CONTRIBUTION.equals(name)) {
+ contribution = null;
+ } else if (DEPLOYMENT_COMPOSITE.equals(name)) {
+ composite = null;
+ } else if (BINDING.equals(name)) {
+ binding = null;
+ }
+ }
+ if (reader.hasNext()) {
+ reader.next();
+ } else {
+ break;
+ }
+ }
+
+ return node;
+ }
+
+ public void resolve(NodeConfiguration node, ModelResolver resolver) throws ContributionResolveException {
+ }
+
+ public void write(NodeConfiguration node, XMLStreamWriter writer) throws ContributionWriteException,
+ XMLStreamException {
+
+ writeStart(writer,
+ NODE.getNamespaceURI(),
+ NODE.getLocalPart(),
+ new XAttr("uri", node.getURI()),
+ new XAttr("domain", node.getDomainURI()));
+
+ for (ContributionConfiguration c : node.getContributions()) {
+ writeStart(writer,
+ CONTRIBUTION.getNamespaceURI(),
+ CONTRIBUTION.getLocalPart(),
+ new XAttr("uri", c.getURI()),
+ new XAttr("location", c.getLocation()));
+ for (DeploymentComposite dc : c.getDeploymentComposites()) {
+ writeStart(writer,
+ DEPLOYMENT_COMPOSITE.getNamespaceURI(),
+ DEPLOYMENT_COMPOSITE.getLocalPart(),
+ new XAttr("location", dc.getLocation()),
+ new XAttr("contribution", dc.getContributionURI()));
+ if (dc.getContent() != null) {
+ XMLStreamReader reader = xmlInputFactory.createXMLStreamReader(new StringReader(dc.getContent()));
+ reader.nextTag(); // Move to the first element
+ new XMLStreamSerializer().serialize(reader, writer);
+ reader.close();
+ }
+ writeEnd(writer);
+ }
+ writeEnd(writer);
+ }
+
+ for (BindingConfiguration b : node.getBindings()) {
+ StringBuffer uris = new StringBuffer();
+ for (String uri : b.getBaseURIs()) {
+ uris.append(uri).append(' ');
+ }
+ if (uris.length() > 0) {
+ uris.deleteCharAt(uris.length() - 1); // Remove the trailing space
+ } else {
+ uris = null;
+ }
+ writeStart(writer,
+ BINDING.getNamespaceURI(),
+ BINDING.getLocalPart(),
+ new XAttr("name", b.getBindingType()),
+ new XAttr("baseURIs", uris.toString()));
+ writeEnd(writer);
+ }
+
+ writeEnd(writer);
+ }
+}
diff --git a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/XMLStreamSerializer.java b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/XMLStreamSerializer.java
index 38d8215cb2..1ddf25953d 100644
--- a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/XMLStreamSerializer.java
+++ b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/configuration/xml/XMLStreamSerializer.java
@@ -1,287 +1,287 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.configuration.xml;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-/**
- * The XMLStreamSerializer pulls events from the XMLStreamReader and dumps into the XMLStreamWriter
- *
- * @version $Rev: 656146 $ $Date: 2008-05-14 01:22:08 -0700 (Wed, 14 May 2008) $
- */
-public class XMLStreamSerializer implements XMLStreamConstants {
- public static final String NAMESPACE_PREFIX = "ns";
- private static int namespaceSuffix;
-
- /*
- * The behavior of the Serializer is such that it returns when it encounters the starting element for the second
- * time. The depth variable tracks the depth of the Serializer and tells it when to return. Note that it is assumed
- * that this Serialization starts on an Element.
- */
-
- /**
- * Field depth
- */
- private int depth;
-
- /**
- * Generates a unique namespace prefix that is not in the scope of the NamespaceContext
- *
- * @param nsCtxt
- * @return string
- */
- private String generateUniquePrefix(NamespaceContext nsCtxt) {
- String prefix = NAMESPACE_PREFIX + namespaceSuffix++;
- // null should be returned if the prefix is not bound!
- while (nsCtxt.getNamespaceURI(prefix) != null) {
- prefix = NAMESPACE_PREFIX + namespaceSuffix++;
- }
-
- return prefix;
- }
-
- /**
- * Method serialize.
- *
- * @param node
- * @param writer
- * @throws XMLStreamException
- */
- public void serialize(XMLStreamReader node, XMLStreamWriter writer) throws XMLStreamException {
- serializeNode(node, writer);
- }
-
- /**
- * @param reader
- * @param writer
- * @throws XMLStreamException
- */
- protected void serializeAttributes(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
- int count = reader.getAttributeCount();
- String prefix;
- String namespaceName;
- String writerPrefix;
- for (int i = 0; i < count; i++) {
- prefix = reader.getAttributePrefix(i);
- namespaceName = reader.getAttributeNamespace(i);
- /*
- * Due to parser implementations returning null as the namespace URI (for the empty namespace) we need to
- * make sure that we deal with a namespace name that is not null. The best way to work around this issue is
- * to set the namespace URI to "" if it is null
- */
- if (namespaceName == null) {
- namespaceName = "";
- }
-
- writerPrefix = writer.getPrefix(namespaceName);
-
- if (!"".equals(namespaceName)) {
- // prefix has already being declared but this particular
- // attrib has a
- // no prefix attached. So use the prefix provided by the
- // writer
- if (writerPrefix != null && (prefix == null || prefix.equals(""))) {
- writer.writeAttribute(writerPrefix, namespaceName, reader.getAttributeLocalName(i), reader
- .getAttributeValue(i));
-
- // writer prefix is available but different from the
- // current
- // prefix of the attrib. We should be declaring the new
- // prefix
- // as a namespace declaration
- } else if (prefix != null && !"".equals(prefix) && !prefix.equals(writerPrefix)) {
- writer.writeNamespace(prefix, namespaceName);
- writer.writeAttribute(prefix, namespaceName, reader.getAttributeLocalName(i), reader
- .getAttributeValue(i));
-
- // prefix is null (or empty), but the namespace name is
- // valid! it has not
- // being written previously also. So we need to generate
- // a prefix
- // here
- } else if (prefix == null || prefix.equals("")) {
- prefix = generateUniquePrefix(writer.getNamespaceContext());
- writer.writeNamespace(prefix, namespaceName);
- writer.writeAttribute(prefix, namespaceName, reader.getAttributeLocalName(i), reader
- .getAttributeValue(i));
- } else {
- writer.writeAttribute(prefix, namespaceName, reader.getAttributeLocalName(i), reader
- .getAttributeValue(i));
- }
- } else {
- // empty namespace is equal to no namespace!
- writer.writeAttribute(reader.getAttributeLocalName(i), reader.getAttributeValue(i));
- }
-
- }
- }
-
- /**
- * Method serializeCData.
- *
- * @param reader
- * @param writer
- * @throws XMLStreamException
- */
- protected void serializeCData(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
- writer.writeCData(reader.getText());
- }
-
- /**
- * Method serializeComment.
- *
- * @param reader
- * @param writer
- * @throws XMLStreamException
- */
- protected void serializeComment(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
- writer.writeComment(reader.getText());
- }
-
- /**
- * @param reader
- * @param writer
- * @throws XMLStreamException
- */
- protected void serializeElement(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
- String prefix = reader.getPrefix();
- String nameSpaceName = reader.getNamespaceURI();
- if (nameSpaceName != null) {
- String writerPrefix = writer.getPrefix(nameSpaceName);
- if (writerPrefix != null) {
- writer.writeStartElement(nameSpaceName, reader.getLocalName());
- } else {
- if (prefix != null) {
- writer.writeStartElement(prefix, reader.getLocalName(), nameSpaceName);
- writer.writeNamespace(prefix, nameSpaceName);
- // writer.setPrefix(prefix, nameSpaceName);
- } else {
- // [rfeng] We need to set default NS 1st before calling writeStateElement
- writer.setDefaultNamespace(nameSpaceName);
- writer.writeStartElement(nameSpaceName, reader.getLocalName());
- writer.writeDefaultNamespace(nameSpaceName);
- }
- }
- } else {
- writer.writeStartElement(reader.getLocalName());
- }
-
- // add the namespaces
- int count = reader.getNamespaceCount();
- String namespacePrefix;
- for (int i = 0; i < count; i++) {
- namespacePrefix = reader.getNamespacePrefix(i);
- // [rfeng] The following is commented out to allow to default ns
- // if (namespacePrefix != null && namespacePrefix.length() == 0) {
- // continue;
- // }
-
- serializeNamespace(namespacePrefix, reader.getNamespaceURI(i), writer);
- }
-
- // add attributes
- serializeAttributes(reader, writer);
-
- }
-
- /**
- * Method serializeEndElement.
- *
- * @param writer
- * @throws XMLStreamException
- */
- protected void serializeEndElement(XMLStreamWriter writer) throws XMLStreamException {
- writer.writeEndElement();
- }
-
- /**
- * Method serializeNamespace.
- *
- * @param prefix
- * @param uri
- * @param writer
- * @throws XMLStreamException
- */
- private void serializeNamespace(String prefix, String uri, XMLStreamWriter writer) throws XMLStreamException {
- String prefix1 = writer.getPrefix(uri);
- if (prefix1 == null) {
- writer.writeNamespace(prefix, uri);
- // writer.setPrefix(prefix, uri);
- }
- }
-
- /**
- * Method serializeNode.
- *
- * @param reader
- * @param writer
- * @throws XMLStreamException
- */
- protected void serializeNode(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
- while (true) {
- int event = reader.getEventType();
- if (event == START_ELEMENT) {
- serializeElement(reader, writer);
- depth++;
- } else if (event == ATTRIBUTE) {
- serializeAttributes(reader, writer);
- } else if (event == CHARACTERS) {
- serializeText(reader, writer);
- } else if (event == COMMENT) {
- serializeComment(reader, writer);
- } else if (event == CDATA) {
- serializeCData(reader, writer);
- } else if (event == END_ELEMENT) {
- serializeEndElement(writer);
- depth--;
- } else if (event == START_DOCUMENT) {
- depth++; // if a start document is found then increment
- writer.writeStartDocument();
- // the depth
- } else if (event == END_DOCUMENT) {
- if (depth != 0) {
- depth--; // for the end document - reduce the depth
- }
- writer.writeEndDocument();
- }
- if (depth == 0) {
- break;
- }
- if (reader.hasNext()) {
- reader.next();
- } else {
- break;
- }
- }
- }
-
- /**
- * @param reader
- * @param writer
- * @throws XMLStreamException
- */
- protected void serializeText(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
- writer.writeCharacters(reader.getText());
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration.xml;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+/**
+ * The XMLStreamSerializer pulls events from the XMLStreamReader and dumps into the XMLStreamWriter
+ *
+ * @version $Rev$ $Date$
+ */
+public class XMLStreamSerializer implements XMLStreamConstants {
+ public static final String NAMESPACE_PREFIX = "ns";
+ private static int namespaceSuffix;
+
+ /*
+ * The behavior of the Serializer is such that it returns when it encounters the starting element for the second
+ * time. The depth variable tracks the depth of the Serializer and tells it when to return. Note that it is assumed
+ * that this Serialization starts on an Element.
+ */
+
+ /**
+ * Field depth
+ */
+ private int depth;
+
+ /**
+ * Generates a unique namespace prefix that is not in the scope of the NamespaceContext
+ *
+ * @param nsCtxt
+ * @return string
+ */
+ private String generateUniquePrefix(NamespaceContext nsCtxt) {
+ String prefix = NAMESPACE_PREFIX + namespaceSuffix++;
+ // null should be returned if the prefix is not bound!
+ while (nsCtxt.getNamespaceURI(prefix) != null) {
+ prefix = NAMESPACE_PREFIX + namespaceSuffix++;
+ }
+
+ return prefix;
+ }
+
+ /**
+ * Method serialize.
+ *
+ * @param node
+ * @param writer
+ * @throws XMLStreamException
+ */
+ public void serialize(XMLStreamReader node, XMLStreamWriter writer) throws XMLStreamException {
+ serializeNode(node, writer);
+ }
+
+ /**
+ * @param reader
+ * @param writer
+ * @throws XMLStreamException
+ */
+ protected void serializeAttributes(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
+ int count = reader.getAttributeCount();
+ String prefix;
+ String namespaceName;
+ String writerPrefix;
+ for (int i = 0; i < count; i++) {
+ prefix = reader.getAttributePrefix(i);
+ namespaceName = reader.getAttributeNamespace(i);
+ /*
+ * Due to parser implementations returning null as the namespace URI (for the empty namespace) we need to
+ * make sure that we deal with a namespace name that is not null. The best way to work around this issue is
+ * to set the namespace URI to "" if it is null
+ */
+ if (namespaceName == null) {
+ namespaceName = "";
+ }
+
+ writerPrefix = writer.getPrefix(namespaceName);
+
+ if (!"".equals(namespaceName)) {
+ // prefix has already being declared but this particular
+ // attrib has a
+ // no prefix attached. So use the prefix provided by the
+ // writer
+ if (writerPrefix != null && (prefix == null || prefix.equals(""))) {
+ writer.writeAttribute(writerPrefix, namespaceName, reader.getAttributeLocalName(i), reader
+ .getAttributeValue(i));
+
+ // writer prefix is available but different from the
+ // current
+ // prefix of the attrib. We should be declaring the new
+ // prefix
+ // as a namespace declaration
+ } else if (prefix != null && !"".equals(prefix) && !prefix.equals(writerPrefix)) {
+ writer.writeNamespace(prefix, namespaceName);
+ writer.writeAttribute(prefix, namespaceName, reader.getAttributeLocalName(i), reader
+ .getAttributeValue(i));
+
+ // prefix is null (or empty), but the namespace name is
+ // valid! it has not
+ // being written previously also. So we need to generate
+ // a prefix
+ // here
+ } else if (prefix == null || prefix.equals("")) {
+ prefix = generateUniquePrefix(writer.getNamespaceContext());
+ writer.writeNamespace(prefix, namespaceName);
+ writer.writeAttribute(prefix, namespaceName, reader.getAttributeLocalName(i), reader
+ .getAttributeValue(i));
+ } else {
+ writer.writeAttribute(prefix, namespaceName, reader.getAttributeLocalName(i), reader
+ .getAttributeValue(i));
+ }
+ } else {
+ // empty namespace is equal to no namespace!
+ writer.writeAttribute(reader.getAttributeLocalName(i), reader.getAttributeValue(i));
+ }
+
+ }
+ }
+
+ /**
+ * Method serializeCData.
+ *
+ * @param reader
+ * @param writer
+ * @throws XMLStreamException
+ */
+ protected void serializeCData(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
+ writer.writeCData(reader.getText());
+ }
+
+ /**
+ * Method serializeComment.
+ *
+ * @param reader
+ * @param writer
+ * @throws XMLStreamException
+ */
+ protected void serializeComment(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
+ writer.writeComment(reader.getText());
+ }
+
+ /**
+ * @param reader
+ * @param writer
+ * @throws XMLStreamException
+ */
+ protected void serializeElement(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
+ String prefix = reader.getPrefix();
+ String nameSpaceName = reader.getNamespaceURI();
+ if (nameSpaceName != null) {
+ String writerPrefix = writer.getPrefix(nameSpaceName);
+ if (writerPrefix != null) {
+ writer.writeStartElement(nameSpaceName, reader.getLocalName());
+ } else {
+ if (prefix != null) {
+ writer.writeStartElement(prefix, reader.getLocalName(), nameSpaceName);
+ writer.writeNamespace(prefix, nameSpaceName);
+ // writer.setPrefix(prefix, nameSpaceName);
+ } else {
+ // [rfeng] We need to set default NS 1st before calling writeStateElement
+ writer.setDefaultNamespace(nameSpaceName);
+ writer.writeStartElement(nameSpaceName, reader.getLocalName());
+ writer.writeDefaultNamespace(nameSpaceName);
+ }
+ }
+ } else {
+ writer.writeStartElement(reader.getLocalName());
+ }
+
+ // add the namespaces
+ int count = reader.getNamespaceCount();
+ String namespacePrefix;
+ for (int i = 0; i < count; i++) {
+ namespacePrefix = reader.getNamespacePrefix(i);
+ // [rfeng] The following is commented out to allow to default ns
+ // if (namespacePrefix != null && namespacePrefix.length() == 0) {
+ // continue;
+ // }
+
+ serializeNamespace(namespacePrefix, reader.getNamespaceURI(i), writer);
+ }
+
+ // add attributes
+ serializeAttributes(reader, writer);
+
+ }
+
+ /**
+ * Method serializeEndElement.
+ *
+ * @param writer
+ * @throws XMLStreamException
+ */
+ protected void serializeEndElement(XMLStreamWriter writer) throws XMLStreamException {
+ writer.writeEndElement();
+ }
+
+ /**
+ * Method serializeNamespace.
+ *
+ * @param prefix
+ * @param uri
+ * @param writer
+ * @throws XMLStreamException
+ */
+ private void serializeNamespace(String prefix, String uri, XMLStreamWriter writer) throws XMLStreamException {
+ String prefix1 = writer.getPrefix(uri);
+ if (prefix1 == null) {
+ writer.writeNamespace(prefix, uri);
+ // writer.setPrefix(prefix, uri);
+ }
+ }
+
+ /**
+ * Method serializeNode.
+ *
+ * @param reader
+ * @param writer
+ * @throws XMLStreamException
+ */
+ protected void serializeNode(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
+ while (true) {
+ int event = reader.getEventType();
+ if (event == START_ELEMENT) {
+ serializeElement(reader, writer);
+ depth++;
+ } else if (event == ATTRIBUTE) {
+ serializeAttributes(reader, writer);
+ } else if (event == CHARACTERS) {
+ serializeText(reader, writer);
+ } else if (event == COMMENT) {
+ serializeComment(reader, writer);
+ } else if (event == CDATA) {
+ serializeCData(reader, writer);
+ } else if (event == END_ELEMENT) {
+ serializeEndElement(writer);
+ depth--;
+ } else if (event == START_DOCUMENT) {
+ depth++; // if a start document is found then increment
+ writer.writeStartDocument();
+ // the depth
+ } else if (event == END_DOCUMENT) {
+ if (depth != 0) {
+ depth--; // for the end document - reduce the depth
+ }
+ writer.writeEndDocument();
+ }
+ if (depth == 0) {
+ break;
+ }
+ if (reader.hasNext()) {
+ reader.next();
+ } else {
+ break;
+ }
+ }
+ }
+
+ /**
+ * @param reader
+ * @param writer
+ * @throws XMLStreamException
+ */
+ protected void serializeText(XMLStreamReader reader, XMLStreamWriter writer) throws XMLStreamException {
+ writer.writeCharacters(reader.getText());
+ }
+}
diff --git a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/Contributions.java b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/Contributions.java
index 7dabb471be..6aace875b5 100644
--- a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/Contributions.java
+++ b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/Contributions.java
@@ -1,160 +1,160 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.assembly.Extension;
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.Export;
-import org.apache.tuscany.sca.contribution.Import;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-
-/**
- * A Contribution impl wrapping multiple other contributions
- * Currently the sole reason for this is so
- */
-public class Contributions implements Contribution {
-
- private List<Contribution> contributions = new ArrayList<Contribution>();
- private String location;
- private String uri;
- private Object model;
- private byte[] contents;
- private boolean unresolved;
- private ModelResolver modelResolver;
- private List<Contribution> dependencies = new ArrayList<Contribution>();
-
- public Contributions(List<Contribution> contributions) {
- this.contributions = contributions;
- }
-
- public String getLocation() {
- return location;
- }
-
- public Object getModel() {
- return model;
- }
-
- public String getURI() {
- return uri;
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
-
- public void setModel(Object model) {
- this.model = model;
- }
-
- public byte[] getContents() {
- return contents;
- }
-
- public void setContents(byte[] contents) {
- this.contents = contents;
- }
-
- public void setURI(String uri) {
- this.uri = uri;
- }
-
- public boolean isUnresolved() {
- return unresolved;
- }
-
- public void setUnresolved(boolean unresolved) {
- this.unresolved = unresolved;
- }
-
- public List<Contribution> getContributions() {
- return contributions;
- }
-
- public List<Artifact> getArtifacts() {
- return (List<Artifact>)(Object)contributions;
- }
-
- public List<Contribution> getDependencies() {
- return dependencies;
- }
-
- public ClassLoader getClassLoader() {
- //FIXME Remove later
- return null;
- }
-
- public void setClassLoader(ClassLoader classLoader) {
- //FIXME Remove later
- }
-
- public List<Composite> getDeployables() {
- List<Composite> deployables = new ArrayList<Composite>();
- for (Contribution contribution: contributions) {
- deployables.addAll(contribution.getDeployables());
- }
- return deployables;
- }
-
- public List<Export> getExports() {
- List<Export> exports = new ArrayList<Export>();
- for (Contribution contribution: contributions) {
- exports.addAll(contribution.getExports());
- }
- return exports;
- }
-
- public List<Import> getImports() {
- List<Import> imports = new ArrayList<Import>();
- for (Contribution contribution: contributions) {
- imports.addAll(contribution.getImports());
- }
- return imports;
- }
-
- public ModelResolver getModelResolver() {
- return modelResolver;
- }
-
- public void setModelResolver(ModelResolver modelResolver) {
- this.modelResolver = modelResolver;
- }
-
- public List<Extension> getAttributeExtensions() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public List<Object> getExtensions() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Set<String> getTypes() {
- return Collections.emptySet();
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.Extension;
+import org.apache.tuscany.sca.contribution.Artifact;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.Export;
+import org.apache.tuscany.sca.contribution.Import;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+
+/**
+ * A Contribution impl wrapping multiple other contributions
+ * Currently the sole reason for this is so
+ */
+public class Contributions implements Contribution {
+
+ private List<Contribution> contributions = new ArrayList<Contribution>();
+ private String location;
+ private String uri;
+ private Object model;
+ private byte[] contents;
+ private boolean unresolved;
+ private ModelResolver modelResolver;
+ private List<Contribution> dependencies = new ArrayList<Contribution>();
+
+ public Contributions(List<Contribution> contributions) {
+ this.contributions = contributions;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public Object getModel() {
+ return model;
+ }
+
+ public String getURI() {
+ return uri;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ public void setModel(Object model) {
+ this.model = model;
+ }
+
+ public byte[] getContents() {
+ return contents;
+ }
+
+ public void setContents(byte[] contents) {
+ this.contents = contents;
+ }
+
+ public void setURI(String uri) {
+ this.uri = uri;
+ }
+
+ public boolean isUnresolved() {
+ return unresolved;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ this.unresolved = unresolved;
+ }
+
+ public List<Contribution> getContributions() {
+ return contributions;
+ }
+
+ public List<Artifact> getArtifacts() {
+ return (List<Artifact>)(Object)contributions;
+ }
+
+ public List<Contribution> getDependencies() {
+ return dependencies;
+ }
+
+ public ClassLoader getClassLoader() {
+ //FIXME Remove later
+ return null;
+ }
+
+ public void setClassLoader(ClassLoader classLoader) {
+ //FIXME Remove later
+ }
+
+ public List<Composite> getDeployables() {
+ List<Composite> deployables = new ArrayList<Composite>();
+ for (Contribution contribution: contributions) {
+ deployables.addAll(contribution.getDeployables());
+ }
+ return deployables;
+ }
+
+ public List<Export> getExports() {
+ List<Export> exports = new ArrayList<Export>();
+ for (Contribution contribution: contributions) {
+ exports.addAll(contribution.getExports());
+ }
+ return exports;
+ }
+
+ public List<Import> getImports() {
+ List<Import> imports = new ArrayList<Import>();
+ for (Contribution contribution: contributions) {
+ imports.addAll(contribution.getImports());
+ }
+ return imports;
+ }
+
+ public ModelResolver getModelResolver() {
+ return modelResolver;
+ }
+
+ public void setModelResolver(ModelResolver modelResolver) {
+ this.modelResolver = modelResolver;
+ }
+
+ public List<Extension> getAttributeExtensions() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<Object> getExtensions() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Set<String> getTypes() {
+ return Collections.emptySet();
+ }
+}
diff --git a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java
index 8bf3ea8b04..3f65d49740 100644
--- a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java
+++ b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeUtil.java
@@ -32,7 +32,7 @@ import org.apache.tuscany.sca.contribution.ContributionFactory;
/**
* NodeUtil
*
- * @version $Rev: $ $Date: $
+ * @version $Rev$ $Date$
*/
public class NodeUtil {
diff --git a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/management/NodeManager.java b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/management/NodeManager.java
index 5f44dda7d5..12704a3ee5 100644
--- a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/management/NodeManager.java
+++ b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/management/NodeManager.java
@@ -1,65 +1,65 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.management;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.impl.NodeImpl;
-
-/**
- * MBean implementation for the node
- */
-public class NodeManager implements NodeManagerMBean {
- private NodeImpl node;
- private ObjectName name;
-
- public NodeManager(NodeImpl node) {
- this.node = node;
- try {
- this.name = getName(node);
- } catch (MalformedObjectNameException e) {
- // Ignore
- }
- }
-
- public String getURI() {
- return node.getURI();
- }
-
- public String getDomainURI() {
- return node.getConfiguration().getDomainURI();
- }
-
- public ObjectName getName() {
- return name;
- }
-
- private static ObjectName getName(NodeImpl node) throws MalformedObjectNameException {
- String name =
- Node.class.getPackage().getName() + ":type="
- + Node.class.getSimpleName()
- + ",uri="
- + ObjectName.quote(node.getURI());
- return ObjectName.getInstance(name);
-
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.management;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+
+/**
+ * MBean implementation for the node
+ */
+public class NodeManager implements NodeManagerMBean {
+ private NodeImpl node;
+ private ObjectName name;
+
+ public NodeManager(NodeImpl node) {
+ this.node = node;
+ try {
+ this.name = getName(node);
+ } catch (MalformedObjectNameException e) {
+ // Ignore
+ }
+ }
+
+ public String getURI() {
+ return node.getURI();
+ }
+
+ public String getDomainURI() {
+ return node.getConfiguration().getDomainURI();
+ }
+
+ public ObjectName getName() {
+ return name;
+ }
+
+ private static ObjectName getName(NodeImpl node) throws MalformedObjectNameException {
+ String name =
+ Node.class.getPackage().getName() + ":type="
+ + Node.class.getSimpleName()
+ + ",uri="
+ + ObjectName.quote(node.getURI());
+ return ObjectName.getInstance(name);
+
+ }
+}
diff --git a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/management/NodeManagerMBean.java b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/management/NodeManagerMBean.java
index c25cd0f0ca..3133142c2b 100644
--- a/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/management/NodeManagerMBean.java
+++ b/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/management/NodeManagerMBean.java
@@ -1,30 +1,30 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.management;
-
-
-
-/**
- * MBean for NodeImpl
- */
-public interface NodeManagerMBean {
- String getURI();
- String getDomainURI();
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.management;
+
+
+
+/**
+ * MBean for NodeImpl
+ */
+public interface NodeManagerMBean {
+ String getURI();
+ String getDomainURI();
+}
diff --git a/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessorTestCase.java b/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessorTestCase.java
index f76aabe034..6b5bce2d13 100644
--- a/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessorTestCase.java
+++ b/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/configuration/xml/NodeConfigurationProcessorTestCase.java
@@ -1,83 +1,83 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.configuration.xml;
-
-import java.io.InputStream;
-import java.io.StringWriter;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
-import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
-import org.apache.tuscany.sca.core.DefaultFactoryExtensionPoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- *
- */
-public class NodeConfigurationProcessorTestCase {
- private static FactoryExtensionPoint factories;
- private static StAXArtifactProcessor processor;
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
- factories = new DefaultFactoryExtensionPoint(registry);
- StAXArtifactProcessorExtensionPoint processors =
- registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
- processor = processors.getProcessor(NodeConfiguration.class);
- }
-
- @Test
- public void testRead() throws Exception {
- InputStream is = getClass().getResourceAsStream("/org/apache/tuscany/sca/node/configuration/node1.xml");
- XMLInputFactory xmlInputFactory = factories.getFactory(XMLInputFactory.class);
- XMLStreamReader reader = xmlInputFactory.createXMLStreamReader(is);
- is.close();
- reader.nextTag();
- NodeConfiguration config = (NodeConfiguration) processor.read(reader);
- StringWriter sw = new StringWriter();
- XMLOutputFactory xmlOutputFactory = factories.getFactory(XMLOutputFactory.class);
- XMLStreamWriter writer = xmlOutputFactory.createXMLStreamWriter(sw);
- processor.write(config, writer);
- writer.flush();
- System.out.println(sw.toString());
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration.xml;
+
+import java.io.InputStream;
+import java.io.StringWriter;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint;
+import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
+import org.apache.tuscany.sca.core.DefaultFactoryExtensionPoint;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ */
+public class NodeConfigurationProcessorTestCase {
+ private static FactoryExtensionPoint factories;
+ private static StAXArtifactProcessor processor;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
+ factories = new DefaultFactoryExtensionPoint(registry);
+ StAXArtifactProcessorExtensionPoint processors =
+ registry.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
+ processor = processors.getProcessor(NodeConfiguration.class);
+ }
+
+ @Test
+ public void testRead() throws Exception {
+ InputStream is = getClass().getResourceAsStream("/org/apache/tuscany/sca/node/configuration/node1.xml");
+ XMLInputFactory xmlInputFactory = factories.getFactory(XMLInputFactory.class);
+ XMLStreamReader reader = xmlInputFactory.createXMLStreamReader(is);
+ is.close();
+ reader.nextTag();
+ NodeConfiguration config = (NodeConfiguration) processor.read(reader);
+ StringWriter sw = new StringWriter();
+ XMLOutputFactory xmlOutputFactory = factories.getFactory(XMLOutputFactory.class);
+ XMLStreamWriter writer = xmlOutputFactory.createXMLStreamWriter(sw);
+ processor.write(config, writer);
+ writer.flush();
+ System.out.println(sw.toString());
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ }
+
+}
diff --git a/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeUtilTestCase.java b/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeUtilTestCase.java
index 55e44c04ba..725bce5e09 100644
--- a/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeUtilTestCase.java
+++ b/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/node/impl/NodeUtilTestCase.java
@@ -1,38 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.impl;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-
-/**
- *
- */
-public class NodeUtilTestCase {
- @Test
- public void testCreateURI() {
- Assert.assertEquals("/a/b", NodeUtil.createURI("/a/b").toString());
- Assert.assertEquals("/a%20b", NodeUtil.createURI("/a b").toString());
- Assert.assertEquals("file:/a/b", NodeUtil.createURI("file:/a/b").toString());
- Assert.assertEquals("file:/a%20b", NodeUtil.createURI("file:/a b").toString());
- Assert.assertEquals("file:/a%20b", NodeUtil.createURI("file:/a%20b").toString());
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.impl;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+
+/**
+ *
+ */
+public class NodeUtilTestCase {
+ @Test
+ public void testCreateURI() {
+ Assert.assertEquals("/a/b", NodeUtil.createURI("/a/b").toString());
+ Assert.assertEquals("/a%20b", NodeUtil.createURI("/a b").toString());
+ Assert.assertEquals("file:/a/b", NodeUtil.createURI("file:/a/b").toString());
+ Assert.assertEquals("file:/a%20b", NodeUtil.createURI("file:/a b").toString());
+ Assert.assertEquals("file:/a%20b", NodeUtil.createURI("file:/a%20b").toString());
+ }
+}
diff --git a/java/sca/modules/node-impl/src/test/resources/HelloWorld.composite b/java/sca/modules/node-impl/src/test/resources/HelloWorld.composite
index 4c6f1b082f..efe43cbf2f 100644
--- a/java/sca/modules/node-impl/src/test/resources/HelloWorld.composite
+++ b/java/sca/modules/node-impl/src/test/resources/HelloWorld.composite
@@ -1,30 +1,30 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://sample/composite"
- xmlns:sc="http://sample/composite"
- name="HelloWorld">
-
- <component name="HelloWorld">
- <implementation.java class="hello.HelloWorldImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://sample/composite"
+ xmlns:sc="http://sample/composite"
+ name="HelloWorld">
+
+ <component name="HelloWorld">
+ <implementation.java class="hello.HelloWorldImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/node-impl/src/test/resources/org/apache/tuscany/sca/node/configuration/node1.xml b/java/sca/modules/node-impl/src/test/resources/org/apache/tuscany/sca/node/configuration/node1.xml
index 40961a22b7..b6e56368ef 100644
--- a/java/sca/modules/node-impl/src/test/resources/org/apache/tuscany/sca/node/configuration/node1.xml
+++ b/java/sca/modules/node-impl/src/test/resources/org/apache/tuscany/sca/node/configuration/node1.xml
@@ -1,55 +1,55 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- uri="http://sample/nodes/TestNode1"
- domain="http://domain1">
-
- <!-- Configure the base URIs for a given binding -->
- <!-- Each base URI is for a protocol supported by the binding -->
- <binding name="sca:binding.ws" baseURIs="http://localhost:8080/ws https://localhost:8081/ws"/>
- <binding name="tuscany:binding.rmi" baseURIs="rmi://localhost:8080/rmi"/>
- <binding name="tuscany:binding.jsonrpc">
- <baseURI>http://localhost:8080/jsonrpc</baseURI>
- </binding>
-
- <!-- Configure a list of contributions -->
- <contribution uri="http://c1" location="file:///a.jar"/>
- <contribution uri="http://c2" location="http://locahost/repo/b.jar">
- <!-- The deployment composite is optional -->
- <!-- The deployment composite can be defined inline or referenced using a URI -->
- <!-- Can we have more than one deployment composites -->
- <deploymentComposite>
- <sca:composite>
- <sca:component name="Component1"> <!-- first component -->
- <sca:implementation.java class="a.b.Component1Impl"/>
- <sca:reference name="ref1">
- <tuscany:binding.rmi/>
- </sca:reference>
- </sca:component>
- </sca:composite>
- </deploymentComposite>
- </contribution>
- <contribution uri="http://c3" location="http://locahost/repo/c.jar">
- <deploymentComposite location="test/Test.composite">
- </deploymentComposite>
- </contribution>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ uri="http://sample/nodes/TestNode1"
+ domain="http://domain1">
+
+ <!-- Configure the base URIs for a given binding -->
+ <!-- Each base URI is for a protocol supported by the binding -->
+ <binding name="sca:binding.ws" baseURIs="http://localhost:8080/ws https://localhost:8081/ws"/>
+ <binding name="tuscany:binding.rmi" baseURIs="rmi://localhost:8080/rmi"/>
+ <binding name="tuscany:binding.jsonrpc">
+ <baseURI>http://localhost:8080/jsonrpc</baseURI>
+ </binding>
+
+ <!-- Configure a list of contributions -->
+ <contribution uri="http://c1" location="file:///a.jar"/>
+ <contribution uri="http://c2" location="http://locahost/repo/b.jar">
+ <!-- The deployment composite is optional -->
+ <!-- The deployment composite can be defined inline or referenced using a URI -->
+ <!-- Can we have more than one deployment composites -->
+ <deploymentComposite>
+ <sca:composite>
+ <sca:component name="Component1"> <!-- first component -->
+ <sca:implementation.java class="a.b.Component1Impl"/>
+ <sca:reference name="ref1">
+ <tuscany:binding.rmi/>
+ </sca:reference>
+ </sca:component>
+ </sca:composite>
+ </deploymentComposite>
+ </contribution>
+ <contribution uri="http://c3" location="http://locahost/repo/c.jar">
+ <deploymentComposite location="test/Test.composite">
+ </deploymentComposite>
+ </contribution>
</node> \ No newline at end of file
diff --git a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/ContributionLocationHelper.java b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/ContributionLocationHelper.java
index fd7aaed4c8..056ec080ba 100644
--- a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/ContributionLocationHelper.java
+++ b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/ContributionLocationHelper.java
@@ -29,7 +29,7 @@ import org.osgi.framework.Bundle;
/**
* ContributionLocationHelper
*
- * @version $Rev: $ $Date: $
+ * @version $Rev$ $Date$
*/
public class ContributionLocationHelper {
diff --git a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/FrameworkLauncher.java b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/FrameworkLauncher.java
index 777ab59df3..380056e470 100644
--- a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/FrameworkLauncher.java
+++ b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/FrameworkLauncher.java
@@ -1,126 +1,126 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.equinox.launcher;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.eclipse.osgi.framework.console.CommandProvider;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.launch.Framework;
-import org.osgi.framework.launch.FrameworkFactory;
-
-/**
- * Launcher for the OSGi framework using the framework launch APIs
- */
-public class FrameworkLauncher implements BundleActivator {
- private static final Logger logger = Logger.getLogger(FrameworkLauncher.class.getName());
-
- private FrameworkFactory factory;
- private boolean isEquinox;
-
- @SuppressWarnings("unchecked")
- private synchronized FrameworkFactory loadFrameworkFactory() {
- if (factory == null) {
- // Use reflection APIs to call ServiceDiscovery to avoid hard dependency to tuscany-extensibility
- try {
- ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- InputStream is =
- classLoader.getResourceAsStream("META-INF/services/" + FrameworkFactory.class.getName());
- if (is == null) {
- classLoader = FrameworkFactory.class.getClassLoader();
- is = classLoader.getResourceAsStream("META-INF/services/" + FrameworkFactory.class.getName());
- }
- if (is == null) {
- return null;
- }
- BufferedReader reader = null;
- String line = null;
- try {
- reader = new BufferedReader(new InputStreamReader(is));
- while (true) {
- line = reader.readLine();
- if (line == null)
- break;
- line = line.trim();
- if (!line.startsWith("#") && !"".equals(line)) {
- break;
- }
- }
- } finally {
- if (reader != null) {
- try {
- reader.close();
- } catch (IOException e) {
- // Ignore
- }
- }
- }
- if (line != null) {
- Class<? extends FrameworkFactory> factoryImplClass =
- (Class<? extends FrameworkFactory>)Class.forName(line, false, classLoader);
- factory = factoryImplClass.newInstance();
- if (factory != null && factory.getClass().getName().startsWith("org.eclipse.osgi.")) {
- isEquinox = true;
- }
-
- }
- } catch (Throwable e) {
- logger.log(Level.SEVERE, e.getMessage(), e);
- }
- }
- return factory;
- }
-
- public Framework newFramework(Map properties) {
- FrameworkFactory factory = loadFrameworkFactory();
- if (factory == null) {
- return null;
- }
- return factory.newFramework(properties);
- }
-
- public boolean isEquinox() {
- return isEquinox;
- }
-
- public void start(BundleContext context) throws Exception {
- EquinoxHost.injectedBundleContext = context;
- if (context.getClass().getName().startsWith("org.eclipse.osgi.")) {
- isEquinox = true;
- try {
- context.registerService(CommandProvider.class.getName(), new NodeLauncherCommand(), new Hashtable());
- } catch (NoClassDefFoundError e) {
- // Ignore it
- }
- }
- }
-
- public void stop(BundleContext context) throws Exception {
- EquinoxHost.injectedBundleContext = null;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.equinox.launcher;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.eclipse.osgi.framework.console.CommandProvider;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.launch.Framework;
+import org.osgi.framework.launch.FrameworkFactory;
+
+/**
+ * Launcher for the OSGi framework using the framework launch APIs
+ */
+public class FrameworkLauncher implements BundleActivator {
+ private static final Logger logger = Logger.getLogger(FrameworkLauncher.class.getName());
+
+ private FrameworkFactory factory;
+ private boolean isEquinox;
+
+ @SuppressWarnings("unchecked")
+ private synchronized FrameworkFactory loadFrameworkFactory() {
+ if (factory == null) {
+ // Use reflection APIs to call ServiceDiscovery to avoid hard dependency to tuscany-extensibility
+ try {
+ ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ InputStream is =
+ classLoader.getResourceAsStream("META-INF/services/" + FrameworkFactory.class.getName());
+ if (is == null) {
+ classLoader = FrameworkFactory.class.getClassLoader();
+ is = classLoader.getResourceAsStream("META-INF/services/" + FrameworkFactory.class.getName());
+ }
+ if (is == null) {
+ return null;
+ }
+ BufferedReader reader = null;
+ String line = null;
+ try {
+ reader = new BufferedReader(new InputStreamReader(is));
+ while (true) {
+ line = reader.readLine();
+ if (line == null)
+ break;
+ line = line.trim();
+ if (!line.startsWith("#") && !"".equals(line)) {
+ break;
+ }
+ }
+ } finally {
+ if (reader != null) {
+ try {
+ reader.close();
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
+ }
+ if (line != null) {
+ Class<? extends FrameworkFactory> factoryImplClass =
+ (Class<? extends FrameworkFactory>)Class.forName(line, false, classLoader);
+ factory = factoryImplClass.newInstance();
+ if (factory != null && factory.getClass().getName().startsWith("org.eclipse.osgi.")) {
+ isEquinox = true;
+ }
+
+ }
+ } catch (Throwable e) {
+ logger.log(Level.SEVERE, e.getMessage(), e);
+ }
+ }
+ return factory;
+ }
+
+ public Framework newFramework(Map properties) {
+ FrameworkFactory factory = loadFrameworkFactory();
+ if (factory == null) {
+ return null;
+ }
+ return factory.newFramework(properties);
+ }
+
+ public boolean isEquinox() {
+ return isEquinox;
+ }
+
+ public void start(BundleContext context) throws Exception {
+ EquinoxHost.injectedBundleContext = context;
+ if (context.getClass().getName().startsWith("org.eclipse.osgi.")) {
+ isEquinox = true;
+ try {
+ context.registerService(CommandProvider.class.getName(), new NodeLauncherCommand(), new Hashtable());
+ } catch (NoClassDefFoundError e) {
+ // Ignore it
+ }
+ }
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ EquinoxHost.injectedBundleContext = null;
+ }
+}
diff --git a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher2.java b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher2.java
index fc299b3d53..14018a7af5 100644
--- a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher2.java
+++ b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncher2.java
@@ -1,217 +1,217 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.equinox.launcher;
-
-import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.node;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.osgi.framework.BundleContext;
-
-/**
- * A launcher for SCA nodes.
- *
- * @version $Rev: 720905 $ $Date: 2008-11-26 15:47:28 +0000 (Wed, 26 Nov 2008) $
- */
-public class NodeLauncher2 {
-
- static final Logger logger = Logger.getLogger(NodeLauncher2.class.getName());
- private EquinoxHost equinoxHost;
- private BundleContext bundleContext;
-
- /**
- * Constructs a new node launcher.
- */
- private NodeLauncher2() {
- equinoxHost = new EquinoxHost();
- bundleContext = equinoxHost.start();
- }
-
- /**
- * Returns a new launcher instance.
- *
- * @return a new launcher instance
- */
- public static NodeLauncher2 newInstance() {
- return new NodeLauncher2();
- }
-
- /**
- * Creates a new SCA node from the configuration URL
- *
- * @param configurationURL the URL of the node configuration which is the ATOM feed
- * that contains the URI of the composite and a collection of URLs for the contributions
- *
- * @return a new SCA node.
- * @throws LauncherException
- */
- public <T> T createNode(String configurationURL) throws LauncherException {
- return (T)node(configurationURL, null, null, null, bundleContext);
- }
-
- /**
- * Creates a new SCA OSGi Node.
- *
- * @param compositeURI the URI of the composite to use
- * @param contributions the URI of the contributions that provides the composites and related
- * artifacts. If the list is empty, then we will use the thread context classloader to discover
- * the contribution on the classpath
- *
- * @return a new SCA node.
- * @throws LauncherException
- */
- public <T> T createNode(String compositeURI, Contribution... contributions) throws LauncherException {
- return (T)node(null, compositeURI, null, contributions, bundleContext);
- }
-
- /**
- * Creates a new SCA OSGi Node.
- *
- * @param compositeURI the URI of the composite to use
- * @param compositeContent the XML content of the composite to use
- * @param contributions the URI of the contributions that provides the composites and related artifacts
- * @return a new SCA node.
- * @throws LauncherException
- */
- public <T> T createNode(String compositeURI, String compositeContent, Contribution... contributions)
- throws LauncherException {
- return (T)node(null, compositeURI, compositeContent, contributions, bundleContext);
- }
-
- public static void main(String[] args) throws Exception {
- logger.info("Apache Tuscany SCA Node is starting...");
-
- // Create a node launcher
- NodeLauncher2 launcher = newInstance();
-
- EquinoxHost equinox = launcher.equinoxHost;
- Object node = null;
- ShutdownThread shutdown = null;
- try {
-
- Contribution[] contributions = new Contribution[args.length];
- for (int i=0; i<args.length; i++) {
- File f = new File(args[i]);
- if (!f.exists()) {
- System.err.println("contribution not found: " + f);
- System.exit(1);
- }
- contributions[i] = new Contribution(f.toURI().toString(), f.toURI().toString());
- }
-
- // Create a node from a composite URI and a contribution location
-// String contributionLocation = args[1];
-// logger.info("SCA composite: " + null);
-// logger.info("SCA contribution: " + contributionLocation);
- node = launcher.createNode(null, contributions);
-
- // Start the node
- try {
- node.getClass().getMethod("start").invoke(node);
- } catch (Exception e) {
- logger.log(Level.SEVERE, "SCA Node could not be started", e);
- throw e;
- }
- logger.info("SCA Node is now started.");
-
- // Install a shutdown hook
- shutdown = new ShutdownThread(node, equinox);
- Runtime.getRuntime().addShutdownHook(shutdown);
-
- logger.info("Press enter to shutdown.");
- try {
- System.in.read();
- } catch (IOException e) {
-
- // Wait forever
- Object lock = new Object();
- synchronized(lock) {
- lock.wait();
- }
- }
- } finally {
-
- // Remove the shutdown hook
- if (shutdown != null) {
- Runtime.getRuntime().removeShutdownHook(shutdown);
- }
-
- // Stop the node
- if (node != null) {
- destroyNode(node);
- }
- if (equinox != null) {
- equinox.stop();
- }
- }
- }
-
- public void destroy() {
- if (equinoxHost != null) {
- equinoxHost.stop();
- bundleContext = null;
- }
- }
-
- /**
- * Stop the given node.
- *
- * @param node
- * @throws Exception
- */
- private static void destroyNode(Object node) throws Exception {
- try {
- node.getClass().getMethod("stop").invoke(node);
- node.getClass().getMethod("destroy").invoke(node);
- logger.info("SCA Node is now stopped.");
- } catch (Exception e) {
- logger.log(Level.SEVERE, "SCA Node could not be stopped", e);
- throw e;
- }
- }
-
- private static class ShutdownThread extends Thread {
- private Object node;
- private EquinoxHost equinox;
-
- public ShutdownThread(Object node, EquinoxHost equinox) {
- super();
- this.node = node;
- this.equinox = equinox;
- }
-
- @Override
- public void run() {
- try {
- destroyNode(node);
- } catch (Exception e) {
- // Ignore
- }
- try {
- equinox.stop();
- } catch (Exception e) {
- // Ignore
- }
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.equinox.launcher;
+
+import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.node;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.osgi.framework.BundleContext;
+
+/**
+ * A launcher for SCA nodes.
+ *
+ * @version $Rev$ $Date$
+ */
+public class NodeLauncher2 {
+
+ static final Logger logger = Logger.getLogger(NodeLauncher2.class.getName());
+ private EquinoxHost equinoxHost;
+ private BundleContext bundleContext;
+
+ /**
+ * Constructs a new node launcher.
+ */
+ private NodeLauncher2() {
+ equinoxHost = new EquinoxHost();
+ bundleContext = equinoxHost.start();
+ }
+
+ /**
+ * Returns a new launcher instance.
+ *
+ * @return a new launcher instance
+ */
+ public static NodeLauncher2 newInstance() {
+ return new NodeLauncher2();
+ }
+
+ /**
+ * Creates a new SCA node from the configuration URL
+ *
+ * @param configurationURL the URL of the node configuration which is the ATOM feed
+ * that contains the URI of the composite and a collection of URLs for the contributions
+ *
+ * @return a new SCA node.
+ * @throws LauncherException
+ */
+ public <T> T createNode(String configurationURL) throws LauncherException {
+ return (T)node(configurationURL, null, null, null, bundleContext);
+ }
+
+ /**
+ * Creates a new SCA OSGi Node.
+ *
+ * @param compositeURI the URI of the composite to use
+ * @param contributions the URI of the contributions that provides the composites and related
+ * artifacts. If the list is empty, then we will use the thread context classloader to discover
+ * the contribution on the classpath
+ *
+ * @return a new SCA node.
+ * @throws LauncherException
+ */
+ public <T> T createNode(String compositeURI, Contribution... contributions) throws LauncherException {
+ return (T)node(null, compositeURI, null, contributions, bundleContext);
+ }
+
+ /**
+ * Creates a new SCA OSGi Node.
+ *
+ * @param compositeURI the URI of the composite to use
+ * @param compositeContent the XML content of the composite to use
+ * @param contributions the URI of the contributions that provides the composites and related artifacts
+ * @return a new SCA node.
+ * @throws LauncherException
+ */
+ public <T> T createNode(String compositeURI, String compositeContent, Contribution... contributions)
+ throws LauncherException {
+ return (T)node(null, compositeURI, compositeContent, contributions, bundleContext);
+ }
+
+ public static void main(String[] args) throws Exception {
+ logger.info("Apache Tuscany SCA Node is starting...");
+
+ // Create a node launcher
+ NodeLauncher2 launcher = newInstance();
+
+ EquinoxHost equinox = launcher.equinoxHost;
+ Object node = null;
+ ShutdownThread shutdown = null;
+ try {
+
+ Contribution[] contributions = new Contribution[args.length];
+ for (int i=0; i<args.length; i++) {
+ File f = new File(args[i]);
+ if (!f.exists()) {
+ System.err.println("contribution not found: " + f);
+ System.exit(1);
+ }
+ contributions[i] = new Contribution(f.toURI().toString(), f.toURI().toString());
+ }
+
+ // Create a node from a composite URI and a contribution location
+// String contributionLocation = args[1];
+// logger.info("SCA composite: " + null);
+// logger.info("SCA contribution: " + contributionLocation);
+ node = launcher.createNode(null, contributions);
+
+ // Start the node
+ try {
+ node.getClass().getMethod("start").invoke(node);
+ } catch (Exception e) {
+ logger.log(Level.SEVERE, "SCA Node could not be started", e);
+ throw e;
+ }
+ logger.info("SCA Node is now started.");
+
+ // Install a shutdown hook
+ shutdown = new ShutdownThread(node, equinox);
+ Runtime.getRuntime().addShutdownHook(shutdown);
+
+ logger.info("Press enter to shutdown.");
+ try {
+ System.in.read();
+ } catch (IOException e) {
+
+ // Wait forever
+ Object lock = new Object();
+ synchronized(lock) {
+ lock.wait();
+ }
+ }
+ } finally {
+
+ // Remove the shutdown hook
+ if (shutdown != null) {
+ Runtime.getRuntime().removeShutdownHook(shutdown);
+ }
+
+ // Stop the node
+ if (node != null) {
+ destroyNode(node);
+ }
+ if (equinox != null) {
+ equinox.stop();
+ }
+ }
+ }
+
+ public void destroy() {
+ if (equinoxHost != null) {
+ equinoxHost.stop();
+ bundleContext = null;
+ }
+ }
+
+ /**
+ * Stop the given node.
+ *
+ * @param node
+ * @throws Exception
+ */
+ private static void destroyNode(Object node) throws Exception {
+ try {
+ node.getClass().getMethod("stop").invoke(node);
+ node.getClass().getMethod("destroy").invoke(node);
+ logger.info("SCA Node is now stopped.");
+ } catch (Exception e) {
+ logger.log(Level.SEVERE, "SCA Node could not be stopped", e);
+ throw e;
+ }
+ }
+
+ private static class ShutdownThread extends Thread {
+ private Object node;
+ private EquinoxHost equinox;
+
+ public ShutdownThread(Object node, EquinoxHost equinox) {
+ super();
+ this.node = node;
+ this.equinox = equinox;
+ }
+
+ @Override
+ public void run() {
+ try {
+ destroyNode(node);
+ } catch (Exception e) {
+ // Ignore
+ }
+ try {
+ equinox.stop();
+ } catch (Exception e) {
+ // Ignore
+ }
+ }
+ }
+}
diff --git a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherCommand.java b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherCommand.java
index b85e3e4e71..f3ddbe0f80 100644
--- a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherCommand.java
+++ b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherCommand.java
@@ -1,57 +1,57 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.node.equinox.launcher;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.osgi.framework.console.CommandInterpreter;
-import org.eclipse.osgi.framework.console.CommandProvider;
-
-/**
- * An Equinox console command extension for Tuscany
- * http://www.ibm.com/developerworks/library/os-ecl-osgiconsole/index.html
- */
-public class NodeLauncherCommand implements CommandProvider {
-
- public String getHelp() {
- return "---Apache Tuscany Commands for Equinox---\n"
- + "\ttuscany - Launch an SCA node\n"
- + "\tAgruments:\n"
- // + " [-config <equinoxConfiguration>]: The configuration folder for Equinox\n"
- // + " [-bundles <osgiBundles>]: A list of bundles to be installed\n"
- + "\t[-c <compositeURI>]: The composite URI\n"
- + "\t[-t <ttl>]: Time to live in milliseconds before the node is stopped\n"
- + "\tcontribution1 ... contributionN: A list of contribution files or URLs\n";
- }
-
- public void _tuscany(CommandInterpreter ci) throws Exception {
- List<String> args = new ArrayList<String>();
- while (true) {
- String arg = ci.nextArgument();
- if (arg == null) {
- break;
- }
- args.add(arg);
- }
- NodeLauncher.main(args.toArray(new String[args.size()]));
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.equinox.launcher;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.osgi.framework.console.CommandInterpreter;
+import org.eclipse.osgi.framework.console.CommandProvider;
+
+/**
+ * An Equinox console command extension for Tuscany
+ * http://www.ibm.com/developerworks/library/os-ecl-osgiconsole/index.html
+ */
+public class NodeLauncherCommand implements CommandProvider {
+
+ public String getHelp() {
+ return "---Apache Tuscany Commands for Equinox---\n"
+ + "\ttuscany - Launch an SCA node\n"
+ + "\tAgruments:\n"
+ // + " [-config <equinoxConfiguration>]: The configuration folder for Equinox\n"
+ // + " [-bundles <osgiBundles>]: A list of bundles to be installed\n"
+ + "\t[-c <compositeURI>]: The composite URI\n"
+ + "\t[-t <ttl>]: Time to live in milliseconds before the node is stopped\n"
+ + "\tcontribution1 ... contributionN: A list of contribution files or URLs\n";
+ }
+
+ public void _tuscany(CommandInterpreter ci) throws Exception {
+ List<String> args = new ArrayList<String>();
+ while (true) {
+ String arg = ci.nextArgument();
+ if (arg == null) {
+ break;
+ }
+ args.add(arg);
+ }
+ NodeLauncher.main(args.toArray(new String[args.size()]));
+ }
+
+}
diff --git a/java/sca/modules/node-launcher-equinox/src/test/resources/HelloWorld.composite b/java/sca/modules/node-launcher-equinox/src/test/resources/HelloWorld.composite
index e232226fd3..ccd116e848 100644
--- a/java/sca/modules/node-launcher-equinox/src/test/resources/HelloWorld.composite
+++ b/java/sca/modules/node-launcher-equinox/src/test/resources/HelloWorld.composite
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://sample/composite"
- xmlns:sc="http://sample/composite"
- name="HelloWorld">
-
- <component name="HelloWorld">
- <implementation.java class="hello.HelloWorldImpl" />
- </component>
- <component name="HelloWorldClient">
- <implementation.java class="hello.HelloWorldClient" />
- <reference name="helloWorld" target="HelloWorld"></reference>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://sample/composite"
+ xmlns:sc="http://sample/composite"
+ name="HelloWorld">
+
+ <component name="HelloWorld">
+ <implementation.java class="hello.HelloWorldImpl" />
+ </component>
+ <component name="HelloWorldClient">
+ <implementation.java class="hello.HelloWorldClient" />
+ <reference name="helloWorld" target="HelloWorld"></reference>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/policy-logging/pom.xml b/java/sca/modules/policy-logging/pom.xml
index c8dc8362a9..c4d65c66fe 100644
--- a/java/sca/modules/policy-logging/pom.xml
+++ b/java/sca/modules/policy-logging/pom.xml
@@ -1,58 +1,58 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-policy-logging</artifactId>
- <name>Apache Tuscany Logging Policy Model</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-policy-logging</artifactId>
+ <name>Apache Tuscany Logging Policy Model</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-spi</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xml</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/Logging.java b/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/Logging.java
index 2124d453e6..4bed9520ab 100644
--- a/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/Logging.java
+++ b/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/Logging.java
@@ -1,46 +1,46 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.logging;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import org.apache.tuscany.sca.assembly.Base;
-import org.oasisopen.sca.annotation.Intent;
-import org.oasisopen.sca.annotation.Qualifier;
-
-@Inherited
-@Target({TYPE, FIELD, METHOD, PARAMETER})
-@Retention(RUNTIME)
-@Intent(Logging.LOGGING)
-
-public @interface Logging {
- String LOGGING = "{"+Base.SCA11_TUSCANY_NS + "}logging";
-
- @Qualifier
- String[] value() default "";
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.policy.logging;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import org.apache.tuscany.sca.assembly.Base;
+import org.oasisopen.sca.annotation.Intent;
+import org.oasisopen.sca.annotation.Qualifier;
+
+@Inherited
+@Target({TYPE, FIELD, METHOD, PARAMETER})
+@Retention(RUNTIME)
+@Intent(Logging.LOGGING)
+
+public @interface Logging {
+ String LOGGING = "{"+Base.SCA11_TUSCANY_NS + "}logging";
+
+ @Qualifier
+ String[] value() default "";
+}
diff --git a/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicy.java b/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicy.java
index cb2a8b7ee8..ce252fd4e9 100644
--- a/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicy.java
+++ b/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicy.java
@@ -1,85 +1,85 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.logging.jdk;
-
-import java.util.logging.Level;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.assembly.Base;
-
-/**
- * Implementation for policies that could be injected as parameter
- * into the axis2config.
- *
- * @version $Rev$ $Date$
- */
-public class JDKLoggingPolicy {
- static final String SCA11_NS = Base.SCA11_NS;
- static final String SCA11_TUSCANY_NS = Base.SCA11_TUSCANY_NS;
- private static final QName JDK_LOGGING_POLICY_QNAME = new QName(SCA11_TUSCANY_NS, "jdkLogger");
-
- private String loggerName;
- private String resourceBundleName;
- private Level logLevel;
- private boolean useParentHandlers = false;
-
- public String getLoggerName() {
- return loggerName;
- }
-
- public void setLoggerName(String loggerName) {
- this.loggerName = loggerName;
- }
-
- public Level getLogLevel() {
- return logLevel;
- }
-
- public void setLogLevel(Level logLevel) {
- this.logLevel = logLevel;
- }
-
- public String getResourceBundleName() {
- return resourceBundleName;
- }
-
- public void setResourceBundleName(String resourceBundleName) {
- this.resourceBundleName = resourceBundleName;
- }
-
- public boolean isUseParentHandlers() {
- return useParentHandlers;
- }
-
- public void setUseParentHandlers(boolean useParentHandlers) {
- this.useParentHandlers = useParentHandlers;
- }
-
- public QName getSchemaName() {
- return JDK_LOGGING_POLICY_QNAME;
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.policy.logging.jdk;
+
+import java.util.logging.Level;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.Base;
+
+/**
+ * Implementation for policies that could be injected as parameter
+ * into the axis2config.
+ *
+ * @version $Rev$ $Date$
+ */
+public class JDKLoggingPolicy {
+ static final String SCA11_NS = Base.SCA11_NS;
+ static final String SCA11_TUSCANY_NS = Base.SCA11_TUSCANY_NS;
+ private static final QName JDK_LOGGING_POLICY_QNAME = new QName(SCA11_TUSCANY_NS, "jdkLogger");
+
+ private String loggerName;
+ private String resourceBundleName;
+ private Level logLevel;
+ private boolean useParentHandlers = false;
+
+ public String getLoggerName() {
+ return loggerName;
+ }
+
+ public void setLoggerName(String loggerName) {
+ this.loggerName = loggerName;
+ }
+
+ public Level getLogLevel() {
+ return logLevel;
+ }
+
+ public void setLogLevel(Level logLevel) {
+ this.logLevel = logLevel;
+ }
+
+ public String getResourceBundleName() {
+ return resourceBundleName;
+ }
+
+ public void setResourceBundleName(String resourceBundleName) {
+ this.resourceBundleName = resourceBundleName;
+ }
+
+ public boolean isUseParentHandlers() {
+ return useParentHandlers;
+ }
+
+ public void setUseParentHandlers(boolean useParentHandlers) {
+ this.useParentHandlers = useParentHandlers;
+ }
+
+ public QName getSchemaName() {
+ return JDK_LOGGING_POLICY_QNAME;
+ }
+
+ public boolean isUnresolved() {
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ }
+}
diff --git a/java/sca/modules/policy-logging/src/main/resources/org/apache/tuscany/sca/policy/logging/definitions.xml b/java/sca/modules/policy-logging/src/main/resources/org/apache/tuscany/sca/policy/logging/definitions.xml
index 84d7bfc36f..95c976ba49 100644
--- a/java/sca/modules/policy-logging/src/main/resources/org/apache/tuscany/sca/policy/logging/definitions.xml
+++ b/java/sca/modules/policy-logging/src/main/resources/org/apache/tuscany/sca/policy/logging/definitions.xml
@@ -1,30 +1,30 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1">
-
- <!-- Policy Intents Defined by the SCA Runtime -->
- <intent name="logging" constrains="implementation binding">
- <description>
- All messages to and from this implementation must be logged
- </description>
- </intent>
-
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1">
+
+ <!-- Policy Intents Defined by the SCA Runtime -->
+ <intent name="logging" constrains="implementation binding">
+ <description>
+ All messages to and from this implementation must be logged
+ </description>
+ </intent>
+
</definitions> \ No newline at end of file
diff --git a/java/sca/modules/policy-logging/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml b/java/sca/modules/policy-logging/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml
index 45ede2597b..0f1c1f978c 100644
--- a/java/sca/modules/policy-logging/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml
+++ b/java/sca/modules/policy-logging/src/test/resources/org/apache/tuscany/sca/policy/logging/jdk/mock_policies.xml
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<tuscany:jdkLogger xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" name="test.logger">
- <logLevel>INFO</logLevel>
- <resourceBundle>Trace_Messages.properties</resourceBundle>
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<tuscany:jdkLogger xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1" name="test.logger">
+ <logLevel>INFO</logLevel>
+ <resourceBundle>Trace_Messages.properties</resourceBundle>
</tuscany:jdkLogger> \ No newline at end of file
diff --git a/java/sca/modules/policy-security/pom.xml b/java/sca/modules/policy-security/pom.xml
index 5dbc7ee7b7..029f605a4d 100644
--- a/java/sca/modules/policy-security/pom.xml
+++ b/java/sca/modules/policy-security/pom.xml
@@ -1,52 +1,52 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-policy-security</artifactId>
- <name>Apache Tuscany SCA Policy Security Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly-xml</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-core-spi</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-policy-security</artifactId>
+ <name>Apache Tuscany SCA Policy Security Model</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xml</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-core-spi</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicy.java b/java/sca/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicy.java
index 179fd0700f..65d8b5c597 100644
--- a/java/sca/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicy.java
+++ b/java/sca/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicy.java
@@ -1,71 +1,71 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.security.jaas;
-
-import javax.xml.namespace.QName;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class JaasAuthenticationPolicy {
- private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1";
- public static final QName NAME = new QName(SCA10_TUSCANY_NS, "jaasAuthentication");
-
- private String configurationName = "other";
- private String callbackHandlerClassName;
- private Class<?> callbackHandlerClass;
-
- public String getCallbackHandlerClassName() {
- return callbackHandlerClassName;
- }
-
- public void setCallbackHandlerClassName(String callbackHandlerClassName) {
- this.callbackHandlerClassName = callbackHandlerClassName;
- }
-
- public Class<?> getCallbackHandlerClass() {
- return callbackHandlerClass;
- }
-
- public void setCallbackHandlerClass(Class<?> callbackHandlerClass) {
- this.callbackHandlerClass = callbackHandlerClass;
- }
-
- public QName getSchemaName() {
- return NAME;
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- }
-
- public String getConfigurationName() {
- return configurationName;
- }
-
- public void setConfigurationName(String configurationName) {
- this.configurationName = configurationName;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.policy.security.jaas;
+
+import javax.xml.namespace.QName;
+
+/**
+ *
+ * @version $Rev$ $Date$
+ */
+public class JaasAuthenticationPolicy {
+ private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1";
+ public static final QName NAME = new QName(SCA10_TUSCANY_NS, "jaasAuthentication");
+
+ private String configurationName = "other";
+ private String callbackHandlerClassName;
+ private Class<?> callbackHandlerClass;
+
+ public String getCallbackHandlerClassName() {
+ return callbackHandlerClassName;
+ }
+
+ public void setCallbackHandlerClassName(String callbackHandlerClassName) {
+ this.callbackHandlerClassName = callbackHandlerClassName;
+ }
+
+ public Class<?> getCallbackHandlerClass() {
+ return callbackHandlerClass;
+ }
+
+ public void setCallbackHandlerClass(Class<?> callbackHandlerClass) {
+ this.callbackHandlerClass = callbackHandlerClass;
+ }
+
+ public QName getSchemaName() {
+ return NAME;
+ }
+
+ public boolean isUnresolved() {
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ }
+
+ public String getConfigurationName() {
+ return configurationName;
+ }
+
+ public void setConfigurationName(String configurationName) {
+ this.configurationName = configurationName;
+ }
+
+}
diff --git a/java/sca/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyHandler.java b/java/sca/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyHandler.java
index a45ac9b250..16629e4c6b 100644
--- a/java/sca/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyHandler.java
+++ b/java/sca/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationPolicyHandler.java
@@ -1,71 +1,71 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.security.jaas;
-
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.login.LoginContext;
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.PolicySet;
-
-/**
- * Policy handler to handle PolicySet containing JaasAuthenticationPolicy instances
- *
- * @version $Rev$ $Date$
- */
-public class JaasAuthenticationPolicyHandler {
- private static final String jaasPolicy = "JaasPolicy";
- private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1";
- public static final QName policySetQName = new QName(SCA10_TUSCANY_NS, jaasPolicy);
- private PolicySet applicablePolicySet = null;
-
- public void setUp(Object... context) {
- if (applicablePolicySet != null) {
- }
- }
-
- public void cleanUp(Object... context) {
- }
-
- public void beforeInvoke(Object... context) {
- try {
- JaasAuthenticationPolicy policy = (JaasAuthenticationPolicy)applicablePolicySet.getPolicies().get(0);
- CallbackHandler callbackHandler =
- (CallbackHandler)policy.getCallbackHandlerClass().newInstance();
- LoginContext lc = new LoginContext(policy.getConfigurationName(), callbackHandler);
- lc.login();
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
-
- }
-
- public void afterInvoke(Object... context) {
-
- }
-
- public PolicySet getApplicablePolicySet() {
- return applicablePolicySet;
- }
-
- public void setApplicablePolicySet(PolicySet applicablePolicySet) {
- this.applicablePolicySet = applicablePolicySet;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.policy.security.jaas;
+
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.login.LoginContext;
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.policy.PolicySet;
+
+/**
+ * Policy handler to handle PolicySet containing JaasAuthenticationPolicy instances
+ *
+ * @version $Rev$ $Date$
+ */
+public class JaasAuthenticationPolicyHandler {
+ private static final String jaasPolicy = "JaasPolicy";
+ private static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1";
+ public static final QName policySetQName = new QName(SCA10_TUSCANY_NS, jaasPolicy);
+ private PolicySet applicablePolicySet = null;
+
+ public void setUp(Object... context) {
+ if (applicablePolicySet != null) {
+ }
+ }
+
+ public void cleanUp(Object... context) {
+ }
+
+ public void beforeInvoke(Object... context) {
+ try {
+ JaasAuthenticationPolicy policy = (JaasAuthenticationPolicy)applicablePolicySet.getPolicies().get(0);
+ CallbackHandler callbackHandler =
+ (CallbackHandler)policy.getCallbackHandlerClass().newInstance();
+ LoginContext lc = new LoginContext(policy.getConfigurationName(), callbackHandler);
+ lc.login();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ }
+
+ public void afterInvoke(Object... context) {
+
+ }
+
+ public PolicySet getApplicablePolicySet() {
+ return applicablePolicySet;
+ }
+
+ public void setApplicablePolicySet(PolicySet applicablePolicySet) {
+ this.applicablePolicySet = applicablePolicySet;
+ }
+}
diff --git a/java/sca/modules/policy-xml/pom.xml b/java/sca/modules/policy-xml/pom.xml
index 0b866e5c9f..c9e7787111 100644
--- a/java/sca/modules/policy-xml/pom.xml
+++ b/java/sca/modules/policy-xml/pom.xml
@@ -1,58 +1,58 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-policy-xml</artifactId>
- <name>Apache Tuscany SCA Policy XML Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-policy</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-asl</artifactId>
- <version>3.2.4</version>
- <scope>runtime</scope>
- <exclusions>
- <exclusion>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-policy-xml</artifactId>
+ <name>Apache Tuscany SCA Policy XML Model</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-policy</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.4</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyConstants.java b/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyConstants.java
index 7d63440e23..979dad3c8b 100644
--- a/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyConstants.java
+++ b/java/sca/modules/policy-xml/src/main/java/org/apache/tuscany/sca/policy/xml/PolicyConstants.java
@@ -1,74 +1,74 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.xml;
-
-import javax.xml.namespace.QName;
-
-/**
- * constants related to policy framework
- *
- * @version $Rev$ $Date$
- */
-public interface PolicyConstants {
- String WHITE_SPACE = " ";
- String COLON = ":";
- String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
- String TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1";
- String INTENT = "intent";
- String POLICY_SET = "policySet";
- String POLICY_SET_REFERENCE = "policySetReference";
- String INTENT_MAP = "intentMap";
- String NAME = "name";
- String TARGET_NAMESPACE = "targetNamespace";
- String SCA_DEFINITIONS = "definitions";
- String CONSTRAINS = "constrains";
- String DESCRIPTION = "description";
- String PROVIDES = "provides";
- String APPLIES_TO = "appliesTo";
- String ATTACH_TO = "attachTo";
- String ALWAYS_APPLIES_TO = "alwaysAppliesTo";
- String QUALIFIER = ".";
- String INTENT_QUALIFIER = "qualifier";
- String INTENT_MAP_QUALIFIER = "qualifier";
- String REQUIRES = "requires";
- String EXCLUDES = "excludes";
- String DEFAULT = "default";
-
- String ALWAYS_PROVIDES = "alwaysProvides";
- String MAY_PROVIDE = "mayProvide";
- String INTENT_TYPE = "intentType";
- String IMPLEMENTATION_TYPE = "implementationType";
- String BINDING_TYPE = "bindingType";
- QName IMPLEMENTATION_TYPE_QNAME = new QName(SCA11_NS, IMPLEMENTATION_TYPE);
- QName BINDING_TYPE_QNAME = new QName(SCA11_NS, BINDING_TYPE);
- String BINDING = "binding";
- String IMPLEMENTATION = "implementation";
-
- QName POLICY_INTENT_QNAME = new QName(SCA11_NS, INTENT);
- QName POLICY_SET_QNAME = new QName(SCA11_NS, POLICY_SET);
- QName POLICY_INTENT_MAP_QNAME = new QName(SCA11_NS, INTENT_MAP);
- QName SCA_DEFINITIONS_QNAME = new QName(SCA11_NS, SCA_DEFINITIONS);
- QName DESCRIPTION_QNAME = new QName(SCA11_NS, DESCRIPTION);
- QName POLICY_INTENT_MAP_QUALIFIER_QNAME = new QName(SCA11_NS, INTENT_MAP_QUALIFIER);
- QName POLICY_SET_REFERENCE_QNAME = new QName(SCA11_NS, POLICY_SET_REFERENCE);
- QName INTENT_QUALIFIER_QNAME = new QName(SCA11_NS, INTENT_QUALIFIER);
-
- String QUALIFIED_INTENT_CONSTRAINS_ERROR = " - Qualified Intents must not specify 'constrains' attribute";
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.policy.xml;
+
+import javax.xml.namespace.QName;
+
+/**
+ * constants related to policy framework
+ *
+ * @version $Rev$ $Date$
+ */
+public interface PolicyConstants {
+ String WHITE_SPACE = " ";
+ String COLON = ":";
+ String SCA11_NS = "http://docs.oasis-open.org/ns/opencsa/sca/200903";
+ String TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.1";
+ String INTENT = "intent";
+ String POLICY_SET = "policySet";
+ String POLICY_SET_REFERENCE = "policySetReference";
+ String INTENT_MAP = "intentMap";
+ String NAME = "name";
+ String TARGET_NAMESPACE = "targetNamespace";
+ String SCA_DEFINITIONS = "definitions";
+ String CONSTRAINS = "constrains";
+ String DESCRIPTION = "description";
+ String PROVIDES = "provides";
+ String APPLIES_TO = "appliesTo";
+ String ATTACH_TO = "attachTo";
+ String ALWAYS_APPLIES_TO = "alwaysAppliesTo";
+ String QUALIFIER = ".";
+ String INTENT_QUALIFIER = "qualifier";
+ String INTENT_MAP_QUALIFIER = "qualifier";
+ String REQUIRES = "requires";
+ String EXCLUDES = "excludes";
+ String DEFAULT = "default";
+
+ String ALWAYS_PROVIDES = "alwaysProvides";
+ String MAY_PROVIDE = "mayProvide";
+ String INTENT_TYPE = "intentType";
+ String IMPLEMENTATION_TYPE = "implementationType";
+ String BINDING_TYPE = "bindingType";
+ QName IMPLEMENTATION_TYPE_QNAME = new QName(SCA11_NS, IMPLEMENTATION_TYPE);
+ QName BINDING_TYPE_QNAME = new QName(SCA11_NS, BINDING_TYPE);
+ String BINDING = "binding";
+ String IMPLEMENTATION = "implementation";
+
+ QName POLICY_INTENT_QNAME = new QName(SCA11_NS, INTENT);
+ QName POLICY_SET_QNAME = new QName(SCA11_NS, POLICY_SET);
+ QName POLICY_INTENT_MAP_QNAME = new QName(SCA11_NS, INTENT_MAP);
+ QName SCA_DEFINITIONS_QNAME = new QName(SCA11_NS, SCA_DEFINITIONS);
+ QName DESCRIPTION_QNAME = new QName(SCA11_NS, DESCRIPTION);
+ QName POLICY_INTENT_MAP_QUALIFIER_QNAME = new QName(SCA11_NS, INTENT_MAP_QUALIFIER);
+ QName POLICY_SET_REFERENCE_QNAME = new QName(SCA11_NS, POLICY_SET_REFERENCE);
+ QName INTENT_QUALIFIER_QNAME = new QName(SCA11_NS, INTENT_QUALIFIER);
+
+ String QUALIFIED_INTENT_CONSTRAINS_ERROR = " - Qualified Intents must not specify 'constrains' attribute";
+
+}
diff --git a/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java b/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java
index 0d0f945e43..fd11a944c7 100644
--- a/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java
+++ b/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/ReadDocumentTestCase.java
@@ -61,7 +61,7 @@ import org.junit.Test;
/**
* Test reading SCA XML assembly documents.
*
- * @version $Rev: 551296 $ $Date: 2007-06-28 01:18:35 +0530 (Thu, 28 Jun 2007) $
+ * @version $Rev$ $Date$
*/
public class ReadDocumentTestCase {
diff --git a/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/TestPolicyProcessor.java b/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/TestPolicyProcessor.java
index 6887cd1b42..08a2b3b2eb 100644
--- a/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/TestPolicyProcessor.java
+++ b/java/sca/modules/policy-xml/src/test/java/org/apache/tuscany/sca/policy/xml/TestPolicyProcessor.java
@@ -1,82 +1,82 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.xml;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
-import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
-import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
-import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
-import org.apache.tuscany.sca.policy.PolicyExpression;
-
-/**
- *
- * @version $Rev$ $Date$
- */
-public class TestPolicyProcessor implements StAXArtifactProcessor<PolicyExpression> {
-
- public QName getArtifactType() {
- return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
- }
-
- public PolicyExpression read(XMLStreamReader arg0) throws ContributionReadException, XMLStreamException {
- return new MockPolicyImplOne();
- }
-
- public void write(PolicyExpression arg0, XMLStreamWriter arg1) throws ContributionWriteException, XMLStreamException {
- }
-
- public Class<PolicyExpression> getModelType() {
- // TODO Auto-generated method stub
- return PolicyExpression.class;
- }
-
- public void resolve(PolicyExpression arg0, ModelResolver arg1) throws ContributionResolveException {
-
- }
-
- public class MockPolicyImplOne implements PolicyExpression {
- public <T> T getPolicy() {
- return null;
- }
-
- public void setName(QName name) {
- }
-
- public <T> void setPolicy(T policy) {
- }
-
- public QName getName() {
- return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
- }
-
- public boolean isUnresolved() {
- return false;
- }
-
- public void setUnresolved(boolean unresolved) {
- }
-
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.policy.xml;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.contribution.processor.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.processor.ContributionWriteException;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.policy.PolicyExpression;
+
+/**
+ *
+ * @version $Rev$ $Date$
+ */
+public class TestPolicyProcessor implements StAXArtifactProcessor<PolicyExpression> {
+
+ public QName getArtifactType() {
+ return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
+ }
+
+ public PolicyExpression read(XMLStreamReader arg0) throws ContributionReadException, XMLStreamException {
+ return new MockPolicyImplOne();
+ }
+
+ public void write(PolicyExpression arg0, XMLStreamWriter arg1) throws ContributionWriteException, XMLStreamException {
+ }
+
+ public Class<PolicyExpression> getModelType() {
+ // TODO Auto-generated method stub
+ return PolicyExpression.class;
+ }
+
+ public void resolve(PolicyExpression arg0, ModelResolver arg1) throws ContributionResolveException {
+
+ }
+
+ public class MockPolicyImplOne implements PolicyExpression {
+ public <T> T getPolicy() {
+ return null;
+ }
+
+ public void setName(QName name) {
+ }
+
+ public <T> void setPolicy(T policy) {
+ }
+
+ public QName getName() {
+ return new QName("http://schemas.xmlsoap.org/ws/2004/09/policy", "PolicyAttachment");
+ }
+
+ public boolean isUnresolved() {
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ }
+
+ }
+}
diff --git a/java/sca/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/Calculator.composite b/java/sca/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/Calculator.composite
index 3ade69523c..073b636793 100644
--- a/java/sca/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/Calculator.composite
+++ b/java/sca/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/Calculator.composite
@@ -1,49 +1,49 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://sample"
- xmlns:sample="http://sample"
- name="Calculator">
-
- <component name="CalculatorServiceComponent" requires="sca:confidentiality">
- <implementation.java class="calculator.CalculatorServiceImpl"/>
- <reference name="addService" target="AddServiceComponent" />
- <reference name="subtractService" target="SubtractServiceComponent" />
- <reference name="multiplyService" target="MultiplyServiceComponent" />
- <reference name="divideService" target="DivideServiceComponent" />
- </component>
-
- <component name="AddServiceComponent">
- <implementation.java class="calculator.AddServiceImpl"/>
- </component>
-
- <component name="SubtractServiceComponent">
- <implementation.java class="calculator.SubtractServiceImpl"/>
- </component>
-
- <component name="MultiplyServiceComponent">
- <implementation.java class="calculator.MultiplyServiceImpl"/>
- </component>
-
- <component name="DivideServiceComponent">
- <implementation.java class="calculator.DivideServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Calculator">
+
+ <component name="CalculatorServiceComponent" requires="sca:confidentiality">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent" />
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+ <component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ </component>
+
+ <component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component>
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl"/>
+ </component>
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml b/java/sca/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml
index 911833550f..6d41a484d7 100644
--- a/java/sca/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml
+++ b/java/sca/modules/policy-xml/src/test/resources/org/apache/tuscany/sca/policy/xml/test_definitions.xml
@@ -1,203 +1,203 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://test"
- xmlns:test="http://test" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
-
- <!-- Extension Types Metadata -->
- <implementationType type="sca:implementation.java" alwaysProvides="test:logging" mayProvide="test:tracing" />
- <bindingType type="sca:binding.ws" alwaysProvides="test:confidentiality" mayProvide="test:integrity" />
-
- <!-- Intents and Policysets to assume targetnamespace -->
- <intent name="TestIntentOne" constrains="sca:binding">
- <description>
- Test Intent
- </description>
- </intent>
-
- <intent name="TestIntentTwo" constrains="sca:binding" requires="test:TestIntentOne">
- <description>
- Protect messages from unauthorized reading or modification
- </description>
- </intent>
-
- <policySet name="TestPolicySetOne" provides="test:TestIntentOne" appliesTo="sca:binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for
- "basic authentication" -->
- </wsp:PolicyAttachment>
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for
- "reliability" -->
- </wsp:PolicyAttachment>
- </policySet>
-
- <!-- POLICY SETS -->
- <policySet name="SecureReliablePolicy" provides="test:confidentiality.transport test:integrity" appliesTo="sca:binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for
- "basic authentication" -->
- </wsp:PolicyAttachment>
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for
- "reliability" -->
- </wsp:PolicyAttachment>
- </policySet>
-
- <policySet name="SecureMessagingPolicies" provides="test:confidentiality" appliesTo="binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <intentMap provides="test:confidentiality" default="transport">
- <qualifier name="transport">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for "transport" alternative -->
- </wsp:PolicyAttachment>
- <wsp:PolicyAttachment>...</wsp:PolicyAttachment>
- </qualifier>
- <qualifier name="message">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for "message" alternative" -->
- </wsp:PolicyAttachment>
- </qualifier>
- </intentMap>
- </policySet>
-
- <policySet name="SecurityPolicy" provides="test:confidentiality" appliesTo="binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <intentMap provides="test:confidentiality" default="message">
- <qualifier name="message">
- <wsp:PolicyAttachment>
- <!-- policy attachment for body encryption -->
- </wsp:PolicyAttachment>
- </qualifier>
- <qualifier name="transport">
- <wsp:PolicyAttachment>
- <!-- policy attachment for transport encryption -->
- </wsp:PolicyAttachment>
- </qualifier>
- </intentMap>
- </policySet>
-
- <policySet name="BasicAuthMsgProtSecurity" provides="test:authentication test:confidentiality" appliesTo="binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903">
- <policySetReference name="test:AuthenticationPolicies" />
- <policySetReference name="test:ConfidentialityPolicies" />
- </policySet>
-
- <policySet name="AuthenticationPolicies" provides="test:authentication" appliesTo="binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for "basic
- authentication" -->
- </wsp:PolicyAttachment>
- </policySet>
-
- <policySet name="ConfidentialityPolicies" provides="test:confidentiality" appliesTo="binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <intentMap provides="test:confidentiality" default="transport">
- <qualifier name="transport">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for "transport"
- alternative -->
- </wsp:PolicyAttachment>
- <wsp:PolicyAttachment>...</wsp:PolicyAttachment>
- </qualifier>
- <qualifier name="message">
- <wsp:PolicyAttachment>
- <!-- policy expression and policy subject for "message"
- alternative" -->
- ...
- </wsp:PolicyAttachment>
- </qualifier>
- </intentMap>
- </policySet>
-
- <policySet name="SecureWSPolicy" provides="test:confidentiality" appliesTo="sca:binding.ws"
- xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:sp="http://schemas.xmlsoap.org/ws/2002/12/secext"
- xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
- <wsp:Policy>
- <wsp:ExactlyOne>
- <wsp:All>
- <sp:SecurityToken>
- <sp:TokenType>sp:X509v3</sp:TokenType>
- </sp:SecurityToken>
- <sp:UsernameToken />
- <sp:SignedParts />
- <sp:EncryptedParts>
- <sp:Body />
- </sp:EncryptedParts>
- <sp:TransportBinding>
- <sp:IncludeTimeStamp />
- </sp:TransportBinding>
- </wsp:All>
- </wsp:ExactlyOne>
- </wsp:Policy>
- </policySet>
-
- <!-- profile intent -->
- <intent name="reliableMessageProtection" constrains="sca:binding" requires="test:messageProtection">
- <description>
- Protect messages from unauthorized reading or modification
- </description>
- </intent>
-
- <intent name="messageProtection" constrains="sca:binding" requires="test:confidentiality test:integrity">
- <description>
- Protect messages from unauthorized reading or modification
- </description>
- </intent>
-
- <!-- simple intent -->
- <intent name="confidentiality" constrains="sca:binding">
- <description>
- Communitcation thro this binding must prevent
- unauthorized users from reading the messages.
- </description>
- <qualifier name="transport" />
- <qualifier name="message" default="true" />
- </intent>
-
- <intent name="integrity" constrains="sca:binding">
- <description>
- Communitcation thro this binding must prevent
- unauthorized modification of the messages.
- </description>
- </intent>
-
- <intent name="authentication" constrains="sca:binding">
- <description>
- Communitcation thro this binding required
- Authentication.
- </description>
- </intent>
-
- <intent name="logging" constrains="sca:implementation">
- <description>
- All messages to and from this implementation must be logged
- </description>
- </intent>
-
- <intent name="tracing" constrains="sca:implementation.java">
- <description>
- Need to figure out some description for this
- </description>
- </intent>
-
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" targetNamespace="http://test"
+ xmlns:test="http://test" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+
+ <!-- Extension Types Metadata -->
+ <implementationType type="sca:implementation.java" alwaysProvides="test:logging" mayProvide="test:tracing" />
+ <bindingType type="sca:binding.ws" alwaysProvides="test:confidentiality" mayProvide="test:integrity" />
+
+ <!-- Intents and Policysets to assume targetnamespace -->
+ <intent name="TestIntentOne" constrains="sca:binding">
+ <description>
+ Test Intent
+ </description>
+ </intent>
+
+ <intent name="TestIntentTwo" constrains="sca:binding" requires="test:TestIntentOne">
+ <description>
+ Protect messages from unauthorized reading or modification
+ </description>
+ </intent>
+
+ <policySet name="TestPolicySetOne" provides="test:TestIntentOne" appliesTo="sca:binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for
+ "basic authentication" -->
+ </wsp:PolicyAttachment>
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for
+ "reliability" -->
+ </wsp:PolicyAttachment>
+ </policySet>
+
+ <!-- POLICY SETS -->
+ <policySet name="SecureReliablePolicy" provides="test:confidentiality.transport test:integrity" appliesTo="sca:binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for
+ "basic authentication" -->
+ </wsp:PolicyAttachment>
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for
+ "reliability" -->
+ </wsp:PolicyAttachment>
+ </policySet>
+
+ <policySet name="SecureMessagingPolicies" provides="test:confidentiality" appliesTo="binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <intentMap provides="test:confidentiality" default="transport">
+ <qualifier name="transport">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for "transport" alternative -->
+ </wsp:PolicyAttachment>
+ <wsp:PolicyAttachment>...</wsp:PolicyAttachment>
+ </qualifier>
+ <qualifier name="message">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for "message" alternative" -->
+ </wsp:PolicyAttachment>
+ </qualifier>
+ </intentMap>
+ </policySet>
+
+ <policySet name="SecurityPolicy" provides="test:confidentiality" appliesTo="binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <intentMap provides="test:confidentiality" default="message">
+ <qualifier name="message">
+ <wsp:PolicyAttachment>
+ <!-- policy attachment for body encryption -->
+ </wsp:PolicyAttachment>
+ </qualifier>
+ <qualifier name="transport">
+ <wsp:PolicyAttachment>
+ <!-- policy attachment for transport encryption -->
+ </wsp:PolicyAttachment>
+ </qualifier>
+ </intentMap>
+ </policySet>
+
+ <policySet name="BasicAuthMsgProtSecurity" provides="test:authentication test:confidentiality" appliesTo="binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+ <policySetReference name="test:AuthenticationPolicies" />
+ <policySetReference name="test:ConfidentialityPolicies" />
+ </policySet>
+
+ <policySet name="AuthenticationPolicies" provides="test:authentication" appliesTo="binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for "basic
+ authentication" -->
+ </wsp:PolicyAttachment>
+ </policySet>
+
+ <policySet name="ConfidentialityPolicies" provides="test:confidentiality" appliesTo="binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <intentMap provides="test:confidentiality" default="transport">
+ <qualifier name="transport">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for "transport"
+ alternative -->
+ </wsp:PolicyAttachment>
+ <wsp:PolicyAttachment>...</wsp:PolicyAttachment>
+ </qualifier>
+ <qualifier name="message">
+ <wsp:PolicyAttachment>
+ <!-- policy expression and policy subject for "message"
+ alternative" -->
+ ...
+ </wsp:PolicyAttachment>
+ </qualifier>
+ </intentMap>
+ </policySet>
+
+ <policySet name="SecureWSPolicy" provides="test:confidentiality" appliesTo="sca:binding.ws"
+ xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903" xmlns:sp="http://schemas.xmlsoap.org/ws/2002/12/secext"
+ xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+ <wsp:Policy>
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SecurityToken>
+ <sp:TokenType>sp:X509v3</sp:TokenType>
+ </sp:SecurityToken>
+ <sp:UsernameToken />
+ <sp:SignedParts />
+ <sp:EncryptedParts>
+ <sp:Body />
+ </sp:EncryptedParts>
+ <sp:TransportBinding>
+ <sp:IncludeTimeStamp />
+ </sp:TransportBinding>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ </policySet>
+
+ <!-- profile intent -->
+ <intent name="reliableMessageProtection" constrains="sca:binding" requires="test:messageProtection">
+ <description>
+ Protect messages from unauthorized reading or modification
+ </description>
+ </intent>
+
+ <intent name="messageProtection" constrains="sca:binding" requires="test:confidentiality test:integrity">
+ <description>
+ Protect messages from unauthorized reading or modification
+ </description>
+ </intent>
+
+ <!-- simple intent -->
+ <intent name="confidentiality" constrains="sca:binding">
+ <description>
+ Communitcation thro this binding must prevent
+ unauthorized users from reading the messages.
+ </description>
+ <qualifier name="transport" />
+ <qualifier name="message" default="true" />
+ </intent>
+
+ <intent name="integrity" constrains="sca:binding">
+ <description>
+ Communitcation thro this binding must prevent
+ unauthorized modification of the messages.
+ </description>
+ </intent>
+
+ <intent name="authentication" constrains="sca:binding">
+ <description>
+ Communitcation thro this binding required
+ Authentication.
+ </description>
+ </intent>
+
+ <intent name="logging" constrains="sca:implementation">
+ <description>
+ All messages to and from this implementation must be logged
+ </description>
+ </intent>
+
+ <intent name="tracing" constrains="sca:implementation.java">
+ <description>
+ Need to figure out some description for this
+ </description>
+ </intent>
+
</definitions> \ No newline at end of file
diff --git a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java
index 53c6684d11..1a2a9c5bad 100644
--- a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java
+++ b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java
@@ -1,38 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.impl;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.BindingType;
-
-/**
- * Concrete implementation for a BindingType
- *
- * @version $Rev$ $Date$
- */
-public class BindingTypeImpl extends ExtensionTypeImpl implements BindingType {
- protected BindingTypeImpl() {
- super();
- }
-
- public QName getBaseType() {
- return BINDING_BASE;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.policy.impl;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.policy.BindingType;
+
+/**
+ * Concrete implementation for a BindingType
+ *
+ * @version $Rev$ $Date$
+ */
+public class BindingTypeImpl extends ExtensionTypeImpl implements BindingType {
+ protected BindingTypeImpl() {
+ super();
+ }
+
+ public QName getBaseType() {
+ return BINDING_BASE;
+ }
+}
diff --git a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java
index 169ca29833..5c285e4d95 100644
--- a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java
+++ b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java
@@ -1,39 +1,39 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.tuscany.sca.policy.impl;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.ImplementationType;
-
-/**
- * Concrete implementation for a Implementation Type
- *
- * @version $Rev$ $Date$
- */
-public class ImplementationTypeImpl extends ExtensionTypeImpl implements ImplementationType {
- protected ImplementationTypeImpl() {
- super();
- }
-
- public QName getBaseType() {
- return IMPLEMENTATION_BASE;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.sca.policy.impl;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.policy.ImplementationType;
+
+/**
+ * Concrete implementation for a Implementation Type
+ *
+ * @version $Rev$ $Date$
+ */
+public class ImplementationTypeImpl extends ExtensionTypeImpl implements ImplementationType {
+ protected ImplementationTypeImpl() {
+ super();
+ }
+
+ public QName getBaseType() {
+ return IMPLEMENTATION_BASE;
+ }
+
+}
diff --git a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationException.java b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationException.java
index eb97818042..3ed4eac5a2 100644
--- a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationException.java
+++ b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationException.java
@@ -1,38 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.util;
-
-/**
- * Exception to be throw for invalid policy intents / policysets
- *
- * @version $Rev$ $Date$
- */
-public class PolicyValidationException extends Exception {
- private static final long serialVersionUID = 506979037642587755L;
-
- public PolicyValidationException(String message) {
- super(message);
- }
-
- public PolicyValidationException(Throwable e) {
- super(e);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.policy.util;
+
+/**
+ * Exception to be throw for invalid policy intents / policysets
+ *
+ * @version $Rev$ $Date$
+ */
+public class PolicyValidationException extends Exception {
+ private static final long serialVersionUID = 506979037642587755L;
+
+ public PolicyValidationException(String message) {
+ super(message);
+ }
+
+ public PolicyValidationException(Throwable e) {
+ super(e);
+ }
+
+}
diff --git a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationUtils.java b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationUtils.java
index c8fe89f364..616eab5737 100644
--- a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationUtils.java
+++ b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationUtils.java
@@ -1,98 +1,98 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.policy.util;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.policy.ExtensionType;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySubject;
-
-/**
- * @version $Rev$ $Date$
- */
-public class PolicyValidationUtils {
-
- public static boolean isConstrained(ExtensionType constrained, ExtensionType attachPointType) {
- return (attachPointType != null
- && (attachPointType.equals(constrained)) || (attachPointType.getBaseType().equals(constrained)));
- }
-
- public static void validateIntents(PolicySubject attachPoint, ExtensionType attachPointType)
- throws PolicyValidationException {
- boolean found = false;
- if (attachPointType != null) {
- // validate intents specified against the parent (binding /
- // implementation)
- found = false;
- for (Intent intent : attachPoint.getRequiredIntents()) {
- if (!intent.isUnresolved()) {
- for (ExtensionType constrained : intent.getConstrainedTypes()) {
- if (isConstrained(constrained, attachPointType)) {
- found = true;
- break;
- }
- }
-
- if (!found) {
- throw new PolicyValidationException("Policy Intent '" + intent.getName()
- + "' does not constrain extension type "
- + attachPointType.getType());
- }
- } else {
- throw new PolicyValidationException("Policy Intent '" + intent.getName()
- + "' is not defined in this domain ");
- }
- }
- }
- }
-
- public static void validatePolicySets(PolicySubject subject) throws PolicyValidationException {
- // validatePolicySets(subject, subject.getType(), subject.getAttachedPolicySets());
- }
-
- public static void validatePolicySets(PolicySubject subject, ExtensionType attachPointType)
- throws PolicyValidationException {
- validatePolicySets(subject, attachPointType, subject.getPolicySets());
- }
-
- public static void validatePolicySets(PolicySubject subject,
- ExtensionType attachPointType,
- List<PolicySet> applicablePolicySets) throws PolicyValidationException {
- // Since the applicablePolicySets in a subject will already
- // have the list of policysets that might ever be applicable to this attachPoint,
- // just check if the defined policysets feature in the list of applicable
- // policysets
- for (PolicySet definedPolicySet : subject.getPolicySets()) {
- if (!definedPolicySet.isUnresolved()) {
- if (!applicablePolicySets.contains(definedPolicySet)) {
- throw new PolicyValidationException("Policy Set '" + definedPolicySet.getName()
- + "' does not apply to extension type "
- + attachPointType.getType());
- }
- } else {
- throw new PolicyValidationException("Policy Set '" + definedPolicySet.getName()
- + "' is not defined in this domain ");
-
- }
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.policy.util;
+
+import java.util.List;
+
+import org.apache.tuscany.sca.policy.ExtensionType;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.PolicySubject;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class PolicyValidationUtils {
+
+ public static boolean isConstrained(ExtensionType constrained, ExtensionType attachPointType) {
+ return (attachPointType != null
+ && (attachPointType.equals(constrained)) || (attachPointType.getBaseType().equals(constrained)));
+ }
+
+ public static void validateIntents(PolicySubject attachPoint, ExtensionType attachPointType)
+ throws PolicyValidationException {
+ boolean found = false;
+ if (attachPointType != null) {
+ // validate intents specified against the parent (binding /
+ // implementation)
+ found = false;
+ for (Intent intent : attachPoint.getRequiredIntents()) {
+ if (!intent.isUnresolved()) {
+ for (ExtensionType constrained : intent.getConstrainedTypes()) {
+ if (isConstrained(constrained, attachPointType)) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ throw new PolicyValidationException("Policy Intent '" + intent.getName()
+ + "' does not constrain extension type "
+ + attachPointType.getType());
+ }
+ } else {
+ throw new PolicyValidationException("Policy Intent '" + intent.getName()
+ + "' is not defined in this domain ");
+ }
+ }
+ }
+ }
+
+ public static void validatePolicySets(PolicySubject subject) throws PolicyValidationException {
+ // validatePolicySets(subject, subject.getType(), subject.getAttachedPolicySets());
+ }
+
+ public static void validatePolicySets(PolicySubject subject, ExtensionType attachPointType)
+ throws PolicyValidationException {
+ validatePolicySets(subject, attachPointType, subject.getPolicySets());
+ }
+
+ public static void validatePolicySets(PolicySubject subject,
+ ExtensionType attachPointType,
+ List<PolicySet> applicablePolicySets) throws PolicyValidationException {
+ // Since the applicablePolicySets in a subject will already
+ // have the list of policysets that might ever be applicable to this attachPoint,
+ // just check if the defined policysets feature in the list of applicable
+ // policysets
+ for (PolicySet definedPolicySet : subject.getPolicySets()) {
+ if (!definedPolicySet.isUnresolved()) {
+ if (!applicablePolicySets.contains(definedPolicySet)) {
+ throw new PolicyValidationException("Policy Set '" + definedPolicySet.getName()
+ + "' does not apply to extension type "
+ + attachPointType.getType());
+ }
+ } else {
+ throw new PolicyValidationException("Policy Set '" + definedPolicySet.getName()
+ + "' is not defined in this domain ");
+
+ }
+ }
+ }
+}
diff --git a/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/InvalidServiceException.java b/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/InvalidServiceException.java
index 91db11716c..0076ad34c0 100644
--- a/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/InvalidServiceException.java
+++ b/java/sca/modules/sca-api/src/main/java/org/oasisopen/sca/InvalidServiceException.java
@@ -1,60 +1,60 @@
-/*
- * Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
- * OASIS trademark, IPR and other policies apply.
- */
-package org.oasisopen.sca;
-
-/**
- * This exception signals that the ServiceReference is no longer valid.
- * This can happen when the target of the reference is undeployed.
- *
- * This exception is not transient and therefore is unlikely to be
- * resolved by retrying the operation and will most likely require
- * human intervention.
- */
-public class InvalidServiceException extends ServiceRuntimeException {
- /**
- * Constructs a InvalidServiceException with no detail message.
- */
- public InvalidServiceException() {
- super();
- }
-
- /**
- * Constructs a InvalidServiceException with the specified detail
- * message.
- *
- * @param message the detail message
- */
- public InvalidServiceException(String message) {
- super(message);
- }
-
- /**
- * Constructs a InvalidServiceException with the specified detail
- * message and cause.
- *
- * The detail message associated with <code>cause</code> is not
- * automatically incorporated in this exception's detail message.
- *
- * @param message the detail message
- * @param cause the cause, or null if the cause is nonexistent
- * or unknown
- */
- public InvalidServiceException(String message, Throwable cause) {
- super(message, cause);
- }
-
- /**
- * Constructs a InvalidServiceException with the specified cause and
- * a detail message of <tt>(cause==null ? null : cause.toString())</tt>.
- *
- * @param cause the cause, or null if the cause is nonexistent
- * or unknown
- */
- public InvalidServiceException(Throwable cause) {
- super(cause);
- }
-
- private static final long serialVersionUID = 7520492728695222145L;
-}
+/*
+ * Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
+ * OASIS trademark, IPR and other policies apply.
+ */
+package org.oasisopen.sca;
+
+/**
+ * This exception signals that the ServiceReference is no longer valid.
+ * This can happen when the target of the reference is undeployed.
+ *
+ * This exception is not transient and therefore is unlikely to be
+ * resolved by retrying the operation and will most likely require
+ * human intervention.
+ */
+public class InvalidServiceException extends ServiceRuntimeException {
+ /**
+ * Constructs a InvalidServiceException with no detail message.
+ */
+ public InvalidServiceException() {
+ super();
+ }
+
+ /**
+ * Constructs a InvalidServiceException with the specified detail
+ * message.
+ *
+ * @param message the detail message
+ */
+ public InvalidServiceException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a InvalidServiceException with the specified detail
+ * message and cause.
+ *
+ * The detail message associated with <code>cause</code> is not
+ * automatically incorporated in this exception's detail message.
+ *
+ * @param message the detail message
+ * @param cause the cause, or null if the cause is nonexistent
+ * or unknown
+ */
+ public InvalidServiceException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a InvalidServiceException with the specified cause and
+ * a detail message of <tt>(cause==null ? null : cause.toString())</tt>.
+ *
+ * @param cause the cause, or null if the cause is nonexistent
+ * or unknown
+ */
+ public InvalidServiceException(Throwable cause) {
+ super(cause);
+ }
+
+ private static final long serialVersionUID = 7520492728695222145L;
+}
diff --git a/java/sca/modules/sca-client-impl/pom.xml b/java/sca/modules/sca-client-impl/pom.xml
index 9a0fe91a7c..2657e1b466 100644
--- a/java/sca/modules/sca-client-impl/pom.xml
+++ b/java/sca/modules/sca-client-impl/pom.xml
@@ -1,47 +1,47 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-sca-client-impl</artifactId>
- <name>Apache Tuscany SCA Client Impl</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-sca-client-impl</artifactId>
+ <name>Apache Tuscany SCA Client Impl</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl.java b/java/sca/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl.java
index d318a5899c..ba8d6793e2 100644
--- a/java/sca/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl.java
+++ b/java/sca/modules/sca-client-impl/src/main/java/org/apache/tuscany/sca/client/impl/SCAClientFactoryImpl.java
@@ -1,59 +1,59 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.client.impl;
-
-import java.net.URI;
-import java.util.List;
-
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFinder;
-import org.oasisopen.sca.NoSuchDomainException;
-import org.oasisopen.sca.NoSuchServiceException;
-import org.oasisopen.sca.ServiceUnavailableException;
-import org.oasisopen.sca.client.SCAClientFactory;
-
-public class SCAClientFactoryImpl extends SCAClientFactory {
-
- public SCAClientFactoryImpl(URI domainURI) {
- super(domainURI);
- }
-
- @Override
- public <T> T getService(Class<T> serviceInterface, String serviceName) throws NoSuchServiceException, NoSuchDomainException {
- URI domainURI = getDomainURI();
- if (domainURI == null) {
- domainURI = URI.create(Node.DEFAULT_DOMAIN_URI);
- }
- List<Node> nodes = NodeFinder.getNodes(domainURI);
- if (nodes == null || nodes.size() < 1) {
- throw new NoSuchDomainException(domainURI.toString());
- }
-
- for (Node n : nodes) {
- try {
- return n.getService(serviceInterface, serviceName);
- } catch(ServiceUnavailableException e) {
- // Ingore and continue
- }
- }
-
- throw new NoSuchServiceException(serviceName);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.client.impl;
+
+import java.net.URI;
+import java.util.List;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFinder;
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
+import org.oasisopen.sca.ServiceUnavailableException;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+public class SCAClientFactoryImpl extends SCAClientFactory {
+
+ public SCAClientFactoryImpl(URI domainURI) {
+ super(domainURI);
+ }
+
+ @Override
+ public <T> T getService(Class<T> serviceInterface, String serviceName) throws NoSuchServiceException, NoSuchDomainException {
+ URI domainURI = getDomainURI();
+ if (domainURI == null) {
+ domainURI = URI.create(Node.DEFAULT_DOMAIN_URI);
+ }
+ List<Node> nodes = NodeFinder.getNodes(domainURI);
+ if (nodes == null || nodes.size() < 1) {
+ throw new NoSuchDomainException(domainURI.toString());
+ }
+
+ for (Node n : nodes) {
+ try {
+ return n.getService(serviceInterface, serviceName);
+ } catch(ServiceUnavailableException e) {
+ // Ingore and continue
+ }
+ }
+
+ throw new NoSuchServiceException(serviceName);
+ }
+}
diff --git a/java/sca/modules/stripes/pom.xml b/java/sca/modules/stripes/pom.xml
index 95957985c5..6b170dda28 100644
--- a/java/sca/modules/stripes/pom.xml
+++ b/java/sca/modules/stripes/pom.xml
@@ -1,60 +1,60 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-stripes</artifactId>
- <name>Apache Tuscany SCA Stripes Web Framework Integration</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-webapp</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>net.sourceforge.stripes</groupId>
- <artifactId>stripes</artifactId>
- <version>1.5</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-stripes</artifactId>
+ <name>Apache Tuscany SCA Stripes Web Framework Integration</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-webapp</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.stripes</groupId>
+ <artifactId>stripes</artifactId>
+ <version>1.5</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/wicket/pom.xml b/java/sca/modules/wicket/pom.xml
index d87868df4d..06618e42f2 100644
--- a/java/sca/modules/wicket/pom.xml
+++ b/java/sca/modules/wicket/pom.xml
@@ -1,65 +1,65 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>tuscany-wicket</artifactId>
- <name>Apache Tuscany SCA Wicket Web Framework Integration</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-webapp</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket</artifactId>
- <version>1.4-rc2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket-ioc</artifactId>
- <version>1.4-rc2</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>tuscany-wicket</artifactId>
+ <name>Apache Tuscany SCA Wicket Web Framework Integration</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-webapp</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket</artifactId>
+ <version>1.4-rc2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-ioc</artifactId>
+ <version>1.4-rc2</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/IContextLocator.java b/java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/IContextLocator.java
index 0074d1cafd..589c240b84 100644
--- a/java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/IContextLocator.java
+++ b/java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/IContextLocator.java
@@ -1,60 +1,60 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.wicket;
-import javax.servlet.ServletContext;
-
-import org.apache.wicket.IClusterable;
-
-
-/**
- * Interface representing object that can locate a spring context. The implementation should take up
- * little room when serialized.
- *
- * SpringObjectLocator uses this interface to locate the spring context so that it in turn can
- * locate a bean.
- *
- * Ideal implementations use a static lookup to locate the context.
- *
- * For Example:
- *
- * <pre>
- * class SpringContextLocator implements ISpringContextLocator
- * {
- * public ApplicationContext getSpringContext()
- * {
- * //MyApplication is the subclass of WebApplication used by the application
- * return ((MyApplication)Application.get()).getContext();
- * }
- * }
- * </pre>
- *
- * @see SpringBeanLocator
- *
- * Based on code from Apache Wicket by Igor Vaynberg
- */
-public interface IContextLocator extends IClusterable
-{
- /**
- * Getter for spring application context
- *
- * @return spring application context
- */
- ServletContext getServletContext();
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.wicket;
+import javax.servlet.ServletContext;
+
+import org.apache.wicket.IClusterable;
+
+
+/**
+ * Interface representing object that can locate a spring context. The implementation should take up
+ * little room when serialized.
+ *
+ * SpringObjectLocator uses this interface to locate the spring context so that it in turn can
+ * locate a bean.
+ *
+ * Ideal implementations use a static lookup to locate the context.
+ *
+ * For Example:
+ *
+ * <pre>
+ * class SpringContextLocator implements ISpringContextLocator
+ * {
+ * public ApplicationContext getSpringContext()
+ * {
+ * //MyApplication is the subclass of WebApplication used by the application
+ * return ((MyApplication)Application.get()).getContext();
+ * }
+ * }
+ * </pre>
+ *
+ * @see SpringBeanLocator
+ *
+ * Based on code from Apache Wicket by Igor Vaynberg
+ */
+public interface IContextLocator extends IClusterable
+{
+ /**
+ * Getter for spring application context
+ *
+ * @return spring application context
+ */
+ ServletContext getServletContext();
+}
diff --git a/java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/TuscanyComponentInjector.java b/java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/TuscanyComponentInjector.java
index 60d132f27a..b1e9097cdf 100644
--- a/java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/TuscanyComponentInjector.java
+++ b/java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/TuscanyComponentInjector.java
@@ -1,158 +1,158 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.wicket;
-import javax.servlet.ServletContext;
-
-import org.apache.wicket.Application;
-import org.apache.wicket.IClusterable;
-import org.apache.wicket.MetaDataKey;
-import org.apache.wicket.Session;
-import org.apache.wicket.application.IComponentInstantiationListener;
-import org.apache.wicket.injection.ComponentInjector;
-import org.apache.wicket.injection.web.InjectorHolder;
-import org.apache.wicket.model.Model;
-import org.apache.wicket.protocol.http.WebApplication;
-
-/**
- * {@link IComponentInstantiationListener} that injects component properties annotated with {@link
- * SpringBean} annotations.
- *
- * To install in yourapplication.init() call
- * <code>addComponentInstantiationListener(new SpringComponentInjector(this));</code> Non-wicket
- * components such as {@link Session}, {@link Model}, and any other pojo can be injected by calling
- * <code>InjectorHolder.getInjector().inject(this)</code> in their constructor.
- *
- * Based on code from Apache Wicket by Igor Vaynberg and Justin Lee
- */
-public class TuscanyComponentInjector extends ComponentInjector
-{
-
- /**
- * Metadata key used to store application context holder in application's metadata
- */
- private static MetaDataKey<ApplicationContextHolder> CONTEXT_KEY = new MetaDataKey<ApplicationContextHolder>()
- {
-
- private static final long serialVersionUID = 1L;
-
- };
-
- /**
- * Constructor used when spring application context is declared in the spring standard way and
- * can be located through {@link
- * WebApplicationContextUtils#getRequiredWebApplicationContext(ServletContext)}
- *
- * @param webapp
- * wicket web application
- */
- public TuscanyComponentInjector(WebApplication webapp)
- {
- // locate application context through spring's default location
- // mechanism and pass it on to the proper constructor
- this(webapp, webapp.getServletContext());
- }
-
- /**
- * Constructor
- *
- * @param webapp
- * wicket web application
- * @param ctx
- * spring's application context
- */
- public TuscanyComponentInjector(WebApplication webapp, ServletContext ctx)
- {
- if (webapp == null)
- {
- throw new IllegalArgumentException("Argument [[webapp]] cannot be null");
- }
-
- if (ctx == null)
- {
- throw new IllegalArgumentException("Argument [[ctx]] cannot be null");
- }
-
- // store context in application's metadata ...
- webapp.setMetaData(CONTEXT_KEY, new ApplicationContextHolder(ctx));
-
- // ... and create and register the annotation aware injector
- InjectorHolder.setInjector(new TuscanyInjector(new ContextLocator()));
- }
-
- /**
- * This is a holder for the application context. The reason we need a holder is that metadata
- * only supports storing serializable objects but application context is not. The holder acts as
- * a serializable wrapper for the context. Notice that although holder implements IClusterable
- * it really is not because it has a reference to non serializable context - but this is ok
- * because metadata objects in application are never serialized.
- *
- * @author ivaynberg
- *
- */
- private static class ApplicationContextHolder implements IClusterable
- {
- private static final long serialVersionUID = 1L;
-
- private final ServletContext context;
-
- /**
- * Constructor
- *
- * @param context
- */
- public ApplicationContextHolder(ServletContext context)
- {
- this.context = context;
- }
-
- /**
- * @return the context
- */
- public ServletContext getContext()
- {
- return context;
- }
- }
-
- /**
- * A context locator that locates the context in application's metadata. This locator also keeps
- * a transient cache of the lookup.
- *
- * @author ivaynberg
- *
- */
- private static class ContextLocator implements IContextLocator
- {
- private transient ServletContext context;
-
- private static final long serialVersionUID = 1L;
-
- public ServletContext getServletContext()
- {
- if (context == null)
- {
- context = (Application.get().getMetaData(CONTEXT_KEY)).getContext();
- }
- return context;
- }
-
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.wicket;
+import javax.servlet.ServletContext;
+
+import org.apache.wicket.Application;
+import org.apache.wicket.IClusterable;
+import org.apache.wicket.MetaDataKey;
+import org.apache.wicket.Session;
+import org.apache.wicket.application.IComponentInstantiationListener;
+import org.apache.wicket.injection.ComponentInjector;
+import org.apache.wicket.injection.web.InjectorHolder;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.protocol.http.WebApplication;
+
+/**
+ * {@link IComponentInstantiationListener} that injects component properties annotated with {@link
+ * SpringBean} annotations.
+ *
+ * To install in yourapplication.init() call
+ * <code>addComponentInstantiationListener(new SpringComponentInjector(this));</code> Non-wicket
+ * components such as {@link Session}, {@link Model}, and any other pojo can be injected by calling
+ * <code>InjectorHolder.getInjector().inject(this)</code> in their constructor.
+ *
+ * Based on code from Apache Wicket by Igor Vaynberg and Justin Lee
+ */
+public class TuscanyComponentInjector extends ComponentInjector
+{
+
+ /**
+ * Metadata key used to store application context holder in application's metadata
+ */
+ private static MetaDataKey<ApplicationContextHolder> CONTEXT_KEY = new MetaDataKey<ApplicationContextHolder>()
+ {
+
+ private static final long serialVersionUID = 1L;
+
+ };
+
+ /**
+ * Constructor used when spring application context is declared in the spring standard way and
+ * can be located through {@link
+ * WebApplicationContextUtils#getRequiredWebApplicationContext(ServletContext)}
+ *
+ * @param webapp
+ * wicket web application
+ */
+ public TuscanyComponentInjector(WebApplication webapp)
+ {
+ // locate application context through spring's default location
+ // mechanism and pass it on to the proper constructor
+ this(webapp, webapp.getServletContext());
+ }
+
+ /**
+ * Constructor
+ *
+ * @param webapp
+ * wicket web application
+ * @param ctx
+ * spring's application context
+ */
+ public TuscanyComponentInjector(WebApplication webapp, ServletContext ctx)
+ {
+ if (webapp == null)
+ {
+ throw new IllegalArgumentException("Argument [[webapp]] cannot be null");
+ }
+
+ if (ctx == null)
+ {
+ throw new IllegalArgumentException("Argument [[ctx]] cannot be null");
+ }
+
+ // store context in application's metadata ...
+ webapp.setMetaData(CONTEXT_KEY, new ApplicationContextHolder(ctx));
+
+ // ... and create and register the annotation aware injector
+ InjectorHolder.setInjector(new TuscanyInjector(new ContextLocator()));
+ }
+
+ /**
+ * This is a holder for the application context. The reason we need a holder is that metadata
+ * only supports storing serializable objects but application context is not. The holder acts as
+ * a serializable wrapper for the context. Notice that although holder implements IClusterable
+ * it really is not because it has a reference to non serializable context - but this is ok
+ * because metadata objects in application are never serialized.
+ *
+ * @author ivaynberg
+ *
+ */
+ private static class ApplicationContextHolder implements IClusterable
+ {
+ private static final long serialVersionUID = 1L;
+
+ private final ServletContext context;
+
+ /**
+ * Constructor
+ *
+ * @param context
+ */
+ public ApplicationContextHolder(ServletContext context)
+ {
+ this.context = context;
+ }
+
+ /**
+ * @return the context
+ */
+ public ServletContext getContext()
+ {
+ return context;
+ }
+ }
+
+ /**
+ * A context locator that locates the context in application's metadata. This locator also keeps
+ * a transient cache of the lookup.
+ *
+ * @author ivaynberg
+ *
+ */
+ private static class ContextLocator implements IContextLocator
+ {
+ private transient ServletContext context;
+
+ private static final long serialVersionUID = 1L;
+
+ public ServletContext getServletContext()
+ {
+ if (context == null)
+ {
+ context = (Application.get().getMetaData(CONTEXT_KEY)).getContext();
+ }
+ return context;
+ }
+
+ }
+
+}
diff --git a/java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/TuscanyFieldValueFactory.java b/java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/TuscanyFieldValueFactory.java
index 6b92e40847..f2814fbcbe 100644
--- a/java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/TuscanyFieldValueFactory.java
+++ b/java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/TuscanyFieldValueFactory.java
@@ -1,66 +1,66 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.wicket;
-
-import java.lang.reflect.Field;
-
-import org.apache.tuscany.sca.implementation.web.runtime.utils.ContextHelper;
-import org.apache.tuscany.sca.runtime.RuntimeComponent;
-import org.apache.wicket.injection.IFieldValueFactory;
-import org.oasisopen.sca.annotation.ComponentName;
-import org.oasisopen.sca.annotation.Context;
-import org.oasisopen.sca.annotation.Property;
-import org.oasisopen.sca.annotation.Reference;
-
-public class TuscanyFieldValueFactory implements IFieldValueFactory {
-
- private IContextLocator contextLocator;
-
- public TuscanyFieldValueFactory(IContextLocator contextLocator) {
- this.contextLocator = contextLocator;
- }
-
- public Object getFieldValue(Field field, Object instance) {
- Object value = null;
- if (field.isAnnotationPresent(Reference.class)) {
- Reference ref = field.getAnnotation(Reference.class);
- String name = ref.name() != null && !ref.name().equals("") ? ref.name() : field.getName();
- value = ContextHelper.getReference(name, field.getType(), contextLocator.getServletContext());
- } else if (field.isAnnotationPresent(Property.class)) {
- Property prop = field.getAnnotation(Property.class);
- String name = prop.name() != null && !prop.name().equals("") ? prop.name() : field.getName();
- value = ContextHelper.getProperty(name, contextLocator.getServletContext());
- } else if (field.isAnnotationPresent(ComponentName.class)) {
- RuntimeComponent rc = (RuntimeComponent)contextLocator.getServletContext().getAttribute(ContextHelper.COMPONENT_ATTR);
- value = rc.getName();
- } else if (field.isAnnotationPresent(Context.class)) {
- value = ContextHelper.getComponentContext(contextLocator.getServletContext());
- }
- return value;
- }
-
- public boolean supportsField(Field field) {
- return field.isAnnotationPresent(Reference.class)
- || field.isAnnotationPresent(Property.class)
- || field.isAnnotationPresent(Context.class)
- || field.isAnnotationPresent(ComponentName.class);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.wicket;
+
+import java.lang.reflect.Field;
+
+import org.apache.tuscany.sca.implementation.web.runtime.utils.ContextHelper;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.wicket.injection.IFieldValueFactory;
+import org.oasisopen.sca.annotation.ComponentName;
+import org.oasisopen.sca.annotation.Context;
+import org.oasisopen.sca.annotation.Property;
+import org.oasisopen.sca.annotation.Reference;
+
+public class TuscanyFieldValueFactory implements IFieldValueFactory {
+
+ private IContextLocator contextLocator;
+
+ public TuscanyFieldValueFactory(IContextLocator contextLocator) {
+ this.contextLocator = contextLocator;
+ }
+
+ public Object getFieldValue(Field field, Object instance) {
+ Object value = null;
+ if (field.isAnnotationPresent(Reference.class)) {
+ Reference ref = field.getAnnotation(Reference.class);
+ String name = ref.name() != null && !ref.name().equals("") ? ref.name() : field.getName();
+ value = ContextHelper.getReference(name, field.getType(), contextLocator.getServletContext());
+ } else if (field.isAnnotationPresent(Property.class)) {
+ Property prop = field.getAnnotation(Property.class);
+ String name = prop.name() != null && !prop.name().equals("") ? prop.name() : field.getName();
+ value = ContextHelper.getProperty(name, contextLocator.getServletContext());
+ } else if (field.isAnnotationPresent(ComponentName.class)) {
+ RuntimeComponent rc = (RuntimeComponent)contextLocator.getServletContext().getAttribute(ContextHelper.COMPONENT_ATTR);
+ value = rc.getName();
+ } else if (field.isAnnotationPresent(Context.class)) {
+ value = ContextHelper.getComponentContext(contextLocator.getServletContext());
+ }
+ return value;
+ }
+
+ public boolean supportsField(Field field) {
+ return field.isAnnotationPresent(Reference.class)
+ || field.isAnnotationPresent(Property.class)
+ || field.isAnnotationPresent(Context.class)
+ || field.isAnnotationPresent(ComponentName.class);
+ }
+
+}
diff --git a/java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/TuscanyInjector.java b/java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/TuscanyInjector.java
index 231f64e6eb..03c44d96f6 100644
--- a/java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/TuscanyInjector.java
+++ b/java/sca/modules/wicket/src/main/java/org/apache/tuscany/sca/wicket/TuscanyInjector.java
@@ -1,38 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.wicket;
-
-import org.apache.wicket.injection.ConfigurableInjector;
-import org.apache.wicket.injection.IFieldValueFactory;
-
-public class TuscanyInjector extends ConfigurableInjector {
-
- private TuscanyFieldValueFactory factory;
-
- public TuscanyInjector(IContextLocator contextLocator) {
- factory = new TuscanyFieldValueFactory(contextLocator);
- }
-
- @Override
- protected IFieldValueFactory getFieldValueFactory() {
- return factory;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.wicket;
+
+import org.apache.wicket.injection.ConfigurableInjector;
+import org.apache.wicket.injection.IFieldValueFactory;
+
+public class TuscanyInjector extends ConfigurableInjector {
+
+ private TuscanyFieldValueFactory factory;
+
+ public TuscanyInjector(IContextLocator contextLocator) {
+ factory = new TuscanyFieldValueFactory(contextLocator);
+ }
+
+ @Override
+ protected IFieldValueFactory getFieldValueFactory() {
+ return factory;
+ }
+
+}
diff --git a/java/sca/modules/xsd/pom.xml b/java/sca/modules/xsd/pom.xml
index 89299df369..c7aadccd25 100644
--- a/java/sca/modules/xsd/pom.xml
+++ b/java/sca/modules/xsd/pom.xml
@@ -1,65 +1,65 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-modules</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-xsd</artifactId>
- <name>Apache Tuscany SCA XSD Model</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ws.commons.schema</groupId>
- <artifactId>XmlSchema</artifactId>
- <version>1.4.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-contribution</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
- <repositories>
- <!-- Apache repository for Web Services artifacts -->
- <repository>
- <id>apache.ws.zone</id>
- <name>Apache WS Zone Repository</name>
- <url>http://ws.zones.apache.org/repository2</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-modules</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-xsd</artifactId>
+ <name>Apache Tuscany SCA XSD Model</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.ws.commons.schema</groupId>
+ <artifactId>XmlSchema</artifactId>
+ <version>1.4.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-contribution</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+ <repositories>
+ <!-- Apache repository for Web Services artifacts -->
+ <repository>
+ <id>apache.ws.zone</id>
+ <name>Apache WS Zone Repository</name>
+ <url>http://ws.zones.apache.org/repository2</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+</project>
diff --git a/java/sca/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDefinition.java b/java/sca/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDefinition.java
index 9a973cd095..f9bf627655 100644
--- a/java/sca/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDefinition.java
+++ b/java/sca/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/XSDefinition.java
@@ -34,7 +34,7 @@ import org.w3c.dom.Document;
/**
* Represents an XML Schema definition.
*
- * @version $Rev: 633545 $ $Date: 2008-03-04 16:52:24 +0000 (Tue, 04 Mar 2008) $
+ * @version $Rev$ $Date$
*/
public interface XSDefinition extends Base {
XmlSchemaCollection getSchemaCollection();
diff --git a/java/sca/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDefinitionImpl.java b/java/sca/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDefinitionImpl.java
index 34fb19f179..af8cbf12ab 100644
--- a/java/sca/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDefinitionImpl.java
+++ b/java/sca/modules/xsd/src/main/java/org/apache/tuscany/sca/xsd/impl/XSDefinitionImpl.java
@@ -38,7 +38,7 @@ import org.w3c.dom.Document;
/**
* Represents a XML schema definition.
*
- * @version $Rev: 582399 $ $Date: 2007-10-05 22:28:30 +0100 (Fri, 05 Oct 2007) $
+ * @version $Rev$ $Date$
*/
public class XSDefinitionImpl implements XSDefinition {
private XmlSchemaCollection schemaCollection = new XmlSchemaCollection();
diff --git a/java/sca/otest/current/pom.xml b/java/sca/otest/current/pom.xml
index cf008e8ea2..40834fc982 100644
--- a/java/sca/otest/current/pom.xml
+++ b/java/sca/otest/current/pom.xml
@@ -1,144 +1,144 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-otests</artifactId>
- <name>Apache Tuscany SCA Specification Tests Assembly Unit tests</name>
- <!--packaging>jar</packaging-->
- <packaging>pom</packaging>
-
- <repositories>
- <repository>
- <id>apache.incubator</id>
- <url>http://people.apache.org/repo/m2-incubating-repository</url>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-api</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-webservice</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <modules>
- <module>General</module>
- <module>General_Java</module>
-<!--
- <module>ASM_10001</module>
- <module>ASM_10003</module>
- <module>ASM_12001</module>
- <module>ASM_12002</module>
- <module>ASM_12003</module>
- <module>ASM_12005</module>
- <module>ASM_12007</module>
- <module>ASM_12008</module>
- <module>ASM_12009</module>
- <module>ASM_12010</module>
- <module>ASM_12012</module>
- <module>ASM_12013</module>
- <module>ASM_13001</module>
- <module>ASM_13002</module>
- <module>ASM_13003</module>
- <module>ASM_13004</module>
- <module>ASM_13005</module>
- <module>ASM_13006</module>
- <module>ASM_13007</module>
- <module>ASM_13008</module>
- <module>ASM_4002</module>
- <module>ASM_4003</module>
- <module>ASM_4004</module>
- <module>ASM_4007</module>
- <module>ASM_5004</module>
- <module>ASM_5005</module>
- <module>ASM_5007</module>
- <module>ASM_5009</module>
- <module>ASM_5023</module>
- <module>ASM_5024</module>
- <module>ASM_5027</module>
- <module>ASM_5030</module>
- <module>ASM_5035</module>
- <module>ASM_6001</module>
- <module>ASM_6002</module>
- <module>ASM_6003</module>
- <module>ASM_6005</module>
- <module>ASM_6006</module>
- <module>ASM_6008</module>
- <module>ASM_6012</module>
- <module>ASM_6021</module>
- <module>ASM_6022</module>
- <module>ASM_6025</module>
- <module>ASM_6028</module>
- <module>ASM_6029</module>
- <module>ASM_6031</module>
- <module>ASM_6032</module>
- <module>ASM_6033</module>
- <module>ASM_7001</module>
- <module>ASM_7007</module>
- <module>ASM_7008</module>
- <module>ASM_7009</module>
- <module>ASM_7010</module>
- <module>ASM_8001</module>
- <module>ASM_8001_Java</module>
- <module>ASM_8003</module>
- <module>ASM_8004</module>
- <module>ASM_8005</module>
- <module>ASM_8010</module>
- <module>ASM_8011</module>
- <module>ASM_8012</module>
- <module>ASM_9002</module>
- <module>Contribution1</module>
- <module>Contribution2</module>
--->
- <module>ASM_5004</module>
- <module>tests</module>
- </modules>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-otests</artifactId>
+ <name>Apache Tuscany SCA Specification Tests Assembly Unit tests</name>
+ <!--packaging>jar</packaging-->
+ <packaging>pom</packaging>
+
+ <repositories>
+ <repository>
+ <id>apache.incubator</id>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-api</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-core</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-webservice</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <modules>
+ <module>General</module>
+ <module>General_Java</module>
+<!--
+ <module>ASM_10001</module>
+ <module>ASM_10003</module>
+ <module>ASM_12001</module>
+ <module>ASM_12002</module>
+ <module>ASM_12003</module>
+ <module>ASM_12005</module>
+ <module>ASM_12007</module>
+ <module>ASM_12008</module>
+ <module>ASM_12009</module>
+ <module>ASM_12010</module>
+ <module>ASM_12012</module>
+ <module>ASM_12013</module>
+ <module>ASM_13001</module>
+ <module>ASM_13002</module>
+ <module>ASM_13003</module>
+ <module>ASM_13004</module>
+ <module>ASM_13005</module>
+ <module>ASM_13006</module>
+ <module>ASM_13007</module>
+ <module>ASM_13008</module>
+ <module>ASM_4002</module>
+ <module>ASM_4003</module>
+ <module>ASM_4004</module>
+ <module>ASM_4007</module>
+ <module>ASM_5004</module>
+ <module>ASM_5005</module>
+ <module>ASM_5007</module>
+ <module>ASM_5009</module>
+ <module>ASM_5023</module>
+ <module>ASM_5024</module>
+ <module>ASM_5027</module>
+ <module>ASM_5030</module>
+ <module>ASM_5035</module>
+ <module>ASM_6001</module>
+ <module>ASM_6002</module>
+ <module>ASM_6003</module>
+ <module>ASM_6005</module>
+ <module>ASM_6006</module>
+ <module>ASM_6008</module>
+ <module>ASM_6012</module>
+ <module>ASM_6021</module>
+ <module>ASM_6022</module>
+ <module>ASM_6025</module>
+ <module>ASM_6028</module>
+ <module>ASM_6029</module>
+ <module>ASM_6031</module>
+ <module>ASM_6032</module>
+ <module>ASM_6033</module>
+ <module>ASM_7001</module>
+ <module>ASM_7007</module>
+ <module>ASM_7008</module>
+ <module>ASM_7009</module>
+ <module>ASM_7010</module>
+ <module>ASM_8001</module>
+ <module>ASM_8001_Java</module>
+ <module>ASM_8003</module>
+ <module>ASM_8004</module>
+ <module>ASM_8005</module>
+ <module>ASM_8010</module>
+ <module>ASM_8011</module>
+ <module>ASM_8012</module>
+ <module>ASM_9002</module>
+ <module>Contribution1</module>
+ <module>Contribution2</module>
+-->
+ <module>ASM_5004</module>
+ <module>tests</module>
+ </modules>
+
+</project>
diff --git a/java/sca/otest/current/tests/src/test/resources/oasis-sca-tests.properties b/java/sca/otest/current/tests/src/test/resources/oasis-sca-tests.properties
index bb43e08a6d..54c7eeeb6f 100644
--- a/java/sca/otest/current/tests/src/test/resources/oasis-sca-tests.properties
+++ b/java/sca/otest/current/tests/src/test/resources/oasis-sca-tests.properties
@@ -1,17 +1,17 @@
-#
-# Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
-# OASIS trademark, IPR and other policies apply.
-#
-
-# OASIS SCA Assembly test properties
-# The implementation type to use for Assembly test suite
-# org.oasis.sca.tests.assembly.lang=BPEL
-org.oasis.sca.tests.assembly.lang=Java
-
-# The class to use as the Runtime Bridge for the SCA runtime under test
-org.oasis.sca.tests.assembly.runtime_bridge=client.TuscanyRuntimeBridge
-
-# The location of the contributions for the test suite
-# %1 represents the placement of the name of each contribution into the location URI
-org.oasis.sca.tests.assembly.contribution.location=../%1/target/tuscany-otests-asm-%1.jar
-
+#
+# Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
+# OASIS trademark, IPR and other policies apply.
+#
+
+# OASIS SCA Assembly test properties
+# The implementation type to use for Assembly test suite
+# org.oasis.sca.tests.assembly.lang=BPEL
+org.oasis.sca.tests.assembly.lang=Java
+
+# The class to use as the Runtime Bridge for the SCA runtime under test
+org.oasis.sca.tests.assembly.runtime_bridge=client.TuscanyRuntimeBridge
+
+# The location of the contributions for the test suite
+# %1 represents the placement of the name of each contribution into the location URI
+org.oasis.sca.tests.assembly.contribution.location=../%1/target/tuscany-otests-asm-%1.jar
+
diff --git a/java/sca/otest/fixed_version/pom.xml b/java/sca/otest/fixed_version/pom.xml
index cd7ae5a7b8..a203ef93f8 100644
--- a/java/sca/otest/fixed_version/pom.xml
+++ b/java/sca/otest/fixed_version/pom.xml
@@ -1,92 +1,92 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>tuscany-otests-fixed-version</artifactId>
- <name>Apache Tuscany SCA Specification Tests</name>
-
- <repositories>
- <repository>
- <id>apache.incubator</id>
- <url>http://people.apache.org/repo/m2-incubating-repository</url>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-api</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-core</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-webservice</artifactId>
- <type>pom</type>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
-</dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>add-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${basedir}/src/main/resources/General</source>
- </sources>
- </configuration>
- </execution>
- </executions>
-
- </plugin>
- </plugins>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>tuscany-otests-fixed-version</artifactId>
+ <name>Apache Tuscany SCA Specification Tests</name>
+
+ <repositories>
+ <repository>
+ <id>apache.incubator</id>
+ <url>http://people.apache.org/repo/m2-incubating-repository</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-api</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-core</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-webservice</artifactId>
+ <type>pom</type>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/src/main/resources/General</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/java/sca/samples/calculator-rmi-reference/build.xml b/java/sca/samples/calculator-rmi-reference/build.xml
index 16d94c3b0b..e95ad1610b 100644
--- a/java/sca/samples/calculator-rmi-reference/build.xml
+++ b/java/sca/samples/calculator-rmi-reference/build.xml
@@ -1,84 +1,84 @@
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<project name="binding-rmi-calculator-reference" default="run">
-
- <property name="jar.name" value="sample-calculator-rmi-reference.jar" />
- <property name="main.class" value="calculator.CalculatorClient" />
-
- <target name="init">
- <delete quiet="true" includeemptydirs="true">
- <fileset dir="target"/>
- </delete>
- <mkdir dir="target/classes"/>
- </target>
-
- <target name="compile" depends="init">
- <javac srcdir="src/main/java"
- destdir="target/classes"
- debug="on"
- source="1.5"
- target="1.5"
- failonerror="true">
- <classpath>
- <fileset dir="../../modules">
- <include name="tuscany-sca-api-*.jar" />
- <include name="tuscany-node-api-*.jar" />
- </fileset>
- </classpath>
- </javac>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- </copy>
- <jar destfile="target/${jar.name}" basedir="target/classes">
- <manifest>
- <attribute name="Main-Class" value="${main.class}" />
- </manifest>
- </jar>
- </target>
-
- <target name="run" depends="compile">
- <java classname="org.apache.tuscany.sca.launcher.LauncherMain"
- fork="true"
- failonerror="true">
- <classpath>
- <pathelement location="../../bin/launcher.jar"/>
- </classpath>
- <arg value="unmanaged"/>
- <arg value="target/${jar.name}"/>
- </java>
- </target>
-
- <!-- We need to add a client component to trigger the calculation -->
- <target name="run-equinox" depends="compile">
- <java jar="../../features/tuscany-sca-equinox-manifest.jar" fork="true">
- <jvmarg value="-Djava.util.logging.config.file=../logging.properties"/>
- <arg value="-composite"/>
- <arg value="CalculatorRMIReference.composite"/>
- <arg value="-config"/>
- <arg value="../../features/configuration"/>
- <arg value="-ttl"/>
- <arg value="0"/>
- <arg value="target/${jar.name}"/>
- </java>
- </target>
-
-</project>
-
-
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<project name="binding-rmi-calculator-reference" default="run">
+
+ <property name="jar.name" value="sample-calculator-rmi-reference.jar" />
+ <property name="main.class" value="calculator.CalculatorClient" />
+
+ <target name="init">
+ <delete quiet="true" includeemptydirs="true">
+ <fileset dir="target"/>
+ </delete>
+ <mkdir dir="target/classes"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <javac srcdir="src/main/java"
+ destdir="target/classes"
+ debug="on"
+ source="1.5"
+ target="1.5"
+ failonerror="true">
+ <classpath>
+ <fileset dir="../../modules">
+ <include name="tuscany-sca-api-*.jar" />
+ <include name="tuscany-node-api-*.jar" />
+ </fileset>
+ </classpath>
+ </javac>
+ <copy todir="target/classes">
+ <fileset dir="src/main/resources"/>
+ </copy>
+ <jar destfile="target/${jar.name}" basedir="target/classes">
+ <manifest>
+ <attribute name="Main-Class" value="${main.class}" />
+ </manifest>
+ </jar>
+ </target>
+
+ <target name="run" depends="compile">
+ <java classname="org.apache.tuscany.sca.launcher.LauncherMain"
+ fork="true"
+ failonerror="true">
+ <classpath>
+ <pathelement location="../../bin/launcher.jar"/>
+ </classpath>
+ <arg value="unmanaged"/>
+ <arg value="target/${jar.name}"/>
+ </java>
+ </target>
+
+ <!-- We need to add a client component to trigger the calculation -->
+ <target name="run-equinox" depends="compile">
+ <java jar="../../features/tuscany-sca-equinox-manifest.jar" fork="true">
+ <jvmarg value="-Djava.util.logging.config.file=../logging.properties"/>
+ <arg value="-composite"/>
+ <arg value="CalculatorRMIReference.composite"/>
+ <arg value="-config"/>
+ <arg value="../../features/configuration"/>
+ <arg value="-ttl"/>
+ <arg value="0"/>
+ <arg value="target/${jar.name}"/>
+ </java>
+ </target>
+
+</project>
+
+
diff --git a/java/sca/samples/calculator-rmi-reference/pom.xml b/java/sca/samples/calculator-rmi-reference/pom.xml
index 8ef62cf9e4..3c95474ebc 100644
--- a/java/sca/samples/calculator-rmi-reference/pom.xml
+++ b/java/sca/samples/calculator-rmi-reference/pom.xml
@@ -1,82 +1,82 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-calculator-rmi-reference</artifactId>
- <name>Apache Tuscany SCA Sample Calculator RMI Reference</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rmi-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.2</version>
- <configuration>
- <archive>
- <manifest>
- <mainClass>calculator.CalculatorClient</mainClass>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-calculator-rmi-reference</artifactId>
+ <name>Apache Tuscany SCA Sample Calculator RMI Reference</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifest>
+ <mainClass>calculator.CalculatorClient</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/AddService.java b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/AddService.java
index ec57a6a533..a235e648c7 100644
--- a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/AddService.java
+++ b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/AddService.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the add service
- */
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * The interface for the add service
+ */
+public interface AddService {
+
+ double add(double n1, double n2);
+
+}
diff --git a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorClient.java b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorClient.java
index 3ee36be233..e14cc3dd13 100644
--- a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorClient.java
+++ b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorClient.java
@@ -1,49 +1,49 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package calculator;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-/**
- * This client program shows how to create an SCA runtime, start it,
- * and locate and invoke a SCA component
- */
-public class CalculatorClient {
- public static void main(String[] args) throws Exception {
- String uri = ContributionLocationHelper.getContributionLocation("CalculatorRMIReference.composite");
- Contribution contribution = new Contribution("c1", uri);
- Node node = NodeFactory.newInstance().createNode("CalculatorRMIReference.composite", contribution);
- node.start();
- CalculatorService calculatorService = node.getService(CalculatorService.class, "CalculatorServiceComponent");
-
- // Calculate
- System.out.println("3 + 2=" + calculatorService.add(3, 2));
- System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
- System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
- System.out.println("3 / 2=" + calculatorService.divide(3, 2));
-
- node.stop();
-
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package calculator;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+/**
+ * This client program shows how to create an SCA runtime, start it,
+ * and locate and invoke a SCA component
+ */
+public class CalculatorClient {
+ public static void main(String[] args) throws Exception {
+ String uri = ContributionLocationHelper.getContributionLocation("CalculatorRMIReference.composite");
+ Contribution contribution = new Contribution("c1", uri);
+ Node node = NodeFactory.newInstance().createNode("CalculatorRMIReference.composite", contribution);
+ node.start();
+ CalculatorService calculatorService = node.getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ // Calculate
+ System.out.println("3 + 2=" + calculatorService.add(3, 2));
+ System.out.println("3 - 2=" + calculatorService.subtract(3, 2));
+ System.out.println("3 * 2=" + calculatorService.multiply(3, 2));
+ System.out.println("3 / 2=" + calculatorService.divide(3, 2));
+
+ node.stop();
+
+ }
+
+}
diff --git a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorService.java b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorService.java
index 0bac3da45c..0f7dec116f 100644
--- a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorService.java
+++ b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorService.java
@@ -1,39 +1,39 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The Calculator service interface.
- */
-@Remotable
-public interface CalculatorService extends Remote {
-
- double add(double n1, double n2) throws RemoteException;
-
- double subtract(double n1, double n2) throws RemoteException;
-
- double multiply(double n1, double n2) throws RemoteException;
-
- double divide(double n1, double n2) throws RemoteException;
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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 java.rmi.Remote;
+import java.rmi.RemoteException;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The Calculator service interface.
+ */
+@Remotable
+public interface CalculatorService extends Remote {
+
+ double add(double n1, double n2) throws RemoteException;
+
+ double subtract(double n1, double n2) throws RemoteException;
+
+ double multiply(double n1, double n2) throws RemoteException;
+
+ double divide(double n1, double n2) throws RemoteException;
+}
diff --git a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorServiceImpl.java b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorServiceImpl.java
index 675350860e..bcfd8871b6 100644
--- a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorServiceImpl.java
+++ b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/CalculatorServiceImpl.java
@@ -1,68 +1,68 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import org.oasisopen.sca.annotation.Reference;
-
-/**
- * An implementation of the Calculator service.
- */
-public class CalculatorServiceImpl implements CalculatorService {
-
- private AddService addService;
- private SubtractService subtractService;
- private MultiplyService multiplyService;
- private DivideService divideService;
-
- @Reference
- public void setAddService(AddService addService) {
- this.addService = addService;
- }
-
- @Reference
- public void setSubtractService(SubtractService subtractService) {
- this.subtractService = subtractService;
- }
-
- @Reference
- public void setDivideService(DivideService divideService) {
- this.divideService = divideService;
- }
-
- @Reference
- public void setMultiplyService(MultiplyService multiplyService) {
- this.multiplyService = multiplyService;
- }
-
- public double add(double n1, double n2) {
- return addService.add(n1, n2);
- }
-
- public double subtract(double n1, double n2) {
- return subtractService.subtract(n1, n2);
- }
-
- public double multiply(double n1, double n2) {
- return multiplyService.multiply(n1, n2);
- }
-
- public double divide(double n1, double n2) {
- return divideService.divide(n1, n2);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+import org.oasisopen.sca.annotation.Reference;
+
+/**
+ * An implementation of the Calculator service.
+ */
+public class CalculatorServiceImpl implements CalculatorService {
+
+ private AddService addService;
+ private SubtractService subtractService;
+ private MultiplyService multiplyService;
+ private DivideService divideService;
+
+ @Reference
+ public void setAddService(AddService addService) {
+ this.addService = addService;
+ }
+
+ @Reference
+ public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ @Reference
+ public void setDivideService(DivideService divideService) {
+ this.divideService = divideService;
+ }
+
+ @Reference
+ public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ public double add(double n1, double n2) {
+ return addService.add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ return subtractService.subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ return multiplyService.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return divideService.divide(n1, n2);
+ }
+}
diff --git a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/DivideService.java b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/DivideService.java
index 835e4fda6d..497dafd4fd 100644
--- a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/DivideService.java
+++ b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/DivideService.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the divide service
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * The interface for the divide service
+ */
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
diff --git a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/MultiplyService.java b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/MultiplyService.java
index db568cc762..5290605938 100644
--- a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/MultiplyService.java
+++ b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/MultiplyService.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
diff --git a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/SubtractService.java b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/SubtractService.java
index 30e4e6a56a..376b3e5bb9 100644
--- a/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/SubtractService.java
+++ b/java/sca/samples/calculator-rmi-reference/src/main/java/calculator/SubtractService.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the subtract service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * The interface for the subtract service
+ */
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
diff --git a/java/sca/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIReferenceTestCase.java b/java/sca/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIReferenceTestCase.java
index b7aa70f122..39d4b2fd28 100644
--- a/java/sca/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIReferenceTestCase.java
+++ b/java/sca/samples/calculator-rmi-reference/src/test/java/calculator/CalculatorRMIReferenceTestCase.java
@@ -1,70 +1,70 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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 static org.junit.Assert.assertEquals;
-
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-
-/**
- * This shows how to test the Calculator service component.
- */
-public class CalculatorRMIReferenceTestCase {
-
- private static Node node;
- private static CalculatorService calculatorService;
-
- @BeforeClass
- public static void setUp() throws Exception {
- CalculatorRMIServiceImpl rmiCalculatorImpl = new CalculatorRMIServiceImpl();
- Registry rmiRegistry = LocateRegistry.createRegistry(8099);
- rmiRegistry.bind("CalculatorRMIService", rmiCalculatorImpl);
-
- String uri = ContributionLocationHelper.getContributionLocation(CalculatorService.class);
- Contribution contribution = new Contribution("c1", uri);
- node = NodeFactory.newInstance().createNode("CalculatorRMIReference.composite", contribution);
- node.start();
- calculatorService = node.getService(CalculatorService.class, "CalculatorServiceComponent");
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- node.stop();
- LocateRegistry.getRegistry(8099).unbind("CalculatorRMIService");
- }
-
- @Test
- public void testCalculator() throws Exception {
- // Calculate
- assertEquals(calculatorService.add(3, 2), 5.0, 0.0);
- assertEquals(calculatorService.subtract(3, 2), 1.0, 0.0);
- assertEquals(calculatorService.multiply(3, 2), 6.0, 0.0);
- assertEquals(calculatorService.divide(3, 2), 1.5, 0.0);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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 static org.junit.Assert.assertEquals;
+
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class CalculatorRMIReferenceTestCase {
+
+ private static Node node;
+ private static CalculatorService calculatorService;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ CalculatorRMIServiceImpl rmiCalculatorImpl = new CalculatorRMIServiceImpl();
+ Registry rmiRegistry = LocateRegistry.createRegistry(8099);
+ rmiRegistry.bind("CalculatorRMIService", rmiCalculatorImpl);
+
+ String uri = ContributionLocationHelper.getContributionLocation(CalculatorService.class);
+ Contribution contribution = new Contribution("c1", uri);
+ node = NodeFactory.newInstance().createNode("CalculatorRMIReference.composite", contribution);
+ node.start();
+ calculatorService = node.getService(CalculatorService.class, "CalculatorServiceComponent");
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ node.stop();
+ LocateRegistry.getRegistry(8099).unbind("CalculatorRMIService");
+ }
+
+ @Test
+ public void testCalculator() throws Exception {
+ // Calculate
+ assertEquals(calculatorService.add(3, 2), 5.0, 0.0);
+ assertEquals(calculatorService.subtract(3, 2), 1.0, 0.0);
+ assertEquals(calculatorService.multiply(3, 2), 6.0, 0.0);
+ assertEquals(calculatorService.divide(3, 2), 1.5, 0.0);
+ }
+}
diff --git a/java/sca/samples/calculator-rmi-service/pom.xml b/java/sca/samples/calculator-rmi-service/pom.xml
index 08c792b02a..0c96583b98 100644
--- a/java/sca/samples/calculator-rmi-service/pom.xml
+++ b/java/sca/samples/calculator-rmi-service/pom.xml
@@ -1,67 +1,67 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>sample-calculator-rmi-service</artifactId>
- <name>Apache Tuscany SCA Sample Calculator RMI Service</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-java-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rmi-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>sample-calculator-rmi-service</artifactId>
+ <name>Apache Tuscany SCA Sample Calculator RMI Service</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rmi-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/AddService.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/AddService.java
index ec57a6a533..a235e648c7 100644
--- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/AddService.java
+++ b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/AddService.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the add service
- */
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * The interface for the add service
+ */
+public interface AddService {
+
+ double add(double n1, double n2);
+
+}
diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/AddServiceImpl.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/AddServiceImpl.java
index e9c635e3c8..8b6fe066a6 100644
--- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/AddServiceImpl.java
+++ b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/AddServiceImpl.java
@@ -1,30 +1,30 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * An implementation of the Add service
- */
-public class AddServiceImpl implements AddService {
-
- public double add(double n1, double n2) {
- return n1 + n2;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * An implementation of the Add service
+ */
+public class AddServiceImpl implements AddService {
+
+ public double add(double n1, double n2) {
+ return n1 + n2;
+ }
+
+}
diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServer.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServer.java
index ffa40d0234..b77015bcae 100644
--- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServer.java
+++ b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServer.java
@@ -1,45 +1,45 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package calculator;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-/**
- * A claculator service server. Starts up the SCA runtime which
- * will start listening for RMI service requests.
- */
-public class CalculatorServer {
- public static void main(String[] args) throws Exception {
- System.out.println("Starting of the SCA Calculator Application exposed as RMI Services...");
- String uri = ContributionLocationHelper.getContributionLocation("CalculatorRMIServer.composite");
- Contribution contribution = new Contribution("c1", uri);
- Node node = NodeFactory.newInstance().createNode("CalculatorRMIServer.composite", contribution);
- node.start();
- System.out.println("... Press Enter to Exit...");
- System.in.read();
- node.stop();
- System.out.println("Exited...");
- System.exit(0);
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package calculator;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+/**
+ * A claculator service server. Starts up the SCA runtime which
+ * will start listening for RMI service requests.
+ */
+public class CalculatorServer {
+ public static void main(String[] args) throws Exception {
+ System.out.println("Starting of the SCA Calculator Application exposed as RMI Services...");
+ String uri = ContributionLocationHelper.getContributionLocation("CalculatorRMIServer.composite");
+ Contribution contribution = new Contribution("c1", uri);
+ Node node = NodeFactory.newInstance().createNode("CalculatorRMIServer.composite", contribution);
+ node.start();
+ System.out.println("... Press Enter to Exit...");
+ System.in.read();
+ node.stop();
+ System.out.println("Exited...");
+ System.exit(0);
+ }
+
+}
diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorService.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorService.java
index b0a46b6dd0..3c0375924f 100644
--- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorService.java
+++ b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorService.java
@@ -1,36 +1,36 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The Calculator service interface.
- */
-@Remotable
-public interface CalculatorService {
-
- double add(double n1, double n2);
-
- double subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The Calculator service interface.
+ */
+@Remotable
+public interface CalculatorService {
+
+ double add(double n1, double n2);
+
+ double subtract(double n1, double n2);
+
+ double multiply(double n1, double n2);
+
+ double divide(double n1, double n2);
+}
diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServiceImpl.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServiceImpl.java
index 675350860e..bcfd8871b6 100644
--- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServiceImpl.java
+++ b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/CalculatorServiceImpl.java
@@ -1,68 +1,68 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import org.oasisopen.sca.annotation.Reference;
-
-/**
- * An implementation of the Calculator service.
- */
-public class CalculatorServiceImpl implements CalculatorService {
-
- private AddService addService;
- private SubtractService subtractService;
- private MultiplyService multiplyService;
- private DivideService divideService;
-
- @Reference
- public void setAddService(AddService addService) {
- this.addService = addService;
- }
-
- @Reference
- public void setSubtractService(SubtractService subtractService) {
- this.subtractService = subtractService;
- }
-
- @Reference
- public void setDivideService(DivideService divideService) {
- this.divideService = divideService;
- }
-
- @Reference
- public void setMultiplyService(MultiplyService multiplyService) {
- this.multiplyService = multiplyService;
- }
-
- public double add(double n1, double n2) {
- return addService.add(n1, n2);
- }
-
- public double subtract(double n1, double n2) {
- return subtractService.subtract(n1, n2);
- }
-
- public double multiply(double n1, double n2) {
- return multiplyService.multiply(n1, n2);
- }
-
- public double divide(double n1, double n2) {
- return divideService.divide(n1, n2);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+import org.oasisopen.sca.annotation.Reference;
+
+/**
+ * An implementation of the Calculator service.
+ */
+public class CalculatorServiceImpl implements CalculatorService {
+
+ private AddService addService;
+ private SubtractService subtractService;
+ private MultiplyService multiplyService;
+ private DivideService divideService;
+
+ @Reference
+ public void setAddService(AddService addService) {
+ this.addService = addService;
+ }
+
+ @Reference
+ public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ @Reference
+ public void setDivideService(DivideService divideService) {
+ this.divideService = divideService;
+ }
+
+ @Reference
+ public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ public double add(double n1, double n2) {
+ return addService.add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ return subtractService.subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ return multiplyService.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return divideService.divide(n1, n2);
+ }
+}
diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/DivideService.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/DivideService.java
index 835e4fda6d..497dafd4fd 100644
--- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/DivideService.java
+++ b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/DivideService.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the divide service
- */
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * The interface for the divide service
+ */
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/DivideServiceImpl.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/DivideServiceImpl.java
index 8c33862f6d..f7ac0b7287 100644
--- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/DivideServiceImpl.java
+++ b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/DivideServiceImpl.java
@@ -1,30 +1,30 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * An implementation of the Divide service.
- */
-public class DivideServiceImpl implements DivideService {
-
- public double divide(double n1, double n2) {
- return n1 / n2;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * An implementation of the Divide service.
+ */
+public class DivideServiceImpl implements DivideService {
+
+ public double divide(double n1, double n2) {
+ return n1 / n2;
+ }
+
+}
diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/MultiplyService.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/MultiplyService.java
index db568cc762..5290605938 100644
--- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/MultiplyService.java
+++ b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/MultiplyService.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the multiply service
- */
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * The interface for the multiply service
+ */
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/MultiplyServiceImpl.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/MultiplyServiceImpl.java
index c7fbc73c00..b7dca792b2 100644
--- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/MultiplyServiceImpl.java
+++ b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/MultiplyServiceImpl.java
@@ -1,30 +1,30 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * An implementation of the Multiply service.
- */
-public class MultiplyServiceImpl implements MultiplyService {
-
- public double multiply(double n1, double n2) {
- return n1 * n2;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * An implementation of the Multiply service.
+ */
+public class MultiplyServiceImpl implements MultiplyService {
+
+ public double multiply(double n1, double n2) {
+ return n1 * n2;
+ }
+
+}
diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/SubtractService.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/SubtractService.java
index 30e4e6a56a..376b3e5bb9 100644
--- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/SubtractService.java
+++ b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/SubtractService.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * The interface for the subtract service
- */
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * The interface for the subtract service
+ */
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
diff --git a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/SubtractServiceImpl.java b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/SubtractServiceImpl.java
index 1a7f145ad8..77b128ab8d 100644
--- a/java/sca/samples/calculator-rmi-service/src/main/java/calculator/SubtractServiceImpl.java
+++ b/java/sca/samples/calculator-rmi-service/src/main/java/calculator/SubtractServiceImpl.java
@@ -1,30 +1,30 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-/**
- * An implementation of the subtract service.
- */
-public class SubtractServiceImpl implements SubtractService {
-
- public double subtract(double n1, double n2) {
- return n1 - n2;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package calculator;
+
+/**
+ * An implementation of the subtract service.
+ */
+public class SubtractServiceImpl implements SubtractService {
+
+ public double subtract(double n1, double n2) {
+ return n1 - n2;
+ }
+
+}
diff --git a/java/sca/samples/calculator-rmi-service/src/main/resources/META-INF/sca-contribution.xml b/java/sca/samples/calculator-rmi-service/src/main/resources/META-INF/sca-contribution.xml
index 10140b7bc1..27a1ee74e4 100644
--- a/java/sca/samples/calculator-rmi-service/src/main/resources/META-INF/sca-contribution.xml
+++ b/java/sca/samples/calculator-rmi-service/src/main/resources/META-INF/sca-contribution.xml
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sample="http://sample">
- <deployable composite="sample:Calculator"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:Calculator"/>
</contribution> \ No newline at end of file
diff --git a/java/sca/samples/calculator-rmi-service/src/test/java/calculator/CalculatorRMIServerTestCase.java b/java/sca/samples/calculator-rmi-service/src/test/java/calculator/CalculatorRMIServerTestCase.java
index eb824679a8..0e352db9bb 100644
--- a/java/sca/samples/calculator-rmi-service/src/test/java/calculator/CalculatorRMIServerTestCase.java
+++ b/java/sca/samples/calculator-rmi-service/src/test/java/calculator/CalculatorRMIServerTestCase.java
@@ -1,63 +1,63 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import static org.junit.Assert.assertEquals;
-
-import java.rmi.Naming;
-
-import org.apache.tuscany.sca.node.Contribution;
-import org.apache.tuscany.sca.node.ContributionLocationHelper;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * This shows how to test the Calculator service component.
- */
-public class CalculatorRMIServerTestCase {
-
- private static Node node;
- private static CalculatorService calculatorService;
-
- @BeforeClass
- public static void setUp() throws Exception {
- String uri = ContributionLocationHelper.getContributionLocation(CalculatorService.class);
- Contribution contribution = new Contribution("c1", uri);
- node = NodeFactory.newInstance().createNode("CalculatorRMIServer.composite", contribution);
- node.start();
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- node.stop();
- }
-
- @Test
- public void testCalculator() throws Exception {
- // Calculate
- calculatorService = (CalculatorService)Naming.lookup("//localhost:8099/CalculatorRMIService");
- assertEquals(calculatorService.add(3, 2), 5.0, 0.0);
- assertEquals(calculatorService.subtract(3, 2), 1.0, 0.0);
- assertEquals(calculatorService.multiply(3, 2), 6.0, 0.0);
- assertEquals(calculatorService.divide(3, 2), 1.5, 0.0);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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 static org.junit.Assert.assertEquals;
+
+import java.rmi.Naming;
+
+import org.apache.tuscany.sca.node.Contribution;
+import org.apache.tuscany.sca.node.ContributionLocationHelper;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * This shows how to test the Calculator service component.
+ */
+public class CalculatorRMIServerTestCase {
+
+ private static Node node;
+ private static CalculatorService calculatorService;
+
+ @BeforeClass
+ public static void setUp() throws Exception {
+ String uri = ContributionLocationHelper.getContributionLocation(CalculatorService.class);
+ Contribution contribution = new Contribution("c1", uri);
+ node = NodeFactory.newInstance().createNode("CalculatorRMIServer.composite", contribution);
+ node.start();
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ node.stop();
+ }
+
+ @Test
+ public void testCalculator() throws Exception {
+ // Calculate
+ calculatorService = (CalculatorService)Naming.lookup("//localhost:8099/CalculatorRMIService");
+ assertEquals(calculatorService.add(3, 2), 5.0, 0.0);
+ assertEquals(calculatorService.subtract(3, 2), 1.0, 0.0);
+ assertEquals(calculatorService.multiply(3, 2), 6.0, 0.0);
+ assertEquals(calculatorService.divide(3, 2), 1.5, 0.0);
+ }
+}
diff --git a/java/sca/samples/calculator/src/main/resources/META-INF/sca-contribution.xml b/java/sca/samples/calculator/src/main/resources/META-INF/sca-contribution.xml
index 10140b7bc1..27a1ee74e4 100644
--- a/java/sca/samples/calculator/src/main/resources/META-INF/sca-contribution.xml
+++ b/java/sca/samples/calculator/src/main/resources/META-INF/sca-contribution.xml
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sample="http://sample">
- <deployable composite="sample:Calculator"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:Calculator"/>
</contribution> \ No newline at end of file
diff --git a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/add-component.xml b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/add-component.xml
index bf4ccc3d28..99845257ff 100644
--- a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/add-component.xml
+++ b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/add-component.xml
@@ -1,25 +1,25 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<scr:component name="AddComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
- <implementation class="calculator.dosgi.operations.impl.AddServiceImpl" />
- <service>
- <provide interface="calculator.dosgi.operations.AddService" />
- </service>
-</scr:component>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<scr:component name="AddComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+ <implementation class="calculator.dosgi.operations.impl.AddServiceImpl" />
+ <service>
+ <provide interface="calculator.dosgi.operations.AddService" />
+ </service>
+</scr:component>
diff --git a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml
index e3b690f24a..f6b5f4690e 100644
--- a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml
+++ b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml
@@ -1,40 +1,40 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- A sample module-context.xml for OSGI RFC 124 (BluePrint Service) -->
-<components xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
- <component id="AddComponent" class="calculator.dosgi.operations.impl.AddServiceImpl">
- </component>
- <component id="SubtractComponent" class="calculator.dosgi.operations.impl.SubtractServiceImpl">
- </component>
- <component id="MultiplyComponent" class="calculator.dosgi.operations.impl.MultiplyServiceImpl">
- </component>
- <component id="DivideComponent" class="calculator.dosgi.operations.impl.DivideServiceImpl">
- </component>
-
- <!-- We can derive the SCA services for the implementation.osgi -->
- <service id="AddService" ref="AddComponent" interface="calculator.dosgi.operations.AddService">
- </service>
- <service id="SubtractService" ref="SubtractComponent" interface="calculator.dosgi.operations.SubtractService">
- </service>
- <service id="MultiplyService" ref="MultiplyComponent" interface="calculator.dosgi.operations.MultiplyService">
- </service>
- <service id="DivideService" ref="DivideComponent" interface="calculator.dosgi.operations.DivideService">
- </service>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- A sample module-context.xml for OSGI RFC 124 (BluePrint Service) -->
+<components xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+ <component id="AddComponent" class="calculator.dosgi.operations.impl.AddServiceImpl">
+ </component>
+ <component id="SubtractComponent" class="calculator.dosgi.operations.impl.SubtractServiceImpl">
+ </component>
+ <component id="MultiplyComponent" class="calculator.dosgi.operations.impl.MultiplyServiceImpl">
+ </component>
+ <component id="DivideComponent" class="calculator.dosgi.operations.impl.DivideServiceImpl">
+ </component>
+
+ <!-- We can derive the SCA services for the implementation.osgi -->
+ <service id="AddService" ref="AddComponent" interface="calculator.dosgi.operations.AddService">
+ </service>
+ <service id="SubtractService" ref="SubtractComponent" interface="calculator.dosgi.operations.SubtractService">
+ </service>
+ <service id="MultiplyService" ref="MultiplyComponent" interface="calculator.dosgi.operations.MultiplyService">
+ </service>
+ <service id="DivideService" ref="DivideComponent" interface="calculator.dosgi.operations.DivideService">
+ </service>
</components> \ No newline at end of file
diff --git a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/divide-component.xml b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/divide-component.xml
index b939a5de80..322d4daf2f 100644
--- a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/divide-component.xml
+++ b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/divide-component.xml
@@ -1,25 +1,25 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<scr:component name="DivideComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
- <implementation class="calculator.dosgi.operations.impl.DivideServiceImpl" />
- <service>
- <provide interface="calculator.dosgi.operations.DivideService" />
- </service>
-</scr:component>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<scr:component name="DivideComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+ <implementation class="calculator.dosgi.operations.impl.DivideServiceImpl" />
+ <service>
+ <provide interface="calculator.dosgi.operations.DivideService" />
+ </service>
+</scr:component>
diff --git a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/multiply-component.xml b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/multiply-component.xml
index 2bf897d72a..b9ca777bd8 100644
--- a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/multiply-component.xml
+++ b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/multiply-component.xml
@@ -1,25 +1,25 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<scr:component name="MultiplyComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
- <implementation class="calculator.dosgi.operations.impl.MultiplyServiceImpl" />
- <service>
- <provide interface="calculator.dosgi.operations.MultiplyService" />
- </service>
-</scr:component>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<scr:component name="MultiplyComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+ <implementation class="calculator.dosgi.operations.impl.MultiplyServiceImpl" />
+ <service>
+ <provide interface="calculator.dosgi.operations.MultiplyService" />
+ </service>
+</scr:component>
diff --git a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType
index 6f6f4bdce6..72e2c339f1 100644
--- a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType
+++ b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType
@@ -1,47 +1,47 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1">
-
-
- <!-- The service elment defines an SCA proxy to a remote OSGi service -->
- <service name="AddService">
- <interface.java interface="calculator.dosgi.operations.AddService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </service>
- <service name="SubtractService">
- <interface.java interface="calculator.dosgi.operations.SubtractService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </service>
- <service name="MultiplyService">
- <interface.java interface="calculator.dosgi.operations.MultiplyService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </service>
- <service name="DivideService">
- <interface.java interface="calculator.dosgi.operations.DivideService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </service>
-
-</componentType>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1">
+
+
+ <!-- The service elment defines an SCA proxy to a remote OSGi service -->
+ <service name="AddService">
+ <interface.java interface="calculator.dosgi.operations.AddService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </service>
+ <service name="SubtractService">
+ <interface.java interface="calculator.dosgi.operations.SubtractService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </service>
+ <service name="MultiplyService">
+ <interface.java interface="calculator.dosgi.operations.MultiplyService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </service>
+ <service name="DivideService">
+ <interface.java interface="calculator.dosgi.operations.DivideService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </service>
+
+</componentType>
diff --git a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite
index c9fb3818b8..253f7d0df1 100644
--- a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite
+++ b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite
@@ -1,43 +1,43 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://calculator.dosgi"
- name="OperationsComposite">
-
- <component name="OperationsComponent">
- <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi.operations" bundleVersion="1.0.0" />
- <service name="AddService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/>
- </service>
- <service name="SubtractService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/>
- </service>
- <service name="MultiplyService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/>
- </service>
- <service name="DivideService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/>
- </service>
-
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://calculator.dosgi"
+ name="OperationsComposite">
+
+ <component name="OperationsComponent">
+ <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi.operations" bundleVersion="1.0.0" />
+ <service name="AddService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/>
+ </service>
+ <service name="SubtractService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/>
+ </service>
+ <service name="MultiplyService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/>
+ </service>
+ <service name="DivideService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/>
+ </service>
+
+ </component>
+
+</composite>
diff --git a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/subtract-component.xml b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/subtract-component.xml
index 4af00695da..1472f5a976 100644
--- a/java/sca/samples/dosgi-calculator-operations/OSGI-INF/subtract-component.xml
+++ b/java/sca/samples/dosgi-calculator-operations/OSGI-INF/subtract-component.xml
@@ -1,25 +1,25 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<scr:component name="SubtractComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
- <implementation class="calculator.dosgi.operations.impl.SubtractServiceImpl" />
- <service>
- <provide interface="calculator.dosgi.operations.SubtractService" />
- </service>
-</scr:component>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<scr:component name="SubtractComponent" xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+ <implementation class="calculator.dosgi.operations.impl.SubtractServiceImpl" />
+ <service>
+ <provide interface="calculator.dosgi.operations.SubtractService" />
+ </service>
+</scr:component>
diff --git a/java/sca/samples/dosgi-calculator-operations/pom.xml b/java/sca/samples/dosgi-calculator-operations/pom.xml
index add9380c55..db08bc0461 100644
--- a/java/sca/samples/dosgi-calculator-operations/pom.xml
+++ b/java/sca/samples/dosgi-calculator-operations/pom.xml
@@ -1,134 +1,134 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-dosgi-calculator-operations</artifactId>
- <name>Apache Tuscany SCA Distributed OSGi (RFC 119) Caculator Operations Sample</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-ejava</artifactId>
- <version>2.0-SNAPSHOT</version>
- <type>pom</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl-osgi</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.osgi</groupId>
- <artifactId>services</artifactId>
- <version>3.2.0-v20090520-1800</version>
- <scope>test</scope>
- </dependency>
-
- <!-- Equinox Declarative Services -->
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>ds</artifactId>
- <version>1.1.0-v20090601</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>util</artifactId>
- <version>1.0.100-v20090520-1800</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <artifactId>maven-eclipse-plugin</artifactId>
- <version>2.5.1</version>
- <configuration>
- <buildcommands>
- <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
- <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
- </buildcommands>
- <projectnatures>
- <projectnature>org.eclipse.jdt.core.javanature</projectnature>
- <projectnature>org.eclipse.pde.PluginNature</projectnature>
- </projectnatures>
- <classpathContainers>
- <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
- </classpathContainer>
- </classpathContainers>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-osgi-junit-plugin</artifactId>
- <version>1.0-SNAPSHOT</version>
- <executions>
- <execution>
- <id>osgi-test</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration></configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-dosgi-calculator-operations</artifactId>
+ <name>Apache Tuscany SCA Distributed OSGi (RFC 119) Caculator Operations Sample</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-ejava</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher-equinox</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl-osgi</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.osgi</groupId>
+ <artifactId>services</artifactId>
+ <version>3.2.0-v20090520-1800</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Equinox Declarative Services -->
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>ds</artifactId>
+ <version>1.1.0-v20090601</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>util</artifactId>
+ <version>1.0.100-v20090520-1800</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.5.1</version>
+ <configuration>
+ <buildcommands>
+ <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
+ <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
+ </buildcommands>
+ <projectnatures>
+ <projectnature>org.eclipse.jdt.core.javanature</projectnature>
+ <projectnature>org.eclipse.pde.PluginNature</projectnature>
+ </projectnatures>
+ <classpathContainers>
+ <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
+ </classpathContainer>
+ </classpathContainers>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-osgi-junit-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>osgi-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration></configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java
index 7d68dbd5c5..971500782f 100644
--- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java
+++ b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java
@@ -1,31 +1,31 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for the add service
- */
-@Remotable
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The interface for the add service
+ */
+@Remotable
+public interface AddService {
+
+ double add(double n1, double n2);
+
+}
diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java
index 998f6e9554..49b8a1c0bf 100644
--- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java
+++ b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java
@@ -1,31 +1,31 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for the divide service
- */
-@Remotable
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The interface for the divide service
+ */
+@Remotable
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java
index 7ed6db2e6b..f4e59d12ea 100644
--- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java
+++ b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java
@@ -1,31 +1,31 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for the multiply service
- */
-@Remotable
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The interface for the multiply service
+ */
+@Remotable
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java
index cb98b8fb67..bfb9b820f7 100644
--- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java
+++ b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java
@@ -1,31 +1,31 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for the subtract service
- */
-@Remotable
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The interface for the subtract service
+ */
+@Remotable
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java
index e0a6622136..66b2977241 100644
--- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java
+++ b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java
@@ -1,37 +1,37 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator.dosgi.operations.impl;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import calculator.dosgi.operations.AddService;
-
-/**
- * An implementation of the Add service
- */
-public class AddServiceImpl implements AddService {
-
- public double add(double n1, double n2) {
- Logger logger = Logger.getLogger("calculator");
- logger.log(Level.INFO, "Adding " + n1 + " and " + n2);
- return n1 + n2;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations.impl;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import calculator.dosgi.operations.AddService;
+
+/**
+ * An implementation of the Add service
+ */
+public class AddServiceImpl implements AddService {
+
+ public double add(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.INFO, "Adding " + n1 + " and " + n2);
+ return n1 + n2;
+ }
+
+}
diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java
index 028f860885..a3c21b2b96 100644
--- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java
+++ b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java
@@ -1,37 +1,37 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator.dosgi.operations.impl;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import calculator.dosgi.operations.DivideService;
-
-/**
- * An implementation of the Divide service.
- */
-public class DivideServiceImpl implements DivideService {
-
- public double divide(double n1, double n2) {
- Logger logger = Logger.getLogger("calculator");
- logger.log(Level.INFO, "Dividing " + n1 + " with " + n2);
- return n1 / n2;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations.impl;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import calculator.dosgi.operations.DivideService;
+
+/**
+ * An implementation of the Divide service.
+ */
+public class DivideServiceImpl implements DivideService {
+
+ public double divide(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.INFO, "Dividing " + n1 + " with " + n2);
+ return n1 / n2;
+ }
+
+}
diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java
index e928317c2e..7922d2d392 100644
--- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java
+++ b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java
@@ -1,37 +1,37 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator.dosgi.operations.impl;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import calculator.dosgi.operations.MultiplyService;
-
-/**
- * An implementation of the Multiply service.
- */
-public class MultiplyServiceImpl implements MultiplyService {
-
- public double multiply(double n1, double n2) {
- Logger logger = Logger.getLogger("calculator");
- logger.log(Level.INFO, "Multiplying " + n1 + " with " + n2);
- return n1 * n2;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations.impl;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import calculator.dosgi.operations.MultiplyService;
+
+/**
+ * An implementation of the Multiply service.
+ */
+public class MultiplyServiceImpl implements MultiplyService {
+
+ public double multiply(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.INFO, "Multiplying " + n1 + " with " + n2);
+ return n1 * n2;
+ }
+
+}
diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java
index f9e606bd9a..5348d19f34 100644
--- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java
+++ b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java
@@ -1,88 +1,88 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations.impl;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.logging.Logger;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.packageadmin.PackageAdmin;
-
-import calculator.dosgi.operations.AddService;
-import calculator.dosgi.operations.DivideService;
-import calculator.dosgi.operations.MultiplyService;
-import calculator.dosgi.operations.SubtractService;
-
-/**
- *
- */
-public class OperationsActivator implements BundleActivator {
- private Logger logger = Logger.getLogger(OperationsActivator.class.getName());
-
- public void start(BundleContext context) throws Exception {
- logger.info("Starting " + context.getBundle());
-
- Dictionary<String, Object> props = new Hashtable<String, Object>();
-
- logger.info("Registering " + AddService.class.getName());
- props.put("sca.service", "AddComponent#service-name(Add)");
- context.registerService(AddService.class.getName(), new AddServiceImpl(), props);
-
- logger.info("Registering " + SubtractService.class.getName());
- props.put("sca.service", "SubtractComponent#service-name(Subtract)");
- context.registerService(SubtractService.class.getName(), new SubtractServiceImpl(), props);
-
- logger.info("Registering " + MultiplyService.class.getName());
- props.put("sca.service", "MultiplyComponent#service-name(Multiply)");
- context.registerService(MultiplyService.class.getName(), new MultiplyServiceImpl(), props);
-
- logger.info("Registering " + DivideService.class.getName());
- props.put("sca.service", "DivideComponent#service-name(Divide)");
- context.registerService(DivideService.class.getName(), new DivideServiceImpl(), props);
-
- getBundle(context, AddService.class);
- }
-
- public void stop(BundleContext context) throws Exception {
- logger.info("Stopping " + context.getBundle());
- // Registered services will be automatically unregistered
- }
-
- private Bundle getBundle(BundleContext bundleContext, Class<?> cls) {
- PackageAdmin packageAdmin = null;
- // PackageAdmin is used to resolve bundles
- ServiceReference ref = bundleContext.getServiceReference("org.osgi.service.packageadmin.PackageAdmin");
- if (ref != null) {
- packageAdmin = (PackageAdmin)bundleContext.getService(ref);
- Bundle bundle = packageAdmin.getBundle(cls);
- if (bundle != null) {
- logger.info(cls.getName() + " is loaded by bundle: " + bundle.getSymbolicName());
- }
- bundleContext.ungetService(ref);
- return bundle;
- }
- return null;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations.impl;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.logging.Logger;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+import calculator.dosgi.operations.AddService;
+import calculator.dosgi.operations.DivideService;
+import calculator.dosgi.operations.MultiplyService;
+import calculator.dosgi.operations.SubtractService;
+
+/**
+ *
+ */
+public class OperationsActivator implements BundleActivator {
+ private Logger logger = Logger.getLogger(OperationsActivator.class.getName());
+
+ public void start(BundleContext context) throws Exception {
+ logger.info("Starting " + context.getBundle());
+
+ Dictionary<String, Object> props = new Hashtable<String, Object>();
+
+ logger.info("Registering " + AddService.class.getName());
+ props.put("sca.service", "AddComponent#service-name(Add)");
+ context.registerService(AddService.class.getName(), new AddServiceImpl(), props);
+
+ logger.info("Registering " + SubtractService.class.getName());
+ props.put("sca.service", "SubtractComponent#service-name(Subtract)");
+ context.registerService(SubtractService.class.getName(), new SubtractServiceImpl(), props);
+
+ logger.info("Registering " + MultiplyService.class.getName());
+ props.put("sca.service", "MultiplyComponent#service-name(Multiply)");
+ context.registerService(MultiplyService.class.getName(), new MultiplyServiceImpl(), props);
+
+ logger.info("Registering " + DivideService.class.getName());
+ props.put("sca.service", "DivideComponent#service-name(Divide)");
+ context.registerService(DivideService.class.getName(), new DivideServiceImpl(), props);
+
+ getBundle(context, AddService.class);
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ logger.info("Stopping " + context.getBundle());
+ // Registered services will be automatically unregistered
+ }
+
+ private Bundle getBundle(BundleContext bundleContext, Class<?> cls) {
+ PackageAdmin packageAdmin = null;
+ // PackageAdmin is used to resolve bundles
+ ServiceReference ref = bundleContext.getServiceReference("org.osgi.service.packageadmin.PackageAdmin");
+ if (ref != null) {
+ packageAdmin = (PackageAdmin)bundleContext.getService(ref);
+ Bundle bundle = packageAdmin.getBundle(cls);
+ if (bundle != null) {
+ logger.info(cls.getName() + " is loaded by bundle: " + bundle.getSymbolicName());
+ }
+ bundleContext.ungetService(ref);
+ return bundle;
+ }
+ return null;
+ }
+
+}
diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java
index 565670963f..4bbe83b14f 100644
--- a/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java
+++ b/java/sca/samples/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java
@@ -1,37 +1,37 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator.dosgi.operations.impl;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import calculator.dosgi.operations.SubtractService;
-
-/**
- * An implementation of the subtract service.
- */
-public class SubtractServiceImpl implements SubtractService {
-
- public double subtract(double n1, double n2) {
- Logger logger = Logger.getLogger("calculator");
- logger.log(Level.INFO, "Subtracting " + n1 + " from " + n2);
- return n1 - n2;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations.impl;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import calculator.dosgi.operations.SubtractService;
+
+/**
+ * An implementation of the subtract service.
+ */
+public class SubtractServiceImpl implements SubtractService {
+
+ public double subtract(double n1, double n2) {
+ Logger logger = Logger.getLogger("calculator");
+ logger.log(Level.INFO, "Subtracting " + n1 + " from " + n2);
+ return n1 - n2;
+ }
+
+}
diff --git a/java/sca/samples/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml b/java/sca/samples/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml
index ed7083fb29..16a33f4f65 100644
--- a/java/sca/samples/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml
+++ b/java/sca/samples/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
--->
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:c="http://calculator.dosgi">
- <deployable composite="c:OperationsComposite" />
-</contribution>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:c="http://calculator.dosgi">
+ <deployable composite="c:OperationsComposite" />
+</contribution>
diff --git a/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java b/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java
index 332ba44396..cd92989da1 100644
--- a/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java
+++ b/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java
@@ -1,105 +1,105 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations.test;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-import org.osgi.framework.Bundle;
-
-/**
- *
- * Utility class to create OSGi bundles
- *
- * @version $Rev: 758877 $ $Date: 2009-03-26 14:51:19 -0700 (Thu, 26 Mar 2009) $
- */
-public class OSGiTestUtils {
- private static class InvocationHandlerImpl implements InvocationHandler {
- private Object instance;
-
- public InvocationHandlerImpl(Object instance) {
- super();
- this.instance = instance;
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- Method m = instance.getClass().getMethod(method.getName(), method.getParameterTypes());
- return m.invoke(instance, args);
- }
-
- }
-
- /**
- * Returns a string representation of the given bundle.
- *
- * @param b
- * @param verbose
- * @return
- */
- public static String bundleStatus(Bundle bundle, boolean verbose) {
- StringBuffer sb = new StringBuffer();
- sb.append(bundle.getBundleId()).append(" ").append(bundle.getSymbolicName());
- int s = bundle.getState();
- if ((s & Bundle.UNINSTALLED) != 0) {
- sb.append(" UNINSTALLED");
- }
- if ((s & Bundle.INSTALLED) != 0) {
- sb.append(" INSTALLED");
- }
- if ((s & Bundle.RESOLVED) != 0) {
- sb.append(" RESOLVED");
- }
- if ((s & Bundle.STARTING) != 0) {
- sb.append(" STARTING");
- }
- if ((s & Bundle.STOPPING) != 0) {
- sb.append(" STOPPING");
- }
- if ((s & Bundle.ACTIVE) != 0) {
- sb.append(" ACTIVE");
- }
-
- if (verbose) {
- sb.append(" ").append(bundle.getLocation());
- sb.append(" ").append(bundle.getHeaders());
- }
- return sb.toString();
- }
-
- /**
- * A utility to cast the object to the given interface. If the class for the object
- * is loaded by a different classloader, a proxy will be created.
- *
- * @param <T>
- * @param obj
- * @param cls
- * @return
- */
- public static <T> T cast(Object obj, Class<T> cls) {
- if (cls.isInstance(obj)) {
- return cls.cast(obj);
- } else {
- return cls.cast(Proxy.newProxyInstance(cls.getClassLoader(),
- new Class<?>[] {cls},
- new InvocationHandlerImpl(obj)));
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations.test;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import org.osgi.framework.Bundle;
+
+/**
+ *
+ * Utility class to create OSGi bundles
+ *
+ * @version $Rev$ $Date$
+ */
+public class OSGiTestUtils {
+ private static class InvocationHandlerImpl implements InvocationHandler {
+ private Object instance;
+
+ public InvocationHandlerImpl(Object instance) {
+ super();
+ this.instance = instance;
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ Method m = instance.getClass().getMethod(method.getName(), method.getParameterTypes());
+ return m.invoke(instance, args);
+ }
+
+ }
+
+ /**
+ * Returns a string representation of the given bundle.
+ *
+ * @param b
+ * @param verbose
+ * @return
+ */
+ public static String bundleStatus(Bundle bundle, boolean verbose) {
+ StringBuffer sb = new StringBuffer();
+ sb.append(bundle.getBundleId()).append(" ").append(bundle.getSymbolicName());
+ int s = bundle.getState();
+ if ((s & Bundle.UNINSTALLED) != 0) {
+ sb.append(" UNINSTALLED");
+ }
+ if ((s & Bundle.INSTALLED) != 0) {
+ sb.append(" INSTALLED");
+ }
+ if ((s & Bundle.RESOLVED) != 0) {
+ sb.append(" RESOLVED");
+ }
+ if ((s & Bundle.STARTING) != 0) {
+ sb.append(" STARTING");
+ }
+ if ((s & Bundle.STOPPING) != 0) {
+ sb.append(" STOPPING");
+ }
+ if ((s & Bundle.ACTIVE) != 0) {
+ sb.append(" ACTIVE");
+ }
+
+ if (verbose) {
+ sb.append(" ").append(bundle.getLocation());
+ sb.append(" ").append(bundle.getHeaders());
+ }
+ return sb.toString();
+ }
+
+ /**
+ * A utility to cast the object to the given interface. If the class for the object
+ * is loaded by a different classloader, a proxy will be created.
+ *
+ * @param <T>
+ * @param obj
+ * @param cls
+ * @return
+ */
+ public static <T> T cast(Object obj, Class<T> cls) {
+ if (cls.isInstance(obj)) {
+ return cls.cast(obj);
+ } else {
+ return cls.cast(Proxy.newProxyInstance(cls.getClassLoader(),
+ new Class<?>[] {cls},
+ new InvocationHandlerImpl(obj)));
+ }
+ }
+}
diff --git a/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java b/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java
index faf61d11e4..02007c385c 100644
--- a/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java
+++ b/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java
@@ -1,43 +1,43 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations.test;
-
-import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher;
-
-/**
- *
- */
-public class OperationsNode {
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- if (args.length == 0) {
- args = new String[] {"-bundles"};
- }
- try {
- NodeLauncher.main(args);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations.test;
+
+import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher;
+
+/**
+ *
+ */
+public class OperationsNode {
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ if (args.length == 0) {
+ args = new String[] {"-bundles"};
+ }
+ try {
+ NodeLauncher.main(args);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java b/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java
index bca04d11a4..49c5aab041 100644
--- a/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java
+++ b/java/sca/samples/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java
@@ -1,104 +1,104 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations.test;
-
-import static calculator.dosgi.operations.test.OSGiTestUtils.bundleStatus;
-
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-
-import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-
-import calculator.dosgi.operations.AddService;
-
-/**
- *
- */
-public class OperationsOSGiNodeTestCase {
- private static EquinoxHost host;
- private static BundleContext context;
- private static Bundle operationsBundle;
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- try {
- host = new EquinoxHost();
- context = host.start();
-
- for (Bundle b : context.getBundles()) {
- if (b.getSymbolicName().equals("org.eclipse.equinox.ds") || b.getSymbolicName()
- .startsWith("org.apache.tuscany.sca.")) {
- try {
- if (b.getHeaders().get(Constants.FRAGMENT_HOST) == null) {
- // Start the non-fragment bundle
- b.start();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- System.out.println(bundleStatus(b, false));
- }
- if ("calculator.dosgi.operations".equals(b.getSymbolicName())) {
- operationsBundle = b;
- }
- }
-
- if (operationsBundle != null) {
- operationsBundle.start();
- System.out.println(bundleStatus(operationsBundle, false));
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- throw e;
- }
- }
-
- @Test
- public void testOSGi() throws Exception {
- Registry registry = LocateRegistry.getRegistry(8085);
- Object add = registry.lookup("AddService");
- AddService addService = OSGiTestUtils.cast(add, AddService.class);
- double sum = addService.add(1.0, 2.0);
- Assert.assertEquals(3.0, sum, 0.0);
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- if (host != null) {
- host.stop();
- context = null;
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations.test;
+
+import static calculator.dosgi.operations.test.OSGiTestUtils.bundleStatus;
+
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+
+import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+
+import calculator.dosgi.operations.AddService;
+
+/**
+ *
+ */
+public class OperationsOSGiNodeTestCase {
+ private static EquinoxHost host;
+ private static BundleContext context;
+ private static Bundle operationsBundle;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ try {
+ host = new EquinoxHost();
+ context = host.start();
+
+ for (Bundle b : context.getBundles()) {
+ if (b.getSymbolicName().equals("org.eclipse.equinox.ds") || b.getSymbolicName()
+ .startsWith("org.apache.tuscany.sca.")) {
+ try {
+ if (b.getHeaders().get(Constants.FRAGMENT_HOST) == null) {
+ // Start the non-fragment bundle
+ b.start();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ System.out.println(bundleStatus(b, false));
+ }
+ if ("calculator.dosgi.operations".equals(b.getSymbolicName())) {
+ operationsBundle = b;
+ }
+ }
+
+ if (operationsBundle != null) {
+ operationsBundle.start();
+ System.out.println(bundleStatus(operationsBundle, false));
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw e;
+ }
+ }
+
+ @Test
+ public void testOSGi() throws Exception {
+ Registry registry = LocateRegistry.getRegistry(8085);
+ Object add = registry.lookup("AddService");
+ AddService addService = OSGiTestUtils.cast(add, AddService.class);
+ double sum = addService.add(1.0, 2.0);
+ Assert.assertEquals(3.0, sum, 0.0);
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (host != null) {
+ host.stop();
+ context = null;
+ }
+ }
+
+}
diff --git a/java/sca/samples/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml b/java/sca/samples/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml
index fe0bbf21df..fd834e12ef 100644
--- a/java/sca/samples/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml
+++ b/java/sca/samples/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml
@@ -1,43 +1,43 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<!-- A sample module-context.xml for OSGI RFC 124 (BluePrint Service) -->
-<components xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
- <component id="CalculatorComponent" class="calculator.dosgi.impl.CalculatorServiceImpl">
- <property name="addService" ref="AddService" />
- <property name="subtractService" ref="SubtractService" />
- <property name="multiplyService" ref="MultiplyService" />
- <property name="divideService" ref="DivideService" />
- </component>
-
- <!-- We can derive the SCA services for the implementation.osgi -->
- <service id="CalculatorService" ref="CalculatorComponent" interface="calculator.dosgi.CalculatorService">
- </service>
-
- <!-- We can derive the SCA references for the implementation.osgi -->
- <reference id="AddService" interface="calculator.dosgi.operations.AddService">
- </reference>
- <reference id="SubtractService" interface="calculator.dosgi.operations.SubtractService">
- </reference>
- <reference id="MultiplyService" interface="calculator.dosgi.operations.MultiplyService">
- </reference>
- <reference id="DivideService" interface="calculator.dosgi.operations.DivideService">
- </reference>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- A sample module-context.xml for OSGI RFC 124 (BluePrint Service) -->
+<components xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+ <component id="CalculatorComponent" class="calculator.dosgi.impl.CalculatorServiceImpl">
+ <property name="addService" ref="AddService" />
+ <property name="subtractService" ref="SubtractService" />
+ <property name="multiplyService" ref="MultiplyService" />
+ <property name="divideService" ref="DivideService" />
+ </component>
+
+ <!-- We can derive the SCA services for the implementation.osgi -->
+ <service id="CalculatorService" ref="CalculatorComponent" interface="calculator.dosgi.CalculatorService">
+ </service>
+
+ <!-- We can derive the SCA references for the implementation.osgi -->
+ <reference id="AddService" interface="calculator.dosgi.operations.AddService">
+ </reference>
+ <reference id="SubtractService" interface="calculator.dosgi.operations.SubtractService">
+ </reference>
+ <reference id="MultiplyService" interface="calculator.dosgi.operations.MultiplyService">
+ </reference>
+ <reference id="DivideService" interface="calculator.dosgi.operations.DivideService">
+ </reference>
+
</components> \ No newline at end of file
diff --git a/java/sca/samples/dosgi-calculator/OSGI-INF/calculator-component.xml b/java/sca/samples/dosgi-calculator/OSGI-INF/calculator-component.xml
index 457588bfb6..5daaa59aae 100644
--- a/java/sca/samples/dosgi-calculator/OSGI-INF/calculator-component.xml
+++ b/java/sca/samples/dosgi-calculator/OSGI-INF/calculator-component.xml
@@ -1,36 +1,36 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<scr:component name="CalculatorComponent"
- xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
- <implementation class="calculator.dosgi.impl.CalculatorServiceDSImpl" />
- <service>
- <provide interface="calculator.dosgi.CalculatorService" />
- </service>
-
- <reference name="addService" interface="calculator.dosgi.operations.AddService" bind="setAddService" unbind="unsetAddService"
- policy="dynamic" />
- <reference name="subtractService" interface="calculator.dosgi.operations.SubtractService" bind="setSubtractService"
- unbind="unsetSubtractService" policy="dynamic" />
- <reference name="multiplyService" interface="calculator.dosgi.operations.MultiplyService" bind="setMultiplyService"
- unbind="unsetMultiplyService" policy="dynamic" />
- <reference name="divideService" interface="calculator.dosgi.operations.DivideService" bind="setDivideService"
- unbind="unsetDivideService" policy="dynamic" />
-
-</scr:component>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<scr:component name="CalculatorComponent"
+ xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0">
+ <implementation class="calculator.dosgi.impl.CalculatorServiceDSImpl" />
+ <service>
+ <provide interface="calculator.dosgi.CalculatorService" />
+ </service>
+
+ <reference name="addService" interface="calculator.dosgi.operations.AddService" bind="setAddService" unbind="unsetAddService"
+ policy="dynamic" />
+ <reference name="subtractService" interface="calculator.dosgi.operations.SubtractService" bind="setSubtractService"
+ unbind="unsetSubtractService" policy="dynamic" />
+ <reference name="multiplyService" interface="calculator.dosgi.operations.MultiplyService" bind="setMultiplyService"
+ unbind="unsetMultiplyService" policy="dynamic" />
+ <reference name="divideService" interface="calculator.dosgi.operations.DivideService" bind="setDivideService"
+ unbind="unsetDivideService" policy="dynamic" />
+
+</scr:component>
diff --git a/java/sca/samples/dosgi-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml b/java/sca/samples/dosgi-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml
index 1a35665803..da76d00024 100644
--- a/java/sca/samples/dosgi-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml
+++ b/java/sca/samples/dosgi-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml
@@ -1,67 +1,67 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
--->
-<!-- A consumer-side service description file for RFC 119 -->
-<service-descriptions xmlns="http://www.osgi.org/xmlns/sd/v1.0.0" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
- <!-- Describe a remote OSGi service -->
- <service-description>
- <provide interface="calculator.dosgi.operations.AddService" />
- <property name="service.intents">sca:SOAP sca:HTTP</property>
- <property name="osgi.remote.configuration.type">sca</property>
- <property name="osgi.remote.configuration.sca.componentType">
- OSGI-INF/sca/bundle.componentType
- </property>
- <property name="osgi.remote.configuration.sca.reference">
- addService
- </property>
- </service-description>
- <service-description>
- <provide interface="calculator.dosgi.operations.SubtractService" />
- <property name="service.intents">sca:SOAP sca:HTTP</property>
- <property name="osgi.remote.configuration.type">sca</property>
- <property name="osgi.remote.configuration.sca.componentType">
- OSGI-INF/sca/bundle.componentType
- </property>
- <property name="osgi.remote.configuration.sca.reference">
- subtractService
- </property>
- </service-description>
- <service-description>
- <provide interface="calculator.dosgi.operations.MultiplyService" />
- <property name="service.intents">sca:SOAP sca:HTTP</property>
- <property name="osgi.remote.configuration.type">sca</property>
- <property name="osgi.remote.configuration.sca.componentType">
- OSGI-INF/sca/bundle.componentType
- </property>
- <property name="osgi.remote.configuration.sca.reference">
- multiplyService
- </property>
- </service-description>
- <service-description>
- <provide interface="calculator.dosgi.operations.DivideService" />
- <property name="service.intents">sca:SOAP sca:HTTP</property>
- <property name="osgi.remote.configuration.type">sca</property>
- <property name="osgi.remote.configuration.sca.componentType">
- OSGI-INF/sca/bundle.componentType
- </property>
- <property name="osgi.remote.configuration.sca.reference">
- divideService
- </property>
- </service-description>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+-->
+<!-- A consumer-side service description file for RFC 119 -->
+<service-descriptions xmlns="http://www.osgi.org/xmlns/sd/v1.0.0" xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903">
+ <!-- Describe a remote OSGi service -->
+ <service-description>
+ <provide interface="calculator.dosgi.operations.AddService" />
+ <property name="service.intents">sca:SOAP sca:HTTP</property>
+ <property name="osgi.remote.configuration.type">sca</property>
+ <property name="osgi.remote.configuration.sca.componentType">
+ OSGI-INF/sca/bundle.componentType
+ </property>
+ <property name="osgi.remote.configuration.sca.reference">
+ addService
+ </property>
+ </service-description>
+ <service-description>
+ <provide interface="calculator.dosgi.operations.SubtractService" />
+ <property name="service.intents">sca:SOAP sca:HTTP</property>
+ <property name="osgi.remote.configuration.type">sca</property>
+ <property name="osgi.remote.configuration.sca.componentType">
+ OSGI-INF/sca/bundle.componentType
+ </property>
+ <property name="osgi.remote.configuration.sca.reference">
+ subtractService
+ </property>
+ </service-description>
+ <service-description>
+ <provide interface="calculator.dosgi.operations.MultiplyService" />
+ <property name="service.intents">sca:SOAP sca:HTTP</property>
+ <property name="osgi.remote.configuration.type">sca</property>
+ <property name="osgi.remote.configuration.sca.componentType">
+ OSGI-INF/sca/bundle.componentType
+ </property>
+ <property name="osgi.remote.configuration.sca.reference">
+ multiplyService
+ </property>
+ </service-description>
+ <service-description>
+ <provide interface="calculator.dosgi.operations.DivideService" />
+ <property name="service.intents">sca:SOAP sca:HTTP</property>
+ <property name="osgi.remote.configuration.type">sca</property>
+ <property name="osgi.remote.configuration.sca.componentType">
+ OSGI-INF/sca/bundle.componentType
+ </property>
+ <property name="osgi.remote.configuration.sca.reference">
+ divideService
+ </property>
+ </service-description>
</service-descriptions> \ No newline at end of file
diff --git a/java/sca/samples/dosgi-calculator/OSGI-INF/sca/bundle.componentType b/java/sca/samples/dosgi-calculator/OSGI-INF/sca/bundle.componentType
index 92b0ac7bf9..769bcdd14d 100644
--- a/java/sca/samples/dosgi-calculator/OSGI-INF/sca/bundle.componentType
+++ b/java/sca/samples/dosgi-calculator/OSGI-INF/sca/bundle.componentType
@@ -1,54 +1,54 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1">
- <!-- The service elment defines an SCA view of the OSGi service -->
- <service name="CalculatorService">
- <!-- The interface will be mapped into the OSGi service class -->
- <interface.java interface="calculator.dosgi.CalculatorService"/>
- <!-- The list of OSGi properties -->
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </service>
-
- <!-- The reference elment defines an SCA proxy to a remote OSGi service -->
- <reference name="addService">
- <interface.java interface="calculator.dosgi.operations.AddService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </reference>
- <reference name="subtractService">
- <interface.java interface="calculator.dosgi.operations.SubtractService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </reference>
- <reference name="multiplyService">
- <interface.java interface="calculator.dosgi.operations.MultiplyService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </reference>
- <reference name="divideService">
- <interface.java interface="calculator.dosgi.operations.DivideService"/>
- <t:osgi.property name="prop1">1</t:osgi.property>
- <t:osgi.property name="prop2">ABC</t:osgi.property>
- </reference>
-
-</componentType>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<componentType xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1">
+ <!-- The service elment defines an SCA view of the OSGi service -->
+ <service name="CalculatorService">
+ <!-- The interface will be mapped into the OSGi service class -->
+ <interface.java interface="calculator.dosgi.CalculatorService"/>
+ <!-- The list of OSGi properties -->
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </service>
+
+ <!-- The reference elment defines an SCA proxy to a remote OSGi service -->
+ <reference name="addService">
+ <interface.java interface="calculator.dosgi.operations.AddService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </reference>
+ <reference name="subtractService">
+ <interface.java interface="calculator.dosgi.operations.SubtractService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </reference>
+ <reference name="multiplyService">
+ <interface.java interface="calculator.dosgi.operations.MultiplyService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </reference>
+ <reference name="divideService">
+ <interface.java interface="calculator.dosgi.operations.DivideService"/>
+ <t:osgi.property name="prop1">1</t:osgi.property>
+ <t:osgi.property name="prop2">ABC</t:osgi.property>
+ </reference>
+
+</componentType>
diff --git a/java/sca/samples/dosgi-calculator/OSGI-INF/sca/bundle.composite b/java/sca/samples/dosgi-calculator/OSGI-INF/sca/bundle.composite
index 7109300293..2bcd44e970 100644
--- a/java/sca/samples/dosgi-calculator/OSGI-INF/sca/bundle.composite
+++ b/java/sca/samples/dosgi-calculator/OSGI-INF/sca/bundle.composite
@@ -1,56 +1,56 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://calculator.dosgi"
- name="CalculatorComposite">
-
- <component name="CalculatorComponent">
- <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi" bundleVersion="1.0.0" />
- <service name="CalculatorService">
- <binding.ws uri="http://localhost:8086/CalculatorService"/>
- </service>
- <reference name="addService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/>
- </reference>
- <reference name="subtractService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/>
- </reference>
- <reference name="multiplyService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/>
- </reference>
- <reference name="divideService">
- <tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/>
- </reference>
-
- <!--
- <reference name="addService" target="OperationsComponent/AddService">
- </reference>
- <reference name="subtractService" target="OperationsComponent/SubtractService">
- </reference>
- <reference name="multiplyService" target="OperationsComponent/MultiplyService">
- </reference>
- <reference name="divideService" target="OperationsComponent/DivideService">
- </reference>
- -->
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://calculator.dosgi"
+ name="CalculatorComposite">
+
+ <component name="CalculatorComponent">
+ <tuscany:implementation.osgi bundleSymbolicName="calculator.dosgi" bundleVersion="1.0.0" />
+ <service name="CalculatorService">
+ <binding.ws uri="http://localhost:8086/CalculatorService"/>
+ </service>
+ <reference name="addService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/AddService"/>
+ </reference>
+ <reference name="subtractService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/SubtractService"/>
+ </reference>
+ <reference name="multiplyService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/MultiplyService"/>
+ </reference>
+ <reference name="divideService">
+ <tuscany:binding.rmi uri="rmi://localhost:8085/DivideService"/>
+ </reference>
+
+ <!--
+ <reference name="addService" target="OperationsComponent/AddService">
+ </reference>
+ <reference name="subtractService" target="OperationsComponent/SubtractService">
+ </reference>
+ <reference name="multiplyService" target="OperationsComponent/MultiplyService">
+ </reference>
+ <reference name="divideService" target="OperationsComponent/DivideService">
+ </reference>
+ -->
+ </component>
+
+</composite>
diff --git a/java/sca/samples/dosgi-calculator/pom.xml b/java/sca/samples/dosgi-calculator/pom.xml
index 115dd15003..79523d0c24 100644
--- a/java/sca/samples/dosgi-calculator/pom.xml
+++ b/java/sca/samples/dosgi-calculator/pom.xml
@@ -1,139 +1,139 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-dosgi-calculator</artifactId>
- <name>Apache Tuscany SCA Distributed OSGi (RFC 119) Caculator Sample</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-ejava</artifactId>
- <version>2.0-SNAPSHOT</version>
- <type>pom</type>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-feature-webservice</artifactId>
- <version>2.0-SNAPSHOT</version>
- <type>pom</type>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-launcher-equinox</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl-osgi</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.osgi</groupId>
- <artifactId>services</artifactId>
- <version>3.2.0-v20090520-1800</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- <!-- Equinox Declarative Services -->
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>ds</artifactId>
- <version>1.1.0-v20090601</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>util</artifactId>
- <version>1.0.100-v20090520-1800</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- <plugins>
- <plugin>
- <artifactId>maven-eclipse-plugin</artifactId>
- <version>2.5.1</version>
- <configuration>
- <buildcommands>
- <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
- <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
- </buildcommands>
- <projectnatures>
- <projectnature>org.eclipse.jdt.core.javanature</projectnature>
- <projectnature>org.eclipse.pde.PluginNature</projectnature>
- </projectnatures>
- <classpathContainers>
- <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
- </classpathContainer>
- </classpathContainers>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
- </archive>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.tuscany.maven.plugins</groupId>
- <artifactId>maven-osgi-junit-plugin</artifactId>
- <version>1.0-SNAPSHOT</version>
- <executions>
- <execution>
- <id>osgi-test</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration></configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-dosgi-calculator</artifactId>
+ <name>Apache Tuscany SCA Distributed OSGi (RFC 119) Caculator Sample</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-ejava</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>pom</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-feature-webservice</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <type>pom</type>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-launcher-equinox</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl-osgi</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.osgi</groupId>
+ <artifactId>services</artifactId>
+ <version>3.2.0-v20090520-1800</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Equinox Declarative Services -->
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>ds</artifactId>
+ <version>1.1.0-v20090601</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.equinox</groupId>
+ <artifactId>util</artifactId>
+ <version>1.0.100-v20090520-1800</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.5.1</version>
+ <configuration>
+ <buildcommands>
+ <buildcommand>org.eclipse.pde.ManifestBuilder</buildcommand>
+ <buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
+ </buildcommands>
+ <projectnatures>
+ <projectnature>org.eclipse.jdt.core.javanature</projectnature>
+ <projectnature>org.eclipse.pde.PluginNature</projectnature>
+ </projectnatures>
+ <classpathContainers>
+ <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER
+ </classpathContainer>
+ </classpathContainers>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.tuscany.maven.plugins</groupId>
+ <artifactId>maven-osgi-junit-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>osgi-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration></configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java
index 796b1afe61..cc562b7c2f 100644
--- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java
+++ b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java
@@ -1,36 +1,36 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator.dosgi;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The Calculator service interface.
- */
-@Remotable
-public interface CalculatorService {
-
- double add(double n1, double n2);
-
- double subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The Calculator service interface.
+ */
+@Remotable
+public interface CalculatorService {
+
+ double add(double n1, double n2);
+
+ double subtract(double n1, double n2);
+
+ double multiply(double n1, double n2);
+
+ double divide(double n1, double n2);
+}
diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java
index e484dc3e0b..40388144ee 100644
--- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java
+++ b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java
@@ -1,78 +1,78 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.impl;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.logging.Logger;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.packageadmin.PackageAdmin;
-
-import calculator.dosgi.CalculatorService;
-import calculator.dosgi.operations.AddService;
-
-/**
- *
- */
-public class CalculatorActivator implements BundleActivator {
- private Logger logger = Logger.getLogger(CalculatorActivator.class.getName());
-
- private Bundle getBundle(BundleContext bundleContext, Class<?> cls) {
- PackageAdmin packageAdmin = null;
- // PackageAdmin is used to resolve bundles
- ServiceReference ref = bundleContext.getServiceReference("org.osgi.service.packageadmin.PackageAdmin");
- if (ref != null) {
- packageAdmin = (PackageAdmin)bundleContext.getService(ref);
- Bundle bundle = packageAdmin.getBundle(cls);
- if (bundle != null) {
- logger.info(cls.getName() + " is loaded by bundle: " + bundle.getSymbolicName());
- }
- bundleContext.ungetService(ref);
- return bundle;
- }
- return null;
- }
-
- public void start(BundleContext context) throws Exception {
- logger.info("Starting " + context.getBundle());
- Dictionary<String, Object> props = new Hashtable<String, Object>();
- props.put("sca.service", "CalculatorComponent#service-name(Calculator)");
- props.put("calculator", "Calculator");
- props.put("service.exported.configs", new String[] {"sca"});
- props.put("sca.bindings", new String[] {"OSGI-INF/sca/calculator-service.bindings"});
- props.put("service.exported.interfaces", new String[] {"*"});
- logger.info("Registering " + CalculatorService.class.getName());
- CalculatorService calculator = new CalculatorServiceImpl(context);
- context.registerService(CalculatorService.class.getName(), calculator, props);
-
- getBundle(context, AddService.class);
-
- }
-
- public void stop(BundleContext context) throws Exception {
- logger.info("Stopping " + context.getBundle());
- // Registered services will be automatically unregistered
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.impl;
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.logging.Logger;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+import calculator.dosgi.CalculatorService;
+import calculator.dosgi.operations.AddService;
+
+/**
+ *
+ */
+public class CalculatorActivator implements BundleActivator {
+ private Logger logger = Logger.getLogger(CalculatorActivator.class.getName());
+
+ private Bundle getBundle(BundleContext bundleContext, Class<?> cls) {
+ PackageAdmin packageAdmin = null;
+ // PackageAdmin is used to resolve bundles
+ ServiceReference ref = bundleContext.getServiceReference("org.osgi.service.packageadmin.PackageAdmin");
+ if (ref != null) {
+ packageAdmin = (PackageAdmin)bundleContext.getService(ref);
+ Bundle bundle = packageAdmin.getBundle(cls);
+ if (bundle != null) {
+ logger.info(cls.getName() + " is loaded by bundle: " + bundle.getSymbolicName());
+ }
+ bundleContext.ungetService(ref);
+ return bundle;
+ }
+ return null;
+ }
+
+ public void start(BundleContext context) throws Exception {
+ logger.info("Starting " + context.getBundle());
+ Dictionary<String, Object> props = new Hashtable<String, Object>();
+ props.put("sca.service", "CalculatorComponent#service-name(Calculator)");
+ props.put("calculator", "Calculator");
+ props.put("service.exported.configs", new String[] {"sca"});
+ props.put("sca.bindings", new String[] {"OSGI-INF/sca/calculator-service.bindings"});
+ props.put("service.exported.interfaces", new String[] {"*"});
+ logger.info("Registering " + CalculatorService.class.getName());
+ CalculatorService calculator = new CalculatorServiceImpl(context);
+ context.registerService(CalculatorService.class.getName(), calculator, props);
+
+ getBundle(context, AddService.class);
+
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ logger.info("Stopping " + context.getBundle());
+ // Registered services will be automatically unregistered
+ }
+
+}
diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java
index 9c80c5beb9..5f9db16ca9 100644
--- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java
+++ b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java
@@ -1,114 +1,114 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.impl;
-
-import org.osgi.service.component.ComponentContext;
-
-import calculator.dosgi.CalculatorService;
-import calculator.dosgi.operations.AddService;
-import calculator.dosgi.operations.DivideService;
-import calculator.dosgi.operations.MultiplyService;
-import calculator.dosgi.operations.SubtractService;
-
-/**
- * An implementation of the Calculator service.
- */
-public class CalculatorServiceDSImpl implements CalculatorService {
- private AddService addService;
- private SubtractService subtractService;
- private MultiplyService multiplyService;
- private DivideService divideService;
-
- public CalculatorServiceDSImpl() {
- super();
- System.out.println("CalculatorServiceDSImpl()");
- }
-
- protected void activate(ComponentContext context) {
- System.out.println("Activating " + context);
- }
-
- protected void deactivate(ComponentContext context) {
- System.out.println("Deactivating " + context);
- }
-
- /*
- * The following setters can be used for DS injection
- */
- public void setAddService(AddService addService) {
- System.out.println("setAddService()");
- this.addService = addService;
- }
-
- public void setSubtractService(SubtractService subtractService) {
- this.subtractService = subtractService;
- }
-
- public void setDivideService(DivideService divideService) {
- this.divideService = divideService;
- }
-
- public void setMultiplyService(MultiplyService multiplyService) {
- this.multiplyService = multiplyService;
- }
-
- /*
- * The following setters can be used for DS injection
- */
- public void unsetAddService(AddService addService) {
- System.out.println("unsetAddService()");
- this.addService = null;
- }
-
- public void unsetSubtractService(SubtractService subtractService) {
- this.subtractService = null;
- }
-
- public void unsetDivideService(DivideService divideService) {
- this.divideService = null;
- }
-
- public void unsetMultiplyService(MultiplyService multiplyService) {
- this.multiplyService = null;
- }
- private <T> T getService(Class<T> cls) {
- for (Object s : new Object[] {addService, subtractService, multiplyService, divideService}) {
- if (cls.isInstance(s)) {
- return cls.cast(s);
- }
- }
- throw new IllegalStateException(cls.getSimpleName() + " is not available");
- }
-
- public double add(double n1, double n2) {
- return getService(AddService.class).add(n1, n2);
- }
-
- public double subtract(double n1, double n2) {
- return getService(SubtractService.class).subtract(n1, n2);
- }
-
- public double multiply(double n1, double n2) {
- return getService(MultiplyService.class).multiply(n1, n2);
- }
-
- public double divide(double n1, double n2) {
- return getService(DivideService.class).divide(n1, n2);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.impl;
+
+import org.osgi.service.component.ComponentContext;
+
+import calculator.dosgi.CalculatorService;
+import calculator.dosgi.operations.AddService;
+import calculator.dosgi.operations.DivideService;
+import calculator.dosgi.operations.MultiplyService;
+import calculator.dosgi.operations.SubtractService;
+
+/**
+ * An implementation of the Calculator service.
+ */
+public class CalculatorServiceDSImpl implements CalculatorService {
+ private AddService addService;
+ private SubtractService subtractService;
+ private MultiplyService multiplyService;
+ private DivideService divideService;
+
+ public CalculatorServiceDSImpl() {
+ super();
+ System.out.println("CalculatorServiceDSImpl()");
+ }
+
+ protected void activate(ComponentContext context) {
+ System.out.println("Activating " + context);
+ }
+
+ protected void deactivate(ComponentContext context) {
+ System.out.println("Deactivating " + context);
+ }
+
+ /*
+ * The following setters can be used for DS injection
+ */
+ public void setAddService(AddService addService) {
+ System.out.println("setAddService()");
+ this.addService = addService;
+ }
+
+ public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ public void setDivideService(DivideService divideService) {
+ this.divideService = divideService;
+ }
+
+ public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ /*
+ * The following setters can be used for DS injection
+ */
+ public void unsetAddService(AddService addService) {
+ System.out.println("unsetAddService()");
+ this.addService = null;
+ }
+
+ public void unsetSubtractService(SubtractService subtractService) {
+ this.subtractService = null;
+ }
+
+ public void unsetDivideService(DivideService divideService) {
+ this.divideService = null;
+ }
+
+ public void unsetMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = null;
+ }
+ private <T> T getService(Class<T> cls) {
+ for (Object s : new Object[] {addService, subtractService, multiplyService, divideService}) {
+ if (cls.isInstance(s)) {
+ return cls.cast(s);
+ }
+ }
+ throw new IllegalStateException(cls.getSimpleName() + " is not available");
+ }
+
+ public double add(double n1, double n2) {
+ return getService(AddService.class).add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ return getService(SubtractService.class).subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ return getService(MultiplyService.class).multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return getService(DivideService.class).divide(n1, n2);
+ }
+}
diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java
index 276bcdc76f..932c5fcf15 100644
--- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java
+++ b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java
@@ -1,98 +1,98 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.impl;
-
-import static org.osgi.framework.Constants.OBJECTCLASS;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Filter;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.util.tracker.ServiceTracker;
-
-import calculator.dosgi.CalculatorService;
-import calculator.dosgi.operations.AddService;
-import calculator.dosgi.operations.DivideService;
-import calculator.dosgi.operations.MultiplyService;
-import calculator.dosgi.operations.SubtractService;
-
-/**
- * An implementation of the Calculator service.
- */
-public class CalculatorServiceImpl implements CalculatorService {
- private ServiceTracker remoteServices;
- private ServiceTracker localServices;
-
- public CalculatorServiceImpl() {
- super();
- }
-
- public CalculatorServiceImpl(BundleContext context) {
- super();
- Filter remoteFilter = null, localFilter = null;
- try {
- remoteFilter =
- context.createFilter("(&(" + OBJECTCLASS + "=calculator.dosgi.operations.*) (service.imported=*))");
- localFilter =
- context.createFilter("(&(" + OBJECTCLASS + "=calculator.dosgi.operations.*) (!(service.imported=*)))");
- } catch (InvalidSyntaxException e) {
- e.printStackTrace();
- }
- this.remoteServices = new ServiceTracker(context, remoteFilter, null);
- remoteServices.open();
- this.localServices = new ServiceTracker(context, localFilter, null);
- localServices.open();
- }
-
- private <T> T getService(Class<T> cls) {
- Object[] remoteObjects = remoteServices.getServices();
- if (remoteObjects != null) {
- for (Object s : remoteObjects) {
- if (cls.isInstance(s)) {
- System.out.println("Remote service: " + s);
- return cls.cast(s);
- }
- }
- }
- Object[] localObjects = localServices.getServices();
- if (localObjects != null)
- for (Object s : localObjects) {
- if (cls.isInstance(s)) {
- System.out.println("Local service: " + s);
- return cls.cast(s);
- }
- }
- throw new IllegalStateException(cls.getSimpleName() + " is not available");
- }
-
- public double add(double n1, double n2) {
- return getService(AddService.class).add(n1, n2);
- }
-
- public double subtract(double n1, double n2) {
- return getService(SubtractService.class).subtract(n1, n2);
- }
-
- public double multiply(double n1, double n2) {
- return getService(MultiplyService.class).multiply(n1, n2);
- }
-
- public double divide(double n1, double n2) {
- return getService(DivideService.class).divide(n1, n2);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.impl;
+
+import static org.osgi.framework.Constants.OBJECTCLASS;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.util.tracker.ServiceTracker;
+
+import calculator.dosgi.CalculatorService;
+import calculator.dosgi.operations.AddService;
+import calculator.dosgi.operations.DivideService;
+import calculator.dosgi.operations.MultiplyService;
+import calculator.dosgi.operations.SubtractService;
+
+/**
+ * An implementation of the Calculator service.
+ */
+public class CalculatorServiceImpl implements CalculatorService {
+ private ServiceTracker remoteServices;
+ private ServiceTracker localServices;
+
+ public CalculatorServiceImpl() {
+ super();
+ }
+
+ public CalculatorServiceImpl(BundleContext context) {
+ super();
+ Filter remoteFilter = null, localFilter = null;
+ try {
+ remoteFilter =
+ context.createFilter("(&(" + OBJECTCLASS + "=calculator.dosgi.operations.*) (service.imported=*))");
+ localFilter =
+ context.createFilter("(&(" + OBJECTCLASS + "=calculator.dosgi.operations.*) (!(service.imported=*)))");
+ } catch (InvalidSyntaxException e) {
+ e.printStackTrace();
+ }
+ this.remoteServices = new ServiceTracker(context, remoteFilter, null);
+ remoteServices.open();
+ this.localServices = new ServiceTracker(context, localFilter, null);
+ localServices.open();
+ }
+
+ private <T> T getService(Class<T> cls) {
+ Object[] remoteObjects = remoteServices.getServices();
+ if (remoteObjects != null) {
+ for (Object s : remoteObjects) {
+ if (cls.isInstance(s)) {
+ System.out.println("Remote service: " + s);
+ return cls.cast(s);
+ }
+ }
+ }
+ Object[] localObjects = localServices.getServices();
+ if (localObjects != null)
+ for (Object s : localObjects) {
+ if (cls.isInstance(s)) {
+ System.out.println("Local service: " + s);
+ return cls.cast(s);
+ }
+ }
+ throw new IllegalStateException(cls.getSimpleName() + " is not available");
+ }
+
+ public double add(double n1, double n2) {
+ return getService(AddService.class).add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ return getService(SubtractService.class).subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ return getService(MultiplyService.class).multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ return getService(DivideService.class).divide(n1, n2);
+ }
+}
diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java
index 7d68dbd5c5..971500782f 100644
--- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java
+++ b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java
@@ -1,31 +1,31 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for the add service
- */
-@Remotable
-public interface AddService {
-
- double add(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The interface for the add service
+ */
+@Remotable
+public interface AddService {
+
+ double add(double n1, double n2);
+
+}
diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java
index 998f6e9554..49b8a1c0bf 100644
--- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java
+++ b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java
@@ -1,31 +1,31 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for the divide service
- */
-@Remotable
-public interface DivideService {
-
- double divide(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The interface for the divide service
+ */
+@Remotable
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java
index 7ed6db2e6b..f4e59d12ea 100644
--- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java
+++ b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java
@@ -1,31 +1,31 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for the multiply service
- */
-@Remotable
-public interface MultiplyService {
-
- double multiply(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The interface for the multiply service
+ */
+@Remotable
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java
index cb98b8fb67..bfb9b820f7 100644
--- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java
+++ b/java/sca/samples/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java
@@ -1,31 +1,31 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-/**
- * The interface for the subtract service
- */
-@Remotable
-public interface SubtractService {
-
- double subtract(double n1, double n2);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.operations;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * The interface for the subtract service
+ */
+@Remotable
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java
index 1a3e36f571..a4fc52694e 100644
--- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java
+++ b/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java
@@ -1,93 +1,93 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.rmi;
-
-import java.io.Serializable;
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-import java.rmi.server.UnicastRemoteObject;
-
-/**
- *
- */
-public class OperationsRMIServer implements OperationsRemote, Serializable {
-
- private static final long serialVersionUID = 6081008315263103012L;
- private transient Registry registry;
-
- public OperationsRMIServer() throws RemoteException {
- super();
- }
-
- public double add(double n1, double n2) {
- return n1 + n2;
- }
-
- public double subtract(double n1, double n2) {
- return n1 - n2;
- }
-
- public double divide(double n1, double n2) {
- return n1 / n2;
- }
-
- public double multiply(double n1, double n2) {
- return n1 * n2;
- }
-
- public void start() throws RemoteException {
- Thread thread = new Thread() {
- public void run() {
- try {
- System.out.println("Starting the RMI server for calculator operations...");
- Remote stub = UnicastRemoteObject.exportObject(OperationsRMIServer.this);
- registry = LocateRegistry.createRegistry(8085);
- registry.bind("AddService", stub);
- registry.bind("SubtractService", stub);
- registry.bind("MultiplyService", stub);
- registry.bind("DivideService", stub);
- System.out.println("RMI server for calculator operations is now started.");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- };
- thread.start();
- }
-
- public void stop() {
- if (registry != null) {
- try {
- registry.unbind("AddService");
- registry.unbind("SubtractService");
- registry.unbind("MultiplyService");
- registry.unbind("DivideService");
- UnicastRemoteObject.unexportObject(this, false);
- UnicastRemoteObject.unexportObject(registry, false);
- registry = null;
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.rmi;
+
+import java.io.Serializable;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.rmi.registry.LocateRegistry;
+import java.rmi.registry.Registry;
+import java.rmi.server.UnicastRemoteObject;
+
+/**
+ *
+ */
+public class OperationsRMIServer implements OperationsRemote, Serializable {
+
+ private static final long serialVersionUID = 6081008315263103012L;
+ private transient Registry registry;
+
+ public OperationsRMIServer() throws RemoteException {
+ super();
+ }
+
+ public double add(double n1, double n2) {
+ return n1 + n2;
+ }
+
+ public double subtract(double n1, double n2) {
+ return n1 - n2;
+ }
+
+ public double divide(double n1, double n2) {
+ return n1 / n2;
+ }
+
+ public double multiply(double n1, double n2) {
+ return n1 * n2;
+ }
+
+ public void start() throws RemoteException {
+ Thread thread = new Thread() {
+ public void run() {
+ try {
+ System.out.println("Starting the RMI server for calculator operations...");
+ Remote stub = UnicastRemoteObject.exportObject(OperationsRMIServer.this);
+ registry = LocateRegistry.createRegistry(8085);
+ registry.bind("AddService", stub);
+ registry.bind("SubtractService", stub);
+ registry.bind("MultiplyService", stub);
+ registry.bind("DivideService", stub);
+ System.out.println("RMI server for calculator operations is now started.");
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ };
+ thread.start();
+ }
+
+ public void stop() {
+ if (registry != null) {
+ try {
+ registry.unbind("AddService");
+ registry.unbind("SubtractService");
+ registry.unbind("MultiplyService");
+ registry.unbind("DivideService");
+ UnicastRemoteObject.unexportObject(this, false);
+ UnicastRemoteObject.unexportObject(registry, false);
+ registry = null;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+}
diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java
index d573f6b8fa..a813dfb6f3 100644
--- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java
+++ b/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java
@@ -1,132 +1,132 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-// Stub class generated by rmic, do not edit.
-// Contents subject to change without notice.
-package calculator.rmi;
-
-public final class OperationsRMIServer_Stub extends java.rmi.server.RemoteStub implements calculator.rmi.OperationsRemote {
- private static final long serialVersionUID = 2;
-
- private static java.lang.reflect.Method $method_add_0;
- private static java.lang.reflect.Method $method_divide_1;
- private static java.lang.reflect.Method $method_multiply_2;
- private static java.lang.reflect.Method $method_subtract_3;
-
- static {
- try {
- $method_add_0 =
- calculator.rmi.OperationsRemote.class.getMethod("add", new java.lang.Class[] {double.class, double.class});
- $method_divide_1 =
- calculator.rmi.OperationsRemote.class.getMethod("divide",
- new java.lang.Class[] {double.class, double.class});
- $method_multiply_2 =
- calculator.rmi.OperationsRemote.class.getMethod("multiply", new java.lang.Class[] {double.class,
- double.class});
- $method_subtract_3 =
- calculator.rmi.OperationsRemote.class.getMethod("subtract", new java.lang.Class[] {double.class,
- double.class});
- } catch (java.lang.NoSuchMethodException e) {
- throw new java.lang.NoSuchMethodError("stub class initialization failed");
- }
- }
-
- // constructors
- public OperationsRMIServer_Stub(java.rmi.server.RemoteRef ref) {
- super(ref);
- }
-
- // methods from remote interfaces
-
- // implementation of add(double, double)
- public double add(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException {
- try {
- Object $result =
- ref.invoke(this,
- $method_add_0,
- new java.lang.Object[] {new java.lang.Double($param_double_1),
- new java.lang.Double($param_double_2)},
- 864055858262779977L);
- return ((java.lang.Double)$result).doubleValue();
- } catch (java.lang.RuntimeException e) {
- throw e;
- } catch (java.rmi.RemoteException e) {
- throw e;
- } catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
- // implementation of divide(double, double)
- public double divide(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException {
- try {
- Object $result =
- ref.invoke(this,
- $method_divide_1,
- new java.lang.Object[] {new java.lang.Double($param_double_1),
- new java.lang.Double($param_double_2)},
- 8097593626497421928L);
- return ((java.lang.Double)$result).doubleValue();
- } catch (java.lang.RuntimeException e) {
- throw e;
- } catch (java.rmi.RemoteException e) {
- throw e;
- } catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
- // implementation of multiply(double, double)
- public double multiply(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException {
- try {
- Object $result =
- ref.invoke(this,
- $method_multiply_2,
- new java.lang.Object[] {new java.lang.Double($param_double_1),
- new java.lang.Double($param_double_2)},
- -346155016949350695L);
- return ((java.lang.Double)$result).doubleValue();
- } catch (java.lang.RuntimeException e) {
- throw e;
- } catch (java.rmi.RemoteException e) {
- throw e;
- } catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
- // implementation of subtract(double, double)
- public double subtract(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException {
- try {
- Object $result =
- ref.invoke(this,
- $method_subtract_3,
- new java.lang.Object[] {new java.lang.Double($param_double_1),
- new java.lang.Double($param_double_2)},
- -610707357620578750L);
- return ((java.lang.Double)$result).doubleValue();
- } catch (java.lang.RuntimeException e) {
- throw e;
- } catch (java.rmi.RemoteException e) {
- throw e;
- } catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Stub class generated by rmic, do not edit.
+// Contents subject to change without notice.
+package calculator.rmi;
+
+public final class OperationsRMIServer_Stub extends java.rmi.server.RemoteStub implements calculator.rmi.OperationsRemote {
+ private static final long serialVersionUID = 2;
+
+ private static java.lang.reflect.Method $method_add_0;
+ private static java.lang.reflect.Method $method_divide_1;
+ private static java.lang.reflect.Method $method_multiply_2;
+ private static java.lang.reflect.Method $method_subtract_3;
+
+ static {
+ try {
+ $method_add_0 =
+ calculator.rmi.OperationsRemote.class.getMethod("add", new java.lang.Class[] {double.class, double.class});
+ $method_divide_1 =
+ calculator.rmi.OperationsRemote.class.getMethod("divide",
+ new java.lang.Class[] {double.class, double.class});
+ $method_multiply_2 =
+ calculator.rmi.OperationsRemote.class.getMethod("multiply", new java.lang.Class[] {double.class,
+ double.class});
+ $method_subtract_3 =
+ calculator.rmi.OperationsRemote.class.getMethod("subtract", new java.lang.Class[] {double.class,
+ double.class});
+ } catch (java.lang.NoSuchMethodException e) {
+ throw new java.lang.NoSuchMethodError("stub class initialization failed");
+ }
+ }
+
+ // constructors
+ public OperationsRMIServer_Stub(java.rmi.server.RemoteRef ref) {
+ super(ref);
+ }
+
+ // methods from remote interfaces
+
+ // implementation of add(double, double)
+ public double add(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException {
+ try {
+ Object $result =
+ ref.invoke(this,
+ $method_add_0,
+ new java.lang.Object[] {new java.lang.Double($param_double_1),
+ new java.lang.Double($param_double_2)},
+ 864055858262779977L);
+ return ((java.lang.Double)$result).doubleValue();
+ } catch (java.lang.RuntimeException e) {
+ throw e;
+ } catch (java.rmi.RemoteException e) {
+ throw e;
+ } catch (java.lang.Exception e) {
+ throw new java.rmi.UnexpectedException("undeclared checked exception", e);
+ }
+ }
+
+ // implementation of divide(double, double)
+ public double divide(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException {
+ try {
+ Object $result =
+ ref.invoke(this,
+ $method_divide_1,
+ new java.lang.Object[] {new java.lang.Double($param_double_1),
+ new java.lang.Double($param_double_2)},
+ 8097593626497421928L);
+ return ((java.lang.Double)$result).doubleValue();
+ } catch (java.lang.RuntimeException e) {
+ throw e;
+ } catch (java.rmi.RemoteException e) {
+ throw e;
+ } catch (java.lang.Exception e) {
+ throw new java.rmi.UnexpectedException("undeclared checked exception", e);
+ }
+ }
+
+ // implementation of multiply(double, double)
+ public double multiply(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException {
+ try {
+ Object $result =
+ ref.invoke(this,
+ $method_multiply_2,
+ new java.lang.Object[] {new java.lang.Double($param_double_1),
+ new java.lang.Double($param_double_2)},
+ -346155016949350695L);
+ return ((java.lang.Double)$result).doubleValue();
+ } catch (java.lang.RuntimeException e) {
+ throw e;
+ } catch (java.rmi.RemoteException e) {
+ throw e;
+ } catch (java.lang.Exception e) {
+ throw new java.rmi.UnexpectedException("undeclared checked exception", e);
+ }
+ }
+
+ // implementation of subtract(double, double)
+ public double subtract(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException {
+ try {
+ Object $result =
+ ref.invoke(this,
+ $method_subtract_3,
+ new java.lang.Object[] {new java.lang.Double($param_double_1),
+ new java.lang.Double($param_double_2)},
+ -610707357620578750L);
+ return ((java.lang.Double)$result).doubleValue();
+ } catch (java.lang.RuntimeException e) {
+ throw e;
+ } catch (java.rmi.RemoteException e) {
+ throw e;
+ } catch (java.lang.Exception e) {
+ throw new java.rmi.UnexpectedException("undeclared checked exception", e);
+ }
+ }
+}
diff --git a/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java b/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java
index d735ce8172..955e386ad8 100644
--- a/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java
+++ b/java/sca/samples/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java
@@ -1,37 +1,37 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package calculator.rmi;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-/**
- * RMI Remote interface
- */
-public interface OperationsRemote extends Remote {
- double add(double n1, double n2) throws RemoteException;
-
- double subtract(double n1, double n2) throws RemoteException;
-
- double multiply(double n1, double n2) throws RemoteException;
-
- double divide(double n1, double n2) throws RemoteException;
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.rmi;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * RMI Remote interface
+ */
+public interface OperationsRemote extends Remote {
+ double add(double n1, double n2) throws RemoteException;
+
+ double subtract(double n1, double n2) throws RemoteException;
+
+ double multiply(double n1, double n2) throws RemoteException;
+
+ double divide(double n1, double n2) throws RemoteException;
+
+}
diff --git a/java/sca/samples/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml b/java/sca/samples/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml
index 8ba4b85247..b14b3516f6 100644
--- a/java/sca/samples/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml
+++ b/java/sca/samples/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml
@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
--->
-
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:c="http://calculator.dosgi">
- <deployable composite="c:CalculatorComposite" />
-</contribution>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+-->
+
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:c="http://calculator.dosgi">
+ <deployable composite="c:CalculatorComposite" />
+</contribution>
diff --git a/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java b/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java
index 7f96067764..565a314d85 100644
--- a/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java
+++ b/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java
@@ -1,43 +1,43 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.test;
-
-import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher;
-
-/**
- *
- */
-public class CalculatorNode {
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- if (args.length == 0) {
- args = new String[] {"-bundles"};
- }
- try {
- NodeLauncher.main(args);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.test;
+
+import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher;
+
+/**
+ *
+ */
+public class CalculatorNode {
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ if (args.length == 0) {
+ args = new String[] {"-bundles"};
+ }
+ try {
+ NodeLauncher.main(args);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java b/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
index d4bede0d98..4dd713ecef 100644
--- a/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
+++ b/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java
@@ -1,144 +1,144 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.test;
-
-import static calculator.dosgi.test.OSGiTestUtils.bundleStatus;
-
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.net.URL;
-
-import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-
-import calculator.dosgi.CalculatorService;
-import calculator.rmi.OperationsRMIServer;
-
-/**
- *
- */
-public class CalculatorOSGiNodeTestCase {
- private static EquinoxHost host;
- private static BundleContext context;
- private static Bundle calculatorBundle;
- private static OperationsRMIServer rmiServer;
-
- /**
- * @throws java.lang.Exception
- */
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- try {
- rmiServer = new OperationsRMIServer();
- rmiServer.start();
-
- host = new EquinoxHost();
- context = host.start();
-
- for (Bundle b : context.getBundles()) {
- System.out.println(b);
- if (b.getSymbolicName().equals("org.eclipse.equinox.ds") || b.getSymbolicName()
- .startsWith("org.apache.tuscany.sca.")) {
- try {
- if (b.getHeaders().get(Constants.FRAGMENT_HOST) == null) {
- // Start the non-fragment bundle
- b.start();
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- System.out.println(bundleStatus(b, false));
- }
- if ("calculator.dosgi".equals(b.getSymbolicName())) {
- calculatorBundle = b;
- }
- }
-
- if (calculatorBundle != null) {
- calculatorBundle.start();
- System.out.println(bundleStatus(calculatorBundle, false));
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- throw e;
- }
- }
-
- @Test
- public void testOSGi() {
- ServiceReference ref =
- calculatorBundle.getBundleContext().getServiceReference(CalculatorService.class.getName());
- Assert.assertNotNull(ref);
- Object service = context.getService(ref);
- Assert.assertNotNull(service);
- CalculatorService calculator = OSGiTestUtils.cast(service, CalculatorService.class);
- System.out.println("2.0 + 1.0 = " + calculator.add(2.0, 1.0));
- System.out.println("2.0 - 1.0 = " + calculator.subtract(2.0, 1.0));
- System.out.println("2.0 * 1.0 = " + calculator.multiply(2.0, 1.0));
- System.out.println("2.0 / 1.0 = " + calculator.divide(2.0, 1.0));
- }
-
- @Test
- /**
- * Test the Web service exposed by the Calculator
- */
- public void testWS() throws Exception {
- URL url = new URL("http://localhost:8086/CalculatorService?wsdl");
- InputStream is = url.openStream();
- Reader reader = new InputStreamReader(is);
- char[] content = new char[10240]; // 10k
- int len = 0;
- while (true) {
- int size = reader.read(content, len, content.length - len);
- if (size < 0) {
- break;
- }
- len += size;
- }
- Assert.assertTrue(len > 0);
- String str = new String(content, 0, len);
- System.out.println(str);
- Assert.assertTrue(str.indexOf("<wsdl:definitions") != -1);
- }
-
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- if (host != null) {
- host.stop();
- rmiServer.stop();
- host = null;
- rmiServer = null;
- context = null;
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.test;
+
+import static calculator.dosgi.test.OSGiTestUtils.bundleStatus;
+
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.net.URL;
+
+import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+
+import calculator.dosgi.CalculatorService;
+import calculator.rmi.OperationsRMIServer;
+
+/**
+ *
+ */
+public class CalculatorOSGiNodeTestCase {
+ private static EquinoxHost host;
+ private static BundleContext context;
+ private static Bundle calculatorBundle;
+ private static OperationsRMIServer rmiServer;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ try {
+ rmiServer = new OperationsRMIServer();
+ rmiServer.start();
+
+ host = new EquinoxHost();
+ context = host.start();
+
+ for (Bundle b : context.getBundles()) {
+ System.out.println(b);
+ if (b.getSymbolicName().equals("org.eclipse.equinox.ds") || b.getSymbolicName()
+ .startsWith("org.apache.tuscany.sca.")) {
+ try {
+ if (b.getHeaders().get(Constants.FRAGMENT_HOST) == null) {
+ // Start the non-fragment bundle
+ b.start();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ System.out.println(bundleStatus(b, false));
+ }
+ if ("calculator.dosgi".equals(b.getSymbolicName())) {
+ calculatorBundle = b;
+ }
+ }
+
+ if (calculatorBundle != null) {
+ calculatorBundle.start();
+ System.out.println(bundleStatus(calculatorBundle, false));
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw e;
+ }
+ }
+
+ @Test
+ public void testOSGi() {
+ ServiceReference ref =
+ calculatorBundle.getBundleContext().getServiceReference(CalculatorService.class.getName());
+ Assert.assertNotNull(ref);
+ Object service = context.getService(ref);
+ Assert.assertNotNull(service);
+ CalculatorService calculator = OSGiTestUtils.cast(service, CalculatorService.class);
+ System.out.println("2.0 + 1.0 = " + calculator.add(2.0, 1.0));
+ System.out.println("2.0 - 1.0 = " + calculator.subtract(2.0, 1.0));
+ System.out.println("2.0 * 1.0 = " + calculator.multiply(2.0, 1.0));
+ System.out.println("2.0 / 1.0 = " + calculator.divide(2.0, 1.0));
+ }
+
+ @Test
+ /**
+ * Test the Web service exposed by the Calculator
+ */
+ public void testWS() throws Exception {
+ URL url = new URL("http://localhost:8086/CalculatorService?wsdl");
+ InputStream is = url.openStream();
+ Reader reader = new InputStreamReader(is);
+ char[] content = new char[10240]; // 10k
+ int len = 0;
+ while (true) {
+ int size = reader.read(content, len, content.length - len);
+ if (size < 0) {
+ break;
+ }
+ len += size;
+ }
+ Assert.assertTrue(len > 0);
+ String str = new String(content, 0, len);
+ System.out.println(str);
+ Assert.assertTrue(str.indexOf("<wsdl:definitions") != -1);
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception {
+ if (host != null) {
+ host.stop();
+ rmiServer.stop();
+ host = null;
+ rmiServer = null;
+ context = null;
+ }
+ }
+
+}
diff --git a/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java b/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java
index 958e744b41..99e0da9f97 100644
--- a/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java
+++ b/java/sca/samples/dosgi-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java
@@ -1,105 +1,105 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.test;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-import org.osgi.framework.Bundle;
-
-/**
- *
- * Utility class to create OSGi bundles
- *
- * @version $Rev: 758877 $ $Date: 2009-03-26 14:51:19 -0700 (Thu, 26 Mar 2009) $
- */
-public class OSGiTestUtils {
- private static class InvocationHandlerImpl implements InvocationHandler {
- private Object instance;
-
- public InvocationHandlerImpl(Object instance) {
- super();
- this.instance = instance;
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- Method m = instance.getClass().getMethod(method.getName(), method.getParameterTypes());
- return m.invoke(instance, args);
- }
-
- }
-
- /**
- * Returns a string representation of the given bundle.
- *
- * @param b
- * @param verbose
- * @return
- */
- public static String bundleStatus(Bundle bundle, boolean verbose) {
- StringBuffer sb = new StringBuffer();
- sb.append(bundle.getBundleId()).append(" ").append(bundle.getSymbolicName());
- int s = bundle.getState();
- if ((s & Bundle.UNINSTALLED) != 0) {
- sb.append(" UNINSTALLED");
- }
- if ((s & Bundle.INSTALLED) != 0) {
- sb.append(" INSTALLED");
- }
- if ((s & Bundle.RESOLVED) != 0) {
- sb.append(" RESOLVED");
- }
- if ((s & Bundle.STARTING) != 0) {
- sb.append(" STARTING");
- }
- if ((s & Bundle.STOPPING) != 0) {
- sb.append(" STOPPING");
- }
- if ((s & Bundle.ACTIVE) != 0) {
- sb.append(" ACTIVE");
- }
-
- if (verbose) {
- sb.append(" ").append(bundle.getLocation());
- sb.append(" ").append(bundle.getHeaders());
- }
- return sb.toString();
- }
-
- /**
- * A utility to cast the object to the given interface. If the class for the object
- * is loaded by a different classloader, a proxy will be created.
- *
- * @param <T>
- * @param obj
- * @param cls
- * @return
- */
- public static <T> T cast(Object obj, Class<T> cls) {
- if (cls.isInstance(obj)) {
- return cls.cast(obj);
- } else {
- return cls.cast(Proxy.newProxyInstance(cls.getClassLoader(),
- new Class<?>[] {cls},
- new InvocationHandlerImpl(obj)));
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.dosgi.test;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import org.osgi.framework.Bundle;
+
+/**
+ *
+ * Utility class to create OSGi bundles
+ *
+ * @version $Rev$ $Date$
+ */
+public class OSGiTestUtils {
+ private static class InvocationHandlerImpl implements InvocationHandler {
+ private Object instance;
+
+ public InvocationHandlerImpl(Object instance) {
+ super();
+ this.instance = instance;
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ Method m = instance.getClass().getMethod(method.getName(), method.getParameterTypes());
+ return m.invoke(instance, args);
+ }
+
+ }
+
+ /**
+ * Returns a string representation of the given bundle.
+ *
+ * @param b
+ * @param verbose
+ * @return
+ */
+ public static String bundleStatus(Bundle bundle, boolean verbose) {
+ StringBuffer sb = new StringBuffer();
+ sb.append(bundle.getBundleId()).append(" ").append(bundle.getSymbolicName());
+ int s = bundle.getState();
+ if ((s & Bundle.UNINSTALLED) != 0) {
+ sb.append(" UNINSTALLED");
+ }
+ if ((s & Bundle.INSTALLED) != 0) {
+ sb.append(" INSTALLED");
+ }
+ if ((s & Bundle.RESOLVED) != 0) {
+ sb.append(" RESOLVED");
+ }
+ if ((s & Bundle.STARTING) != 0) {
+ sb.append(" STARTING");
+ }
+ if ((s & Bundle.STOPPING) != 0) {
+ sb.append(" STOPPING");
+ }
+ if ((s & Bundle.ACTIVE) != 0) {
+ sb.append(" ACTIVE");
+ }
+
+ if (verbose) {
+ sb.append(" ").append(bundle.getLocation());
+ sb.append(" ").append(bundle.getHeaders());
+ }
+ return sb.toString();
+ }
+
+ /**
+ * A utility to cast the object to the given interface. If the class for the object
+ * is loaded by a different classloader, a proxy will be created.
+ *
+ * @param <T>
+ * @param obj
+ * @param cls
+ * @return
+ */
+ public static <T> T cast(Object obj, Class<T> cls) {
+ if (cls.isInstance(obj)) {
+ return cls.cast(obj);
+ } else {
+ return cls.cast(Proxy.newProxyInstance(cls.getClassLoader(),
+ new Class<?>[] {cls},
+ new InvocationHandlerImpl(obj)));
+ }
+ }
+}
diff --git a/java/sca/samples/helloworld-bpel/src/main/java/helloworld/Hello.java b/java/sca/samples/helloworld-bpel/src/main/java/helloworld/Hello.java
index ae7be07be6..dbd3854d7c 100644
--- a/java/sca/samples/helloworld-bpel/src/main/java/helloworld/Hello.java
+++ b/java/sca/samples/helloworld-bpel/src/main/java/helloworld/Hello.java
@@ -1,29 +1,29 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package helloworld;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface Hello {
-
- String hello(String name);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES 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.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface Hello {
+
+ String hello(String name);
+
+}
diff --git a/java/sca/samples/helloworld-bpel/src/main/resources/META-INF/sca-contribution.xml b/java/sca/samples/helloworld-bpel/src/main/resources/META-INF/sca-contribution.xml
index 8378a15824..b95468acd8 100644
--- a/java/sca/samples/helloworld-bpel/src/main/resources/META-INF/sca-contribution.xml
+++ b/java/sca/samples/helloworld-bpel/src/main/resources/META-INF/sca-contribution.xml
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:sample="http://bpel">
- <deployable composite="sample:bpel"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:sample="http://bpel">
+ <deployable composite="sample:bpel"/>
</contribution> \ No newline at end of file
diff --git a/java/sca/samples/webapps/helloworld-bpel/src/main/java/sample/HelloworldService.java b/java/sca/samples/webapps/helloworld-bpel/src/main/java/sample/HelloworldService.java
index 27d7a2297a..c1a50d9be5 100644
--- a/java/sca/samples/webapps/helloworld-bpel/src/main/java/sample/HelloworldService.java
+++ b/java/sca/samples/webapps/helloworld-bpel/src/main/java/sample/HelloworldService.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface HelloworldService {
-
- String hello(String name);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface HelloworldService {
+
+ String hello(String name);
+
+}
diff --git a/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.wsdl b/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.wsdl
index 1cb338b283..46cf381577 100644
--- a/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.wsdl
+++ b/java/sca/samples/webapps/helloworld-bpel/src/main/resources/helloworld.wsdl
@@ -1,82 +1,82 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-
-<wsdl:definitions
- targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
- xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
-
- <wsdl:types>
- <schema elementFormDefault="qualified"
- targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
- xmlns="http://www.w3.org/2001/XMLSchema">
-
- <element name="hello">
- <complexType>
- <sequence>
- <element name="message" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
- </schema>
- </wsdl:types>
-
- <wsdl:message name="HelloMessage">
- <wsdl:part element="tns:hello" name="TestPart"/>
- </wsdl:message>
-
- <wsdl:portType name="HelloPortType">
- <wsdl:operation name="hello">
- <wsdl:input message="tns:HelloMessage" name="TestIn"/>
- <wsdl:output message="tns:HelloMessage" name="TestOut"/>
- </wsdl:operation>
- </wsdl:portType>
-
-
- <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
- <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <wsdl:operation name="hello">
- <wsdlsoap:operation soapAction=""/>
- <wsdl:input name="TestIn">
- <wsdlsoap:body use="literal"/>
- </wsdl:input>
- <wsdl:output name="TestOut">
- <wsdlsoap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
-
- <wsdl:service name="HelloService">
- <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
- <soap:address location="http://localhost:8085/ode/processes/helloWorld"/>
- </wsdl:port>
- </wsdl:service>
-
- <plnk:partnerLinkType name="HelloPartnerLinkType">
- <plnk:role name="me" portType="tns:HelloPortType"/>
- <plnk:role name="you" portType="tns:HelloPortType"/>
- </plnk:partnerLinkType>
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<wsdl:definitions
+ targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+ xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified"
+ targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <element name="hello">
+ <complexType>
+ <sequence>
+ <element name="message" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="HelloMessage">
+ <wsdl:part element="tns:hello" name="TestPart"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloPortType">
+ <wsdl:operation name="hello">
+ <wsdl:input message="tns:HelloMessage" name="TestIn"/>
+ <wsdl:output message="tns:HelloMessage" name="TestOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+
+ <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="hello">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="TestIn">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="TestOut">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="HelloService">
+ <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
+ <soap:address location="http://localhost:8085/ode/processes/helloWorld"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="HelloPartnerLinkType">
+ <plnk:role name="me" portType="tns:HelloPortType"/>
+ <plnk:role name="you" portType="tns:HelloPortType"/>
+ </plnk:partnerLinkType>
</wsdl:definitions> \ No newline at end of file
diff --git a/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.composite b/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.composite
index 85d12156d1..3ffe604ef7 100644
--- a/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.composite
+++ b/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.composite
@@ -1,37 +1,37 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:hns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
- targetNamespace="http://sample"
- name="helloworld-bpel">
-
- <component name="WebComponent">
- <implementation.web web-uri=""/>
- <reference name="service" target="HelloworldComponent">
- <interface.java interface="sample.HelloworldService"/>
- </reference>
- </component>
-
- <component name="HelloworldComponent">
- <implementation.bpel process="hns:HelloWorld"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:hns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
+ targetNamespace="http://sample"
+ name="helloworld-bpel">
+
+ <component name="WebComponent">
+ <implementation.web web-uri=""/>
+ <reference name="service" target="HelloworldComponent">
+ <interface.java interface="sample.HelloworldService"/>
+ </reference>
+ </component>
+
+ <component name="HelloworldComponent">
+ <implementation.bpel process="hns:HelloWorld"/>
+ </component>
+
+</composite>
diff --git a/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.xml
index cb3610367b..bf01a7b759 100644
--- a/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.xml
+++ b/java/sca/samples/webapps/helloworld-bpel/src/main/webapp/WEB-INF/web.xml
@@ -1,41 +1,41 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<web-app version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
-
- <display-name>helloworld-bpel</display-name>
-
- <filter>
- <filter-name>tuscany.helloworld-bpel</filter-name>
- <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>tuscany.helloworld-bpel</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
- <welcome-file-list id="WelcomeFileList">
- <welcome-file>hello.jsp</welcome-file>
- </welcome-file-list>
-
-</web-app>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
+
+ <display-name>helloworld-bpel</display-name>
+
+ <filter>
+ <filter-name>tuscany.helloworld-bpel</filter-name>
+ <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>tuscany.helloworld-bpel</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>hello.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>
diff --git a/java/sca/samples/webapps/helloworld-jsf/pom.xml b/java/sca/samples/webapps/helloworld-jsf/pom.xml
index c65586daa5..236501838e 100644
--- a/java/sca/samples/webapps/helloworld-jsf/pom.xml
+++ b/java/sca/samples/webapps/helloworld-jsf/pom.xml
@@ -1,62 +1,62 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>helloworld-jsf</artifactId>
- <name>Apache Tuscany SCA Sample Helloworld JSF</name>
- <packaging>war</packaging>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-myfaces</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>helloworld-jsf</artifactId>
+ <name>Apache Tuscany SCA Sample Helloworld JSF</name>
+ <packaging>war</packaging>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-myfaces</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
diff --git a/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloWorldController.java b/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloWorldController.java
index 931c1ad820..9c9f541997 100644
--- a/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloWorldController.java
+++ b/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloWorldController.java
@@ -1,56 +1,56 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-import org.oasisopen.sca.annotation.Reference;
-
-/**
- *
- */
-public class HelloWorldController {
-
- @Reference
- protected HelloworldService service;
-
- private String name;
-
- public HelloWorldController() {
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Method that is backed to a submit button of a form.
- */
- public String send() {
- if (service == null) {
- name = "reference not injected!";
- } else {
- name = service.sayHello(name);
- }
- return "success";
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+import org.oasisopen.sca.annotation.Reference;
+
+/**
+ *
+ */
+public class HelloWorldController {
+
+ @Reference
+ protected HelloworldService service;
+
+ private String name;
+
+ public HelloWorldController() {
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Method that is backed to a submit button of a form.
+ */
+ public String send() {
+ if (service == null) {
+ name = "reference not injected!";
+ } else {
+ name = service.sayHello(name);
+ }
+ return "success";
+ }
+
+}
diff --git a/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldService.java b/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldService.java
index 123774b936..53ff7a5ca1 100644
--- a/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldService.java
+++ b/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldService.java
@@ -1,25 +1,25 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-public interface HelloworldService {
-
- String sayHello(String name);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+public interface HelloworldService {
+
+ String sayHello(String name);
+
+}
diff --git a/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldServiceImpl.java b/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldServiceImpl.java
index 6db7e93188..23925d6c69 100644
--- a/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldServiceImpl.java
+++ b/java/sca/samples/webapps/helloworld-jsf/src/main/java/sample/HelloworldServiceImpl.java
@@ -1,27 +1,27 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-public class HelloworldServiceImpl implements HelloworldService {
-
- public String sayHello(String name) {
- return "Hello " + name;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+public class HelloworldServiceImpl implements HelloworldService {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/faces-config.xml b/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/faces-config.xml
index 3a51ed2623..99cee9faeb 100644
--- a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/faces-config.xml
+++ b/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/faces-config.xml
@@ -1,51 +1,51 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<faces-config version="1.2"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xi="http://www.w3.org/2001/XInclude"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
-
- <!-- managed beans of the simple hello world app -->
- <managed-bean>
- <managed-bean-name>helloWorld</managed-bean-name>
- <managed-bean-class>sample.HelloWorldController</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- </managed-bean>
-
- <!-- navigation rules for helloWorld.jsp -->
- <navigation-rule>
- <from-view-id>/helloWorld.jsp</from-view-id>
- <navigation-case>
- <from-outcome>success</from-outcome>
- <to-view-id>/page2.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
-
- <!-- navigation rules for page2.jsp -->
- <navigation-rule>
- <from-view-id>/page2.jsp</from-view-id>
- <navigation-case>
- <from-outcome>back</from-outcome>
- <to-view-id>/helloWorld.jsp</to-view-id>
- </navigation-case>
- </navigation-rule>
-
-</faces-config>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<faces-config version="1.2"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <!-- managed beans of the simple hello world app -->
+ <managed-bean>
+ <managed-bean-name>helloWorld</managed-bean-name>
+ <managed-bean-class>sample.HelloWorldController</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+
+ <!-- navigation rules for helloWorld.jsp -->
+ <navigation-rule>
+ <from-view-id>/helloWorld.jsp</from-view-id>
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/page2.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <!-- navigation rules for page2.jsp -->
+ <navigation-rule>
+ <from-view-id>/page2.jsp</from-view-id>
+ <navigation-case>
+ <from-outcome>back</from-outcome>
+ <to-view-id>/helloWorld.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+</faces-config>
diff --git a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.composite b/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.composite
index 56ed55b2d5..875d6aae9d 100644
--- a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.composite
+++ b/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.composite
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://samples"
- name="Helloworld">
-
- <component name="foo">
- <implementation.web web-uri=""/>
- <reference name="service" target="HelloworldComponent"/>
- </component>
-
- <component name="HelloworldComponent">
- <implementation.java class="sample.HelloworldServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://samples"
+ name="Helloworld">
+
+ <component name="foo">
+ <implementation.web web-uri=""/>
+ <reference name="service" target="HelloworldComponent"/>
+ </component>
+
+ <component name="HelloworldComponent">
+ <implementation.java class="sample.HelloworldServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.xml
index 41098def30..fecbd7c79b 100644
--- a/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.xml
+++ b/java/sca/samples/webapps/helloworld-jsf/src/main/webapp/WEB-INF/web.xml
@@ -1,191 +1,191 @@
-<?xml version="1.0"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
- version="2.4">
-
- <description>MyProject web.xml</description>
-
- <!-- The only web.xml change to the MyFaces Helloworld sample is to add
- the Tuscany listener and annotation processor context parameter -->
- <listener>
- <listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class>
- </listener>
- <context-param>
- <param-name>org.apache.myfaces.config.annotation.LifecycleProvider</param-name>
- <param-value>org.apache.tuscany.sca.myfaces.TuscanyAnnotationLifecycleProvider</param-value>
- </context-param>
-
- <!--optional: context-param>
- <description>Comma separated list of URIs of (additional) faces config files.
- (e.g. /WEB-INF/my-config.xml)
- See JSF 1.0 PRD2, 10.3.2
- Attention: You do not need to put /WEB-INF/faces-config.xml in here.
- </description>
- <param-name>javax.faces.CONFIG_FILES</param-name>
- <param-value>/WEB-INF/examples-config.xml</param-value>
- </context-param-->
- <context-param>
- <description>State saving method: "client" or "server" (= default)
- See JSF Specification 2.5.3</description>
- <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
- <param-value>client</param-value>
- </context-param>
- <context-param>
- <description>Only applicable if state saving method is "server" (= default).
- Defines the amount (default = 20) of the latest views are stored in session.</description>
- <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
- <param-value>20</param-value>
- </context-param>
- <context-param>
- <description>Only applicable if state saving method is "server" (= default).
- If true (default) the state will be serialized to a byte stream before it
- is written to the session.
- If false the state will not be serialized to a byte stream.</description>
- <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <description>Only applicable if state saving method is "server" (= default) and if
- org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (= default)
- If true (default) the serialized state will be compressed before it
- is written to the session. If false the state will not be compressed.</description>
- <param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <description>This parameter tells MyFaces if javascript code should be allowed in the
- rendered HTML output.
- If javascript is allowed, command_link anchors will have javascript code
- that submits the corresponding form.
- If javascript is not allowed, the state saving info and nested parameters
- will be added as url parameters.
- Default: "true"</description>
- <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
- <param-value>false</param-value>
- </context-param>
- <context-param>
- <description>If true, rendered HTML code will be formatted, so that it is "human readable".
- i.e. additional line separators and whitespace will be written, that do not
- influence the HTML code.
- Default: "true"</description>
- <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <description>If true, a javascript function will be rendered that is able to restore the
- former vertical scroll on every request. Convenient feature if you have pages
- with long lists and you do not want the browser page to always jump to the top
- if you trigger a link or button action that stays on the same page.
- Default: "false"</description>
- <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
- <param-value>true</param-value>
- </context-param>
-
- <context-param>
- <description>Used for encrypting view state. Only relevant for client side
- state saving. See MyFaces wiki/web site documentation for instructions
- on how to configure an application for diffenent encryption strengths.
- </description>
- <param-name>org.apache.myfaces.SECRET</param-name>
- <param-value>NzY1NDMyMTA=</param-value>
- </context-param>
-
- <context-param>
- <description>
- Validate managed beans, navigation rules and ensure that forms are not nested.
- </description>
- <param-name>org.apache.myfaces.VALIDATE</param-name>
- <param-value>true</param-value>
- </context-param>
-
- <context-param>
- <description>
- Treat readonly same as if disabled attribute was set for select elements.
- </description>
- <param-name>org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS</param-name>
- <param-value>true</param-value>
- </context-param>
-
- <context-param>
- <description>
- Use the defined class as the class which will be called when a resource is added to the
- ExtensionFilter handling. Using StreamingAddResource here helps with performance. If you want to add
- custom components and want to use the ExtensionFilter, you need to provide your custom implementation here.
- </description>
- <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
- <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
- </context-param>
-
- <context-param>
- <description>
- Virtual path in the URL which triggers loading of resources for the MyFaces extended components
- in the ExtensionFilter.
- </description>
- <param-name>org.apache.myfaces.RESOURCE_VIRTUAL_PATH</param-name>
- <param-value>/faces/myFacesExtensionResource</param-value>
- </context-param>
-
- <context-param>
- <description>
- Check if the extensions-filter has been properly configured.
- </description>
- <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
- <param-value>true</param-value>
- </context-param>
-
- <context-param>
- <description>
- Define partial state saving as true/false.
- </description>
- <param-name>javax.faces.PARTIAL_STATE_SAVING_METHOD</param-name>
- <param-value>false</param-value>
- </context-param>
-
- <!-- Listener, to allow Jetty serving MyFaces apps -->
- <listener>
- <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
- </listener>
-
- <!-- Faces Servlet -->
- <servlet>
- <servlet-name>Faces Servlet</servlet-name>
- <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
-
- <!-- Faces Servlet Mapping -->
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>*.jsf</url-pattern>
- </servlet-mapping>
-
- <!-- Welcome files -->
- <welcome-file-list>
- <welcome-file>index.jsp</welcome-file>
- <welcome-file>index.html</welcome-file>
- </welcome-file-list>
-
-</web-app>
+<?xml version="1.0"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <description>MyProject web.xml</description>
+
+ <!-- The only web.xml change to the MyFaces Helloworld sample is to add
+ the Tuscany listener and annotation processor context parameter -->
+ <listener>
+ <listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class>
+ </listener>
+ <context-param>
+ <param-name>org.apache.myfaces.config.annotation.LifecycleProvider</param-name>
+ <param-value>org.apache.tuscany.sca.myfaces.TuscanyAnnotationLifecycleProvider</param-value>
+ </context-param>
+
+ <!--optional: context-param>
+ <description>Comma separated list of URIs of (additional) faces config files.
+ (e.g. /WEB-INF/my-config.xml)
+ See JSF 1.0 PRD2, 10.3.2
+ Attention: You do not need to put /WEB-INF/faces-config.xml in here.
+ </description>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/examples-config.xml</param-value>
+ </context-param-->
+ <context-param>
+ <description>State saving method: "client" or "server" (= default)
+ See JSF Specification 2.5.3</description>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>client</param-value>
+ </context-param>
+ <context-param>
+ <description>Only applicable if state saving method is "server" (= default).
+ Defines the amount (default = 20) of the latest views are stored in session.</description>
+ <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
+ <param-value>20</param-value>
+ </context-param>
+ <context-param>
+ <description>Only applicable if state saving method is "server" (= default).
+ If true (default) the state will be serialized to a byte stream before it
+ is written to the session.
+ If false the state will not be serialized to a byte stream.</description>
+ <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <description>Only applicable if state saving method is "server" (= default) and if
+ org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (= default)
+ If true (default) the serialized state will be compressed before it
+ is written to the session. If false the state will not be compressed.</description>
+ <param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <description>This parameter tells MyFaces if javascript code should be allowed in the
+ rendered HTML output.
+ If javascript is allowed, command_link anchors will have javascript code
+ that submits the corresponding form.
+ If javascript is not allowed, the state saving info and nested parameters
+ will be added as url parameters.
+ Default: "true"</description>
+ <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <description>If true, rendered HTML code will be formatted, so that it is "human readable".
+ i.e. additional line separators and whitespace will be written, that do not
+ influence the HTML code.
+ Default: "true"</description>
+ <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <description>If true, a javascript function will be rendered that is able to restore the
+ former vertical scroll on every request. Convenient feature if you have pages
+ with long lists and you do not want the browser page to always jump to the top
+ if you trigger a link or button action that stays on the same page.
+ Default: "false"</description>
+ <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>Used for encrypting view state. Only relevant for client side
+ state saving. See MyFaces wiki/web site documentation for instructions
+ on how to configure an application for diffenent encryption strengths.
+ </description>
+ <param-name>org.apache.myfaces.SECRET</param-name>
+ <param-value>NzY1NDMyMTA=</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Validate managed beans, navigation rules and ensure that forms are not nested.
+ </description>
+ <param-name>org.apache.myfaces.VALIDATE</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Treat readonly same as if disabled attribute was set for select elements.
+ </description>
+ <param-name>org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Use the defined class as the class which will be called when a resource is added to the
+ ExtensionFilter handling. Using StreamingAddResource here helps with performance. If you want to add
+ custom components and want to use the ExtensionFilter, you need to provide your custom implementation here.
+ </description>
+ <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
+ <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Virtual path in the URL which triggers loading of resources for the MyFaces extended components
+ in the ExtensionFilter.
+ </description>
+ <param-name>org.apache.myfaces.RESOURCE_VIRTUAL_PATH</param-name>
+ <param-value>/faces/myFacesExtensionResource</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Check if the extensions-filter has been properly configured.
+ </description>
+ <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <context-param>
+ <description>
+ Define partial state saving as true/false.
+ </description>
+ <param-name>javax.faces.PARTIAL_STATE_SAVING_METHOD</param-name>
+ <param-value>false</param-value>
+ </context-param>
+
+ <!-- Listener, to allow Jetty serving MyFaces apps -->
+ <listener>
+ <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
+ </listener>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- Faces Servlet Mapping -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+ <!-- Welcome files -->
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+</web-app>
diff --git a/java/sca/samples/webapps/helloworld-jsp/pom.xml b/java/sca/samples/webapps/helloworld-jsp/pom.xml
index 1b47656b5e..8a7101c775 100644
--- a/java/sca/samples/webapps/helloworld-jsp/pom.xml
+++ b/java/sca/samples/webapps/helloworld-jsp/pom.xml
@@ -1,55 +1,55 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-webapp-helloworld-jsp</artifactId>
- <packaging>war</packaging>
- <name>Apache Tuscany SCA Sample Helloworld JSP</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-webapp-helloworld-jsp</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA Sample Helloworld JSP</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
diff --git a/java/sca/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldService.java b/java/sca/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldService.java
index 123774b936..53ff7a5ca1 100644
--- a/java/sca/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldService.java
+++ b/java/sca/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldService.java
@@ -1,25 +1,25 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-public interface HelloworldService {
-
- String sayHello(String name);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+public interface HelloworldService {
+
+ String sayHello(String name);
+
+}
diff --git a/java/sca/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldServiceImpl.java b/java/sca/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldServiceImpl.java
index 66cef71a25..a22c095f29 100644
--- a/java/sca/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldServiceImpl.java
+++ b/java/sca/samples/webapps/helloworld-jsp/src/main/java/sample/HelloworldServiceImpl.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-
-public class HelloworldServiceImpl implements HelloworldService {
-
- public String sayHello(String name) {
- return "Hello " + name;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+
+public class HelloworldServiceImpl implements HelloworldService {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.composite b/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.composite
index 56ed55b2d5..875d6aae9d 100644
--- a/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.composite
+++ b/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.composite
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://samples"
- name="Helloworld">
-
- <component name="foo">
- <implementation.web web-uri=""/>
- <reference name="service" target="HelloworldComponent"/>
- </component>
-
- <component name="HelloworldComponent">
- <implementation.java class="sample.HelloworldServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://samples"
+ name="Helloworld">
+
+ <component name="foo">
+ <implementation.web web-uri=""/>
+ <reference name="service" target="HelloworldComponent"/>
+ </component>
+
+ <component name="HelloworldComponent">
+ <implementation.java class="sample.HelloworldServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.xml
index a5b03d4904..fa1f7ad7b9 100644
--- a/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.xml
+++ b/java/sca/samples/webapps/helloworld-jsp/src/main/webapp/WEB-INF/web.xml
@@ -1,41 +1,41 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<web-app version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
-
- <display-name>Apache Tuscany Helloworld JSP Sample</display-name>
-
- <filter>
- <filter-name>tuscany</filter-name>
- <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>tuscany</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
- <welcome-file-list id="WelcomeFileList">
- <welcome-file>hello.jsp</welcome-file>
- </welcome-file-list>
-
-</web-app>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
+
+ <display-name>Apache Tuscany Helloworld JSP Sample</display-name>
+
+ <filter>
+ <filter-name>tuscany</filter-name>
+ <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>tuscany</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>hello.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>
diff --git a/java/sca/samples/webapps/helloworld-rest/pom.xml b/java/sca/samples/webapps/helloworld-rest/pom.xml
index 5f48b89463..0bb7a58812 100644
--- a/java/sca/samples/webapps/helloworld-rest/pom.xml
+++ b/java/sca/samples/webapps/helloworld-rest/pom.xml
@@ -1,111 +1,111 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
- <artifactId>helloworld-rest</artifactId>
- <packaging>war</packaging>
- <name>HelloWorld RESTFul Web Application</name>
-
- <repositories>
- <repository>
- <id>maven2-repository.dev.java.net</id>
- <name>Java.net Repository for Maven</name>
- <url>http://download.java.net/maven/2/</url>
- <layout>default</layout>
- </repository>
- <repository>
- <id>maven-repository.dev.java.net</id>
- <name>Java.net Maven 1 Repository (legacy)</name>
- <url>http://download.java.net/maven/1</url>
- <layout>legacy</layout>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-node-impl</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-implementation-web-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-binding-rest-runtime</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <version>1.0</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-bundle</artifactId>
- <version>1.0.3</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>helloworld-rest</artifactId>
+ <packaging>war</packaging>
+ <name>HelloWorld RESTFul Web Application</name>
+
+ <repositories>
+ <repository>
+ <id>maven2-repository.dev.java.net</id>
+ <name>Java.net Repository for Maven</name>
+ <url>http://download.java.net/maven/2/</url>
+ <layout>default</layout>
+ </repository>
+ <repository>
+ <id>maven-repository.dev.java.net</id>
+ <name>Java.net Maven 1 Repository (legacy)</name>
+ <url>http://download.java.net/maven/1</url>
+ <layout>legacy</layout>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-impl</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-web-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-binding-rest-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ <version>1.0</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.jersey</groupId>
+ <artifactId>jersey-bundle</artifactId>
+ <version>1.0.3</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
diff --git a/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/ClientJavaTestService.java b/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/ClientJavaTestService.java
index 414c6821ca..8b19af7a52 100644
--- a/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/ClientJavaTestService.java
+++ b/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/ClientJavaTestService.java
@@ -1,29 +1,29 @@
-package helloworldrest;
-
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-
-/*
- * To test, simply run the program
- * Access the service by invoking the getName() method of HelloWorldService
- */
-
-public class ClientJavaTestService {
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- NodeFactory factory = NodeFactory.newInstance();
- Node node = factory.createNode("rest.composite", ClientJavaTestService.class.getClassLoader()).start();
- HelloWorldService helloService = node.getService(HelloWorldService.class, "HelloWorldRESTServiceComponent");
-
- //HelloWorldService helloService = new HelloWorldServiceImpl();
- System.out.println("### Message from REST service " + helloService.getName());
-
- node.stop();
- node.destroy();
- factory.destroy();
- }
-
-}
+package helloworldrest;
+
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeFactory;
+
+/*
+ * To test, simply run the program
+ * Access the service by invoking the getName() method of HelloWorldService
+ */
+
+public class ClientJavaTestService {
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ NodeFactory factory = NodeFactory.newInstance();
+ Node node = factory.createNode("rest.composite", ClientJavaTestService.class.getClassLoader()).start();
+ HelloWorldService helloService = node.getService(HelloWorldService.class, "HelloWorldRESTServiceComponent");
+
+ //HelloWorldService helloService = new HelloWorldServiceImpl();
+ System.out.println("### Message from REST service " + helloService.getName());
+
+ node.stop();
+ node.destroy();
+ factory.destroy();
+ }
+
+}
diff --git a/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/ClientTestServiceWebapp.java b/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/ClientTestServiceWebapp.java
index 5f875c1888..fb83b26315 100644
--- a/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/ClientTestServiceWebapp.java
+++ b/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/ClientTestServiceWebapp.java
@@ -1,108 +1,108 @@
-package helloworldrest;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.Formatter;
-
-/**
- *
- * To test, deploy the application as a webapp.
- * Then, run this file to access the REST web service by making HTTP GET/POST requests
- *
- */
-public class ClientTestServiceWebapp {
-
- final static String UrlBase = "http://localhost:8080/helloworld-rest-webapp/HelloWorldService";
-
- final static class HttpResponse {
- Object content;
- int code;
- String message;
- }
-
- static HttpResponse makeHttpGetRequest(String method, String url, String contentType) throws Exception {
- HttpResponse response = new HttpResponse();
- URL urlAddress = new URL(url);
- HttpURLConnection huc = (HttpURLConnection)urlAddress.openConnection();
- huc.setRequestMethod(method);
- huc.setRequestProperty("Content-type", contentType);
- huc.connect();
- InputStreamReader isr = new InputStreamReader(huc.getInputStream());
-
- BufferedReader in = new BufferedReader(isr);
- String uline = in.readLine();
- response.content = uline;
-
- // huc.disconnect();
- // System.out.println("#### huc disconnected ###");
-
- return response;
- }
-
- static HttpResponse makeHttpRequest(String method, String url, String contentType, InputStream is) throws Exception {
- HttpResponse response = new HttpResponse();
- URL urlAddress = new URL(url);
- HttpURLConnection huc = (HttpURLConnection)urlAddress.openConnection();
- huc.setRequestMethod(method);
- if (null != is) {
- huc.setDoOutput(true);
- huc.setRequestProperty("Content-Type", contentType);
- OutputStream os = huc.getOutputStream();
- byte[] buf = new byte[1024];
- int read;
- while ((read = is.read(buf)) != -1) {
- os.write(buf, 0, read);
- }
- }
- InputStreamReader isr = new InputStreamReader(huc.getInputStream());
- BufferedReader in = new BufferedReader(isr);
- String uline = in.readLine();
- response.content = uline;
- return response;
- }
-
- static HttpResponse makeHttpGetRequest(String method, String url, String contentType, String content)
- throws Exception {
- return makeHttpRequest(method, url, contentType, new ByteArrayInputStream(content.getBytes("UTF-8")));
- }
-
- static HttpResponse makeHttpRequest(String method, String url) throws Exception {
- return makeHttpRequest(method, url, null, (InputStream)null);
- }
-
- public static void main(String[] args) {
- try {
-
- HttpResponse response;
-
- System.out.println("Getting the name *BEFORE* setting it:");
- response = makeHttpGetRequest("GET", UrlBase + "/helloworld/getname", "text/plain");
- System.out.println(new Formatter().format("---- Received String:\n%s", response.content.toString()));
-
- System.out.println("Setting the name:");
- String newText = "Morpheus";
- InputStream inputStream = new ByteArrayInputStream(newText.getBytes());
- response = makeHttpRequest("PUT", UrlBase + "/helloworld/setname", "text/plain", inputStream);
-
- System.out.println("Getting the name *AFTER* setting it:");
- response = makeHttpGetRequest("GET", UrlBase + "/helloworld/getname", "text/plain");
- System.out.println(new Formatter().format("---- Received String:\n%s", response.content.toString()));
-
- System.out.println("POST Operation:");
- response = makeHttpGetRequest("POST", UrlBase + "/helloworld/postoperation/prateek", "text/plain");
- //System.out.println(new Formatter().format("---- Received String:\n%s", response.content.toString()));
-
- System.out.println("Getting the name *AFTER* the POST operation:");
- response = makeHttpGetRequest("GET", UrlBase + "/helloworld/getname", "text/plain");
- System.out.println(new Formatter().format("---- Received String:\n%s", response.content.toString()));
- } catch (Exception e) {
- System.out.println("TEST FAILED! :-(");
- e.printStackTrace(System.out);
- }
- }
-}
+package helloworldrest;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.Formatter;
+
+/**
+ *
+ * To test, deploy the application as a webapp.
+ * Then, run this file to access the REST web service by making HTTP GET/POST requests
+ *
+ */
+public class ClientTestServiceWebapp {
+
+ final static String UrlBase = "http://localhost:8080/helloworld-rest-webapp/HelloWorldService";
+
+ final static class HttpResponse {
+ Object content;
+ int code;
+ String message;
+ }
+
+ static HttpResponse makeHttpGetRequest(String method, String url, String contentType) throws Exception {
+ HttpResponse response = new HttpResponse();
+ URL urlAddress = new URL(url);
+ HttpURLConnection huc = (HttpURLConnection)urlAddress.openConnection();
+ huc.setRequestMethod(method);
+ huc.setRequestProperty("Content-type", contentType);
+ huc.connect();
+ InputStreamReader isr = new InputStreamReader(huc.getInputStream());
+
+ BufferedReader in = new BufferedReader(isr);
+ String uline = in.readLine();
+ response.content = uline;
+
+ // huc.disconnect();
+ // System.out.println("#### huc disconnected ###");
+
+ return response;
+ }
+
+ static HttpResponse makeHttpRequest(String method, String url, String contentType, InputStream is) throws Exception {
+ HttpResponse response = new HttpResponse();
+ URL urlAddress = new URL(url);
+ HttpURLConnection huc = (HttpURLConnection)urlAddress.openConnection();
+ huc.setRequestMethod(method);
+ if (null != is) {
+ huc.setDoOutput(true);
+ huc.setRequestProperty("Content-Type", contentType);
+ OutputStream os = huc.getOutputStream();
+ byte[] buf = new byte[1024];
+ int read;
+ while ((read = is.read(buf)) != -1) {
+ os.write(buf, 0, read);
+ }
+ }
+ InputStreamReader isr = new InputStreamReader(huc.getInputStream());
+ BufferedReader in = new BufferedReader(isr);
+ String uline = in.readLine();
+ response.content = uline;
+ return response;
+ }
+
+ static HttpResponse makeHttpGetRequest(String method, String url, String contentType, String content)
+ throws Exception {
+ return makeHttpRequest(method, url, contentType, new ByteArrayInputStream(content.getBytes("UTF-8")));
+ }
+
+ static HttpResponse makeHttpRequest(String method, String url) throws Exception {
+ return makeHttpRequest(method, url, null, (InputStream)null);
+ }
+
+ public static void main(String[] args) {
+ try {
+
+ HttpResponse response;
+
+ System.out.println("Getting the name *BEFORE* setting it:");
+ response = makeHttpGetRequest("GET", UrlBase + "/helloworld/getname", "text/plain");
+ System.out.println(new Formatter().format("---- Received String:\n%s", response.content.toString()));
+
+ System.out.println("Setting the name:");
+ String newText = "Morpheus";
+ InputStream inputStream = new ByteArrayInputStream(newText.getBytes());
+ response = makeHttpRequest("PUT", UrlBase + "/helloworld/setname", "text/plain", inputStream);
+
+ System.out.println("Getting the name *AFTER* setting it:");
+ response = makeHttpGetRequest("GET", UrlBase + "/helloworld/getname", "text/plain");
+ System.out.println(new Formatter().format("---- Received String:\n%s", response.content.toString()));
+
+ System.out.println("POST Operation:");
+ response = makeHttpGetRequest("POST", UrlBase + "/helloworld/postoperation/prateek", "text/plain");
+ //System.out.println(new Formatter().format("---- Received String:\n%s", response.content.toString()));
+
+ System.out.println("Getting the name *AFTER* the POST operation:");
+ response = makeHttpGetRequest("GET", UrlBase + "/helloworld/getname", "text/plain");
+ System.out.println(new Formatter().format("---- Received String:\n%s", response.content.toString()));
+ } catch (Exception e) {
+ System.out.println("TEST FAILED! :-(");
+ e.printStackTrace(System.out);
+ }
+ }
+}
diff --git a/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldService.java b/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldService.java
index 9c678d4bd1..fb9d3e2f82 100644
--- a/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldService.java
+++ b/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldService.java
@@ -1,13 +1,13 @@
-package helloworldrest;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@Remotable
-public interface HelloWorldService {
-
- public void setName(String name);
-
- public String getName();
-
- public void postOperationTest(String name);
-}
+package helloworldrest;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface HelloWorldService {
+
+ public void setName(String name);
+
+ public String getName();
+
+ public void postOperationTest(String name);
+}
diff --git a/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldServiceImpl.java b/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldServiceImpl.java
index 25e0ba7efb..cacb88b5e3 100644
--- a/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldServiceImpl.java
+++ b/java/sca/samples/webapps/helloworld-rest/src/main/java/helloworldrest/HelloWorldServiceImpl.java
@@ -1,44 +1,44 @@
-package helloworldrest;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-
-import org.oasisopen.sca.annotation.Scope;
-import org.oasisopen.sca.annotation.Service;
-
-@Service(HelloWorldService.class)
-@Scope("Composite")
-@Path("/helloworld")
-public class HelloWorldServiceImpl implements HelloWorldService {
-
- private String name = new String("original!");
-
- @Path("/setname")
- @PUT
- @Consumes("text/plain")
- public void setName(String name) {
- this.name = name;
-
- }
-
- //http://<host>:<port>/helloworld-rest-webapp/HelloWorldService/helloworld/getname
- @Path("/getname")
- @GET
- @Produces("text/plain")
- public String getName() {
- return this.name;
- }
-
- @POST
- @Path("/postoperation/{name}/")
- @Consumes("text/plain")
- public void postOperationTest(@PathParam("name") String name) {
- this.name = name;
- }
-
-}
+package helloworldrest;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+
+import org.oasisopen.sca.annotation.Scope;
+import org.oasisopen.sca.annotation.Service;
+
+@Service(HelloWorldService.class)
+@Scope("Composite")
+@Path("/helloworld")
+public class HelloWorldServiceImpl implements HelloWorldService {
+
+ private String name = new String("original!");
+
+ @Path("/setname")
+ @PUT
+ @Consumes("text/plain")
+ public void setName(String name) {
+ this.name = name;
+
+ }
+
+ //http://<host>:<port>/helloworld-rest-webapp/HelloWorldService/helloworld/getname
+ @Path("/getname")
+ @GET
+ @Produces("text/plain")
+ public String getName() {
+ return this.name;
+ }
+
+ @POST
+ @Path("/postoperation/{name}/")
+ @Consumes("text/plain")
+ public void postOperationTest(@PathParam("name") String name) {
+ this.name = name;
+ }
+
+}
diff --git a/java/sca/samples/webapps/helloworld-rest/src/main/resources/rest.composite b/java/sca/samples/webapps/helloworld-rest/src/main/resources/rest.composite
index 70b83fd986..7f76f5946d 100644
--- a/java/sca/samples/webapps/helloworld-rest/src/main/resources/rest.composite
+++ b/java/sca/samples/webapps/helloworld-rest/src/main/resources/rest.composite
@@ -1,37 +1,37 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://sample"
- xmlns:sample="http://sample"
- name="helloworldrest">
-
- <service name="HelloWorldService" promote="HelloWorldRESTServiceComponent/HelloWorldService">
- <interface.java interface="helloworldrest.HelloWorldService"/>
- <tuscany:binding.rest />
- </service>
-
- <component name="HelloWorldRESTServiceComponent">
- <implementation.java class="helloworldrest.HelloWorldServiceImpl"/>
- </component>
-
-</composite>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="helloworldrest">
+
+ <service name="HelloWorldService" promote="HelloWorldRESTServiceComponent/HelloWorldService">
+ <interface.java interface="helloworldrest.HelloWorldService"/>
+ <tuscany:binding.rest />
+ </service>
+
+ <component name="HelloWorldRESTServiceComponent">
+ <implementation.java class="helloworldrest.HelloWorldServiceImpl"/>
+ </component>
+
+</composite>
+
diff --git a/java/sca/samples/webapps/helloworld-rest/src/main/webapp/META-INF/sca-contribution.xml b/java/sca/samples/webapps/helloworld-rest/src/main/webapp/META-INF/sca-contribution.xml
index ca18a360c2..9fc16372b3 100644
--- a/java/sca/samples/webapps/helloworld-rest/src/main/webapp/META-INF/sca-contribution.xml
+++ b/java/sca/samples/webapps/helloworld-rest/src/main/webapp/META-INF/sca-contribution.xml
@@ -1,26 +1,26 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
--->
-
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://sample"
- xmlns:sample="http://sample">
- <deployable composite="sample:helloworldrest"/>
-</contribution>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+-->
+
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:helloworldrest"/>
+</contribution>
+
diff --git a/java/sca/samples/webapps/helloworld-rest/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld-rest/src/main/webapp/WEB-INF/web.xml
index ae1bd5252c..3a670696e4 100644
--- a/java/sca/samples/webapps/helloworld-rest/src/main/webapp/WEB-INF/web.xml
+++ b/java/sca/samples/webapps/helloworld-rest/src/main/webapp/WEB-INF/web.xml
@@ -1,35 +1,35 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
-Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
-<web-app>
-
- <filter>
- <filter-name>tuscany</filter-name>
- <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>tuscany</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
-</web-app>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
+Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+
+ <filter>
+ <filter-name>tuscany</filter-name>
+ <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>tuscany</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+</web-app>
diff --git a/java/sca/samples/webapps/helloworld-servlet/pom.xml b/java/sca/samples/webapps/helloworld-servlet/pom.xml
index cbccfb7f42..ee41488ef0 100644
--- a/java/sca/samples/webapps/helloworld-servlet/pom.xml
+++ b/java/sca/samples/webapps/helloworld-servlet/pom.xml
@@ -1,54 +1,54 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-webapp-helloworld-servlet</artifactId>
- <packaging>war</packaging>
- <name>Apache Tuscany SCA Sample Helloworld Servlet</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-</project>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-webapp-helloworld-servlet</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA Sample Helloworld Servlet</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+</project>
+
diff --git a/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldService.java b/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldService.java
index 3d8defc611..2e43e09897 100644
--- a/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldService.java
+++ b/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldService.java
@@ -1,25 +1,25 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-public interface HelloworldService {
-
- String sayHello(String name);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+public interface HelloworldService {
+
+ String sayHello(String name);
+
+}
diff --git a/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServiceImpl.java b/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServiceImpl.java
index c3230b5cdd..9e79276704 100644
--- a/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServiceImpl.java
+++ b/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServiceImpl.java
@@ -1,27 +1,27 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-public class HelloworldServiceImpl implements HelloworldService {
-
- public String sayHello(String name) {
- return "Hello " + name;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+public class HelloworldServiceImpl implements HelloworldService {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServlet.java b/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServlet.java
index be7c5f0a31..2265bfa8ea 100644
--- a/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServlet.java
+++ b/java/sca/samples/webapps/helloworld-servlet/src/main/java/sample/HelloworldServlet.java
@@ -1,56 +1,56 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-import java.io.IOException;
-import java.io.Writer;
-
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.oasisopen.sca.annotation.Reference;
-
-/**
- */
-public class HelloworldServlet extends HttpServlet {
- private static final long serialVersionUID = 1L;
-
- @Reference
- protected HelloworldService service;
-
- public HelloworldServlet() {
- System.out.println("HelloworldServlet");
- }
-
- @Override
- protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
-
- String name = request.getParameter("name");
- String greeting = service.sayHello(name);
-
- Writer out = response.getWriter();
- out.write("<html><head><title>Apache Tuscany Helloworld Servlet Sample</title></head><body>");
- out.write("<h2>Apache Tuscany Helloworld Servlet Sample</h2>");
- out.write("<br><strong>Result: </strong>" + greeting);
- out.write("</body></html>");
- out.flush();
- out.close();
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.oasisopen.sca.annotation.Reference;
+
+/**
+ */
+public class HelloworldServlet extends HttpServlet {
+ private static final long serialVersionUID = 1L;
+
+ @Reference
+ protected HelloworldService service;
+
+ public HelloworldServlet() {
+ System.out.println("HelloworldServlet");
+ }
+
+ @Override
+ protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
+
+ String name = request.getParameter("name");
+ String greeting = service.sayHello(name);
+
+ Writer out = response.getWriter();
+ out.write("<html><head><title>Apache Tuscany Helloworld Servlet Sample</title></head><body>");
+ out.write("<h2>Apache Tuscany Helloworld Servlet Sample</h2>");
+ out.write("<br><strong>Result: </strong>" + greeting);
+ out.write("</body></html>");
+ out.flush();
+ out.close();
+ }
+}
diff --git a/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.composite b/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.composite
index 56ed55b2d5..875d6aae9d 100644
--- a/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.composite
+++ b/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.composite
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://samples"
- name="Helloworld">
-
- <component name="foo">
- <implementation.web web-uri=""/>
- <reference name="service" target="HelloworldComponent"/>
- </component>
-
- <component name="HelloworldComponent">
- <implementation.java class="sample.HelloworldServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://samples"
+ name="Helloworld">
+
+ <component name="foo">
+ <implementation.web web-uri=""/>
+ <reference name="service" target="HelloworldComponent"/>
+ </component>
+
+ <component name="HelloworldComponent">
+ <implementation.java class="sample.HelloworldServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.xml
index 8fd6a6614a..6cfcae0005 100644
--- a/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.xml
+++ b/java/sca/samples/webapps/helloworld-servlet/src/main/webapp/WEB-INF/web.xml
@@ -1,42 +1,42 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<web-app version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
-
- <display-name>Apache Tuscany Helloworld Servlet Sample</display-name>
-
- <servlet>
- <servlet-name>HelloworldServlet</servlet-name>
- <servlet-class>sample.HelloworldServlet</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>HelloworldServlet</servlet-name>
- <url-pattern>/HelloworldServlet</url-pattern>
- </servlet-mapping>
-
- <welcome-file-list id="WelcomeFileList">
- <welcome-file>hello.html</welcome-file>
- </welcome-file-list>
-
-</web-app>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
+
+ <display-name>Apache Tuscany Helloworld Servlet Sample</display-name>
+
+ <servlet>
+ <servlet-name>HelloworldServlet</servlet-name>
+ <servlet-class>sample.HelloworldServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>HelloworldServlet</servlet-name>
+ <url-pattern>/HelloworldServlet</url-pattern>
+ </servlet-mapping>
+
+ <welcome-file-list id="WelcomeFileList">
+ <welcome-file>hello.html</welcome-file>
+ </welcome-file-list>
+
+</web-app>
+
diff --git a/java/sca/samples/webapps/helloworld-stripes/pom.xml b/java/sca/samples/webapps/helloworld-stripes/pom.xml
index 4449b52aa1..da6793875d 100644
--- a/java/sca/samples/webapps/helloworld-stripes/pom.xml
+++ b/java/sca/samples/webapps/helloworld-stripes/pom.xml
@@ -1,65 +1,65 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-webapp-helloworld-stripes</artifactId>
- <packaging>war</packaging>
- <name>Apache Tuscany SCA Sample Helloworld using Stripes</name>
-
- <dependencies>
-
- <!-- Tuscany dependencies -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-stripes</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
-
- <!-- Stripes Framework dependencies -->
- <dependency>
- <groupId>net.sourceforge.stripes</groupId>
- <artifactId>stripes</artifactId>
- <version>1.5</version>
- </dependency>
- <dependency>
- <groupId>taglibs</groupId>
- <artifactId>standard</artifactId>
- <version>1.1.2</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-webapp-helloworld-stripes</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA Sample Helloworld using Stripes</name>
+
+ <dependencies>
+
+ <!-- Tuscany dependencies -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-stripes</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- Stripes Framework dependencies -->
+ <dependency>
+ <groupId>net.sourceforge.stripes</groupId>
+ <artifactId>stripes</artifactId>
+ <version>1.5</version>
+ </dependency>
+ <dependency>
+ <groupId>taglibs</groupId>
+ <artifactId>standard</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/BaseActionBean.java b/java/sca/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/BaseActionBean.java
index 98c35dd431..0ab02682ac 100644
--- a/java/sca/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/BaseActionBean.java
+++ b/java/sca/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/BaseActionBean.java
@@ -1,33 +1,33 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package mystripes.action;
-
-import net.sourceforge.stripes.action.ActionBean;
-import net.sourceforge.stripes.action.ActionBeanContext;
-
-public class BaseActionBean implements ActionBean {
- private ActionBeanContext context;
-
- public ActionBeanContext getContext() {
- return context;
- }
- public void setContext(ActionBeanContext context) {
- this.context = context;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package mystripes.action;
+
+import net.sourceforge.stripes.action.ActionBean;
+import net.sourceforge.stripes.action.ActionBeanContext;
+
+public class BaseActionBean implements ActionBean {
+ private ActionBeanContext context;
+
+ public ActionBeanContext getContext() {
+ return context;
+ }
+ public void setContext(ActionBeanContext context) {
+ this.context = context;
+ }
+}
diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/HomeActionBean.java b/java/sca/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/HomeActionBean.java
index 75ee7c2843..0385c92369 100644
--- a/java/sca/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/HomeActionBean.java
+++ b/java/sca/samples/webapps/helloworld-stripes/src/main/java/mystripes/action/HomeActionBean.java
@@ -1,45 +1,45 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package mystripes.action;
-
-import net.sourceforge.stripes.action.DefaultHandler;
-import net.sourceforge.stripes.action.ForwardResolution;
-import net.sourceforge.stripes.action.Resolution;
-import net.sourceforge.stripes.action.UrlBinding;
-
-import org.oasisopen.sca.annotation.Reference;
-
-import sample.HelloworldService;
-
-@UrlBinding("/Home.htm")
-public class HomeActionBean extends BaseActionBean {
-
- @Reference
- HelloworldService service;
-
- @DefaultHandler
- public Resolution view() {
- return new ForwardResolution("/WEB-INF/jsp/home.jsp");
- }
-
- public String getHello() {
- return service.sayHello("world");
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package mystripes.action;
+
+import net.sourceforge.stripes.action.DefaultHandler;
+import net.sourceforge.stripes.action.ForwardResolution;
+import net.sourceforge.stripes.action.Resolution;
+import net.sourceforge.stripes.action.UrlBinding;
+
+import org.oasisopen.sca.annotation.Reference;
+
+import sample.HelloworldService;
+
+@UrlBinding("/Home.htm")
+public class HomeActionBean extends BaseActionBean {
+
+ @Reference
+ HelloworldService service;
+
+ @DefaultHandler
+ public Resolution view() {
+ return new ForwardResolution("/WEB-INF/jsp/home.jsp");
+ }
+
+ public String getHello() {
+ return service.sayHello("world");
+ }
+
+}
diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldService.java b/java/sca/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldService.java
index 123774b936..53ff7a5ca1 100644
--- a/java/sca/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldService.java
+++ b/java/sca/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldService.java
@@ -1,25 +1,25 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-public interface HelloworldService {
-
- String sayHello(String name);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+public interface HelloworldService {
+
+ String sayHello(String name);
+
+}
diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldServiceImpl.java b/java/sca/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldServiceImpl.java
index 66cef71a25..a22c095f29 100644
--- a/java/sca/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldServiceImpl.java
+++ b/java/sca/samples/webapps/helloworld-stripes/src/main/java/sample/HelloworldServiceImpl.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-
-public class HelloworldServiceImpl implements HelloworldService {
-
- public String sayHello(String name) {
- return "Hello " + name;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+
+public class HelloworldServiceImpl implements HelloworldService {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.composite b/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.composite
index 56ed55b2d5..875d6aae9d 100644
--- a/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.composite
+++ b/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.composite
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://samples"
- name="Helloworld">
-
- <component name="foo">
- <implementation.web web-uri=""/>
- <reference name="service" target="HelloworldComponent"/>
- </component>
-
- <component name="HelloworldComponent">
- <implementation.java class="sample.HelloworldServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://samples"
+ name="Helloworld">
+
+ <component name="foo">
+ <implementation.web web-uri=""/>
+ <reference name="service" target="HelloworldComponent"/>
+ </component>
+
+ <component name="HelloworldComponent">
+ <implementation.java class="sample.HelloworldServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.xml
index 0a16144519..f01584cc2f 100644
--- a/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.xml
+++ b/java/sca/samples/webapps/helloworld-stripes/src/main/webapp/WEB-INF/web.xml
@@ -1,61 +1,61 @@
-<?xml version="1.0" encoding="UTF-8"?>
- <!--
- * Licensed to the Apache Software Foundation (ASF) under one * or more
- contributor license agreements. See the NOTICE file * distributed with
- this work for additional information * regarding copyright ownership.
- The ASF licenses this file * to you under the Apache License, Version
- 2.0 (the * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at * *
- http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by
- applicable law or agreed to in writing, * software distributed under
- the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES
- OR CONDITIONS OF ANY * KIND, either express or implied. See the
- License for the * specific language governing permissions and
- limitations * under the License.
- -->
-<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
- <display-name>Apache Tuscany Helloworld Stripes Sample</display-name>
-
- <listener>
- <listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class>
- </listener>
-
- <filter>
- <filter-name>StripesFilter</filter-name>
- <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
- <init-param>
- <param-name>ActionResolver.Packages</param-name>
- <param-value>mystripes.action</param-value>
- </init-param>
- <init-param>
- <param-name>Extension.Packages</param-name>
- <param-value>org.apache.tuscany.sca.stripes</param-value>
- </init-param>
- </filter>
-
- <servlet>
- <servlet-name>DispatcherServlet</servlet-name>
- <servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
-
- <filter-mapping>
- <filter-name>StripesFilter</filter-name>
- <servlet-name>DispatcherServlet</servlet-name>
- <dispatcher>REQUEST</dispatcher>
- <dispatcher>FORWARD</dispatcher>
- </filter-mapping>
-
- <servlet-mapping>
- <servlet-name>DispatcherServlet</servlet-name>
- <url-pattern>*.htm</url-pattern>
- </servlet-mapping>
-
- <welcome-file-list>
- <welcome-file>index.html</welcome-file>
- </welcome-file-list>
-
-</web-app>
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ * Licensed to the Apache Software Foundation (ASF) under one * or more
+ contributor license agreements. See the NOTICE file * distributed with
+ this work for additional information * regarding copyright ownership.
+ The ASF licenses this file * to you under the Apache License, Version
+ 2.0 (the * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at * *
+ http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by
+ applicable law or agreed to in writing, * software distributed under
+ the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES
+ OR CONDITIONS OF ANY * KIND, either express or implied. See the
+ License for the * specific language governing permissions and
+ limitations * under the License.
+ -->
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <display-name>Apache Tuscany Helloworld Stripes Sample</display-name>
+
+ <listener>
+ <listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>StripesFilter</filter-name>
+ <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
+ <init-param>
+ <param-name>ActionResolver.Packages</param-name>
+ <param-value>mystripes.action</param-value>
+ </init-param>
+ <init-param>
+ <param-name>Extension.Packages</param-name>
+ <param-value>org.apache.tuscany.sca.stripes</param-value>
+ </init-param>
+ </filter>
+
+ <servlet>
+ <servlet-name>DispatcherServlet</servlet-name>
+ <servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <filter-mapping>
+ <filter-name>StripesFilter</filter-name>
+ <servlet-name>DispatcherServlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ </filter-mapping>
+
+ <servlet-mapping>
+ <servlet-name>DispatcherServlet</servlet-name>
+ <url-pattern>*.htm</url-pattern>
+ </servlet-mapping>
+
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+</web-app>
diff --git a/java/sca/samples/webapps/helloworld-wicket/pom.xml b/java/sca/samples/webapps/helloworld-wicket/pom.xml
index b2635f9b45..db5a8e7f6b 100644
--- a/java/sca/samples/webapps/helloworld-wicket/pom.xml
+++ b/java/sca/samples/webapps/helloworld-wicket/pom.xml
@@ -1,76 +1,76 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>helloworld-wicket</artifactId>
- <packaging>war</packaging>
- <name>Apache Tuscany SCA Sample Helloworld using Wicket</name>
-
- <dependencies>
-
- <!-- Tuscany dependencies -->
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-wicket</artifactId>
- <version>2.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- Wicket dependencies -->
- <dependency>
- <groupId>org.apache.wicket</groupId>
- <artifactId>wicket</artifactId>
- <version>1.4-rc2</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.4.2</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>helloworld-wicket</artifactId>
+ <packaging>war</packaging>
+ <name>Apache Tuscany SCA Sample Helloworld using Wicket</name>
+
+ <dependencies>
+
+ <!-- Tuscany dependencies -->
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-wicket</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Wicket dependencies -->
+ <dependency>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket</artifactId>
+ <version>1.4-rc2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.4.2</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/HelloworldService.java b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/HelloworldService.java
index 123774b936..53ff7a5ca1 100644
--- a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/HelloworldService.java
+++ b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/HelloworldService.java
@@ -1,25 +1,25 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-public interface HelloworldService {
-
- String sayHello(String name);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+public interface HelloworldService {
+
+ String sayHello(String name);
+
+}
diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/HelloworldServiceImpl.java b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/HelloworldServiceImpl.java
index 66cef71a25..a22c095f29 100644
--- a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/HelloworldServiceImpl.java
+++ b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/HelloworldServiceImpl.java
@@ -1,28 +1,28 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-
-public class HelloworldServiceImpl implements HelloworldService {
-
- public String sayHello(String name) {
- return "Hello " + name;
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+
+public class HelloworldServiceImpl implements HelloworldService {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+}
diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/HomePage.java b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/HomePage.java
index 89b8d7eba4..061f4c58ae 100644
--- a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/HomePage.java
+++ b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/HomePage.java
@@ -1,66 +1,66 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample.wicket;
-
-import org.apache.wicket.markup.html.WebPage;
-import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.markup.html.link.Link;
-import org.apache.wicket.model.AbstractReadOnlyModel;
-import org.oasisopen.sca.annotation.Reference;
-
-/**
- * Everybody's favorite example (Hello World), modified to use Guice.
- *
- * @author Alastair Maw
- */
-public class HomePage extends WebPage
-{
- @Reference
- IMyService service;
-
- private String labelValue = "<not yet initialized>";
-
- /**
- * Constructor
- */
- public HomePage()
- {
- add(new Link("link")
- {
- /**
- * @see org.apache.wicket.markup.html.link.Link#onClick()
- */
- @Override
- public void onClick()
- {
- labelValue = service.getHelloWorldText();
- }
- });
- add(new Label("message", new AbstractReadOnlyModel<String>()
- {
-
- @Override
- public String getObject()
- {
- return labelValue;
- }
-
- }));
- }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample.wicket;
+
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.Link;
+import org.apache.wicket.model.AbstractReadOnlyModel;
+import org.oasisopen.sca.annotation.Reference;
+
+/**
+ * Everybody's favorite example (Hello World), modified to use Guice.
+ *
+ * @author Alastair Maw
+ */
+public class HomePage extends WebPage
+{
+ @Reference
+ IMyService service;
+
+ private String labelValue = "<not yet initialized>";
+
+ /**
+ * Constructor
+ */
+ public HomePage()
+ {
+ add(new Link("link")
+ {
+ /**
+ * @see org.apache.wicket.markup.html.link.Link#onClick()
+ */
+ @Override
+ public void onClick()
+ {
+ labelValue = service.getHelloWorldText();
+ }
+ });
+ add(new Label("message", new AbstractReadOnlyModel<String>()
+ {
+
+ @Override
+ public String getObject()
+ {
+ return labelValue;
+ }
+
+ }));
+ }
} \ No newline at end of file
diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/IMyService.java b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/IMyService.java
index ab72a2b0f5..fdd91b0933 100644
--- a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/IMyService.java
+++ b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/IMyService.java
@@ -1,35 +1,35 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample.wicket;
-
-
-/**
- * Service interface for a simple "Hello World" app.
- *
- * @author Alastair Maw
- */
-public interface IMyService
-{
- /**
- * Retrieves the text to say "Hello World".
- *
- * @return "Hello World"
- */
- public String getHelloWorldText();
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample.wicket;
+
+
+/**
+ * Service interface for a simple "Hello World" app.
+ *
+ * @author Alastair Maw
+ */
+public interface IMyService
+{
+ /**
+ * Retrieves the text to say "Hello World".
+ *
+ * @return "Hello World"
+ */
+ public String getHelloWorldText();
} \ No newline at end of file
diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/MyService.java b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/MyService.java
index 34d4dad625..e7d864c5e6 100644
--- a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/MyService.java
+++ b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/MyService.java
@@ -1,38 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample.wicket;
-
-
-/**
- * Implementation of IService.
- *
- * @author Alastair Maw
- */
-public class MyService implements IMyService
-{
-
- /**
- * @see org.apache.wicket.examples.guice.service.IMyService#getHelloWorldText()
- */
- public String getHelloWorldText()
- {
- return "Hello World";
- }
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample.wicket;
+
+
+/**
+ * Implementation of IService.
+ *
+ * @author Alastair Maw
+ */
+public class MyService implements IMyService
+{
+
+ /**
+ * @see org.apache.wicket.examples.guice.service.IMyService#getHelloWorldText()
+ */
+ public String getHelloWorldText()
+ {
+ return "Hello World";
+ }
+
} \ No newline at end of file
diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/WicketApplication.java b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/WicketApplication.java
index d26b729898..85f2c00dbc 100644
--- a/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/WicketApplication.java
+++ b/java/sca/samples/webapps/helloworld-wicket/src/main/java/sample/wicket/WicketApplication.java
@@ -1,47 +1,47 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample.wicket;
-
-import org.apache.wicket.Page;
-import org.apache.wicket.protocol.http.WebApplication;
-import org.apache.tuscany.sca.wicket.TuscanyComponentInjector;;
-
-/**
- * Application object for your web application. If you want to run this application without deploying, run the Start class.
- *
- * @see com.mycompany.Start#main(String[])
- */
-public class WicketApplication extends WebApplication
-{
-
- @Override
- protected void init()
- {
- addComponentInstantiationListener(new TuscanyComponentInjector(this));
- }
-
- /**
- * @see org.apache.wicket.Application#getHomePage()
- */
- @Override
- public Class< ? extends Page> getHomePage()
- {
- return HomePage.class;
- }
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample.wicket;
+
+import org.apache.wicket.Page;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.tuscany.sca.wicket.TuscanyComponentInjector;;
+
+/**
+ * Application object for your web application. If you want to run this application without deploying, run the Start class.
+ *
+ * @see com.mycompany.Start#main(String[])
+ */
+public class WicketApplication extends WebApplication
+{
+
+ @Override
+ protected void init()
+ {
+ addComponentInstantiationListener(new TuscanyComponentInjector(this));
+ }
+
+ /**
+ * @see org.apache.wicket.Application#getHomePage()
+ */
+ @Override
+ public Class< ? extends Page> getHomePage()
+ {
+ return HomePage.class;
+ }
} \ No newline at end of file
diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/resources/log4j.properties b/java/sca/samples/webapps/helloworld-wicket/src/main/resources/log4j.properties
index 822153c0e2..1e24577860 100644
--- a/java/sca/samples/webapps/helloworld-wicket/src/main/resources/log4j.properties
+++ b/java/sca/samples/webapps/helloworld-wicket/src/main/resources/log4j.properties
@@ -1,29 +1,29 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-log4j.appender.Stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.Stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.Stdout.layout.conversionPattern=%-5p - %-26.26c{1} - %m\n
-
-log4j.rootLogger=INFO,Stdout
-
-log4j.logger.org.apache.wicket=INFO
-log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=INFO
-log4j.logger.org.apache.wicket.version=INFO
-log4j.logger.org.apache.wicket.RequestCycle=INFO
-
-
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+log4j.appender.Stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.Stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.Stdout.layout.conversionPattern=%-5p - %-26.26c{1} - %m\n
+
+log4j.rootLogger=INFO,Stdout
+
+log4j.logger.org.apache.wicket=INFO
+log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=INFO
+log4j.logger.org.apache.wicket.version=INFO
+log4j.logger.org.apache.wicket.RequestCycle=INFO
+
+
diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/webapp/WEB-INF/web.composite b/java/sca/samples/webapps/helloworld-wicket/src/main/webapp/WEB-INF/web.composite
index 7e2ca0a158..a52d6b6cbe 100644
--- a/java/sca/samples/webapps/helloworld-wicket/src/main/webapp/WEB-INF/web.composite
+++ b/java/sca/samples/webapps/helloworld-wicket/src/main/webapp/WEB-INF/web.composite
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200712"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
- targetNamespace="http://samples"
- name="Helloworld">
-
- <component name="foo">
- <implementation.web web-uri=""/>
- <reference name="service" target="HelloworldComponent"/>
- </component>
-
- <component name="HelloworldComponent">
- <implementation.java class="sample.HelloworldServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200712"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ targetNamespace="http://samples"
+ name="Helloworld">
+
+ <component name="foo">
+ <implementation.web web-uri=""/>
+ <reference name="service" target="HelloworldComponent"/>
+ </component>
+
+ <component name="HelloworldComponent">
+ <implementation.java class="sample.HelloworldServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/samples/webapps/helloworld-wicket/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld-wicket/src/main/webapp/WEB-INF/web.xml
index 7b8490b2be..3783b7bf82 100644
--- a/java/sca/samples/webapps/helloworld-wicket/src/main/webapp/WEB-INF/web.xml
+++ b/java/sca/samples/webapps/helloworld-wicket/src/main/webapp/WEB-INF/web.xml
@@ -1,50 +1,50 @@
-<?xml version="1.0" encoding="UTF-8"?>
- <!--
- * Licensed to the Apache Software Foundation (ASF) under one * or more
- contributor license agreements. See the NOTICE file * distributed with
- this work for additional information * regarding copyright ownership.
- The ASF licenses this file * to you under the Apache License, Version
- 2.0 (the * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at * *
- http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by
- applicable law or agreed to in writing, * software distributed under
- the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES
- OR CONDITIONS OF ANY * KIND, either express or implied. See the
- License for the * specific language governing permissions and
- limitations * under the License.
- -->
-<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
- <display-name>Apache Tuscany Helloworld Wicket Sample</display-name>
-
- <listener>
- <listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class>
- </listener>
-
- <!--
- There are three means to configure Wickets configuration mode and they are
- tested in the order given.
- 1) A system property: -Dwicket.configuration
- 2) servlet specific <init-param>
- 3) context specific <context-param>
- The value might be either "development" (reloading when templates change)
- or "deployment". If no configuration is found, "development" is the default.
- -->
-
- <filter>
- <filter-name>wicket.tuscany</filter-name>
- <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
- <init-param>
- <param-name>applicationClassName</param-name>
- <param-value>sample.wicket.WicketApplication</param-value>
- </init-param>
- </filter>
-
- <filter-mapping>
- <filter-name>wicket.tuscany</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
-</web-app>
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ * Licensed to the Apache Software Foundation (ASF) under one * or more
+ contributor license agreements. See the NOTICE file * distributed with
+ this work for additional information * regarding copyright ownership.
+ The ASF licenses this file * to you under the Apache License, Version
+ 2.0 (the * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at * *
+ http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by
+ applicable law or agreed to in writing, * software distributed under
+ the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES
+ OR CONDITIONS OF ANY * KIND, either express or implied. See the
+ License for the * specific language governing permissions and
+ limitations * under the License.
+ -->
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <display-name>Apache Tuscany Helloworld Wicket Sample</display-name>
+
+ <listener>
+ <listener-class>org.apache.tuscany.sca.host.webapp.TuscanyContextListener</listener-class>
+ </listener>
+
+ <!--
+ There are three means to configure Wickets configuration mode and they are
+ tested in the order given.
+ 1) A system property: -Dwicket.configuration
+ 2) servlet specific <init-param>
+ 3) context specific <context-param>
+ The value might be either "development" (reloading when templates change)
+ or "deployment". If no configuration is found, "development" is the default.
+ -->
+
+ <filter>
+ <filter-name>wicket.tuscany</filter-name>
+ <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
+ <init-param>
+ <param-name>applicationClassName</param-name>
+ <param-value>sample.wicket.WicketApplication</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>wicket.tuscany</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+</web-app>
diff --git a/java/sca/samples/webapps/helloworld/pom.xml b/java/sca/samples/webapps/helloworld/pom.xml
index 019be246da..e43ae5bc5b 100644
--- a/java/sca/samples/webapps/helloworld/pom.xml
+++ b/java/sca/samples/webapps/helloworld/pom.xml
@@ -1,55 +1,55 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca</artifactId>
- <version>2.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <artifactId>sample-webapp-helloworld</artifactId>
- <name>Apache Tuscany SCA Sample Helloworld</name>
- <packaging>war</packaging>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-sca-api</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-host-webapp</artifactId>
- <version>2.0-SNAPSHOT</version>
- <scope>runtime</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>${artifactId}</finalName>
- </build>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>sample-webapp-helloworld</artifactId>
+ <name>Apache Tuscany SCA Sample Helloworld</name>
+ <packaging>war</packaging>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-sca-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-host-webapp</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>${artifactId}</finalName>
+ </build>
+
+</project>
diff --git a/java/sca/samples/webapps/helloworld/src/main/java/sample/HelloworldService.java b/java/sca/samples/webapps/helloworld/src/main/java/sample/HelloworldService.java
index 123774b936..53ff7a5ca1 100644
--- a/java/sca/samples/webapps/helloworld/src/main/java/sample/HelloworldService.java
+++ b/java/sca/samples/webapps/helloworld/src/main/java/sample/HelloworldService.java
@@ -1,25 +1,25 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-public interface HelloworldService {
-
- String sayHello(String name);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+public interface HelloworldService {
+
+ String sayHello(String name);
+
+}
diff --git a/java/sca/samples/webapps/helloworld/src/main/java/sample/HelloworldServiceImpl.java b/java/sca/samples/webapps/helloworld/src/main/java/sample/HelloworldServiceImpl.java
index 010ca34f00..8d220029a5 100644
--- a/java/sca/samples/webapps/helloworld/src/main/java/sample/HelloworldServiceImpl.java
+++ b/java/sca/samples/webapps/helloworld/src/main/java/sample/HelloworldServiceImpl.java
@@ -1,38 +1,38 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package sample;
-
-import org.oasisopen.sca.annotation.EagerInit;
-import org.oasisopen.sca.annotation.Init;
-import org.oasisopen.sca.annotation.Scope;
-
-@EagerInit
-@Scope("COMPOSITE")
-public class HelloworldServiceImpl implements HelloworldService {
-
- public String sayHello(String name) {
- return "Hello " + name;
- }
-
- @Init
- public void init() {
- System.out.println(sayHello("world"));
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package sample;
+
+import org.oasisopen.sca.annotation.EagerInit;
+import org.oasisopen.sca.annotation.Init;
+import org.oasisopen.sca.annotation.Scope;
+
+@EagerInit
+@Scope("COMPOSITE")
+public class HelloworldServiceImpl implements HelloworldService {
+
+ public String sayHello(String name) {
+ return "Hello " + name;
+ }
+
+ @Init
+ public void init() {
+ System.out.println(sayHello("world"));
+ }
+
+}
diff --git a/java/sca/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.composite b/java/sca/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.composite
index f0609d9eb9..045aa4674f 100644
--- a/java/sca/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.composite
+++ b/java/sca/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.composite
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
- targetNamespace="http://samples"
- name="Helloworld">
-
- <component name="HelloworldComponent">
- <implementation.java class="sample.HelloworldServiceImpl"/>
- </component>
-
-</composite>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
+ targetNamespace="http://samples"
+ name="Helloworld">
+
+ <component name="HelloworldComponent">
+ <implementation.java class="sample.HelloworldServiceImpl"/>
+ </component>
+
+</composite>
diff --git a/java/sca/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.xml b/java/sca/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.xml
index f13afbfb74..d7b237641c 100644
--- a/java/sca/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.xml
+++ b/java/sca/samples/webapps/helloworld/src/main/webapp/WEB-INF/web.xml
@@ -1,37 +1,37 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<web-app version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
-
- <display-name>Apache Tuscany Helloworld Sample</display-name>
-
- <filter>
- <filter-name>tuscany</filter-name>
- <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>tuscany</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
-</web-app>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
+
+ <display-name>Apache Tuscany Helloworld Sample</display-name>
+
+ <filter>
+ <filter-name>tuscany</filter-name>
+ <filter-class>org.apache.tuscany.sca.host.webapp.TuscanyServletFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>tuscany</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+</web-app>